Fix Smarkets resolutionDate fallback#1367
Conversation
PR Review: VERIFIEDWhat This DoesThis changes the Smarkets market normalizer so Blast RadiusSmarkets market normalization only: Consumer VerificationBefore (base branch): node - <<'NODE'
const { SmarketsNormalizer } = require('./core/dist/exchanges/smarkets/normalizer');
// normalizeMarket({ event: { end_date: null, start_datetime: '2025-05-01T09:00:00Z', ... }, ... })
NODEObserved response snippet on {
"resolutionDate": "2025-05-01T09:00:00.000Z",
"title": "UK General Election 2025",
"marketId": "market-456"
}After (PR branch): {
"title": "UK General Election 2025",
"marketId": "market-456"
}The existing Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- bug fix to avoid emitting an incorrect optional RiskThe remaining production risk is venue semantics: this assumes Smarkets |
Summary
start_datetimeas a SmarketsresolutionDatefallback whenend_dateis missingend_datepathsContext
I checked the Smarkets public events endpoint and the single-event endpoint while looking at #1366. Both can return
end_date: null; for example,GET https://api.smarkets.com/v3/events/?limit=3&state=upcomingandGET /v3/events/{id}/returned nullend_datevalues for sampled events.Since
start_datetimeis the event start time rather than a resolution time, exposing it asresolutionDatecan make cross-venue sorting/filtering look more precise than the venue data supports.UnifiedMarket.resolutionDateis optional, so this now leaves it unset unless Smarkets actually providesend_date.Tests
npm test --workspace=pmxt-core -- --runTestsByPath test/normalizers/exchange-normalizers-2.test.tsnpm run build --workspace=pmxt-core