Jump to content
Crypto Front Page

Crypto networks, markets and policy

Collect partner fees from swaps in an embedded widget

Learn how integrator partner fees work in an embedded swap widget: set basis points and a recipient, then verify the fee deduction and payout.

The Crypto Front Page Desk4 min read

Collect partner fees from swaps in an embedded widget

A CoW Widget partnerFee lets you set a basis-point charge and recipient so you can collect a fee from each settled swap. You provide the fee settings; the widget attaches them to orders, and settlement applies the charge and sends it to your recipient.

CoW Swap is a decentralized exchange interface where traders sign trade intents that solver-run batch auctions process. The idea behind coincidence of wants changes the trading context: users can express what they want to trade without needing to find a direct counterparty themselves.

For an integrator, the moving parts are the widget configuration, order metadata, settlement and recipient address. Together, they turn one fee setting into a deduction and payout tied to each order.

  • Configuration: partnerFee bps and recipient
  • Order: the fee details encoded in appData
  • Settlement: fee deducted from the trade and sent to the recipient

The widget carries the configured fee into each order’s appData. At settlement, the protocol reads that metadata and applies the fee. The user sees the fee in the quote, and the amount they receive is reduced by it.

How the fee moves from configuration to payout

The partnerFee setting contains two values: a fee in basis points (bps) and a recipient address. Basis points express the fee as a fraction of the trade: 100 bps equals 1%.

  1. Set the fee. Pass partnerFee with the bps amount and recipient in the widget configuration.
  2. Attach it to the order. The widget encodes the fee details in appData for each order.
  3. Show the quote. The fee appears in the user’s quote, reducing the amount the user receives.
  4. Settle and route. The protocol reads the order metadata at settlement, deducts the fee and sends it to the configured recipient.

Think of appData as a label traveling with a parcel: it tells settlement how the order should be handled. The label does not collect the fee on its own; the fee takes effect when the order settles.

Say a user sells 10,000 USDC and the widget is configured with partnerFee {bps: 50, recipient}. Fifty basis points is 0.5%, so the fee is 50 USDC. The quote reflects that deduction, leaving 9,950 USDC worth of value for the user before any other trade effects. Once the order settles, the 50 USDC fee goes to the recipient.

Choose a recipient that can receive on every enabled chain

Use a recipient address you control on every chain the widget enables. A contract wallet such as a Safe deployed on only one chain cannot receive fees on the others. The fee setting can be correct while the payout destination still fails for a chain where that wallet is not usable.

Before enabling a chain, confirm that your recipient is valid and usable there. This matters when deploying the widget across multiple chains: a single recipient value should not be assumed to represent a working wallet everywhere. Plan the address for each enabled chain, and make sure the configured recipient matches the chain where the order will settle.

Two failure cases deserve attention. First, the bps value may exceed the protocol’s cap, so the fee setting cannot be applied as configured. Second, the recipient may be wrong or unusable on the chain. In either case, inspect the configured values and the relevant order metadata, then confirm the recipient’s chain support before treating the fee as collected.

For an integrator using cowswap, the practical check is to trace one order from configured bps and recipient through appData to the settlement outcome. That confirms the fee shown in the quote matches the amount routed to a recipient you control. Set the recipient for every enabled chain before relying on fee collection.