Show HN: bouncemarket – a live prediction market game for a bouncing ball
265 points by mday404 5 hours ago | 81 comments
a ball will fall. trade on where it lands.

I made this game! Some technical details:

The entire drop of the ball is simulated server-side, then streamed to each client as server-sent events with a small buffer. Every drop is deterministic from its starting position, so rounds can be replayed exactly for later analysis, but tiny variations in starting position can change the ultimate outcome.

There's some AI traders to keep the market moving, but they drop out in any round that has more than five people. They operate using a naive set of rules that I wrote for them, so they're not too hard to beat -- it's when the market is full of real people that it gets tricky.

Curious to get feedback on anything you would change, and especially whether the mechanics were clear right away or not.


charlieyu1 4 hours ago
Fun little game, but the drop needs to be slower so it is easier to bet. Odds jumping from 0.01 to 0.99 in like one tenth of a second makes it hard to play
reply
johnnyenn 4 hours ago
The drop is pre-simulated over SSE anyway, so adding a bit more delay between frames would fix this. Right now normal ping moves the odds before the click even hits the server.
reply
catlifeonmars 3 hours ago
> The drop is pre-simulated over SSE anyway

Trying to understand this phrase but its meaning escapes me

reply
chambored 2 hours ago
The server calculates the balls’ motions and uses Server Sent Events to stream the results to the browser.
reply
catlifeonmars 2 hours ago
Ah so like a replay! Is SSE a specific term of art or does any event generated on a web server sent to a client count regardless of technology? At the risk of sounding sarcastic (I’m not), why did you capitalize S, S, and E?
reply
jaapz 2 hours ago
reply
savef 60 minutes ago
Jinx.
reply
savef 2 hours ago
It's a specific web tech: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...

But in colloquial usage I'd expect people probably do use that phrase referring to any system for events sent to clients by servers, such as long polling or websockets.

reply
johnnyenn 2 hours ago
[dead]
reply
novia 4 hours ago
this was because of a bot added to the game, it was easier
reply
vova_hn2 5 hours ago
Completely ignoring the ball and just buying cheap shares is a surprisingly efficient strategy. Often I'm able to get both kinds of share for cheap, so I win regardless of the outcome.
reply
cvoss 4 hours ago
I would guess that the universe of players not being closed is a source of imbalance. There is a constant stream of new players who are granted 10 credits. Maybe they play for a bit and leave when they get disinterested, which is more likely than not going to occur when they have less than 10 credits.

So if the money supply per capita is constantly increasing, holding a share in anything with a 50% chance of payout has a positive expected return. Diversifying by buying both shares makes your portfolio very resistant to fluctuation. The ideal strategy just rides the inflation on average.

reply
marcosdumay 3 hours ago
What you are describing is there, yes.

But the GP's experience is due to a lack of good players with time to plan their bets. This is a well known feature of derivatives markets...

reply
novia 4 hours ago
it was fun to buy low until someone added a bot to do that which makes the price instantly swing in the opposite direction by the time your click guess through
reply
sebastos 3 hours ago
I was frustrated by the same until I realized that if it’s that predictable I should be able to take advantage of it. I started getting more success with a buy high strategy, which because of the bot ends up as a buy low strategy by the time your click registers. The bot moves the market so much and so consistently that it ends up just behaving as a phase shift.
reply
catlifeonmars 3 hours ago
I read this as “trading is easy until the quants get involved”. So basically just like a real market.
reply
imeanwhatdoikno 5 hours ago
Yeah feels like either the market is quite inefficient or there's a bug because just buying up sub-0.05 shares on both sides makes it too easy

P.S. still genius idea. Might need some refining

reply
mday404 5 hours ago
Just checked my logs -- the market maker is actually up slightly (around 46 points). Lots of people are profiting, but it's balanced by losses from other players. Around ~400 points move around per round at the moment.
reply
aniceperson 5 hours ago
its is missing trading fees indeed.
reply
StingyJelly 4 hours ago
[dead]
reply
qoez 3 hours ago
I wish people leaned into making prediction markets about pure random events like this. In theory they should be just as legal as sports betting in the sense of being considered "financial contracts", but no one has actually done the experiment (with real money not fake like here) as far as I'm aware.
reply
lesam 2 hours ago
The CFTC disagrees (IANAL):

> Gaming contracts are likely to be contrary to the public interest, the CFTC indicates, if they involve games of random chance, as trading in such contracts would not provide useful or meaningful information.

https://www.congress.gov/crs-product/LSB11441

reply
qoez 2 hours ago
Would be interesting to know/test where the line is. If a person gets to place the initial placement of the ball is that now slightly a game of skill? Maybe the 'chat' votes on it. There's already coin tosses in sports games sometimes (to determine who goes first and stuff like that) so some kind of mixing of pure randomness is allowed.

