New arb/prepare.py + GET /api/prepare: for one monthly arb pair it re-pulls
fresh quotes (incl. real Kalshi top-of-book ask size) and builds the exact
order pair a cross-venue hedge would need -- sides from best_side, size
capped to the thinner book, limit = ask + slippage buffer, capital required,
guaranteed worst-case, and warnings. Places NO orders and touches no order
endpoints anywhere.
UI: a "Prepare trade" button in the monthly drawer's breakdown card opens a
PREVIEW-ONLY ticket modal (max-size + slippage-cent inputs that re-price live;
a deliberately disabled Confirm button as the Step-2 placeholder). Also
reorders the expanded drawer so the breakdown/Prepare card is the wide left
column.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Guards the paired view against rows that lack a kind field (e.g. a backend
that hasn't reloaded), so a real pair never renders as "one leg".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The paired view now recognizes cross-venue hedges economically (by what each
leg pays) instead of only matching curated pairs.json rows, and fills by
contract count: exact-strike (matched) pairs fill first, so a leg's excess
spills into the nearest basis pair only after every matched pairing is
exhausted. Partially consumed legs are pro-rated; size/cost/value/pnl conserve
exactly. Frontend shows matched / basis+ / basis- badges, strike band, and a
plain-English coverage note per row.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
calc.evaluate now reports NO POLY when the Kalshi side has data but the
Polymarket slug doesn't resolve (the common case: Polymarket renamed/
dropped a market while Kalshi still trades it). NO KALSHI is the reverse,
NO DATA only when both are missing. User caught this looking at BTC <70k
May: 20 of 118 pairs were silently NO-DATA when the real cause was Poly-
side absence — now visible as a dedicated NO POLY chip + filter button.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- arb/ibkr.py: Client Portal Gateway client (localhost:5000 over self-
signed SSL; auth_status, tickle, snapshot, secdef/search). Distinct
NotConnected vs NotAuthed exceptions for graceful UI fallbacks.
- arb/daily.py: pairs each user-configured IBKR ForecastEx daily-BTC
contract against the Kalshi KXBTCD market closing at the same UTC
instant with nearest strike. Reuses arb.calc.evaluate for the worst-
case arb math; IBKR slots into the 'pq' position. NO KALSHI status
when no matching Kalshi market exists.
- data/ibkr_contracts.example.json: template (real file gitignored).
- /api/scan/daily route + 'IBKR × Kalshi' tab in the local UI. Tab
shows a setup banner explaining what to do when Gateway/contracts
aren't configured (vs crashing).
- Public Pages dashboard unchanged (positions + IBKR are local-only).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Monthly + hourly Kalshi/Polymarket arb scanner (stdlib-only Python).
- Live positions tab w/ realized P&L history.
- GitHub Actions cron workflow texts SMS via Apps Script webhook on
newly-detected arbs. State persisted in alerts_state.json.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>