Symptom (live data, 2026-07-23)
The 4 energy bet_engine bets at deadline 07-19 are still pending 4 days later and are headed for VOID, while the commodity bets at the same deadline resolved cleanly (0% VOID).
Root cause
The energy settlement gate keys on the EIA feed's data date (asOf), which lags reality:
- Today (07-23) the EIA
asOf is 07-17 (from the Wed 07-23 report, covering the week ending ~07-18).
- The bet deadline is 07-19; the gate resolves only once
asOf >= 07-19.
asOf reaches 07-19 only with the ~07-30 report (data through ~07-24).
- But
VALUE_SETTLEMENT_MAX_LAG_MS = 10 days → the bet VOIDs at deadline+10d = 07-29, one day before the 07-30 data lands.
So an energy bet with a 7-day horizon (EIA_HORIZON_MS, scripts/_bet-templates-energy.mjs) can essentially never settle within the grace: EIA data lags "now" by ~6 days and only updates weekly, so the data for the deadline week publishes ~1–2 weeks after the deadline.
Fix options
- Lengthen the energy horizon to clear the lag — e.g. deadline = generatedAt + ~21d so the covering EIA report lands within the grace. (Simplest.)
- Lag-aware grace — a longer
VALUE_SETTLEMENT_MAX_LAG_MS for weekly period feeds (EIA) than for live feeds (commodities).
- Gate on report availability, not data-date — resolve when the EIA report covering the deadline period publishes.
Given the commodity lane resolves reliably at the deadline (live prices, no lag), the energy lane is lower-value until this is fixed. Recommend option (1) — a ~21d energy horizon — as the minimal change.
Evidence
bet_engine slice (07-23): resolved 8 (all commodity, 0 VOID); 4 energy @07-19 stuck pending; EIA asOf = 07-17.
Refs #5233, #4930. Follow-up from the Gate-1 review.
Symptom (live data, 2026-07-23)
The 4 energy
bet_enginebets at deadline 07-19 are still pending 4 days later and are headed for VOID, while the commodity bets at the same deadline resolved cleanly (0% VOID).Root cause
The energy settlement gate keys on the EIA feed's data date (
asOf), which lags reality:asOfis 07-17 (from the Wed 07-23 report, covering the week ending ~07-18).asOf >= 07-19.asOfreaches 07-19 only with the ~07-30 report (data through ~07-24).VALUE_SETTLEMENT_MAX_LAG_MS= 10 days → the bet VOIDs at deadline+10d = 07-29, one day before the 07-30 data lands.So an energy bet with a 7-day horizon (
EIA_HORIZON_MS,scripts/_bet-templates-energy.mjs) can essentially never settle within the grace: EIA data lags "now" by ~6 days and only updates weekly, so the data for the deadline week publishes ~1–2 weeks after the deadline.Fix options
VALUE_SETTLEMENT_MAX_LAG_MSfor weekly period feeds (EIA) than for live feeds (commodities).Given the commodity lane resolves reliably at the deadline (live prices, no lag), the energy lane is lower-value until this is fixed. Recommend option (1) — a ~21d energy horizon — as the minimal change.
Evidence
bet_engineslice (07-23): resolved 8 (all commodity, 0 VOID); 4 energy @07-19 stuck pending; EIAasOf= 07-17.Refs #5233, #4930. Follow-up from the Gate-1 review.