Skip to main content
The widget supports two monetization surfaces:
  • partnerConfig — fee or surplus share on every swap that completes through your integration.
  • referrerConfig — a referrer wallet that receives a share of protocol revenue.
Both are optional and independent.

Partner fees

Pass partnerConfig 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.
Either 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 a referrerConfig 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

Load partner 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.
Last modified on June 14, 2026