-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate How Much Market Will Move On Next Bet #185
Comments
|
Ok, setting up a new endpoint to gather the game setup information. This information can be used in the calculation but also in other ongoing tickets. What gets spit out:
|
On the buying side, the number projected doesn't seem to match the price number at the top. Rounding might come into play here. However on the selling side, the number is not updating correctly. There seems to be some complication with how selling shares gets calculated. Also, this frontend formula doesn't really use the most updated market price, it uses the market price at page upload time. What would be, "more accurate" hypothetically is to do an API call every time that the proposed bet amount is changed. This would also improve test-ability. However, it might sacrifice performance, but we would have to decide by how much and what the benefit would be. I put together a ticket for this: https://github.com/orgs/openpredictionmarkets/projects/4/views/1?pane=issue&itemId=76256796 |
I'm going to cancel this MR after putting together a ticket to use the API call method. Put together a ticket on how to decide how to do this properly. https://github.com/orgs/openpredictionmarkets/projects/4/views/1?pane=issue&itemId=76256796 |
Currently a sample of MarketDetails looks like the following:
In order to calculate the wpam probability we have a simple function:
This will tell what the next calculated probability will be at the given bet level and direction.
That being said, to get the addedYes and addedNo we have to use specific values within MarketDetails functions that are currently used to handle the bets.
Betting is currently accomplished via a layout. We have a, "purchase shares tab" which allows a user to confirm_direction and then enter_amount ... these two functions should trigger either +addedYes or +addedNo ... which then go into the above function to create a new_market_probability which could be displayed at the bottom.
If we go over to the, "sell shares," tab, then confirm_direction and enter_amount could be used to trigger either -addedYes or -addedNo ... since they are sales, we're decreasing the amount.
There needs to be some kind of error obviously if the amount being sold is less than what the market has available.
There should probably be also a maximum amount that can be entered in the billions or whatever to prevent some kind of calculation problem, maybe?
UX ... basically, the above should result in instant results, e.g. it needs to update in React instantly, and I'm not sure how to do this, but it needs to show the user what the ramifications of their bet will be.
The text was updated successfully, but these errors were encountered: