manifoldmarkets / manifold

Manifold Markets: A market for every question
https://manifold.markets
MIT License
396 stars 146 forks source link

Switch to broadcasting all answers updated in a bet #2695

Open jahooma opened 3 days ago

jahooma commented 3 days ago

Copied from Discord: I think the current problem with multiple choice is that we broadcast the updated answers one-by-one, which means if you are in the bet panel in the middle of this, you could get an inconsistent state where the answer probabilities don't add up to 100%.

Maybe I will create a websocket topic for plural answers: contract/${answer.contractId}/updated-answers, which takes an array of answers.

Then we could deprecate the singular /updated-answer after.

@MentatBot, could you add a broadcastUpdatedAnswers function in backend/shared/src/websockets/helpers.ts, and use it as well as broadcastUpdatedAnswer everywhere? Then update the client to receive those updates as an array of answers.

mentatbot[bot] commented 3 days ago

I will start working on this issue