Before continuing with this guide, make sure you have initialized your Hyperliquid client as shown
in the Getting Started guide. This guide assumes you have
client
and other basic setup completed.Overview
Builder codes are an on-chain, per-order attribution mechanism that lets apps and interfaces earn fees on orders they route for users. Builder codes enable order-level revenue sharing - completely independent of which market the order is on:- Apps earn a small fee on every order fill they route through their interface
- Works on all markets across Hyperliquid
- Users must approve a max builder fee for each builder they want to use
- Builder codes can override referral codes on specific orders
How Builder Codes Work
- User Approval: User approves your builder code and sets a max builder fee they’re willing to pay
- Order Attribution: When placing orders through your app, include your builder code in the order
- Fee Collection: You earn a small fee on each filled order
- On-Chain Tracking: Revenue is tracked on-chain and paid out automatically
Obtaining a Builder Code
To get started with builder codes, you’ll need to register as a builder with Hyperliquid. Contact the Hyperliquid team or refer to the builder codes documentation for registration details.Approving Builder Fees
Before users can use your builder code, they must approve your builder address and set a max fee rate (one-time per user per builder):The
maxFeeRate is the maximum fee the user is willing to pay. Actual fees charged can be lower,
but never higher than this approved rate.Applying Builder Codes to Orders
Once approved, include your builder code when placing orders to earn fees:fis specified in tenths of a basis point- Example:
f: 50means 50 tenths of a bp = 5 bps = 0.05% - Must be ≤ the user’s approved
maxFeeRate
Checking Builder Fee Approval
Verify a user’s builder fee approval before placing orders:Best Practices
Monitor builder code performance
Monitor builder code performance
Track the fee revenue from your builder code to understand user engagement and optimize your
application.
Set competitive builder fees
Set competitive builder fees
Balance between earning revenue and providing value to users. Lower fees may attract more users.
Test on testnet first
Test on testnet first
Always test your builder code integration on testnet before going live.
Resources
Builder Codes Documentation
Official guide to order-level revenue sharing
Next Steps
Executing trades
Learn common trading patterns

