Learn about Decibel’s technical architecture and how builders can leverage the platform
Builder codes allow you to earn fees when users execute transactions through your application. When placing orders or executing other transactions, you can specify a builder address and fee to receive a portion of the transaction fees.
User Approval Required: Users must approve the maximum builder fee before your application can collect fees. This is a security measure to prevent unauthorized fee collection.
Seven projects are already building on Decibel with Builder Codes. Some bring new ways to trade: Copin lets you discover and copy top perp traders, Samosa puts perps in Telegram, and PulseTrader delivers backtested quant signals you can execute in one click. Others extend what’s possible: Panora aggregates liquidity across Aptos, RNDM deploys AI agents that run autonomous DeFi strategies, Moar provides up to 15x composable leverage, and Tapp adds programmable hooks to the trading stack. See the full ecosystem spotlight for details.
Before users can pay builder fees, they need to approve a maximum builder fee amount. This is a one-time approval that allows your application to collect fees up to the approved limit:
await dex.approveMaxBuilderFee({ builderAddr: builderAddress, // Builder's address (64 characters, padded with zeros) maxFee: maxBuilderFeeBps, // Maximum fee in basis points (e.g., 10 = 0.1%)});
Parameters:
builderAddr: The address of the builder that should receive the fee. Must be a 64-character hex string (pad with leading zeros after 0x).
maxFee: The maximum fee in basis points (1 basis point = 0.01%). For example:
1 = 0.01%
5 = 0.05%
10 = 0.1%
10 bps (0.1%) is the protocol-wide maximum builder fee. Approvals above the global cap are rejected on-chain, so maxFee: 100 aborts rather than approving 1%.
Approval is required first: Users must approve the maximum builder fee (Step 1) before you can use builder codes in transactions (Step 2)
Fee limits: The builderFee in Step 2 cannot exceed the maxFee approved in Step 1, and no approval can exceed the protocol-wide cap of 10 bps (0.1%)
Users can revoke: A user can revoke your approval at any time with revokeMaxBuilderFee. Orders already queued are re-validated rather than aborted, and the effective fee is always the lesser of the approved maximum and the fee on the order
Spot has its own registry: Spot builder codes are approved separately with approveMaxSpotBuilderFee (and revoked with revokeMaxSpotBuilderFee). Unlike perps, the spot builder address may be a subaccount or a primary wallet. Spot builder fees are deducted from the settlement asset alongside the protocol fee
Address format: Builder addresses must be 64 characters (pad with leading zeros after 0x)
Fee calculation: Builder fees are added to the user’s transaction fees
Payment: Builder fees are paid in the same token as the transaction fees
Optional: If no builder address is specified, no builder fee is collected