# Polymarket CLOB & Kalshi Orderbook_FP Net Fee Calculator API

- **Canonical HTML**: https://quantdesk.fastmesh.dev/seo_geo/polymarket-clob-kalshi-orderbook-fee-calculator-api.html
- **Target Query**: `Polymarket CLOB Kalshi orderbook fee calculator API` (`calculator`)
- **Source Family**: `prediction_spread` | **MCP Tool**: `quantdesk_harvest_signal` | **Pricing**: $0.05 per verified spread ($0.025 watch-diff on >=25 bps edge shift)
- **Seed**: `42` | **Trials**: `10000` | **Receipt SHA-256**: `90bf738466370c5bf0727efbbac4842d820810ad2bfb240bc2e9f0111ec26823`

## Direct Answer
Parse live Polymarket CLOB order-book ladders alongside Kalshi 2026 fixed-point orderbook_fp bid stacks—computing exact implied asks, quadratic taker fees, executable depth, and post-fee net spread basis points in Decimal precision.

## Implied Ask Inversion & Quadratic Venue Fee Drag
- Polymarket Top-of-Book: best_bid = max(Decimal(b['price'])), best_ask = min(Decimal(a['price'])) (never index [0]).
- Kalshi orderbook_fp Implied Asks: implied_yes_ask = Decimal('1.0000') - max(no_dollars); implied_no_ask = Decimal('1.0000') - max(yes_dollars).
- Post-Fee Net Edge: net_edge_bps = (1 - (leg1_ask + leg2_ask) - ceil_cent(0.07*p_K*(1-p_K)) - fee_P - slippage) * 10000.

## Deterministic 10,000-Trial Risk Metrics (Seed 42)
- P5 / P50 / P95 Return: -2.57% / +2.46% / +7.23%
- Mean / Std Return: +2.33% / 3.46%
- VaR 95 / CVaR 95: 2.57% / 6.42%
- VaR 99 / CVaR 99: 10.50% / 14.93%
- Max Drawdown (95th) / Ruin Probability: 3.48% / 0.00%
- Half-Kelly Cap: 25.00%
- Top Tornado Driver: `expected_return` (swing 5.21%, variance share 62.8%)

## Key Engineering Capabilities
- Filters out Kalshi multi-leg parlay MVE shells (KXMVECROSSCATEGORY-*) with zero quotes by preferring /events?status=open&with_nested_markets=true.
- Decodes Polymarket Gamma JSON-stringified outcomes, outcomePrices, and clobTokenIds cleanly.
- Emits watch-diff webhooks ONLY when |delta_net_edge_bps| >= 25 bps or implied probability moves >= 300 bps.

## Remote `/mcp` Invocation Example
```bash
curl -fsSL -X POST "https://quantdesk.fastmesh.dev/mcp" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "quantdesk_harvest_signal", "arguments": {"source_type": "prediction_spread", "raw_payload": {"market_id": "kalshi_poly_book_01", "polymarket_book": {"bids": [{"price": "0.001", "size": "188198.84"}, {"price": "0.440", "size": "2500.00"}], "asks": [{"price": "0.999", "size": "500000.00"}, {"price": "0.455", "size": "1800.00"}]}, "kalshi_orderbook_fp": {"yes_dollars": [["0.4800", "900.00"], ["0.5000", "420.00"]], "no_dollars": [["0.4900", "850.00"], ["0.5100", "310.00"]]}}}}}'
```

## Frequently Asked Questions
### Why does Kalshi's orderbook_fp only contain bid arrays?
Because YES + NO = $1.00 on a binary contract, a bid for NO at $0.51 is economically identical to an offer (ask) for YES at $0.49. Our parser derives implied asks automatically via Decimal('1.0000') - max(opposite_bids).

### How do I avoid zero-quote Kalshi parlay markets when scanning?
Querying /events?status=open&with_nested_markets=true and filtering out mve_collection_ticker excludes empty multi-leg parlay stubs.

### Does this API execute orders on Polymarket or Kalshi?
No. Agent-WallStreet-Desk is strictly a read-only quantitative market-data and risk modeling tool with zero brokerage, trade execution, or custody.

## Compliance & Zero-Resale Policy
Agent-WallStreet-Desk is a deterministic quantitative public-disclosure extraction and Monte Carlo risk modeling engineering tool only. It is NOT investment advice under the U.S. Investment Advisers Act of 1940, NOT a broker-dealer, and provides ZERO asset management, trade execution, or custody. 100% legal public regulatory disclosures and public market data only (zero MNPI, zero paywall bypass). Strictly $0 billed on empty, unchanged, fake-200, SSRF-blocked, or HTTP 422 responses. Zero client trading strategy, portfolio holdings, or watchlist retention or resale (zero_resale_policy: true). Support: support@fastmesh.dev.
