Skip to main content
This is an enterprise-only feature. Please contact us to enable.
Charge your own fee on every swap a flow runs. You attach a fee config when you create a flow, and on each swap a percentage of the source amount is collected and delivered to the recipient wallet(s) you specify. This is direct revenue for your business, layered on top of Dynamic’s own routing costs. Depending on the route used to fill a swap, fees are collected one of two ways:
  • Distributed on-chain at swap time — the fee is sent straight to the wallet address you specified in the fee configs when creating the flow, as part of the settlement transaction. Nothing to claim; it arrives with the swap.
  • Accrued as a claimable balance — the fee accumulates off-chain (typically as USDC) and you sweep it later with the claim flow below.
Because either can happen, poll the balances endpoint and run the claim flow to collect anything that accrued rather than being distributed directly.
Fee collection is an EVM-only feature. See Supported chains for fees.

Add a fee config

feeConfig is an optional field on the create flow body (Step 1 of any mode — payment, deposit, or withdrawal). It is fixed at creation and cannot be changed later.
Validation. The create call returns 422 if:
  • there are fewer than 1 or more than 10 recipients,
  • any percentage is not strictly between 0 and 1,
  • the recipients’ combined percentage is 1 or greater (that would consume the entire swap), or
  • any walletAddress is not a valid EVM address (see Supported chains for fees).
With multiple recipients, each recipient’s share is percentage × sourceAmount, split independently — so [{ 0.01 }, { 0.005 }] collects 1.5% total and delivers each recipient their own cut.

Supported chains for fees

Fee collection is an EVM-only feature:
  • Recipient addresses must be EVM (0x…). A non-EVM recipient (for example a Solana address) is rejected at flow creation with 422. Both underlying settlement models require an EVM recipient — on-chain distribution sends to an EVM receiver, and claimable balances are released by an EVM signature from the recipient wallet.
  • Fees are collected on EVM swaps and any claimable balance settles on an EVM chain, denominated per token and chain in the balances response.
The source token a payer swaps from can still be on any supported chain; the fee itself is always collected to, and claimed from, an EVM address.

Check claimable balances

Check whether a recipient has any fees waiting to be claimed. Returns a per-token, per-chain breakdown plus a hasClaimableFees convenience flag.
Response (200):
An empty balances list (hasClaimableFees: false) means there is nothing to claim right now — either no fees have accrued, or every fee was distributed directly on-chain at swap time.
Error (400): recipientAddress is not a valid EVM address.

Claim accrued fees

Claiming is a two-step, sign-in-the-middle flow: initiate to get the payload(s) the recipient must sign, then submit the signatures. The recipient wallet authorizes the release — no provider details are ever exposed. 1. Initiate the claim.
Response (200):
An empty steps array means there was nothing to claim — no signing or submit needed. Error (400): recipientAddress is not a valid EVM address. 2. Sign each step with the recipient wallet, then submit the signatures.
Response (200):
After a successful submit, re-check balances — the claimed balance should now be empty.

Example: claim in TypeScript

claim-fees.ts
Sign data.message exactly as returned — don’t reconstruct or modify it. data.signatureKind (eip191) tells you how to sign: it’s a standard personal-sign message, so most libraries’ signMessage (for example viem’s) produce the right signature directly.
Last modified on September 17, 2026