Monetize crypto trading in your app with Swap API
Discover how you can leverage Swap API to unlock new revenue streams.
As Web3 matures from small projects to robust businesses, companies are not only thinking about building the best experience but also how to generate revenue to sustainably invest in their technology and deliver the most value to users.
Swap API offers Web3 teams low-friction ways to monetize their products. With Swap API, you can unlock new revenue streams by easily tapping into affiliate fee and trade surplus features. Regardless of whether you’re on a free or paid plan, monetization options are available to all integrators.
Swap API enables your users to easily and conveniently trade tokens at the best prices directly in your app. With one simple integration, 0x unlocks thousands of tokens on the most popular blockchains and aggregated liquidity from 100+ AMMs and professional market makers.
In this guide, we will highlight the two monetization options available through Swap API - collecting affiliate fees and trade surplus. We will also discuss pricing considerations and show code samples and a demo app for how to easily implement these options.
How to monetize trades
Swap API offers two monetization options out-of-the-box:
- Collect affiliate fees (i.e. trading fee or commission)
- Collect trade surplus (i.e. positive slippage)
Option 1: Affiliate fees
Swap API integrators have the ability to collect an affiliate fee on all trades made through their app.
Pro tip: We recommend setting the fee in a way that strengthens your bottom line while aligning it with the value you provide to customers. Note that the addition of an affiliate fee will impact the price for the end user, so try finding a fee structure where pricing remains competitive while still generating revenue.
Setting up an affiliate fee is easy. Just include the following two parameters when making a Swap API request:
- feeRecipient - The ETH address that should receive affiliate fees
- buyTokenPercentageFee - The percentage of the buyAmount (tokens received by the user) that should be attributed to feeRecipient (your wallet) as affiliate fees. Denoted as a decimal between 0 - 1.0 where 1.0 represents 100%.
When the transaction has gone through, the fee amount will be sent to the feeRecipient address you've set. The fee is received in the buyToken (the token that the user will receive).
Option 2: Trade surplus
Slippage is the difference between the expected price of a given trade and the actual price at which it is executed. Trade surplus, also known as positive slippage, occurs when the user ends up receiving more tokens than their quoted amount. Based on our in-depth report on slippage, 18% of trades on Swap API resulted in positive slippage.
Swap API can be easily configured so that you collect the trade surplus. Trade surplus can be collected on all pairs on all supported chains.
It is an opt-in feature. In order to collect trade surplus, all you need to do is set the feeRecipientTradeSurplus parameter in your Swap API requests.
feeRecipientTradeSurplus represents the wallet address you want to collect the fee in. When a transaction produces trade surplus, 100% of it will be sent to the set address. The fee is received in the buyToken (the token that the user will receive).
When feeRecipientTradeSurplus is not specified, the feature is effectively OFF and all trade surplus will be passed back to the user.
Note that trade surplus is only sent to feeRecipientTradeSurplus for sells (i.e. when the sellAmount is specified). It is a no-op for buys (i.e. when the buyAmount is specified), which means the user will always receive the trade surplus.
Want to see these monetization practices implemented in a live demo? Checkout this demo app to see how to implement collecting affiliate fees in practice:
With Swap API, you can easily power trading in your app. Access thousands of tokens on the most popular blockchains and monetize your users’ trading activity, all with one simple integration.
Check out the full tutorial on how to monetize your app here.
New to 0x? Sign-up for an account on the 0x Dashboard to integrate and monetize swaps in your app today.