Skip to main content
Base builder codes are a way to attribute onchain activity. Each code enhances onchain transactions with offchain metadata and makes your application more discoverable. To learn more about builder codes, see the Base documentation.

How to add a builder code

A builder code is an ERC-8021 dataSuffix appended to the end of a deposit transaction’s calldata. The called contract ignores the trailing bytes, but indexers read them to credit your application. Relay matches an onchain transaction to its quote by requestId. Appending bytes to arbitrary calldata changes the transaction, so the solver can no longer match it and the request stops tracking — even though the transaction succeeds onchain. To avoid this, request an explicit deposit quote: set explicitDeposit to true. The explicit flow routes funds through the Relay Depository contract that carries the order ID as an argument, so the solver tracks the deposit by that order ID rather than by exact calldata — trailing suffix bytes don’t affect it. Builder codes only work for quotes that route through the Relay Depository contract; same-chain swaps don’t use the deposit flow and can’t carry a builder code.

Example


Caveats

  • Builder codes require an explicit deposit: set explicitDeposit to true and protocolVersion to "v2" in your quote request.
  • Only quotes that route through the Relay Depository contract (depositErc20) support builder codes. Same-chain swaps do not.
  • Append the suffix to the deposit step only.