There's also already weather contracts that are allowed which are very 'random'/a very chaotic system very hard to fully predict. A coin toss is technically fully determined/not random if one knew all the atoms and their momentum etc.

reply
pjc50 2 hours ago
Am I the only one going "this is just gambling! No!" Here?

Used to be electro mechanical toy horse racing games for this purpose.

reply
retsibsi 2 hours ago
> Am I the only one going "this is just gambling! No!" Here?

That was my first reaction too, but I think that was their point: prediction markets are already being used as a loophole to allow sports betting in jurisdictions where it is supposed to be banned, and (according to them; I haven't checked this) the legal theory that justifies that would also justify 'prediction markets' on random outcomes, i.e. really blatantly just pure gambling. So it could serve as a kind of reductio of the sports betting loophole.

reply
whycombinetor 2 hours ago
Casinos definitely exist, lmao.
reply
qoez 2 hours ago
The point would kind of be to make fun in almost a performance art way of the "sports are financial contracts" idea. Though as someone else commented I'm incorrect about this specific ruling.
reply
whycombinetor 2 hours ago
You can walk up to any craps or roulette table in a casino and participate in a legal prediction market for the random events happening on the table. That's not a performance art.
reply
amenhotep 54 minutes ago
Casinos aren't regulated by the CFTC, which is the whole point of the bit.
reply
akshayp29 16 minutes ago
There's a lag! The odds seem to be updating quicker than the ball animation for me, which makes it really hard to trade...
reply
mday404 56 seconds ago
I actually think the bots may have started trading on buffered frames...

Streaming directly from server to client leads to jitter due to inconsistent frame delivery times, so the client actually holds a few frames "in the future". Given that the price seems to be almost clairvoyant at times, I think the most likely explanation is that someone is reading the buffered frames before the client is supposed to be displaying them haha

reply
suzukivenom 5 hours ago
bouncemarket: bought Right x52 at avg 0.19, landed Right, +42.21 in one round https://bouncemarket.minhanhday.com/r/FYv-qiLU
reply
tantalor 5 hours ago
This guy bounces
reply
xp84 4 hours ago
It’s too hard to buy multiple shares. The price changes super fast so I’d like to have buy 5,10,100 shares buttons too. Or something like that.

Super fun though. Love the idea and the execution.

reply
theophrastus 4 hours ago
If it is an approximal simulation of Galton board[1] then wouldn't wagering on the side the ball starts on have a positive outcome over time?

[1] https://en.wikipedia.org/wiki/Galton_board

reply
danielmarkbruce 4 hours ago
Wagering has a pricing element.
reply
Lightbody 3 hours ago
Fun! Can you update it so double tapping the bet buttons doesn’t zoom in on mobile? Should be a one line CSS tweak.
reply
mday404 2 hours ago
should be fixed now!
reply
trwhite 3 hours ago
The latency on the button press is much too slow to actually make a decision about the price. It feels pretty random as to what price you’re gonna get
reply
Andr2Andr 2 hours ago
Could be expanded with futures, indexes, hedge funds, shares etc. to teach the general public about the financial topics. A user is first prompted to play a few rounds, and then has the ability to invest, to buy some shares etc. I think it could become the go to page to understand the financial markets. Just my thoughts what to make of this in future
reply
theturtletalks 3 hours ago
This is actually how the formula for options came about!
reply
darepublic 2 hours ago
I would prefer if it were a known 'fair' plinko machine that was being automated physically and you were live streaming that. It would make it a lot more interesting to me. That or a roulette wheel
reply
frenchmajesty 5 hours ago
Surprising fun and awesome! Love it.

It was not immediately clear how the game was played but it came to me soon enough. I think one or two "trial/tutorial" rounds would go a long way to give me a proper shot at the leaderboard.

I wasted my first 2-3 balls as I was looking at the UI trying to understand how to play.

reply
mday404 5 hours ago
Thanks for the feedback! I'll work on some kind of tutorial to start the game
reply
matthova 5 hours ago
Love the concept. Great implementation
reply
hellojomp 4 hours ago
I had a similar idea a few months ago https://hellojomp.com/mob-market/ but instead of a ball bouncing it was about the dynamics of webpage links turned into hawks and pigeons and random predictions regarding them i.e. will X spawn Y times in _ seconds.
reply
joshribakoff 5 hours ago
So fun, and easy to profit, at least for a few minutes. Seems like if you played this professionally 40hrs a week full-time it would get tiring fast. Maybe there is a metaphor in there.
reply
2bird3 2 hours ago
Nice! Claude was able to recreate the simulation pretty quickly- it might be worth adding a little randomness to the bounces.
reply
mday404 2 hours ago
I'm curious, were you able to actually trade on the simulation's results?

My assumption was that the data you get as a browser doesn't have sufficient resolution to reverse-engineer the simulation, since the simulation operates on full 64-bit floats and you only get 0.1px granularity in display, so you don't know where the ball "really" is to guess it super early.

reply
imeanwhatdoikno 5 hours ago
This is kind of genius
reply
echoangle 5 hours ago
Is there a way to sell shares before resolution?
reply
mday404 3 hours ago
No, I thought about it but I wanted to keep the UI as simple as possible. Definitely would make the market more interesting in a future update!
reply
gpm 4 hours ago
Buying a share on the opposite side is effectively selling a share.
reply
gpm 5 hours ago
I'd like to see how much the market maker is making/losing.
reply
dpmartinez 5 hours ago
This looks fun, but I imagine someone somewhere in a financial exchange company looking at this and thinking:

"bouncing ball futures contracts, would be a thing to offer our sophisticated clients."

reply
folli 5 hours ago
"AI Traders" - "naive set of rules". Definitive proof that if..else is AI now.

Jokes aside, cool game. Introducing trading fees would be interesting to make it more realistic in terms of buying both sides.

reply
furyofantares 4 hours ago
Hilarious and fun. Btw if I tap furiously on a button the page zoomed in every time the button ends up disabled.
reply
mday404 2 hours ago
should be fixed now!
reply
cush 4 hours ago
Fun idea! The page shouldn’t zoom in when you tap rapidly - makes it impossible to play on iOS
reply
mday404 2 hours ago
fixed!
reply
elisgillberg 5 hours ago
Hehe this is awesome!
reply
jojogeo 5 hours ago
Agreed; throwing all my "free money" on one side, after guessing correctly several times in a row with small stakes had me literally shouting in excitement, just before losing it all :')

I can see why people throw money at gambling, if its easy enough to do.

reply
deadbeefer 5 hours ago
Y'know, the more I think about it... a lot of the games that hook ya have this element of prediction. Even (especially?) stuff that's deterministic without true RNG. Even really fast-paced twitch games tend to push your reflexes to the point where you have to predict in advance. Sorta triggering that gambler's reflex. Pre-aiming hitscan weaps at corners and pre-firing projectiles where feet will land in many shooters feels like they trigger something similar.
reply
bee_rider 3 hours ago
That’s an interesting thought.

Whether pre-aiming has a downside or not seems to depend on map design? Like if there are multiple plausible corners, you have to pick one, so there’s a cost of not picking the other. Other games have simpler maps, if there’s only one plausible corner I guess there isn’t much cost to aiming at it.

Of course, defining plausible corners relies on map knowledge. Actually I think that’s one of the reasons I quit playing online shooters didn’t want to put in the level of effort required to make those gambles fun. Random death is boring.

reply
cogythea 3 hours ago
Yep, having that "I can see where this is going" moment is what pulls you in, especially when you get it right. And then for gambling, it's when you start to think "I can see where this is going better than other people can", that's when you see real opportunity to win your fortune. For games like Poker, that's rare but entirely possible, but for games like OP's it's borderline impossible - but that doesn't stop the brain thinking it.
reply
jdorfman 3 hours ago
That’s it I’m opening up a Kalshi account. Going to be rich.
reply
idiotsecant 47 minutes ago
This is pure dopamine, fantastic. Now the question is whether it will replace my urge to be wolf of wall street or whether it will enflame it.
reply
dandaka 4 hours ago
Please add keyboard controls
reply
mday404 3 hours ago
added! Reload the page to see
reply
JonnieCache 5 hours ago
Do it with a camera and a real ball lol
reply
rickcarlino 5 hours ago
Finally a useful application for predictive markets.
reply
franze 5 hours ago
make it so that the important stuff is the height of the viewport above fold. i don't see the ball falling at the start
reply
ex-aws-dude 4 hours ago
This is what I pretend my stock buying strategy is not underneath
reply
eterm 5 hours ago
It annoys me we can't put in limit orders, as with a touch screen the latency kills you as the price changes underneath you!

( Annoys is too strong a word, it's just a game! )

reply
andai 5 hours ago
Sounds like you may be interested in my new real-time neural interface, ball2brain.
reply
hei-lima 3 hours ago
Really cool!
reply
d--b 3 hours ago
A prediction market should allow us to sell
reply
iamgopal 4 hours ago
are there keyboard short cut ?
reply
mday404 3 hours ago
just added! left and right arrows
reply
setnone 5 hours ago
cool! up next: bouncemarketbot
reply
mday404 4 hours ago
In hindsight I'm realizing I should have had a bot high scores and real player high scores since both require skill but in different ways
reply
NooneAtAll5 4 hours ago
another gambling website?
reply
hsng95 39 minutes ago
[dead]
reply
RemingtonDavies 3 hours ago
[dead]
reply