Referral Code
To enable affiliate fees, a referral code must be included in thecreate-tx
request
parameters. Further details on obtaining a referral code and its
additional use-cases are available in the Referrers and Integrators Overview sections.
Affiliate Fees
Affiliate fees can be earned through both cross-chain and same-chain swaps by including the appropriate parameters in the request. This allows integrators to monetize swap activity within their applications.Cross-Chain Affiliate Fees
To enable affiliate fees for cross-chain swaps, the following parameters must be included when creating an order:affiliateFeePercent
: The percentage of the order input amount allocated as the affiliate fee.affiliateFeeRecipient
: The address or public key of the affiliate fee beneficiary. This must be:- A public key on Solana
- A wallet address on EVM chains
ClaimedUnlock
state.
- On EVM chains, the affiliate fee is automatically transferred to the specified recipient when a solver claims the order
- On Solana, the fee must be withdrawn manually. Further details on withdrawing affiliate fees are provided here.
Additional Considerations for Cross-Chain Affiliate Fees
Gas costs for affiliate fee transfers are capped at 2300 gas on EVM chains. If theaffiliateFeeRecipient
is a contract that requires more gas to
process the transfer, the affiliate fees will not be sent, but the order will still be processed normally. In those cases, affiliate fees have to be
claimed manually by calling DlnSource.withdrawUnclaimedAffiliateFees(...)
. The caller can be anyone, but the specified beneficiary must be the
affiliateFeeRecipient
set in the request.
Same-Chain Affiliate Fees
Affiliate fees are supported for same-chain swaps as well. These swaps use the sameaffiliateFeePercent
and affiliateFeeRecipient
parameters, with Solana requiring additional
configuration.
EVM Chains
Affiliate fees for same-chain swaps on EVM chains are handled automatically during the swap transaction execution and they are not subject to the 2300 gas limit on transfers, as the cross-chain affiliate fees are.Solana
For same-chain swaps on Solana:- The
affiliateFeeRecipient
must be a Jupiter referral key. - Referral keys can be generated at https://referral.jup.ag/dashboard.
- Earned fees can be claimed via the Jupiter Referral Dashboard.