Referral Codes


Referral codes are a powerful new feature introduced in Odos SOR V2. As Odos continues to get integrated into more applications as a vital piece of DeFi infrastructure, referral codes will allow for tracking and attribution of volume through the Odos platform. Referral codes will also allow for platforms such as wallets or exchanges to monetize the swap volume from their user base by registering a partner fee connected to their referral code. The fee will then be charged by the Odos router and deposited into the specified beneficiary address, allowing for a simple and easy monetization process.

Register A Code


Codes are registered on the router via the registerReferralCode function. You will need to register your code on each chain that you wish to use it on. We have created a frontend for transacting with this function and registering codes. Anyone integrating or using the Odos API can use this frontend to register a referral code for inclusion in all API quote requests they make.


Referral codes can only be registered once. If you need to change something, you will need to register a new code.

Setting Fees

When registering a referral code, there is an option to add an additional fee. This additional fee will be removed from the output amount of the swap by the router when the registered referral code is used. Of the removed fee, 20% will be retained by the router as protocol revenue while the other 80% will be sent to the specified beneficiary address at the time of the transaction. This mechanism provides an easy way for partners to monetize their swap volume without making, auditing, or, maintaining any of their own smart contracts.

FunctionOwner TakeReferrer Take
SwapPositive Slippage + 20% of fee80% of fee
SwapMulti0.01% + 20% of fee80% of fee

Code Types

For the purposes of smart contract optimization, referral codes are split into two ranges/types. Codes with no additional fees (tracking/attribution only) are restricted to the range from 0 to 2147483648 (highest bit of uint32 is 0), while codes with an additional fee are restricted to the range from 2147483648 to 4294967296 (highest bit of uint32 is 1). This allows for the router contract to only make an additional storage read when the code used charges an additional fee.

0 - 2147483648Tracking and Attribution
2147483649 - 4294967296Additional Fee