> ## Documentation Index
> Fetch the complete documentation index at: https://docs.debridge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Affiliate Fees

> Referral Code, Same-Chain and Cross-Chain Affiliate Fees, and Additional Considerations for Cross-Chain Affiliate Fees.

# Referral Code

To enable affiliate fees, a referral code must be included in the `create-tx` request
[parameters](/dln-details/integration-guidelines/order-creation/creating-order/api-parameters/api-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](/dln-details/integration-guidelines/order-creation/creating-order/api-parameters/api-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](/dln-details/integration-guidelines/order-creation/order-tracking-api/order-states).

* On EVM chains, the affiliate fee is [automatically transferred to the specified recipient when a solver claims the
  order](/dln-details/dln-specifics/order-fulfillment/claiming-order)
* On Solana, the fee must be withdrawn manually. Further details on withdrawing affiliate fees are provided
  [here](/dln-details/affiliates/withdrawing-affiliate-fees).

### 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](/dln-details/integration-guidelines/order-creation/creating-order/api-parameters/api-parameters), with [Solana requiring additional
configuration](/dln-details/affiliates/affiliate-fees#solana).

### 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](https://referral.jup.ag/dashboard).
* Earned fees can be claimed via the [Jupiter Referral Dashboard](https://referral.jup.ag/dashboard).
