GoDex Referral Codes
Overview
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 GoDex 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 GoDex API can use this frontend to register a referral code for inclusion in all API quote requests they make.
Info
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.
Function | Owner Take | Referrer Take |
---|---|---|
Swap | Positive Slippage + 20% of fee | 20% of fee |
SwapMulti | 0.01% + 20% of fee | 20% of fee |
CopyWhale | 6% Profit + 20% 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.
Codes | Use |
---|---|
0 - AGD_18920f8 | Tracking and Attribution |
AGD_18920f9 - AGD_4294967296 | Additional Fee |
Last updated