Monetize Your App

View as Markdown

The 0x Cross-Chain API is in private beta. Request access to start building.

Collect a percentage-based fee on every cross-chain swap your users make. Fees are deducted from the sellAmount and sent directly to your wallet during the origin transaction.

Quick Start

Add feeBps and feeRecipient to your quote request:

1const quoteParams = new URLSearchParams({
2 originChain: '8453',
3 destinationChain: '42161',
4 sellToken: '0x4200000000000000000000000000000000000006',
5 buyToken: '0xaf88d065e77c8cc2239327c5edb3a432268e5831',
6 sellAmount: '1000000000000000000',
7 originAddress: '$USER_TAKER_ADDRESS',
8 sortQuotesBy: 'price',
9
10 // Monetisation parameters
11 feeRecipient: '0x2fb3a9fb601808e110b1ade14068d69c3bfe0fef', // address to which the fee should be sent
12 feeBps: 100 // The amount in bps of the amount that will be delivered to the feeRecipient
13
14 // The feeToken is optional as currently it is only possible to collect fees in sellToken
15});

How Fee Calculation Works

Fees are calculated as a percentage of the sellAmount:

feeAmount = sellAmount * feeBps / 10000
amountAfterFee = sellAmount - feeAmount

Example: User sells 1,000 USDC with feeBps=50 (0.5%):

  • Fee collected: 1,000,000,000 * 50 / 10000 = 5,000,000 (5 USDC)
  • Amount that reaches the bridge: 995,000,000 (995 USDC)
  • The buyAmount in the quote reflects the post-fee amount

The quote response includes a fees object:

1{
2 "fees": {
3 "integratorFees": [
4 {
5 "amount": "5000000",
6 "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
7 "type": "volume"
8 }
9 ],
10 "zeroExFee": null,
11 "bridgeNativeFee": null
12 }
13}
FieldDescription
integratorFeesArray of your fees
zeroExFee0x protocol fee, if applicable.
bridgeNativeFeeAdditional bridge infrastructure cost paid by the user in native tokens. Please see Native Tokens and Bridge Fees for details.

Multiple Fee Recipients

It is also possible to collect multiple fees, sent to different recipients as a part of a single trade.

1// To collect multiple fees
2feeRecipient: '0xWalletA,0xWalletB'
3feeBps: '30,20'

This collects:

  • Index 0: 0.3% (30 bps) will go to wallet 0xWalletA
  • Index 1: 0.2% (20 bps) will go to wallet 0xWalletB

Arrays are matched by position. All arrays must have the same length.

When multiple fees are used, the response contains integratorFees (array) instead of integratorFee:

1{
2 "fees": {
3 "integratorFees": [
4 { "amount": "3000000", "token": "0x...", "type": "volume" },
5 { "amount": "2000000", "token": "0x...", "type": "volume" }
6 ]
7 }
8}

Parameter Reference

ParameterTypeRequiredDescription
feeBpsstringWith feeRecipientComma-separated basis points. Each: integer 0–10,000.
feeRecipientstringWith feeBpsComma-separated wallet addresses. Must be valid EVM addresses.
feeTokenstringNoComma-separated token addresses. Defaults to sellToken.

Validation Rules

  • feeBps and feeRecipient must both be provided, or neither.
  • If feeToken is provided, array length must match feeBps.
  • feeRecipient addresses must be valid for the origin chain’s address format.

Pricing Considerations

  • Fees reduce the sellAmount that reaches the bridge, reducing the user’s buyAmount.
  • Higher fees may make your quotes less competitive if users compare across aggregators.