The ws orderbookUpdate shows a wrong depth of the no/down shares (it mirrors the size of the yes shares) & the only way to get the real depth of the no shares is to poll rest endpoint GET/markets/slug/orderbook and to compute it which will result in rate limit (too many requests)
any solution for this? Shouldn’t limitless show the real depth of the no instead of a fake one ?
The ws orderbookUpdate shows a wrong depth of the no/down shares (it mirrors the size of the yes shares) & the only way to get the real depth of the no shares is to poll rest endpoint GET/markets/slug/orderbook and to compute it which will result in rate limit (too many requests)
any solution for this? Shouldn’t limitless show the real depth of the no instead of a fake one ?
It's not a bug, and you don't need REST at all.
A binary Limitless market is a single order book keyed to the Yes/Up token (positionIds[0] = Yes, [1] = No) — both REST and the orderbookUpdate stream carry that same one ladder. The NO side mirrors the size because of the merge/split identity: 1 Yes + 1 No = $1, so a buy-Yes at p is the same liquidity as a sell-No at 1 − p. The contracts are shared, so size is genuinely identical — only the price flips to 1 − p. That's the real NO depth, not a fake one.
So just derive NO from the Yes book you're already receiving — no polling, no 429s:
`// from each orderbookUpdate (the Yes book)
const noAsks = data.bids.map(b => ({ price: 1 - b.price, size: b.size })); // BUY No
const noBids = data.asks.map(a => ({ price: 1 - a.price, size: a.size })); // SELL No
// best No ask = 1 − best Yes bid; best No bid = 1 − best Yes ask`
If your NO depth looks wrong, the likely culprit is copying the size (correct) without flipping the price to 1 − p. Fetch REST once on subscribe to seed state, then maintain everything from the WS stream.
It's not a bug, and you don't need REST at all.
A binary Limitless market is a single order book keyed to the Yes/Up token (positionIds[0] = Yes, [1] = No) — both REST and the orderbookUpdate stream carry that same one ladder. The NO side mirrors the size because of the merge/split identity: 1 Yes + 1 No = $1, so a buy-Yes at p is the same liquidity as a sell-No at 1 − p. The contracts are shared, so size is genuinely identical — only the price flips to 1 − p. That's the real NO depth, not a fake one.
So just derive NO from the Yes book you're already receiving — no polling, no 429s:
`// from each orderbookUpdate (the Yes book)
const noAsks = data.bids.map(b => ({ price: 1 - b.price, size: b.size })); // BUY No
const noBids = data.asks.map(a => ({ price: 1 - a.price, size: a.size })); // SELL No
// best No ask = 1 − best Yes bid; best No bid = 1 − best Yes ask`
If your NO depth looks wrong, the likely culprit is copying the size (correct) without flipping the price to 1 − p. Fetch REST once on subscribe to seed state, then maintain everything from the WS stream.