Skip to main content
Glama

Polymarket Fill Risk

polymarket_fill_risk
Read-onlyIdempotent

Realizable-vs-theoretical edge check against live CLOB order-book depth — AND Polymarket's own taker fee, which is never zero and is folded in rather than left for you to add (fleet #3446: r/PredictionsMarkets flagged a "clean" fill that quietly omitted it as optimistic in the direction that loses money). REQUIRES one of market (single-market mode) or event (basket/partition mode). SINGLE-MARKET: pass a market slug/URL + side (buy_yes|sell_yes|buy_no|sell_no, default buy_yes) + size_usd (default 1000 — max spend on buys, target proceeds on sells); walks the ladder and returns top_of_book, vwap_fill_price, slippage_pp, shares_filled, max_fillable_usd, verdict (clean|degraded|cannot_fill), fee_schedule ({category, taker_rate, exponent, maker_rebate_rate, fees_enabled, basis} — read off THIS market, never assumed free), fee_usd/fee_pp at the actual VWAP fill, breakeven_win_rate_taker (the win probability your side needs just to cover price + fee — ~51.8% on a 50c crypto taker fill, not 50%), breakeven_win_rate_maker (no fee charged to makers — any rebate is in fee_schedule.maker_rebate_rate), and all_in_cost_pp = slippage_pp + fee_pp. BASKET: pass an event slug/URL + side (sell_yes = capture overround by selling every leg, buy_yes = capture underround; default auto from partition sum) + size_usd interpreted as settlement notional S (shares per leg; each share pays $1); returns theoretical_sum vs realizable_sum (top-of-book vs VWAP across all legs), capture_ratio and profit_usd — both NET of every leg's own Polymarket taker fee (capture_ratio_gross/profit_usd_gross keep the pre-fee figures; per_leg[].fee_usd itemizes each leg, summed as fees_usd_total), per-leg fill detail, thin_legs[], max_clean_notional_usd, and forced_directional_risk naming the legs most likely to strand you unhedged. USE THIS before acting on any polymarket_arbitrage SELL/BUY-EVERY-LEG signal or any polymarket_edges trade above ~$500 — theoretical overround on thin books is not capturable, and partial basket fills convert an arb into an unhedged directional position (the dominant loss mode in real arb-bot P&L). Adverse selection while working resting orders is still not modeled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideNoSingle-market: buy_yes | sell_yes | buy_no | sell_no (default buy_yes). Basket: sell_yes | buy_yes (default auto — sell if partition sum > 1, buy if < 1).
eventNoBasket mode: event slug or full polymarket.com URL — checks every leg of the partition.
marketNoSingle-market mode: market slug or full polymarket.com URL.
size_usdNoSingle-market: USD to spend (buys) or target proceeds (sells). Basket: settlement notional — shares per leg, each paying $1 at resolution. Default 1000, clamp 10–1,000,000.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoWhich mode answered — set by which of market/event was passed.
sideNoSingle-market mode: the side actually priced (buy_yes|sell_yes|buy_no|sell_no).
_hintNoUsage note — what is gross vs net of fees, and what is still unmodeled.
errorNoError code (orderbook_unavailable, event_books_unavailable, empty_book, bad_side, missing_input) — present only on failure.
eventNoBasket mode: resolved event slug.
titleNoBasket mode: event title.
fee_ppNoSingle-market mode: the taker fee as a percentage point of a $1 share — size-invariant, so it's the same number at any trade size.
marketNoSingle-market mode: resolved market slug.
fee_usdNoSingle-market mode: Polymarket taker fee in USD on the shares actually filled.
messageNoHuman-readable error detail — present only on failure.
per_legNoBasket mode: per-leg fill detail.
verdictNoSingle-market mode: fill-quality verdict based on depth/slippage (independent of the fee).
questionNoSingle-market mode: the market question.
strategyNoBasket mode: which side was priced across every leg.
dead_legsNoBasket mode: leg slugs with zero visible depth on the priced side.
leg_countNoBasket mode: number of legs priced.
reasoningNoPlain-English explanation of the verdict, naming the all-in cost and breakeven.
thin_legsNoBasket mode: leg slugs that cannot cleanly absorb the requested size.
usd_filledNoSingle-market mode: dollars actually fillable from visible depth.
slippage_ppNoSingle-market mode: |vwap - top_of_book| in percentage points.
theoreticalNoBasket mode: top-of-book sum across all legs, before depth.
top_of_bookNoSingle-market mode: best price on the side priced.
fee_scheduleNoPolymarket's published taker-fee parameters for this market, read off the market payload (fleet #3446) — never assumed fee-free.
capture_ratioNoBasket mode: fraction of the theoretical edge that survives depth AND fees (fleet #3446 — was gross of fees before).
shares_filledNoSingle-market mode: shares actually fillable from visible depth.
all_in_cost_ppNoSingle-market mode: slippage_pp + fee_pp — the full round-trip cost of this fill.
truncated_legsNoBasket mode: legs dropped by the 80-leg cap, if any.
vwap_fill_priceNoSingle-market mode: volume-weighted fill price across the requested size; null if nothing filled.
max_fillable_usdNoSingle-market mode: total USD value of the entire visible side of the book.
partition_completeNoBasket mode: false means truncated_legs > 0 — edge figures are directional only.
side_auto_selectedNoBasket mode: true if side was inferred from the partition sum rather than passed explicitly.
size_usd_requestedNoSingle-market mode: the size_usd argument, clamped.
book_levels_visibleNoSingle-market mode: count of price levels on the side priced.
capture_ratio_grossNoBasket mode: the pre-fee figure capture_ratio used to report.
forced_directional_riskNoBasket mode: plain-English risk note naming dead/thin legs.
breakeven_win_rate_makerNoSingle-market mode: win-rate a maker (no taker fee charged) would need — equals top_of_book.
breakeven_win_rate_takerNoSingle-market mode: win-rate (0-1) the filled side needs to break even as a taker, INCLUDING the fee — always worse than the raw fill price.
realizable_at_executed_sizeNoBasket mode: VWAP sum across all legs at the executed size, net of each leg's own Polymarket taker fee (fleet #3446 — profit_usd was gross before).
scaled_down_by_thinnest_legNoBasket mode: true if executed size was capped below the requested size.
settlement_notional_executed_usdNoBasket mode: shares-per-leg actually executable, scaled down by the thinnest leg.
settlement_notional_requested_usdNoBasket mode: requested shares-per-leg (the size_usd argument).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Realizable fill risk against live order-book depth, plus Polymarket's own taker fee and the breakeven win-rate it implies (fleet #3446).",
      +  "properties": {
      +    "_hint": {
      +      "description": "Usage note — what is gross vs net of fees, and what is still unmodeled.",
      +      "type": "string"
      +    },
      +    "all_in_cost_pp": {
      +      "description": "Single-market mode: slippage_pp + fee_pp — the full round-trip cost of this fill.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "book_levels_visible": {
      +      "description": "Single-market mode: count of price levels on the side priced.",
      +      "type": "number"
      +    },
      +    "breakeven_win_rate_maker": {
      +      "description": "Single-market mode: win-rate a maker (no taker fee charged) would need — equals top_of_book.",
      +      "type": "number"
      +    },
      +    "breakeven_win_rate_taker": {
      +      "description": "Single-market mode: win-rate (0-1) the filled side needs to break even as a taker, INCLUDING the fee — always worse than the raw fill price.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "capture_ratio": {
      +      "description": "Basket mode: fraction of the theoretical edge that survives depth AND fees (fleet #3446 — was gross of fees before).",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "capture_ratio_gross": {
      +      "description": "Basket mode: the pre-fee figure capture_ratio used to report.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "dead_legs": {
      +      "description": "Basket mode: leg slugs with zero visible depth on the priced side.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Error code (orderbook_unavailable, event_books_unavailable, empty_book, bad_side, missing_input) — present only on failure.",
      +      "type": "string"
      +    },
      +    "event": {
      +      "description": "Basket mode: resolved event slug.",
      +      "type": "string"
      +    },
      +    "fee_pp": {
      +      "description": "Single-market mode: the taker fee as a percentage point of a $1 share — size-invariant, so it's the same number at any trade size.",
      +      "type": "number"
      +    },
      +    "fee_schedule": {
      +      "description": "Polymarket's published taker-fee parameters for this market, read off the market payload (fleet #3446) — never assumed fee-free.",
      +      "properties": {
      +        "basis": {
      +          "description": "Where the rate came from — payload (read off this market) is the most trustworthy.",
      +          "enum": [
      +            "payload",
      +            "category",
      +            "fallback",
      +            "fee_free"
      +          ],
      +          "type": "string"
      +        },
      +        "category": {
      +          "description": "Polymarket's fee category, e.g. 'crypto_fees_v2'.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "exponent": {
      +          "description": "Exponent in fee = shares × rate × (p×(1-p))^exponent — 1 on every market observed.",
      +          "type": "number"
      +        },
      +        "fees_enabled": {
      +          "description": "false means this market genuinely charges no taker fee.",
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "maker_rebate_rate": {
      +          "description": "Polymarket's published maker rebate rate, when known.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "taker_rate": {
      +          "description": "Taker-fee rate actually applied (0 means genuinely fee-free, never \"unknown\").",
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "fee_usd": {
      +      "description": "Single-market mode: Polymarket taker fee in USD on the shares actually filled.",
      +      "type": "number"
      +    },
      +    "forced_directional_risk": {
      +      "description": "Basket mode: plain-English risk note naming dead/thin legs.",
      +      "type": "string"
      +    },
      +    "leg_count": {
      +      "description": "Basket mode: number of legs priced.",
      +      "type": "number"
      +    },
      +    "market": {
      +      "description": "Single-market mode: resolved market slug.",
      +      "type": "string"
      +    },
      +    "max_fillable_usd": {
      +      "description": "Single-market mode: total USD value of the entire visible side of the book.",
      +      "type": "number"
      +    },
      +    "message": {
      +      "description": "Human-readable error detail — present only on failure.",
      +      "type": "string"
      +    },
      +    "mode": {
      +      "description": "Which mode answered — set by which of market/event was passed.",
      +      "enum": [
      +        "single_market",
      +        "basket"
      +      ],
      +      "type": "string"
      +    },
      +    "partition_complete": {
      +      "description": "Basket mode: false means truncated_legs > 0 — edge figures are directional only.",
      +      "type": "boolean"
      +    },
      +    "per_leg": {
      +      "description": "Basket mode: per-leg fill detail.",
      +      "items": {
      +        "properties": {
      +          "depth_shares": {
      +            "type": "number"
      +          },
      +          "fee_usd": {
      +            "description": "This leg's own Polymarket taker fee in USD at the executed size.",
      +            "type": "number"
      +          },
      +          "fills_requested_size": {
      +            "type": "boolean"
      +          },
      +          "question": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "slippage_pp": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "slug": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "top_of_book": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "vwap_at_executed_size": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "question": {
      +      "description": "Single-market mode: the market question.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "realizable_at_executed_size": {
      +      "description": "Basket mode: VWAP sum across all legs at the executed size, net of each leg's own Polymarket taker fee (fleet #3446 — profit_usd was gross before).",
      +      "properties": {
      +        "edge_pp": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "fees_usd_total": {
      +          "description": "Sum of per_leg[].fee_usd across every leg.",
      +          "type": "number"
      +        },
      +        "note": {
      +          "description": "Present only when the basket is not executable at any size.",
      +          "type": "string"
      +        },
      +        "profit_usd": {
      +          "description": "NET of every leg's own Polymarket taker fee.",
      +          "type": "number"
      +        },
      +        "profit_usd_gross": {
      +          "description": "Before fees — kept alongside profit_usd so the fee cost is never hidden.",
      +          "type": "number"
      +        },
      +        "sum_yes": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "reasoning": {
      +      "description": "Plain-English explanation of the verdict, naming the all-in cost and breakeven.",
      +      "type": "string"
      +    },
      +    "scaled_down_by_thinnest_leg": {
      +      "description": "Basket mode: true if executed size was capped below the requested size.",
      +      "type": "boolean"
      +    },
      +    "settlement_notional_executed_usd": {
      +      "description": "Basket mode: shares-per-leg actually executable, scaled down by the thinnest leg.",
      +      "type": "number"
      +    },
      +    "settlement_notional_requested_usd": {
      +      "description": "Basket mode: requested shares-per-leg (the size_usd argument).",
      +      "type": "number"
      +    },
      +    "shares_filled": {
      +      "description": "Single-market mode: shares actually fillable from visible depth.",
      +      "type": "number"
      +    },
      +    "side": {
      +      "description": "Single-market mode: the side actually priced (buy_yes|sell_yes|buy_no|sell_no).",
      +      "type": "string"
      +    },
      +    "side_auto_selected": {
      +      "description": "Basket mode: true if side was inferred from the partition sum rather than passed explicitly.",
      +      "type": "boolean"
      +    },
      +    "size_usd_requested": {
      +      "description": "Single-market mode: the size_usd argument, clamped.",
      +      "type": "number"
      +    },
      +    "slippage_pp": {
      +      "description": "Single-market mode: |vwap - top_of_book| in percentage points.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "strategy": {
      +      "description": "Basket mode: which side was priced across every leg.",
      +      "enum": [
      +        "sell_yes_every_leg",
      +        "buy_yes_every_leg"
      +      ],
      +      "type": "string"
      +    },
      +    "theoretical": {
      +      "description": "Basket mode: top-of-book sum across all legs, before depth.",
      +      "properties": {
      +        "basis": {
      +          "type": "string"
      +        },
      +        "edge_pp": {
      +          "type": "number"
      +        },
      +        "sum_yes": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "thin_legs": {
      +      "description": "Basket mode: leg slugs that cannot cleanly absorb the requested size.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "title": {
      +      "description": "Basket mode: event title.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "top_of_book": {
      +      "description": "Single-market mode: best price on the side priced.",
      +      "type": "number"
      +    },
      +    "truncated_legs": {
      +      "description": "Basket mode: legs dropped by the 80-leg cap, if any.",
      +      "type": "number"
      +    },
      +    "usd_filled": {
      +      "description": "Single-market mode: dollars actually fillable from visible depth.",
      +      "type": "number"
      +    },
      +    "verdict": {
      +      "description": "Single-market mode: fill-quality verdict based on depth/slippage (independent of the fee).",
      +      "enum": [
      +        "clean",
      +        "degraded",
      +        "cannot_fill"
      +      ],
      +      "type": "string"
      +    },
      +    "vwap_fill_price": {
      +      "description": "Single-market mode: volume-weighted fill price across the requested size; null if nothing filled.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "market": "will-the-fed-increase-interest-rates-by-25-bps-after-the-december-2026-meeting-20260729232808636",
      +    "side": "buy_yes",
      +    "size_usd": 1000
      +  }
      +]
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare a safe read-only, idempotent, open-world operation, so the bar is low — but the description goes well beyond: it discloses that fees are always non-zero and computed per-market, that basket figures are net of every leg's fee with gross counterparts retained, the verdict enum, and the failure mode (partial fills become unhedged directional exposure). That is substantively new behavioral context, and nothing contradicts the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded well (purpose, then mode requirements, then return shape, then usage rule), but it is very dense — the 'fleet #3446 / r/PredictionsMarkets' anecdote is narrative justification rather than agent-facing guidance, and the exhaustive enumeration of return fields duplicates the output schema. Both cost readability without changing how an agent calls the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with four parameters, an output schema, and rich annotations, everything an agent needs to call it correctly is present: mode requirement, defaults, side enums, size semantics per mode, fee treatment, and the pre-trade decision rule. The one acknowledged limitation (adverse selection on resting orders) is stated explicitly rather than left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so 3 is the floor — but the description reinterprets `size_usd` meaningfully per mode (max spend on buys vs target proceeds on sells vs settlement notional/shares-per-leg in basket mode) and explains default side resolution in basket mode. It adds real semantic value beyond the schema text rather than restating it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('realizable-vs-theoretical edge check against live CLOB order-book depth') and adds the distinguishing twist — Polymarket's non-zero taker fee is folded in. It also names the sibling tools it supersedes in this situation (polymarket_arbitrage, polymarket_edges), so an agent can route without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit activation rule: 'USE THIS before acting on any polymarket_arbitrage SELL/BUY-EVERY-LEG signal or any polymarket_edges trade above ~$500.' It also states the mode-selection requirement (exactly one of `market` or `event`) and discloses a known non-coverage ('adverse selection ... is still not modeled'), which is a well-scoped when-not.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.