Partner
The Partner system allows integrators to earn referral fees from swaps executed through their platforms. When users swap through a registered partner, a portion of the protocol fees is allocated to that partner.
1. How Partner Fee Collection Works
Fee Accumulation Mechanism
User Swap with Partner
↓
Protocol calculates referral_fee = protocol_fee × ref_fee_rate / 10^9
↓
Referral fee is stored in Partner.balances (on-chain Bag)
↓
Fees accumulate across multiple swaps
↓
Partner must manually claim fees using PartnerCapImportant: Manual Claim Required, referral fees are NOT automatically transferred to the partner's wallet.
Fees accumulate in the
Partnerobject'sbalancesfield (aBagstoring multiple coin types)Partners must explicitly call
claim_ref_feeto withdraw accumulated feesEach coin type must be claimed separately
Only the holder of
PartnerCapcan claim the fees
2. Swap with Partner (Earn Referral Fees)
Integrators can earn referral fees by passing their partner_id when executing swaps.
Example
3. Claim Referral Fees (For Partners)
Example
Partners can claim accumulated fees using their PartnerCap.
Apply for Partner Swap
Interested in Partner Swap? Submit a request from here:https://4bx69zjogri.typeform.com/to/UUETIX2f
Last updated