Skip to main content
Glama
nexosdata
by nexosdata

calculate_kalshi_fees

Calculates exact Kalshi taker fees and solves the maximum counterpart NO price needed for positive-EV cross-venue arbitrage at a target net ROI.

Instructions

Solve exact quadratic taker fees and maximum counterpart contract prices for Kalshi. Implements CFTC Rule 40.2 quadratic fee formula: ceil(0.07 * C * P * (1-P)), and solves the closed-form quadratic root solver 0.07P_no^2 - 1.07P_no + K >= 0 for guaranteed positive EV cross-venue arbitrage.

Input Schema

NameRequiredDescriptionDefault
priceNoContract price on Kalshi [0.01 - 0.99] to calculate exact taker fee
contractsNoNumber of binary outcome contracts (default: 100)
primary_priceNoPrimary leg contract price (e.g. Polymarket YES at 0.48) to solve maximum counterpart NO price on Kalshi for guaranteed net ROI
target_roi_pctNoTarget net ROI percentage after all fees and gas (default: 0.0% for breakeven)
counterpart_venueNoVenue of counterpart leg (default: 'KALSHI')KALSHI

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose the exact fee formula and root-solver inequality, which is genuinely useful behavioral context for trusting the output. However, it never says the tool is a pure side-effect-free calculation, never describes the return shape, and never discloses that it operates in two distinct modes (fee lookup vs. counterpart-price solve) — a real gap for a 5-param tool with zero required fields.

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

Conciseness4/5

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

Two sentences, front-loaded with the purpose before the formula. The formula is dense but earns its place as the tool's defining behavior. Minor cost: the LaTeX-style notation is harder to parse than plain prose would be.

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

Completeness3/5

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

With 5 optional parameters, two operating modes, and no output schema, the description should explain which parameter combination triggers which computation and roughly what comes back. It explains the math but not the invocation contract, leaving an agent to guess at mode selection.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already carries parameter meaning and the baseline is 3. The description reinforces the math behind price/primary_price but adds no interaction semantics — specifically, it does not say that price+contracts selects fee mode while primary_price+target_roi_pct selects the arbitrage solve mode.

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

Purpose4/5

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

The description names a specific verb+resource pair: solving Kalshi quadratic taker fees and maximum counterpart contract prices. The purpose is unambiguous for an agent reading it, though it never contrasts itself with siblings like scan_arbitrage_opportunities, which it plainly complements rather than duplicates.

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

Usage Guidelines3/5

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

The closing clause 'for guaranteed positive EV cross-venue arbitrage' implies the scenario, but the description never states when to call this versus scan_arbitrage_opportunities, nor does it say what inputs are required for which mode. Usage must be inferred from the parameter names.

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