partnerConfig— fee or surplus share on every swap that completes through your integration.referrerConfig— a referrer wallet that receives a share of protocol revenue.
Partner fees
PasspartnerConfig inside config to identify your integration and (optionally) take a cut of each swap.
PartnerConfig fields
If both
partnerFeeBps and partnerTakesSurplus are set, partnerFeeBps wins. To take surplus instead of a fixed fee, set partnerTakesSurplus: true and leave partnerFeeBps unset.partner or partnerAddress must be present for partner features to activate.
Choosing between fee and surplus
Example: fixed-fee integration
Example: surplus-share integration
Referrer revenue
Pass areferrerConfig to attribute swaps to a referrer wallet that receives a share of protocol revenue. This is independent of partnerConfig: you can set one, both, or neither.
ReferrerConfig fields
Production tips
Loadpartner from an environment variable so staging, production, and white-label builds can use different identifiers without code changes. Memoize partnerConfig like every other non-primitive config field; a new object on every render forces the widget to re-render. And audit partnerAddress before shipping: once a swap is routed, fees pay to it on-chain, so treat it like any other treasury address.
Related pages
- Configure — all other config fields.
- Widget API reference — full
PartnerConfig/ReferrerConfigtypes.