# Fees and commission

> The flat fee, Khalani's fee and your commission, and how they show up in quotes and orders.

Fees come off the deposit before the order is published. Solvers then price what remains, so the rate they quote contains none of these fees.

## The three parts

**A flat fee per pair.** The source token's `depositFee` plus the destination token's `withdrawFee`, converted into source units at a live price. It covers gas on the source and destination chains. It is charged in full at any fill level, including an order that expires unfilled. `GET /v2/params` lists each token's two fees, but only a quote can give you a pair's total, because the conversion needs a live price.

**Khalani's fee** (`operatorBps`) and **your commission** (`commissionBps`) are each basis points of what remains after the flat fee. Your commission is paid to your `commissionWallet` on the hub when the order settles. The two percentages are in your on-chain terms (read them with `GET /v2/params`) and scale with the filled fraction, so on a partial fill you pay them on the filled part only.

```text
flat fee     = depositFee(source) + withdrawFee(destination, converted to source units)
published    = (deposit − flat fee) × (1 − (operatorBps + commissionBps) / 10 000)
receive      = published × rate, rounded down
protocolFee  = flat fee + Khalani's fee          (your commission is not included)
```

## A worked example

A live quote on 19 October 2026: 100 USDC from Arbitrum to USDT on Ethereum, for an integrator whose percentages are both zero. Ethereum USDT's withdraw fee is 0.10 USDT, and Arbitrum USDC's deposit fee is zero.

| | |
|---|---|
| Deposit (`spend.amount`) | 100.000000 USDC |
| Flat fee (`details.protocolFee` = `"99898"`) | − 0.099898 USDC |
| Published to solvers | 99.900102 USDC |
| × Rate (`details.intentOutcomeRate` ÷ 10^18) | × 0.983471… |
| User receives (`receive.amount`) | 98.248902 USDT |

`spend.amount` and `receive.amount` reflect the token fees. Show them using each token's decimals, and show the source-chain transaction gas and `depositTx.value` (the native-token relay fee) separately: neither is included in those token amounts.

## Where fees appear

| Field | Where | What it holds |
|---|---|---|
| `details.protocolFee` | Quote | Flat fee + Khalani's fee. Not your commission. |
| `fullFee` | Order, from `published` | Everything held back at publish: flat fee + Khalani's fee + your commission. |
| `traces.withdraw.accruedFee` | Order, after settlement | What Khalani kept: the flat fee in full plus Khalani's fee on the filled part. |

No endpoint returns the commission earned on a single order. It arrives in your commission wallet as its own transfer on the hub, and you withdraw it on your own schedule.

Your percentages and wallet live in the on-chain integrator registry that the hub reads when each order publishes. No request and no signature can change them, and a change Khalani makes for you can take up to 60 seconds to reach the API.
