9 Commits

Author SHA1 Message Date
Casey Judice 6b8bbb178f data: refresh monthly pairs.json 2026-07-11 10:18:50 -04:00
Casey Judice 0180635534 data: roll monthly pairs to July 2026 (26JUL31)
125 pairs across BTC/ETH/SOL/XRP/DOGE/BNB/HYPE/ZEC (ZEC stays Kalshi-only). The
alerts workflow regenerates docs/data/scan.json from this, so the public dashboard
rolls to July on its next ~5-min refresh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 20:24:47 -04:00
Casey Judice bcc02cac49 Fix HYPE Polymarket discovery: read its event container
Polymarket now publishes a HYPE monthly event
(what-price-will-hyperliquid-hit-in-{month}, no year suffix), so the
old strike-probe fallback was both unnecessary and mis-ranged -- its
strikes [24..52] predated HYPE roughly doubling to ~$72, so every
"above" market ($76-92) was invisible and all 8 above rows came back
NO POLY. Point HYPE at its event like every other asset and re-range
the probe fallback to the current band [52..92].

Regenerated June pairs.json: HYPE now 16/16 with a Poly leg (was 8/16),
total 110/126 (every non-ZEC row paired; ZEC stays Kalshi-only). Only
HYPE rows changed; the other 7 assets are byte-identical.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 17:21:18 -04:00
Casey Judice ffa9b5bbbc Roll pairs.json to June 2026 (26JUN30)
Regenerated from live markets via scripts/roll_month.py --month 2026-06.
126 rows across 8 assets (102 with a Polymarket leg); every Kalshi ticker
carries the 26JUN30 expiry, every Poly slug is a june-2026 slug. Full
16-strike Kalshi ladders (ETH 14) with no throttling. Also gitignore the
*.bak the roller writes on each roll.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:52:54 -04:00
Casey Judice 36dd29b549 Map XRP/ETH below-pairs + harden Kalshi quote handling
Populate the XRP and ETH MINMON (below) pairs that were silently NO PAIR:
they were never mapped to Polymarket's "dip to" markets (and two ETH pairs
pointed at the now-resolved dip-to-2000). Map each to the nearest live Poly
strike; leave strikes with no comparable Poly market (ETH $250, below Poly's
$400 floor) as NO PAIR.

Also fix two correctness gaps surfaced while investigating:
- Settled/finalized Kalshi markets returned stale 1.0/0.0 sentinel prices and
  were scored as live; now reported as NO KALSHI (timely as month-end monthly
  contracts settle).
- A Kalshi ask of exactly $1.00 means "no resting offer" (real asks are 1-99c);
  it was treated as a tradeable quote, producing phantom BAD BASIS rows at
  -100%. Drop it at the source so no fake leg enters the arb math.
- When both venues are live but no opposite-side hedge can be built, report
  NO ARB instead of the misleading NO DATA.

No real arb affected (a $1.00 leg can never be profitable); ARB count holds
at 3 and phantom BAD BASIS rows dropped 16 to 9.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 17:44:43 -04:00
Casey Judice 8cb8d4a9e4 Refresh stale Polymarket slugs (BTC dip markets rediscovered)
Polymarket appends random hash suffixes when re-publishing markets
(e.g. will-bitcoin-dip-to-70k-in-may-2026 → ...-2026-438-356-919).
Our static pairs.json had the unsuffixed slugs from the original
spreadsheet snapshot, so every BTC 'below' pair silently fell through
to NO POLY despite both venues having liquid markets. User flagged
this looking at BTC <70k May.

- scripts/refresh_pairs.py: walks each asset's 'what-price-will-X-
  hit-in-may' multi-outcome event on Gamma, rebuilds the
  (asset, direction, strike) → slug map, rewrites data/pairs.json.
  Probes HYPE strikes individually since there's no container event
  for that asset. Has --dry-run.
- data/pairs.json: updated to current live slugs. Two BTC arbs that
  were previously hidden now surface (BTC <65k and <70k both ARB).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 17:12:05 -04:00
Casey Judice dfdfe8414d IBKR daily scanner: correct YES+NO conid schema + discover helper
Earlier ibkr.py assumed each strike = one conid (buy=Yes / sell=No). The
IBKR ForecastEx CP API actually exposes each strike as TWO separate conids
(YES = right=CALL, NO = right=PUT). Local symbol shape is
CFBTC_MMDDYYHH_<strike>_<YES|NO> e.g. CFBTC_05242616_71000_YES means
4pm ET May 24 2026, $71,000 YES side.

- data/ibkr_contracts.example.json: per entry now has yes_conid + no_conid
  + strike + close_iso + label (one row per strike).
- arb/daily.py: snapshots both conids in one batch; yes_ask/no_ask come
  directly from each side's ask (no more 1-bid derivation).
- scripts/discover_ibkr.py: walks /iserver/secdef/strikes + secdef/info to
  print the full YES/NO ladder for a given underlying + month + maturity.
  Filters by maturityDate so it doesn't mix expiries.

End-to-end verified: 3 sample strikes pair cleanly to KXBTCD-26MAY2416
(IBKR $71K -> Kalshi T70999.99 etc.). Live prices still pending the
user's ForecastEx market-data subscription / strikes closer to spot.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:19:26 -04:00
Casey Judice b1f18ca9f1 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>
2026-05-23 16:16:53 -04:00
Casey Judice 05c0441053 Initial commit: prediction-market arb scanner + GHA alerts
- 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>
2026-05-20 19:48:50 -04:00