mirror of
https://github.com/cjudice-commits/prediction-market-arb.git
synced 2026-07-27 21:47:46 +00:00
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:
@@ -55,9 +55,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
u = urlparse(self.path)
|
||||
if u.path in _STATIC:
|
||||
return self._static(u.path)
|
||||
if u.path in ("/api/scan", "/api/scan/hourly"):
|
||||
if u.path in ("/api/scan", "/api/scan/hourly", "/api/scan/daily"):
|
||||
force = parse_qs(u.query).get("force", ["0"])[0] == "1"
|
||||
runner = (scan.run_hourly if u.path.endswith("hourly")
|
||||
runner = (scan.run_daily if u.path.endswith("daily")
|
||||
else scan.run_hourly if u.path.endswith("hourly")
|
||||
else scan.run_scan)
|
||||
try:
|
||||
return self._send(200, runner(force=force))
|
||||
|
||||
Reference in New Issue
Block a user