The Gamma API returns two date fields:
endDateIso = "2026-02-24" ← date only, no time
endDate = "2026-02-24T06:35:00Z" ← correct close datetime
_parseEndTs() was preferring endDateIso, which parsed to midnight UTC
and was already in the past by the time any market opened during the day.
Both current and next-slot markets were therefore rejected as "already expired".
Fix: prioritise endDate (full ISO datetime) over endDateIso (date-only).
Co-Authored-By: direkturcrypto <direkturcrypto.x@mail3.me>
Adds a debug flag (ONESHOT_DEBUG=true / --debug / npm run oneshot-debug)
that surfaces the engine's internal decision process at every key step.
Debug output tags
─────────────────
[DBG:FEED] — Market discovery: every slug probed, API response status,
token IDs extracted, tick size fetched.
Throttled poll summary every 10 ticks per market showing
bid/ask/spread/mid/depth for both UP and DOWN sides.
[DBG:GATE] — Hard gate result every 5 evaluations per market:
TTE range, spread width, depth thinness, stale flag.
Shows exact gate fail reason or PASS confirmation.
[DBG:FEAT] — Feature breakdown for each side every 5 evals:
slope, imbalance, spread, retrace raw values plus
per-component scores and weighted total.
[DBG:SCORE] — Per-side qualify check: score vs threshold,
trend confirm flag, and QUALIFY / skip verdict.
[DBG:SIGNAL] — Always logged (no throttle) when an ENTER signal fires.
[DBG:HEART] — 5-second heartbeat: active markets, per-market SM state,
dailyPnl, consecLosses, cooldownLeft, halted flag.
New script
──────────
npm run oneshot-debug → DRY_RUN=true ONESHOT_DEBUG=true node src/oneshot.js
Co-Authored-By: direkturcrypto <direkturcrypto.x@mail3.me>