A dead SX Bet identifier no longer reports an upstream outage
GET /v1/markets/{market_id} and GET /v1/events/{event_id} answered
502 upstream service unavailable for some identifiers that could never
exist. The status code is the whole message: 502 tells a client the
venue is down and the request is worth retrying, while 404 tells it the
identifier is dead and it should stop asking. Reporting the first when
the second was true turned a single typo'd or expired identifier into an
unbounded retry loop.
SX Bet identifiers were the remaining gap, and both endpoints now validate the shape before calling upstream:
/v1/markets— amarket_idthat is not a0x-prefixed 64-hex market hash now returns400 invalid market_id. Previouslysxbet:0xdeadbeefand eleven other malformed shapes returned502./v1/events— anevent_idthat is not a fixture id (an uppercase letter followed by digits, e.g.L19825821) now returns400 invalid event_id. This also closes a worse case: a single-digitevent_idsuch assxbet:1made the upstream market filter drop out entirely, so the endpoint returned200with about a hundred markets drawn from unrelated fixtures grouped under one title.
Well-formed identifiers are unaffected. An identifier that is shaped
correctly but does not exist still returns 404 — including
sxbet:0x0000…0000 and sxbet:L99999999 — and a genuine upstream
failure still returns 502, so a client can still tell "this is gone"
apart from "try again later". Both routes already documented 400 for an
invalid identifier, so no API schema or SDK signature changed.
This is the same classification the Hyperliquid and AlphaArcade lookups
already used: malformed input is 400, a confirmed miss is 404, and
502 is reserved for the case where we genuinely could not find out.