Referral Code

To enable affiliate fees, a referral code must be included in the create-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
Affiliate fees become available once an order reaches the ClaimedUnlock state.

Additional Considerations for Cross-Chain Affiliate Fees

Gas costs for affiliate fee transfers are capped at 2300 gas on EVM chains. If the affiliateFeeRecipient 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 same affiliateFeePercent 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: