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

# Fees

> How trading fees work on Bayse Markets

Bayse Markets charges a trading fee on each executed trade. Fees are always included in [quote](/api-reference/pm/get-quote) responses so you can review the estimated total cost before placing an order.

## How fees are calculated

Fees use a **variance-based formula** that scales with price uncertainty:

$$
\text{fee} = \text{feeRate} \times C \times P \times \max(1 - P,\; 0.5)
$$

Where:

* **feeRate** — the market's configured fee rate (e.g. 0.10 for 10%).
* **C** — the number of shares (quantity).
* **P** — the execution price per share (between 0 and 1).
* **0.5** — the floor factor, ensuring the effective rate never drops below 50% of feeRate.

The fee is also capped at a maximum of **\$1,000 per trade**.

### How the formula behaves

The term `P × max(1 − P, 0.5)` controls how the fee scales with price. When `1 − P ≥ 0.5` (i.e. P ≤ 0.50), the variance branch `P × (1 − P)` applies. Above P = 0.50 the floor branch `P × 0.5` takes over, keeping fee behavior predictable at extreme prices.

| Price (P) | Multiplier `P × max(1 − P, 0.5)`    | Fee as % of trade value (feeRate = 0.10) |
| --------- | ----------------------------------- | ---------------------------------------- |
| 0.30      | `0.30 × 0.70 = 0.21`                | **7.0%**                                 |
| 0.50      | `0.50 × 0.50 = 0.25`                | **5.0%**                                 |
| 0.70      | `0.70 × 0.50 = 0.35` (floor begins) | **5.0%**                                 |
| 0.90      | `0.90 × 0.50 = 0.45` (floor)        | **5.0%**                                 |

The "fee as % of trade value" column is `fee / (C × P)`, which simplifies to `feeRate × max(1 − P, 0.5)`.

* Fees are **highest** when the price is near 0.50 (maximum uncertainty).
* Fees are **lowest** at extreme prices (high certainty), but the floor ensures the rate never drops below `feeRate × 0.5` (5% at feeRate = 0.10).

This means you pay proportionally less when trading outcomes the market is already confident about.

## Fees by market engine

### AMM markets

On AMM markets, the fee is **built into the execution price** — it is not broken out as a separate `fee` field. The quote response shows:

```json theme={null}
{
  "price": 0.7235,
  "currentMarketPrice": 0.72,
  "quantity": 138.21,
  "costOfShares": 100,
  "amount": 100
}
```

* `amount` — total you pay.
* `costOfShares` — same as `amount` (fee is embedded).
* `price` — effective per-share price, which already includes the fee.

The difference between `price` and `currentMarketPrice` reflects the fee and any price impact. Orders execute instantly at the quoted price.

### CLOB markets

On CLOB markets, fees apply only to **takers** (orders that match against resting orders on the book). Makers — orders that add liquidity to the book — pay no fee.

| Role      | Fee                              |
| --------- | -------------------------------- |
| **Taker** | Variance-based fee at fill price |
| **Maker** | Free                             |

Fees are calculated at the time each fill occurs. If your order fills in multiple parts at different prices, each fill's fee is calculated independently.

The quote endpoint shows the estimated fee for the full order. How the fee is applied depends on the order side:

**Buy orders** — the fee reduces shares received, not the amount you pay:

```json theme={null}
{
  "price": 0.65,
  "quantity": 150.00,
  "costOfShares": 100,
  "fee": 2.50,
  "amount": 100,
  "completeFill": true
}
```

* `amount` — total you pay.
* `fee` — deducted from shares, not from the amount.
* `quantity` — shares received after the fee.

**Sell orders** — the fee reduces the proceeds you receive:

```json theme={null}
{
  "price": 0.65,
  "quantity": 100,
  "costOfShares": 62.50,
  "fee": 2.50,
  "amount": 62.50,
  "completeFill": true
}
```

* `amount` — net proceeds after the fee is deducted.
* `fee` — deducted from proceeds, not from shares.
* `quantity` — shares you are selling.

<Tip>
  `completeFill` tells you whether the full amount can be filled at the quoted price. If `false`, only partial liquidity is available on the book.
</Tip>

## Fees in quotes vs execution

Always [get a quote](/api-reference/pm/get-quote) before placing an order. The quote gives you:

* The expected fee.
* The number of shares you will receive.
* The estimated total cost including the fee.

For **AMM markets**, the quoted price is exact — orders execute instantly at the quoted price. For **CLOB markets**, the actual fill price (and therefore fee) may differ from the quote if the order book changes between quoting and execution.

## Multi-currency

Fees are automatically shown in the same currency as the quote. If you request a quote in NGN, the fee and all amounts in the response are in NGN. See [Multi-currency](/concepts/multi-currency) for more on how currencies work across the API.
