Monetize Your App
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:
How Fee Calculation Works
Fees are calculated as a percentage of the sellAmount:
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
buyAmountin the quote reflects the post-fee amount
The quote response includes a fees object:
Multiple Fee Recipients
It is also possible to collect multiple fees, sent to different recipients as a part of a single trade.
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:
Parameter Reference
Validation Rules
feeBpsandfeeRecipientmust both be provided, or neither.- If
feeTokenis provided, array length must matchfeeBps. feeRecipientaddresses must be valid for the origin chain’s address format.
Pricing Considerations
- Fees reduce the
sellAmountthat reaches the bridge, reducing the user’sbuyAmount. - Higher fees may make your quotes less competitive if users compare across aggregators.