Affiliate Fees
Implement affiliate fees to earn revenue from Garden swaps through your integration
Garden allows partners to charge an affiliate fee for each swap initiated through their SDK or API integration. This fee must be specified when requesting a quote and is charged in addition to protocol and solver fees.
Fees are expressed in basis points (bps), where 1 bps = 0.01%. For example, a 30 bps fee equals 0.3% of the source asset value.
Affiliates can earn rewards in USDC or cbBTC on supported chains. Fees can be sent entirely to a single address in one asset, or split across multiple addresses and assets.
For example, a 30 bps fee could be split by sending 10 bps in USDC to an Ethereum address, and 20 bps in cbBTC to a Base address.
The amount of each asset the affiliate will receive is calculated based on prices at the time of the quote and is also stored in the order data. All affiliate fees collected during the week are distributed to the specified addresses at the end of the week.
Implementation
To apply an affiliate fee via API, include the affiliate_fee
parameter when requesting a quote:
In this example, we’ve added a 30 bps affiliate fee.
To include affiliate fees, add the affiliate_fees
field when creating an order.
Here’s a sample create order request:
To apply an affiliate fee via API, include the affiliate_fee
parameter when requesting a quote:
In this example, we’ve added a 30 bps affiliate fee.
To include affiliate fees, add the affiliate_fees
field when creating an order.
Here’s a sample create order request:
This process involves two steps:
Request Quote
Requesting a quote with the affiliate fee applied
Create Order
Submitting the order using the selected quote
To request a quote with an affiliate fee, include the affiliateFee
parameter in the options
object.
While creating the order using the swap
function, you can include the affiliateFee
property to specify the recipient addresses, the fee amounts (in bps), and optionally the assets and chains you want the payout to be in. Garden supports payout in USDC and cbBTC.