feat(synth-overlay): Add Kalshi platform support with real ticker format matching(Closes: #19)#40
Conversation
|
Hi, @e35ventura |
|
It doesn't even work in your demo video? extensions shows kalshi price as 99c to 1c? |
bandicam.2026-03-12.21-00-35-853.mp4@e35ventura |
…tification slug; tests; PR docs - README: 'Alerts: why platform is stored', Kalshi slug detection (hash, og:url, __NEXT_DATA__, Polymarket-first) - background.js: notification click use substring(7) for kalshi| prefix - content.js: scrapeKalshiPrices __NEXT_DATA__ fallback - test_matcher: test_detect_platform_legacy_kalshi_ticker_no_kx_prefix - PR_DESCRIPTION.md: why this approach, differentiators - PR_40_VS_OURS.md: comparison with PR entrius#40
|
Closing in favor of #41. PR #41 implements a much more robust Platform Registry architecture and a dynamic grammar parser for Kalshi tickers, which scales significantly better than maintaining a hardcoded list. More importantly, #41 fixes the critical Chrome extension context invalidation bugs on reload and reliably tracks Polymarket balances during SPA navigation. Great effort here, but the structural improvements in #41 make it the preferred path forward. |
Summary
Extends Synth Overlay to support Kalshi as a second prediction market platform alongside Polymarket. The extension now detects Kalshi pages, scrapes live prices (dollar + cent formats), maps real Kalshi ticker formats to Synth assets/market types, and serves edge data through the existing API server. Includes extension context invalidation guards to prevent errors on extension reload.
Related Issues
Fixes #19
Type of Change
What Changed
Matcher (
matcher.py)_KALSHI_ASSET_MAPwith 30+ real Kalshi series tickers (KXBTCD, KXBTC, KXBTC15M, KXETHD, etc.) mapped to assets_kalshi_series_from_ticker()to extract series from full market tickers (e.g.KXBTCD-26MAR1317-T70499.99→kxbtcd)btc,eth,btcd,ethd) require Kalshi-style date suffix to avoid collision with Polymarket slugsdetect_platform(),asset_from_kalshi_ticker(),get_kalshi_market_type()for Kalshi-specific routingnormalize_slug()handles multi-segment Kalshi URLs (e.g./markets/kxsol15m/solana-15-minutes/kxsol15m-26mar121945) and tickers containing periods (e.g.-T70499.99)Content Script (
content.js)scrapeKalshiPrices()with 4 strategies: cent format ("Yes 52¢"), dollar format ("Yes $0.52"), standalone prices with parent context walk, and order book patternsslugFromPage()updated to extract last path segment for deep Kalshi URLsscanKalshiMarketLinks()to detect crypto market links on Kalshi browse pagesisContextValid()guard +teardown()to prevent "Extension context invalidated" errors — clears polling interval, disconnects MutationObserver, and silences allchrome.runtimecalls when extension context diesExtension (
manifest.json,background.js,sidepanel.js)https://*.kalshi.com/*to host_permissions and content_scripts matchesbackground.js: SUPPORTED_ORIGINS includeskalshi.com, null guard onisSupportedUrl()sidepanel.js: platform-aware UI labels ("Kalshi" vs "Poly"), Kalshi market link buttons for navigation, updated hint text with real ticker examplesServer (
server.py)detect_platform()asset_from_kalshi_ticker()for asset resolution"platform": "kalshi"fieldREADME
Testing
venth-issue-19.mp4