秋田预测市场 · Discord 审计

Python SDK 处理无交易市场时因 lastTradePrice 为 null 报错

2026-06-19 · Limitless · 1 条相关讨论

Jeremy | Limitless 2026-06-18 22:24:38

<@691346730867884122> if you're having an issue like cordi_b's, check this out: This isn't anything wrong on your end. It's a bug in our Python SDK. When a market hasn't had any trades yet, our API returns lastTradePrice: null, and the SDK's orderbook model is wrongly expecting a number there, so it errors out and hands you back an empty book, which is why your code then says "no best ask for YES." That's also why it's hit-or-miss: it only happens on fresh markets that haven't traded yet (super common on the 5-min ones right when they open), and clears up as soon as the market gets its first trade. With the next SDK update this will be looked at. The workaround for now is to hit the REST endpoint directly and parse it yourself GET https://api.limitless.exchange/markets/%7Bslug%7D/orderbook Which returns the book fine with lastTradePrice: null.

<@691346730867884122> if you're having an issue like cordi_b's, check this out: This isn't anything wrong on your end. It's a bug in our Python SDK. When a market hasn't had any trades yet, our API returns lastTradePrice: null, and the SDK's orderbook model is wrongly expecting a number there, so it errors out and hands you back an empty book, which is why your code then says "no best ask for YES." That's also why it's hit-or-miss: it only happens on fresh markets that haven't traded yet (super common on the 5-min ones right when they open), and clears up as soon as the market gets its first trade. With the next SDK update this will be looked at. The workaround for now is to hit the REST endpoint directly and parse it yourself GET https://api.limitless.exchange/markets/%7Bslug%7D/orderbook Which returns the book fine with lastTradePrice: null.