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

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Venue fees

> How each venue's taker fee is calculated, and how to apply it to orderbook levels.

`GET /venue-markets` returns three fields describing the venue's taker fee for
each market. These fields are returned by `GET /venue-markets` only — the
embedded `venueMarkets[]` on `/venue-events` and `matchedVenueMarkets[]`
entries do not carry them.

| field | meaning |
| - | - |
| `feeRate` | The venue's published taker rate. `null` = we do not have it. `0` = the venue charges nothing. |
| `feeExponent` | `0` = flat fraction of notional. `>= 1` = quadratic family. `null` when `feeBasis` is `winnings`. |
| `feeBasis` | `fill`, `fill_in_game_only`, `winnings`, or `exit` — when the fee is charged. |

<Warning>
  `null` never means free. It means we have not ingested a fee for that market and
  you should fall back to your own table. A venue that genuinely charges nothing
  returns `0`.
</Warning>

## What is and isn't included

These fields carry the **venue's** fee only, and only the **taker** side — every
venue below charges makers nothing.

They do **not** include AGG's own execution costs, such as the builder fee on
Polymarket. Those appear in
`feeBreakdown` on `GET /orderbook/{venueMarketOutcomeId}/route`, which is the authoritative
number for what a trade will actually cost. Use these fields to render indicative
fee-inclusive levels; use `feeBreakdown` to quote.

## Applying the fee

### `feeBasis: "fill"` with `feeExponent >= 1`

The fee per share is `feeRate * (p * (1 - p))^feeExponent`.

**Polymarket bills buys on the pre-fee quantity** (`notional / p`, not the shares
you receive), so for a buy the correct general form is:

```
fee / notional = feeRate * (p * (1 - p))^feeExponent / p
```

At `feeExponent = 1`, which is by far the common case, that collapses to the
price-linear form:

```
fee / notional = feeRate * (1 - p)     # feeExponent = 1 ONLY
```

<Warning>
  Read `feeExponent` per market — do not assume it is always 1. There is at least
  one live Polymarket market serving `feeExponent = 2`. Hardcoding the collapsed
  form would under-charge it substantially.
</Warning>

For a sell, where you state the share count yourself, use the plain per-share
form with no gross-up.

A market that charges nothing returns `feeRate: 0` with `feeExponent: 1` — the
exponent is an inert placeholder there, since a zero rate gives a zero fee at
any exponent.

### `feeBasis: "fill"` with `feeExponent = 0`

A flat fraction of notional: `fee = feeRate * qty * p`. predict.fun works this
way.

### `feeBasis: "fill_in_game_only"`

Same as `fill`, but the venue charges **nothing** on fills matched before the
event goes live. Only Novig behaves this way. If you are rendering a pre-game
book, the venue fee is zero. This is a property of the *fill*, not the order —
a pre-game order still resting when the event goes live pays the fee on
whatever matches after kickoff.

Note that our own quotes charge this fee unconditionally — the router has no
liveness signal — so a pre-game `feeBreakdown` will be higher than what you
compute here. Novig settles the fill at zero.

### `feeBasis: "winnings"`

Not a cost at execution. The venue takes a cut of your **net profit, netted per
market, at settlement**. Render it as a payout haircut:

```
effective payout  = 1 - feeRate * (1 - p)
fee-adjusted odds = p / (1 - feeRate * (1 - p))
```

Because it nets across your positions in a market, a trader holding offsetting
positions pays less than this implies — treat it as an upper bound.

### `feeBasis: "exit"`

Charged only when a position **closes**. Opening a position is free.

* **Selling** shares: `fee = feeRate * qty * p`, a flat fraction of notional (`feeExponent` is `0`).
* **Holding to settlement** on the winning side: the venue keeps `feeRate` of the \$1 payout.

```
effective payout = 1 - feeRate
```

Only Hyperliquid works this way. Its rate is `0.0007 * (s + max(s, 1))`, where `s` is the market deployer's fee scale (0–10), so 14 bps at scale 1 and up to 140 bps at scale 10. That is the base-tier rate: Hyperliquid's volume, staking and referral discounts lower what a given trader pays.

