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.
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
- Using API
- Using SDK
To apply an affiliate fee via API, include the In this example, we’ve added a 30 bps affiliate fee.To include affiliate fees, add the
affiliate_fee parameter when requesting a quote:affiliate_fees field when creating an order.Here’s a sample create order request:How to claim
The claiming process involves two steps: checking your available earnings through the API, then submitting an on-chain transaction to withdraw them.Check available earnings
First, call the earnings endpoint to get your claimable amounts:cURL
Success
The
claim_amount, claim_amount_usd, claim_signature, and claim_contract fields are only included when you have unclaimed earnings available.Claim your earnings
To claim your earnings, you need to call theclaim function on the distributor contract. Here’s how to construct the transaction:
Make sure to call the claim function on the same chain where you received the rewards. For example, if your earnings are in
ethereum:usdc, you should use the Ethereum mainnet RPC URL and chain configuration.JavaScript