# Prediction Market Spread Risk Simulator (Polymarket CLOB vs Kalshi v2)

- **Canonical HTML**: https://quantdesk.fastmesh.dev/seo_geo/prediction-market-spread-risk-simulator.html
- **Target Query**: `prediction market spread risk simulator` (`calculator`)
- **Source Family**: `prediction_spread` | **MCP Tool**: `quantdesk_full_brief` | **Pricing**: $0.10 full brief ($0.05 harvest-only; $0 on unparseable/422)
- **Seed**: `42` | **Trials**: `10000` | **Receipt SHA-256**: `625ccb0b572a4437d24226d0f7eead687217676b2aa6b7fc7292a3d853122edc`

## Direct Answer
Quantify dual-side cross-venue prediction market arbitrage spreads between Polymarket Gamma/CLOB and Kalshi Trade API v2 after exact quadratic taker fees, order-book sort-trap corrections, settlement-date divergence guards, and 10,000-trial Monte Carlo tail risk.

## Dual-Side Post-Fee Spread Edge & Settlement-Date Divergence Penalty
- Gross Cross-Venue Edge: E_gross,A = 1 - (P_yes_ask + K_no_ask); E_gross,B = 1 - (K_yes_ask + P_no_ask).
- Kalshi Quadratic Taker Fee: fee_K(p) = ceil_cent(Decimal('0.07') * p * (Decimal('1') - p)); Polymarket taker fee = Decimal(takerBaseFee_bps) / 10000 when feesEnabled=true.
- Net Post-Fee Edge (bps): E_net_bps = (max(E_gross,A, E_gross,B) - fee_leg1 - fee_leg2 - slippage) * 10000; confidence discounted by 0.35 if settlement_gap_days > 3 or can_close_early differs.

## Deterministic 10,000-Trial Risk Metrics (Seed 42)
- P5 / P50 / P95 Return: -2.71% / +3.50% / +9.36%
- Mean / Std Return: +3.23% / 4.48%
- VaR 95 / CVaR 95: 2.71% / 9.24%
- VaR 99 / CVaR 99: 15.77% / 19.75%
- Max Drawdown (95th) / Ruin Probability: 3.86% / 0.00%
- Half-Kelly Cap: 25.00%
- Top Tornado Driver: `jump_severity` (swing 5.98%, variance share 46.3%)

## Key Engineering Capabilities
- Fixes Polymarket CLOB /book sort trap where bids are sorted ascending (0.001 first) and asks descending (0.999 first) by strictly extracting max(bids) and min(asks).
- Supports both legacy Kalshi cent fields and 2026 fixed-point dollar strings (yes_bid_dollars, yes_ask_dollars, volume_fp) plus orderbook_fp implied asks (1.0000 - max(no_dollars)).
- Flags resolution_mismatch_risk='HIGH' whenever settlement timestamps diverge by more than 3 days across venues.

## 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_full_brief", "arguments": {"source_type": "prediction_spread", "raw_payload": {"market_id": "macro_cpi_pair_2026", "polymarket": {"yes_ask": "0.4650", "no_ask": "0.5450", "end_date": "2026-12-15T14:00:00Z", "taker_fee_bps": 0}, "kalshi": {"ticker": "KXCPI-26DEC", "yes_ask_dollars": "0.5100", "no_ask_dollars": "0.4800", "close_time": "2026-12-15T14:00:00Z", "can_close_early": false}}, "seed": 42, "trials": 10000, "horizon_days": 14, "initial_capital": 50000}}}'
```

## Frequently Asked Questions
### Why do naive Polymarket CLOB parsers misread top-of-book prices?
Polymarket's /book endpoint returns bids ascending (starting around 0.001) and asks descending (starting around 0.999). Taking index [0] produces bogus 99.8-cent spreads. Agent-WallStreet-Desk always computes max(bids) and min(asks) in Decimal.

### How is Kalshi's taker fee modeled in the net spread calculation?
We deduct exact Kalshi quadratic taker fees per contract, ceil_cent(0.07 * p * (1 - p)), plus Polymarket takerBaseFee when feesEnabled is true, before computing net_edge_bps.

### What does the settlement-date divergence risk guard catch?
Two markets covering similar headlines can have different cutoff dates or early-close rules. Any settlement gap > 3 days or differing can_close_early flag raises resolution_mismatch_risk='HIGH' and discounts signal confidence.

## 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.