Buy route responses report `fills[].settlementFee` and an `estimatedPayout` net of those fees. Use that payout to compare routes and show the winning return; `totalFilled` remains the share count. Hyperliquid quantities are solved as whole shares, including in split routes. Settlement fees do not increase buy funding or bridge amounts.

An absent `deployerFeeScale` is treated as scale 0 (7 bps). If no usable rate is stored for a market, quotes price it at 140 bps until one is available.

## Per-venue reference

| venue | `feeBasis` | `feeRate` | `feeExponent` | where the venue publishes it |
| - | - | - | - | - |
| polymarket | `fill` | per market, 0–0.25 | `1`, occasionally `2` | [Polymarket fees](https://docs.polymarket.com/trading/fees); per-market values from Gamma `feeSchedule` (= CLOB `fd`) |
| kalshi | `fill` | per market (unrounded — see note) | `1` | [Kalshi fee schedule (PDF)](https://kalshi.com/docs/kalshi-fee-schedule.pdf); per-market from `/series.fee_multiplier` |
| predict.fun | `fill` | per market (0.02 today) | `0` | `/markets.feeRateBps` on the venue API |
| novig | `fill_in_game_only` | `0.03` | `1` | [Novig fees](https://docs.novig.com/fees) — verified 2026-09-07 |
| prophetx | `winnings` | `0.02` | `null` | [ProphetX — Understanding Commission](https://prophethelp.zendesk.com/hc/en-us/articles/26975338569489-Understanding-Commission) — verified 2026-09-04 |
| opinion | `null` | `null` | `null` | unverified — see below |
| limitless | `null` | `null` | `null` | [Limitless fees](https://docs.limitless.exchange/fees) — see below |
| myriad | `null` | `null` | `null` | `/markets.fees` on the venue API — see below |
| hyperliquid | `exit` | per market, 0.0007–0.014 | `0` | [Hyperliquid fees](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees); per-market scale from `outcomeMeta` — verified 2026-09-11 |

**Kalshi rounds the computed fee up to the next cent, per order.** The rate in
the table above is the unrounded rate — computing `feeRate * p * (1 - p)`
without rounding under-states the actual charge, materially on small orders (1
contract at `p = 0.5` computes `$0.0175`; Kalshi charges `$0.02`, +14%).

Novig was verified 2026-09-07; ProphetX was verified 2026-09-04 (its page
returns 403 to automated fetchers, so it has not been re-fetched since).
**Treat each date as an expiry date** — venues change these schedules without
notice, and the links above are how you re-check.

## Venues that return `null`

Three venues return `null`. Two of them have fee curves that a
`(rate, exponent)` pair cannot express, so a value would be wrong at most
prices:

* **Limitless** — a piecewise-linear schedule across 12 published anchors, and
  the buy and sell curves differ (buy falls from 3.00% to a 0.40% floor as
  `p → 1`; sell peaks at 1.50% at `p = 0.50`).
* **Myriad** — a tent, `feeBPS(p) = peakBPS * min(p, 1 - p) / 0.5`. A parabola
  cannot express a tent at any exponent.

The third is a sourcing gap rather than a shape problem:

* **Opinion** — we believe it charges nothing, but that has never been verified
  against Opinion's published terms. Since `0` is a positive claim that the
  venue charges nothing, we return `null` instead until someone can cite a
  source. This is deliberately conservative: you fall back to your own table
  rather than trusting an unverified zero.

For all three, read `feeBreakdown` from the route endpoint.

## Parlay and combination contracts

Everything above describes **straight** contracts. Two venues price multi-leg
contracts on an entirely separate schedule:

* **ProphetX parlays** — taker-only, per fill:
  `F(p) = 0.014 * (1 - p) / (0.19 + p) + 0.004`, with per-order rounding and a
  \$0.01 minimum. ([source](https://prophethelp.zendesk.com/hc/en-us/articles/26975338569489-Understanding-Commission))
* **Novig combination contracts** — a 0.10 taker coefficient on a different
  formula, `0.10 * wager * collateral / (wager + collateral)`.
  ([source](https://docs.novig.com/fees))

We do not aggregate multi-leg contracts on either venue, so no market returned
by `/venue-markets` uses these. They are documented here only so the
straight-contract values above are not mistaken for the venue's whole fee story.
