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

> ## Agent Instructions
> The Markdown of an API reference page leaves out the OpenAPI schema.
> Every object an endpoint returns or a webhook carries, with each field's type, presence and meaning, is on https://docs.0xinsider.com/api-reference/objects.md.
> The full OpenAPI 3.1 spec names each operation's and each webhook's exact parameters, request body and response schema: https://docs.0xinsider.com/api-reference/openapi.json.

# Get fee quote

> Get what one Polymarket order on a game outcome costs in fees, taker or maker, and with a wallet, the rebate its tier returns.

Use this endpoint to price one order before you place it: the Polymarket fee it pays, the cost or proceeds per share with that fee, and the weighted volume the fill adds toward your rebate tier. Add `wallet` to read the wallet's taker and maker tiers from Polymarket and price the rebate on this order. The market, its live book and its fee curve are the same reads as [Get fair price](https://docs.0xinsider.com/api-reference/endpoint/get-fair-price.md).

## Parameters

| Parameter | Meaning |
| - | - |
| `condition_id` | The market's condition id, raw or the `mkt_`-prefixed `market.id`, as `markets[].condition_id` on [List game markets](https://docs.0xinsider.com/api-reference/endpoint/list-game-markets.md). The market must be a covered game's. |
| `outcome` | The outcome index to trade, `0` or `1`, as `outcomes[].index` on [List game markets](https://docs.0xinsider.com/api-reference/endpoint/list-game-markets.md). |
| `side` | `buy` (the default) or `sell` the outcome's shares. |
| `role` | `taker` (the default): the order fills against the book and pays the fee. `maker`: the order rests on the book, pays no fee, and earns the wallet's maker rebate on the taker fee its fill generates. |
| `shares` | The order's size in shares. Send `shares` or `notional_usd`, exactly one. |
| `notional_usd` | The order's size in USD before the fee; `shares` is `notional_usd / price`. |
| `price` | Optional. The fill price, `0.001` to `0.999`. Omitted, the quote uses the live book: the best ask for a taker buy or a maker sell, the best bid for a taker sell or a maker buy. |
| `wallet` | Optional. The wallet you trade from, usually your Polymarket proxy wallet. 0xinsider does not store it or log it, and the response does not echo it. |

## Key response fields

| Field | Meaning |
| - | - |
| `data.status` | Checked in this order: `closed` (the market closed or resolved), `unavailable` with `fee_schedule_unavailable` (no fee record in hand; the quote never assumes a rate. A market's first quote starts its fee read and waits for it briefly; if that read is still running, quote again in 1 to 2 seconds. The same answer again means Polymarket has no fee curve for the market), `unavailable` with the book's reason (no `price` sent and the side it defaults to is missing), else `ok`. |
| `data.fee_per_share` | `rate` x (p x (1 - p))^`exponent` at the fill price p, from the market's own fee curve in `data.fee_schedule`. |
| `data.fee_usd` | A taker's fee: `shares` x `fee_per_share`, unrounded. Polymarket rounds each fill's fee to 5 decimals when it matches. A maker's is `0`. |
| `data.fee_generated_usd` | The taker fee the fill generates: the base of a maker rebate. |
| `data.weighted_volume` | What the fill adds toward the role's rebate tier: `shares` x p x (1 - p) for a taker buy and a maker fill on a fee-paying market, `0` on a fee-free one, and `null` for a taker sell, which Polymarket's taker rebate page does not define. |
| `data.wallet.taker_tier`, `maker_tier` | The wallet's tiers as Polymarket reports them, each with the next tier up, the weighted volume it still needs and the fees that volume takes at this market's rate. A tier not read is `status: "unavailable"`: `pending` when a new wallet's lookup is still running (quote again in 1 to 2 seconds; the tier is then cached for 10 minutes), `rate_limited` when tier lookups are at their limit (quote again in a few seconds), or `provider_timeout` or `provider_error`. |
| `data.rebate_usd`, `net_fee_usd` | The rebate on this order and `fee_usd - rebate_usd`. A taker rebate is the tier's share of `fee_usd`: Gold 10%, Platinum 25%, Diamond 40%, Obsidian 50%, Onyx 60%, and 0% for Tier 0 and the retired Bronze and Silver names. A maker rebate is the tier's `rebate_bps` share of `fee_generated_usd`. `null` when the tier is unavailable; the gross fee still serves. |
| `data.rules_version` | The Polymarket rule set the figures apply. |

A value we do not hold is `null`, never `0`. An unknown condition id is a `404`.

## Example

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $OXINSIDER_API_KEY" \
  'https://api.0xinsider.com/api/v1/fees/quote?condition_id=0x...&outcome=0&notional_usd=100&price=0.45'
```

On a market charging a rate of `0.05`, that \$100 taker buy at 45 cents is 222.22 shares, `fee_per_share` 0.012375 and `fee_usd` 2.75. `@0xinsider/sdk` 0.126.11 adds `getFeeQuote`. The free [fee calculator](https://0xinsider.com/tools/fee-calculator) on 0xinsider.com reads the same figures with no key.

## What it does not return

* The fee Polymarket finally charges an order that fills in several parts: each fill is rounded on its own, so the total can differ by a fraction of a cent.
* A tier for a wallet Polymarket does not answer for. The tier is `unavailable` and the after-rebate figures are `null`.


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.0xinsider.com/llms.txt).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.