IBKR × Kalshi daily-BTC scanner (local-only)

- 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>
This commit is contained in:
Casey Judice
2026-05-23 16:16:52 -04:00
parent 81c553d4de
commit b1f18ca9f1
9 changed files with 490 additions and 12 deletions
+19
View File
@@ -0,0 +1,19 @@
{
"_comment": "Copy to data/ibkr_contracts.json and fill in your own IBKR ForecastEx daily-BTC conids. data/ibkr_contracts.json is git-ignored. Find conids via the IBKR Client Portal Gateway once it's auth'd (search 'BTC' under ForecastEx / event contracts) or copy them from the IBKR Web UI. `close_iso` MUST be the UTC ISO timestamp the IBKR contract settles at (e.g. 5pm ET = 21:00 UTC during EDT). `strike` is the dollar level the contract is 'or above'. Add one entry per IBKR contract you want to watch; the scanner pairs each to the Kalshi KXBTCD market closing at the same instant with nearest strike.",
"contracts": [
{
"asset": "BTC",
"conid": 12345678,
"strike": 85000,
"close_iso": "2026-05-23T21:00:00Z",
"label": "BTC > $85,000 @ 5pm ET, 5/23"
},
{
"asset": "BTC",
"conid": 12345679,
"strike": 86000,
"close_iso": "2026-05-23T21:00:00Z",
"label": "BTC > $86,000 @ 5pm ET, 5/23"
}
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"kalshi_fee_rate": 0.07,
"poly_fee_rate": 0.072,
"min_net_return": 0.002,
"min_net_return": 0.001,
"min_poly_volume": 100.0,
"min_contracts": 1.0
}