秋田预测市场 · Discord 审计

WebSocket 错误码 28 “Markets not found” 引发处理争议

2026-06-19 · Kalshi · 32 条相关讨论

bence 2026-06-18 21:27:12

`'code': 28, 'msg': 'Markets not found'` gross

`'code': 28, 'msg': 'Markets not found'` gross

Bumbling Bayesian 2026-06-18 21:38:04

I am still trying to figure out how I am referencing invalid markets. But I am at 34,000 feet and have had an espresso martini, so being careful not to push a change that breaks anything more.

I am still trying to figure out how I am referencing invalid markets. But I am at 34,000 feet and have had an espresso martini, so being careful not to push a change that breaks anything more.

brunoBowser 2026-06-18 21:47:55

Its a good thing to add - would have been nice if it was called out better in the changlog (they kinda tucked it in on another one). Overall it will help reduce the amount of unecessary work the exchange has to do and thus reduce overhead a bit and improve latency for all

Its a good thing to add - would have been nice if it was called out better in the changlog (they kinda tucked it in on another one). Overall it will help reduce the amount of unecessary work the exchange has to do and thus reduce overhead a bit and improve latency for all

brunoBowser 2026-06-18 21:50:49

recently closed markets on a current event or just recently closed markets in general - I haven't dug in to the logs yet to figure out if it is throwing the error on any current subscription once the market closes, if it is only when it receives an update command with the ticker, or if it is whenever it receives an update command where there is a closed ticker in the current subscription list it is monitoring for you.

recently closed markets on a current event or just recently closed markets in general - I haven't dug in to the logs yet to figure out if it is throwing the error on any current subscription once the market closes, if it is only when it receives an update command with the ticker, or if it is whenever it receives an update command where there is a closed ticker in the current subscription list it is monitoring for you.

brunoBowser 2026-06-18 21:51:57

If anyone does find out what is triggering it (if it is throwing the error on any current subscription once the market closes, if it is only when it receives an update command with the ticker, or if it is whenever it receives an update command where there is a closed ticker in the current subscription list it is monitoring for you) - please let everyone else know so we can adjust code eaiser without all having to research - if I am able to dig in today or tomorrow I will post but my schedule looks relatively busy.

If anyone does find out what is triggering it (if it is throwing the error on any current subscription once the market closes, if it is only when it receives an update command with the ticker, or if it is whenever it receives an update command where there is a closed ticker in the current subscription list it is monitoring for you) - please let everyone else know so we can adjust code eaiser without all having to research - if I am able to dig in today or tomorrow I will post but my schedule looks relatively busy.

Bumbling Bayesian 2026-06-18 22:16:56

My system iterates over events of interest at startup and tries to subscribe to all markets in the event. I don't currently check that each market is open before this subscription, so I suspect I am getting this error for that reason.

My system iterates over events of interest at startup and tries to subscribe to all markets in the event. I don't currently check that each market is open before this subscription, so I suspect I am getting this error for that reason.

Bumbling Bayesian 2026-06-18 22:17:24

That is, at subscription time, not asynchronously as a market closes. But maybe that also.

That is, at subscription time, not asynchronously as a market closes. But maybe that also.

humz 2026-06-18 22:20:12

Feels like bad behavior from kalshis side, seems like a race condition for a market closing? I can check a market is open, but before I can subscribe it can close?

Feels like bad behavior from kalshis side, seems like a race condition for a market closing? I can check a market is open, but before I can subscribe it can close?

𝓛𝓮𝓸 2026-06-18 22:21:49

I'm not entirely sure if `Markets not found` is going to even accomplish the intended load reduction on Kalshi's servers. Instead of sending batched subscribes I now have to do them one by one to even detect which is closed :/

I'm not entirely sure if `Markets not found` is going to even accomplish the intended load reduction on Kalshi's servers. Instead of sending batched subscribes I now have to do them one by one to even detect which is closed :/

bence 2026-06-18 22:27:38

I am looking at my logs, and in line with the changelog, it seems to just be firing when I subscribe to `orderbook_delta` with tickers that don't exist (checking their status, they are in `finalized`, but maybe this would also trigger if their status was in `{"inactive", "closed", "determined", "finalized"}`)

I am looking at my logs, and in line with the changelog, it seems to just be firing when I subscribe to `orderbook_delta` with tickers that don't exist (checking their status, they are in `finalized`, but maybe this would also trigger if their status was in `{"inactive", "closed", "determined", "finalized"}`)

bence 2026-06-18 22:32:59

i think this race: found open market -> subscribe -> market has closed, is unlikely. I had only 28 offending tickers, oldest from 26MAY23, and none were a result of this race

i think this race: found open market -> subscribe -> market has closed, is unlikely. I had only 28 offending tickers, oldest from 26MAY23, and none were a result of this race

bence 2026-06-18 22:34:26

(and i guess more clearly none of the thousands of tickers i subscribed to encountered that)

(and i guess more clearly none of the thousands of tickers i subscribed to encountered that)

guplex 2026-06-18 22:37:34

I liekd the old behavior better it seems annoying to have to weed through all names that may have clsoed and remove them before starting up or restarting. I used to update my ticker list daily now it feels like anytime i restart the program ill have to update it which will be a real pita

I liekd the old behavior better it seems annoying to have to weed through all names that may have clsoed and remove them before starting up or restarting. I used to update my ticker list daily now it feels like anytime i restart the program ill have to update it which will be a real pita

humz 2026-06-18 22:38:20

Do you subscribe to 15 min crypto? I have a feeling that will be where this happens the most

Do you subscribe to 15 min crypto? I have a feeling that will be where this happens the most

humz 2026-06-18 22:38:47

Probably easy to deal with practically but still might happen

Probably easy to deal with practically but still might happen

Bumbling Bayesian 2026-06-18 22:40:09

But it is not just a race, right? Lots of open events can have closed markets for a long time?

But it is not just a race, right? Lots of open events can have closed markets for a long time?

Bumbling Bayesian 2026-06-18 22:40:47

But is it even a problem? Can't we just ignore the errors for closed markets?

But is it even a problem? Can't we just ignore the errors for closed markets?

brunoBowser 2026-06-18 22:40:53

that has always been true - the response just now tells you

that has always been true - the response just now tells you

bence 2026-06-18 22:42:39

this is a fair point

this is a fair point