Overview
Builder codes allow developers and builders to receive fees on orders they send on behalf of users. This enables builders to monetize their applications while providing value to traders.The term “builder” refers to DeFi builders who build applications on Token Layer, not block builders within consensus.
How Builder Codes Work
Fee Mechanism
Builder codes enable builders to:- Facilitate orders on behalf of users through their application
- Earn a fee on each order they process
- Set fees per-order for maximum flexibility
User Approval Required
- Users have full control over which builders can charge fees
- Users can see the maximum fee a builder may charge
- Users can revoke permissions at any time
Technical Implementation
Onchain Processing
Builder codes are processed entirely onchain as part of the fee logic
- Transparency in fee calculations
- Trustless execution
- Verifiable fee distribution
Per-Order Flexibility
Builders can set fees per-order, allowing for:- Dynamic pricing based on order size
- Different fees for different types of orders
- Promotional pricing for certain users
- Volume-based discounts
Use Cases
Trading Bots
Build automated trading bots that:- Execute strategies on behalf of users
- Charge a fee per trade
- Provide value through automation and optimization
Portfolio Management Tools
Create applications that:- Rebalance portfolios automatically
- Charge fees for management services
- Optimize tax efficiency
Social Trading Platforms
Develop platforms where:- Expert traders create strategies
- Followers execute the same trades
- Builders earn fees on follower trades
Aggregators
Build aggregation services that:- Find best prices across multiple chains
- Route orders optimally
- Charge fees for routing services
Custom UIs
Create specialized interfaces that:- Cater to specific user segments
- Provide unique features or UX
- Monetize through builder fees
Setting Up Builder Codes
Requirements
To implement builder codes, you need:- API Integration: Integrate with Token Layer’s API
- User Approval Flow: Implement a way for users to approve your builder fee
- Fee Logic: Determine how you’ll calculate fees per order
Implementation Steps
1
Register as a Builder
Contact Token Layer to register your builder code
2
Integrate API
Use the trade endpoints with your builder code parameter
3
Request User Approval
Implement UI for users to approve your maximum fee
4
Process Orders
Send orders on behalf of users with your builder code
5
Earn Fees
Automatically receive fees as orders are executed
Fee Guidelines
Competitive Fees
Consider market rates when setting builder fees:- Simple execution: 5-10 bps
- Advanced strategies: 10-25 bps
- Premium features: 25-50 bps
Transparency
Display to users:- Maximum potential fee
- Typical fee ranges
- Value you’re providing
- How to revoke access
User Permissions
Approval Process
Users approve builder fees through:- Maximum Fee Setting: Users set the maximum fee you can charge
- Scope: Approval can be for all trades or specific tokens
- Duration: Users control how long approval lasts
Revocation
Users can revoke builder permissions:- Instantly: Takes effect immediately
- No exit penalty: Users can leave at any time
- Full control: Users own their funds and relationships
API Integration
Trade Endpoints
When sending trades with builder codes, use:Trade Tokens
POST /trade-token (with builder code parameter)
Buy Tokens
POST /buy-token (with builder code parameter)
Example Request
Fee Distribution
Receiving Fees
Builder fees are:- Automatically deducted from each order
- Sent to your builder account
- Claimable once they exceed the minimum threshold
- Trackable in real-time
Claiming Process
1
Accrue Fees
Fees accumulate as users trade through your app
2
Monitor Balance
Track earnings at app.tokenlayer.network/earn
3
Claim
Claim once balance exceeds $1
4
Receive
Fees are added to your spot balance
Best Practices
Provide Real Value
Users will only approve builder fees if you provide clear value
- Superior execution quality
- Unique features or insights
- Time-saving automation
- Better prices or lower slippage
Competitive Pricing
- Research competitor fees
- Start with lower fees to attract users
- Increase fees as you prove value
- Consider volume discounts for power users
Clear Communication
- Explain what users get for the fee
- Show fee calculations before execution
- Provide receipts after trades
- Be responsive to user questions
Maintain Trust
- Never charge more than approved maximum
- Honor user revocations immediately
- Keep user funds secure
- Be transparent about any issues
Example Applications
DeFi Dashboard Builder
Value Proposition: All-in-one interface for Token Layer with advanced charting Builder Fee: 8 bps per trade Revenue Model: 80/day in feesCopy Trading Platform
Value Proposition: Follow top traders automatically Builder Fee: 15 bps on follower trades Revenue Model: 100 users × 150/dayTelegram Trading Bot
Value Proposition: Trade directly from Telegram Builder Fee: 10 bps per trade Revenue Model: 500 users × 250/dayCompliance Considerations
As a builder earning fees:- You may be providing a financial service in certain jurisdictions
- Understand your local regulations around:
- Payment processing
- Financial services
- Securities (if applicable)
- Tax reporting
Support for Builders
Resources
- API Documentation: Complete reference for integration
- Builder Community: Discord channel for builders
- Technical Support: Dedicated support for integration questions
Getting Started
Interested in building with builder codes?- Join the Token Layer Discord
- Review the API documentation
- Contact us at builders@tokenlayer.network
