Drift Builder Codes
Drift Builder Codes
Overview
Drift’s Builder Code (DBC) system enables any builder to build on top of Drift while earning fees for routing trades.
Drift Builder Codes establish the financial infrastructure layer on Solana, by allowing anyone to tap into Drift’s deep liquidity and efficient execution, without building their own backend. This enables a fully open, composable UI layer for perps on Solana.
This Builder Code system makes Drift the first on-chain DEX on Solana to offer per order monetization for third-party frontends, setting the stage for a permissionless ecosystem of apps, bots, and aggregators all aligned with Drift and Solana’s liquidity growth.
Getting started with DBC
Builder Registration: In order to receive fees, builders are required to have an existing Drift account, as well as set up a
RevenueShareAccount.User Onboarding: Before placing any orders, users must approve the builder and the maximum allowed builder fee. This approval is stored directly inside the
RevenueShareEscrowaccount.
How Builder Codes Work
Code examples can be found in the API docs.
Notes on builder codes for MM’s
RevenueShareEscrow Inclusion: Fillers and market makers must include the user’s
RevenueShareEscrowaccount in every order fill transaction. This PDA is derived from the user’s pubkey (requires no additional RPC calls).Multi Builder Support: Users can approve multiple builders, so MM’s may see multiple builder accounts to sweep to during
settle_pnl. The protocol will not throw if a specific builder is omitted, but all filled rewards must eventually be swept.Error Handling: If a required escrow account isn’t included, the program will throw. Therefore it's recommended to always include it.

