> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xo.market/llms.txt
> Use this file to discover all available pages before exploring further.

# Fees

> How taker and maker fees are charged on XO fills.

XO charges trading fees in collateral (XO USDC), never in outcome tokens. Fees are **not** part of the signed order — you do not set or sign a fee rate. Settlement applies the market's taker and maker rates to each filled leg.

## Fee rates by market category

Each market category has its own fee rate. Fetch the rate for a token with `GET /fee-rate` (`token_id` query param). The response `base_fee` is the fee rate in basis points used in the curve below.

Rates can differ for taker and maker legs; both use the same conviction curve with their respective rates.

## Taker vs maker

| Role      | Who                                       | What rate applies |
| --------- | ----------------------------------------- | ----------------- |
| **Taker** | The incoming order that crosses the book  | Taker fee rate    |
| **Maker** | The resting order that provides liquidity | Maker fee rate    |

Each leg is charged independently from the same fill size and price.

## Maker rewards

XO runs a maker rewards program on some markets. On those markets, the maker fee rate is **0** (makers are not charged), and a portion of the fees collected from takers is distributed to makers who provided the resting liquidity. Resting on a rewards-eligible market means you can earn fees when your orders are filled as maker.

## Conviction curve

For a filled leg:

```text theme={null}
fee = C × (feeBps / 10_000) × p × (1 − p)
```

| Symbol   | Meaning                                                |
| -------- | ------------------------------------------------------ |
| `C`      | Filled shares (6-decimal micro-shares on-chain)        |
| `feeBps` | That leg's rate in basis points (from `GET /fee-rate`) |
| `p`      | Trade price as a fraction in `(0, 1)` — tick `/ 1000`  |

`p × (1 − p)` peaks at `p = 0.5` and approaches zero near the extremes, so near-certain outcomes cost almost nothing relative to mid-price fills.

Integer form (floor division):

```text theme={null}
fee_micro = feeBps × C × tick × (1000 − tick)
            ──────────────────────────────────
            10_000 × 1000 × 1000
```

## How fees are collected

Fees are always collateral (XO USDC), charged to each order's **`maker`** address (the funded trading account on the signed order — not the `beneficiary`):

* If the leg **pays** collateral (typical BUY), the fee is **added** to what that account transfers in.
* If the leg **receives** collateral (typical SELL), the fee is **withheld** from proceeds.
* `beneficiary` (when set) receives net proceeds only; principal refunds and fee funding always stay with `maker`.

Budget a little extra USDC allowance on the smart account for taker buys so the fee can clear with the principal.

## What the API surfaces mean

| Surface                   | Behavior                                                                                            |
| ------------------------- | --------------------------------------------------------------------------------------------------- |
| Signed `CTFOrder`         | No fee field. Do not send or sign `feeRateBps`.                                                     |
| `GET /fee-rate`           | Returns the market category fee rate for a `token_id` as `{ "base_fee": <bps> }`.                   |
| Trade / WS `fee_rate_bps` | Compatibility field on fill events — not the source of truth for quoting fees. Use `GET /fee-rate`. |

Fetch `base_fee`, then apply the curve above to estimate cost for a given size and price.
