[object Object]

← back to Ken

Ken: FIX no-trades root cause — Kalshi API renamed price fields (yes_bid→yes_bid_dollars string, volume_24h→volume_24h_fp). Ken read the dead fields → every market mapped to 0 → 0 active → 0 signals → 0 trades. Now reads new _dollars/_fp fields (dollars-string→cents), backward-compatible. Live test: 0→851 active markets.

2066e75cd060b036c84fa2951144d32074dc334b · 2026-07-15 12:40:37 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 2066e75cd060b036c84fa2951144d32074dc334b
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 15 12:40:37 2026 -0700

    Ken: FIX no-trades root cause — Kalshi API renamed price fields (yes_bid→yes_bid_dollars string, volume_24h→volume_24h_fp). Ken read the dead fields → every market mapped to 0 → 0 active → 0 signals → 0 trades. Now reads new _dollars/_fp fields (dollars-string→cents), backward-compatible. Live test: 0→851 active markets.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 kalshi-dash/server.js | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/kalshi-dash/server.js b/kalshi-dash/server.js
index 82fe64b..55070e4 100644
--- a/kalshi-dash/server.js
+++ b/kalshi-dash/server.js
@@ -7721,20 +7721,28 @@ async function autonomousScan() {
     for (const evt of allEvents) {
       if (evt.markets) {
         for (const m of evt.markets) {
+          // Kalshi API schema change (2026): prices moved from integer-cent fields
+          // (yes_bid, last_price, volume_24h) to string-dollar fields (yes_bid_dollars
+          // "0.5200", volume_24h_fp). Read the new fields, fall back to the old ones.
+          // dollars-string → integer cents (0-100) that the rest of the scan expects.
+          const cents = (intField, dollarField) =>
+            m[intField] != null ? m[intField] : Math.round(parseFloat(m[dollarField] || 0) * 100);
+          const num = (intField, fpField) =>
+            m[intField] != null ? m[intField] : Math.round(parseFloat(m[fpField] || 0));
           allMarkets.push({
             ticker: m.ticker,
             event_ticker: evt.event_ticker,
             title: evt.title,
             subtitle: m.subtitle || m.ticker,
-            volume: m.volume || 0,
-            volume_24h: m.volume_24h || 0,
-            open_interest: m.open_interest || 0,
-            yes_bid: m.yes_bid || 0,
-            yes_ask: m.yes_ask || 0,
-            no_bid: m.no_bid || 0,
-            no_ask: m.no_ask || 0,
-            last_price: m.last_price || 0,
-            prev_price: m.previous_price || m.last_price || 0,
+            volume: num('volume', 'volume_fp'),
+            volume_24h: num('volume_24h', 'volume_24h_fp'),
+            open_interest: num('open_interest', 'open_interest_fp'),
+            yes_bid: cents('yes_bid', 'yes_bid_dollars'),
+            yes_ask: cents('yes_ask', 'yes_ask_dollars'),
+            no_bid: cents('no_bid', 'no_bid_dollars'),
+            no_ask: cents('no_ask', 'no_ask_dollars'),
+            last_price: cents('last_price', 'last_price_dollars'),
+            prev_price: cents('previous_price', 'previous_price_dollars') || cents('last_price', 'last_price_dollars'),
             status: m.status,
             category: evt.category || '',
           });

← 5a71f56 Ken: live Risk Level knob in Settings — drag to preview, App  ·  back to Ken  ·  Ken: surface real Kalshi API error body (was '[object Object a3aff5e →