Skip to main content
Glama

prediction.neg_risk_arbitrage

Detect basket arbitrage in Polymarket neg-risk events: compute net edge from basket bid/ask sums, executable capacity under slippage limits, and flag viable opportunities. Use for multi-outcome events with 2+ outcomes.

Instructions

Detect basket arbitrage in a Polymarket neg-risk (mutually-exclusive,
multi-outcome) event: a full YES basket across all outcomes always settles
to exactly $1 via Polymarket's neg-risk adapter, so a basket price away
from $1 (after costs) is a near risk-free edge. Also computes
buy/sell_basket_capacity_shares - the actual liquidity-bottleneck size the
thinnest outcome's order book can support within max_slippage_pct - so
this isn't just a top-of-book mirage. Note *_capacity_notional_usd still
prices that size at top-of-book (optimistic beyond the first price level) -
use *_capacity_vwap_notional_usd for the realistic average fill cost. Also
returns oldest_book_snapshot_time, the staleness bottleneck across all legs
(the oldest of each leg's own order-book snapshot timestamp). Polymarket only.

Use this to scan a specific multi-outcome event you already know the slug
for. Do NOT use for binary Yes/No markets (no basket to arbitrage, this
needs 2+ mutually-exclusive outcomes) or for Kalshi (its Data ToS forbids
this use of their data). Pair with prediction.exit_capacity_audit before
sizing a real position on one leg.

Args:
    event_slug: Polymarket event slug, from the event's URL on polymarket.com.
    assumed_round_trip_cost_pct: Gas + fees + slippage buffer, as a
        percentage of $1 basket notional (default 1.5).
    max_slippage_pct: How far past each leg's best price to walk the book
        when sizing executable basket capacity (default 1.0).
    min_net_edge_pct: Minimum net edge (%) required to flag
        arbitrage_viable: true (default 1.0).

Returns:
    On success: {"success": true, "basket_ask_sum", "basket_bid_sum",
        "buy_basket_net_edge_usd", "buy_basket_capacity_shares",
        "opportunity", "arbitrage_viable", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_slugYes
max_slippage_pctNo
min_net_edge_pctNo
assumed_round_trip_cost_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and meets it thoroughly. It explains the core mechanism (basket settles to $1), the capacity computation tied to max_slippage_pct, the caveat that notional capacity is optimistic while VWAP capacity is realistic, and the staleness field. It even documents the success and failure return shapes, so the agent knows what to expect.

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

Conciseness5/5

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

Although the description is longer than average, every sentence adds operational value: core concept, capacity caveat, staleness explanation, usage boundaries, parameter semantics, and return format. The structure is front-loaded with the main purpose, followed by caveats and usage, then args and returns. No filler or redundant restatement of the tool name exists.

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?

Given no output schema, no annotations, and 0% schema description coverage, this description is unusually complete. It covers what the tool computes, the key output fields, failure behavior, platform restrictions, and parameter meanings. The only minor omission is potential authentication or rate-limit considerations, but these are not essential for a read-only detection tool and are not expected from sibling context.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate, and it does. Each parameter gets a meaningful explanation: event_slug is sourced from the Polymarket URL, assumed_round_trip_cost_pct is defined as a percentage of $1 basket notional, max_slippage_pct controls how far to walk the book, and min_net_edge_pct gates arbitrage_viable. This goes well beyond the bare schema property names.

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?

The description opens with a specific verb and resource: 'Detect basket arbitrage in a Polymarket neg-risk event.' It clearly distinguishes itself from siblings by naming what it is not for (binary markets, Kalshi) and by referencing the companion tool prediction.exit_capacity_audit. An agent can immediately understand exactly what this tool does and how it differs from related prediction and arbitrage tools.

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?

Explicit when-to-use guidance is present: 'Use this to scan a specific multi-outcome event you already know the slug for.' It also gives concrete exclusions ('Do NOT use for binary Yes/No markets... or for Kalshi') and even provides a workflow recommendation to pair with prediction.exit_capacity_audit before sizing a position. This leaves no ambiguity about when to select this tool.

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