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.
<Widget
  config={{
    partnerConfig: {
      partner: "my-app-name",
      partnerAddress: "0xYourFeeCollector",
      partnerFeeBps: 25,
    },
  }}
/>

PartnerConfig fields

FieldTypeDescription
partnerstringYour partner identifier (e.g. "my-app-name"). Used for attribution and analytics.
partnerAddressAddressOptional. Ethereum address that receives the fee. Overrides the address derived from partner.
partnerFeeBpsnumberOptional. Fee in basis points. 25 = 0.25%. Max 200 (2%).
partnerTakesSurplusbooleanOptional. When true, you receive 50% of swap surplus instead of a fixed fee. Defaults to false.
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

Fixed fee (partnerFeeBps)Surplus share (partnerTakesSurplus)
RevenuePredictable per-trade cutVariable; depends on routing edge
User costWorse quotes (fee comes off the top)Same quote as no-fee: surplus is the better-than-quoted portion
Max2% (partnerFeeBps: 200)50% of surplus
Best forMass-market integrations where a known cut mattersHigh-volume integrations that prioritize the user-facing rate

Example: fixed-fee integration

import { Widget } from "@velora-dex/widget";

export function Swap() {
  return (
    <Widget
      config={{
        theme: "light",
        partnerConfig: {
          partner: "my-app-name",
          partnerAddress: "0xYourFeeCollector",
          partnerFeeBps: 25, // 0.25%
        },
      }}
    />
  );
}

Example: surplus-share integration

<Widget
  config={{
    partnerConfig: {
      partner: "my-app-name",
      partnerAddress: "0xYourFeeCollector",
      partnerTakesSurplus: true,
    },
  }}
/>

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.
<Widget
  config={{
    referrerConfig: {
      referrerAddress: "0xReferrerWallet",
    },
  }}
/>

ReferrerConfig fields

FieldTypeDescription
referrerAddressAddressEthereum address that receives the referrer share. Required to activate referrer attribution.

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 10, 2026