prediction.polymarket_fee_estimate
Polymarket's own taker fee (NOT gas, slippage, or AlphaPipeline's own charge) for a hypothetical fill of shares at price, using the official bell-curve formula shares * fee_rate * price * (1 - price). fee_rate is read live from Polymarket's own GET /fee-rate for the exact token_id - never hardcoded, since per-category rates have changed before. Makers pay 0 across every category - this is the taker fee only. Omit price to use the live best book quote for side. Accepts either a raw token_id or a market_slug (+ outcome) to resolve it automatically. Paid in USDC on Base.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | No | "sell" (default) or "buy" - which side of the book to read price from when price is omitted. | |
| price | No | Hypothetical fill price (0-1 exclusive). Omit to use the live best book quote for side. | |
| shares | Yes | Hypothetical fill size, in shares. Must be > 0. | |
| outcome | No | "yes" (default) or "no" - which side to resolve when using market_slug. | |
| token_id | No | The outcome's CLOB token_id / asset_id, if already known. | |
| market_slug | No | Exact Polymarket market slug, used to resolve token_id automatically. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | ||
| notice | No | ||
| shares | Yes | ||
| fee_usd | Yes | ||
| fee_rate | Yes | ||
| token_id | Yes | ||
| base_fee_bp | Yes | ||
| data_source | Yes | ||
| market_slug | No | ||
| generated_at | Yes | ||
| price_source | Yes | ||
| book_snapshot_time | No |