For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fees

Configure integrator fees, calculate net recipient output, and distinguish custom fees from trading fees and gas.

Configuration

SDK parameter
Rules

customFeeBps

Integer bps; omitted means zero. SDK allows 0–10000, but the active API/router cap is usually lower

customFeeReceiver

Required for a positive fee; non-zero and different from recipient and Execution Router

Read new ApiClient(apiOptions).getStatus() using the same API options as your ArcClient for arc_router.max_custom_fee_bps and the protocol-cut policy. On 2026-09-07 the endpoint reported a 500 bps custom-fee cap and a 2000 bps protocol cut. These are a dated snapshot, not permanent constants. Both the server and contract enforce policy. An accepted SDK value can still be rejected by the deployment.

A zero custom fee normalizes the receiver to the zero address. Use the prepared result to inspect the normalized terms.

What the user pays

Cost
Treatment

Pool, curve and Hook trading fees

Already reflected in route output

Aggregator custom fee

Deducted from route output in the output token

Protocol cut

Allocated from the custom fee, not deducted again from recipient output

Network gas

Paid separately by the transaction sender

Choose and display fee terms before confirmation. A fee change invalidates that confirmation.

Calculation order

grossOutput       = route output after underlying trading fees
customFee         = floor(grossOutput * customFeeBps / 10000)
expectedNetOutput = grossOutput - customFee
protocolCut      = floor(customFee * protocolCutBps / 10000)
integratorFee    = customFee - protocolCut
Example, in output-token base units
Amount

Gross output

1003

Custom fee, 333 bps

33

Expected recipient output

970

Protocol cut, 2000 bps of the custom fee

6

Integrator receives

27

Each division uses integer floor rounding. Calculate with bigint and display with the output token's decimals. Do not round a human-readable decimal and then convert back to token units.

After calculating net output, apply the user’s tolerance as explained in Slippage. Slippage tolerance is not a fee. Network gas is paid separately by the transaction sender.

Read and display the result

swap() accepts customFeeBps and customFeeReceiver in the same request that returns the quote and transaction. Display its net output, fee terms and signed minimum before confirmation. The same fee fields apply to prepareDelegatedSwap(). See Slippage for retaining and enforcing the minimum net output.

  • Direct response amount_out is the route output before aggregator custom fee.

  • expect_amount_out / SDK expectAmountOut is the expected net output.

  • Direct responses additionally report custom_fee_amount, protocol_fee_amount, integrator_fee_amount and protocol_cut_bps.

  • Actual settlement can differ from the quote. Show confirmed execution amounts after the transaction succeeds. Positive-output capture, if enabled by router policy, is a separate settlement policy; the documented live snapshot reports zero capture.

Hook fees versus custom fees

A V4 Hook fee is collected by the pool's Hook during the swap. It is already reflected in the route's output. The aggregator custom fee is then calculated on the resulting output. Do not subtract either fee twice when displaying expected proceeds.

Hook Partner attribution shares part of the Hook's protocol allocation; it does not set the aggregator custom-fee receiver. The current aggregator V4 adapter passes empty hookData, so setting a custom fee does not attribute a Hook Partner. See Partner and hookData.

Supported amount mode

Custom fees apply to the output of a fixed-input swap. See Quotes and Routing for supported amounts.

Last updated

Was this helpful?