Show HN: bouncemarket – a live prediction market game for a bouncing ball

(bouncemarket.minhanhday.com)

329 points | by mday404 11 hours ago

57 comments

  • charlieyu1 10 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
    • johnnyenn 10 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.
      • catlifeonmars 8 hours ago
        > The drop is pre-simulated over SSE anyway

        Trying to understand this phrase but its meaning escapes me

        • chambored 8 hours ago
          The server calculates the balls’ motions and uses Server Sent Events to stream the results to the browser.
        • johnnyenn 8 hours ago
          The backend runs the physics upfront and just streams the coordinates to the browser via Server-Sent Events.
      • novia 9 hours ago
        this was because of a bot added to the game, it was easier
      • vova_hn2 10 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.
        • cvoss 10 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.

          • cannonpalms 4 hours ago
            If a new player never returns, their money disappears from the money supply with them. Unless you mean that the new player is sinking their 10 credits into shares before leaving?
            • jjmarr 4 hours ago
              This implies we will reach a point where the game starts getting less popular and we end up in a deflationary spiral.
            • marcosdumay 8 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...

            • novia 10 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
              • sebastos 9 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.
                • catlifeonmars 8 hours ago
                  I read this as “trading is easy until the quants get involved”. So basically just like a real market.
                • imeanwhatdoikno 10 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

                  • mday404 10 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.
                    • spolitry 3 hours ago
                      What's the update now that HFT arrived?
                      • mday404 46 minutes ago
                        The house now loses a little over 4 points per round, largely due to its role in price smoothing. For a while it was losing much more, as there were bots buying 0.99 shares right at the end when they were near-guaranteed to pay out at 1, so I updated the maximum price to be 1 instead and put a stop to that.
                  • aniceperson 10 hours ago
                    its is missing trading fees indeed.
                    • spolitry 4 hours ago
                      Market maker bid/ask spread is the trading fee.

                      The gains here come from dumb money and high latency tarders.

                    • StingyJelly 10 hours ago
                      [dead]
                    • suzukivenom 11 hours ago
                      bouncemarket: bought Right x52 at avg 0.19, landed Right, +42.21 in one round https://bouncemarket.minhanhday.com/r/FYv-qiLU
                    • qoez 8 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.
                      • lesam 8 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

                        • qoez 8 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.

                        • none_to_remain 2 hours ago
                          They get pretty close to games of chance, though not pure, by using things like various cryptocurrencies up/down over 15 minutes. Reminiscent of the numbers rackets using the last few digits of the NYSE daily volume as an RNG.
                          • pjc50 8 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.

                            • retsibsi 8 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.

                            • whycombinetor 8 hours ago
                              Casinos definitely exist, lmao.
                              • qoez 8 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.
                                • whycombinetor 7 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.
                                  • amenhotep 7 hours ago
                                    Casinos aren't regulated by the CFTC, which is the whole point of the bit.
                            • geoffschmidt 6 hours ago
                              This is super cool! The rabbit hole goes a bit deeper than I first thought.

                              Because anyone can tell Opus "go win bouncemarket.minhanhday.com" and with just those words get a pretty good bot, this is in practice a "battle of the bots".

                              The only unknown is the fractional part of the start position of the ball, which is revealed gradually by the chaotic path of the ball, and a frontier model will quickly realize this and write an exact solver for it. This gives the optimal estimate at time t of the probability of each outcome given the information revealed so far.

                              Of the bots running now, some seem to have an exact solver while others have a lower quality probabilistic solver. Some bots seem to only bet when there is enough information to be certain, others are willing to bet early when the market is mispricing the risk.

                              The rate limit of 10 bets a second means that, past a certain point, a bigger bankroll doesn't help. It also means that bets are a scarce resource. You want to bet at the moments when the market maximally misprices the risk, but you don't know when those moments will be because that's a function of what other players do.

                              To win, you need to do some combination of:

                              1) Be the first to buy when a bounce reveals new information

                              2) Be the first to buy when another player makes a non-optimal buy

                              Both require low latency to the server to win. Only market orders are possible, so if you are not the first you might be severely punished, because if N bots all see an event at the same time, they will pile on (not seeing each other's buys due to the latency in market quotes) and move the market far past fair value, and the Nth bot may buy at a really bad (and unintended) price. Which could then produce a swing in the other direction, so I guess we should expect the market to oscillate. In practice these mispricings seem hard to exploit because they are large but short-lived and so difficult to harvest with market price orders.

                              Since you asked for feedback, my advice would be:

                              1) Allow orders other than market orders (eg, add a limit price to the API)

                              2) Consider running some kind of an auction (once per frame or other time interval) rather than processing orders one at a time

                              That would make it not be a winner-take-all game based on your distance from the server. On the other hand maybe in this case an orderly marketplace is uninteresting! In that case, if you do #1 but not #2 then you open up some new betting strategies, like trying to catch mispricings due to overcorrection.

                              • SecuredMarvin 3 hours ago
                                As you said, Opus did solve for the floating start points competently. I suggested collecting these over 600 games to solve the Mersenne Twister, but the web server restarted. So we tried using the bits from the Twister as an oracle for the start points, but then another deployment forced the start points onto a much coarser grid, and the Twister was also used to scramble the bid answers, so it was no longer solvable. I've never had this much (4h) fun with a click-game. (#20, precogbot)
                                • mday404 2 hours ago
                                  Thanks for playing, it was cool to watch your strategy through log analysis. Mind if I DM you about it when I'm doing a writeup?
                                • kitsu 4 hours ago
                                  Actually the market was changing pretty rapidly and but yet, some of non-solver strategies are still "profitable". That is really quite an interesting dynamic over there. E.g 1-2 hours ago just buying shares for <0.1 was a profitable strategy, now it's losing (probably because of the solvers though). Now there's a trivial manual strategy: buy when the price is 0.99, just to follow the solver. The last one however can be trivially abused, if someone try to manipulate the price with new accounts, especially early in the game with higher uncertainty.
                                • sonickfd 1 hour ago
                                  It suffers from the same core problem as usual prediction markets in that you mostly make gains on big swings. In the real ones the usual outcome is that the market often gets stuck with an artificially high baseline for low probability events that isn't worth correcting because of the time value of money. This doesn't seem to suffer from that exactly, but the probability whips around so much that the strategy seems to have little to do with attempting to predict the ball and simply always buy low probability since the single digit percent then the ball is still high is essentially always a poor estimate and has high EV.
                                  • akshayp29 6 hours 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...
                                    • mday404 6 hours 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

                                      • whycombinetor 6 hours ago
                                        It's deterministic physics. Knowing the ball's precise position and velocity at any 1 point in time should allow you to predict the end outcome. They don't give a formula for their physics engine, but it should be easily derivable from observing repeated runs.
                                        • mday404 6 hours ago
                                          that's true towards the end, but it's harder than it sounds because you don't actually have the precise position and velocity -- you just have the position rounded to the nearest 0.1px.

                                          I ran the physics simulation and a 10^-12 px change in starting X position yields a different outcome more than 30% of the time, so knowing the ball's position to the nearest 0.1px only gives you a good guess, not an oracle

                                          • whycombinetor 3 hours ago
                                            Perhaps with sufficiently many samples, you could reconstruct the floats underlying the rounded output, if there's no randomized dithering applied.
                                    • xp84 10 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.

                                      • theophrastus 10 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

                                      • spolitry 3 hours ago
                                        This looks nowhere near random enough. The result is highly determined almost immediately.

                                        I recommend randomizing the bounce pegs, and randomizing the bounce direction a bit more (bounces almost always reverse the direction exactly, cancelling out a direction change) and adding more "bounce" or lowering gravity so there are more chances to leave the potential well.

                                        • Andr2Andr 8 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
                                          • trwhite 9 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
                                            • Lightbody 8 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.
                                            • harsh146 3 hours ago
                                              Fun game! Idea for the buffered-frame problem: have the server send frames in real time and let the client render about 100ms behind. Then nobody can read ahead of what's on screen.
                                              • frenchmajesty 11 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.

                                                • mday404 11 hours ago
                                                  Thanks for the feedback! I'll work on some kind of tutorial to start the game
                                                • mrkramer 4 hours ago
                                                  This reminds me of that old Bitcoin betting games where you could pay some BTC to bet on where the bouncing ball would land. Nice to see modern take on it.
                                                  • theturtletalks 9 hours ago
                                                    This is actually how the formula for options came about!
                                                    • matthova 10 hours ago
                                                      Love the concept. Great implementation
                                                      • joshribakoff 10 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.
                                                        • 2bird3 8 hours ago
                                                          Nice! Claude was able to recreate the simulation pretty quickly- it might be worth adding a little randomness to the bounces.
                                                          • mday404 8 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.

                                                            • e1ghtSpace 6 hours ago
                                                              I made a bot with claude. Yes it does get to 100% accuracy before the ball lands. However most of the time the entire market jumps to 0.99 at this point. However you can usually get in slightly earlier before that point or the market sometimes dips so you can get the shares cheaper.

                                                              Heres some results: calls 146/146 right · 146/181 rounds called · profit +98.80

                                                              Sometimes the bot can't calculate where the ball will land in time so those rounds are skipped.

                                                              Claude is now working on a new version to basically determine the seed for the random number generator used to set the ball's starting position. That way we can buy before anything even happens and get it right. However I'm not sure yet whether this is actually possible. I'll wait and see.

                                                              • e1ghtSpace 4 hours ago
                                                                Damnit theres a system update in 7 minutes... I'm assuming the dev may have seen my post above... This is my progress so far:

                                                                RNG: collecting round 261/~624 · ~1h 28m left

                                                                Looks like I may not ever be able to pinpoint the ball position before the round begins... Lets hope the dev isn't changing the RNG... he probably is though. I'll post another comment after the update and let you all know.

                                                                • e1ghtSpace 4 hours ago
                                                                  Yep it looks like the dev has updated it so now I can't figure out the exact RNG being used for the ball starting position. I wonder if its because of my post.
                                                                  • mday404 3 hours ago
                                                                    Haha no I didn’t update the RNG because of your post, I had a couple of other logging updates I wanted to make to analyze strategies better.

                                                                    I’m curious if you do end up being able to fully reverse engineer it!

                                                          • imeanwhatdoikno 11 hours ago
                                                            This is kind of genius
                                                            • hellojomp 9 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.
                                                              • echoangle 10 hours ago
                                                                Is there a way to sell shares before resolution?
                                                                • gpm 10 hours ago
                                                                  Buying a share on the opposite side is effectively selling a share.
                                                                  • mday404 9 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!
                                                                  • darepublic 8 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
                                                                    • dorianmariecom 3 hours ago

                                                                        1375. last 0.00
                                                                      • gpm 10 hours ago
                                                                        I'd like to see how much the market maker is making/losing.
                                                                        • elisgillberg 11 hours ago
                                                                          Hehe this is awesome!
                                                                          • jojogeo 11 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.

                                                                            • deadbeefer 10 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.
                                                                              • bee_rider 8 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.

                                                                                • cogythea 8 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.
                                                                            • dpmartinez 11 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."

                                                                              • simondebbarma 2 hours ago
                                                                                I played this for a handful of minutes a few times over the last hours. It went from being kinda easy to win by playing regularly or getting lucky to now being so completely overrun by bots and scripts that know exactly where the ball is going. These bots buy bets on the correct side and in such high quantities that the odds literally become 0.01 on the losing side a couple bounces into a drop.

                                                                                So yeah, it went from fun to ruined in less than 8 hours. Cheers, y'all.

                                                                                • folli 10 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.

                                                                                  • furyofantares 9 hours ago
                                                                                    Hilarious and fun. Btw if I tap furiously on a button the page zoomed in every time the button ends up disabled.
                                                                                  • jasondigitized 4 hours ago
                                                                                    I went into AI psychosis one weekend and did something similar for old NFL football games - https://retropicks.app/
                                                                                    • BaseBaal 2 hours ago
                                                                                      Fun! Would love a graphics performance setting so it doesn't crash my potato tablet.
                                                                                    • ml_comms_eng 5 hours ago
                                                                                      make a reliability diagram for the last N for (end_time-0.2s), (end_time-0.4s)... to see if bots are calibrated
                                                                                      • cush 9 hours ago
                                                                                        Fun idea! The page shouldn’t zoom in when you tap rapidly - makes it impossible to play on iOS
                                                                                      • stavros 2 hours ago
                                                                                        This game is rigged, I tried buying stock when the price was 0.01. I never once won, even four seconds before the ball landed, even when the ball was on the side I bought.

                                                                                        So, the ball would be on the left, with two seconds left, but the price of left was inexplicably 0.01, I'd buy left, and the ball would suddenly bounce to the right and land there.

                                                                                        • JonnieCache 10 hours ago
                                                                                          Do it with a camera and a real ball lol
                                                                                          • dandaka 9 hours ago
                                                                                            Please add keyboard controls
                                                                                            • mday404 8 hours ago
                                                                                              added! Reload the page to see
                                                                                            • ex-aws-dude 10 hours ago
                                                                                              This is what I pretend my stock buying strategy is not underneath
                                                                                              • jdorfman 9 hours ago
                                                                                                That’s it I’m opening up a Kalshi account. Going to be rich.
                                                                                                • dorianmariecom 3 hours ago
                                                                                                  it seems like bots have taken over
                                                                                                  • rickcarlino 10 hours ago
                                                                                                    Finally a useful application for predictive markets.
                                                                                                    • franze 10 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
                                                                                                      • eterm 10 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! )

                                                                                                        • andai 10 hours ago
                                                                                                          Sounds like you may be interested in my new real-time neural interface, ball2brain.
                                                                                                        • idiotsecant 7 hours 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.
                                                                                                          • hei-lima 9 hours ago
                                                                                                            Really cool!
                                                                                                            • d--b 9 hours ago
                                                                                                              A prediction market should allow us to sell
                                                                                                              • iamgopal 10 hours ago
                                                                                                                are there keyboard short cut ?
                                                                                                                • mday404 8 hours ago
                                                                                                                  just added! left and right arrows
                                                                                                                • setnone 11 hours ago
                                                                                                                  cool! up next: bouncemarketbot
                                                                                                                  • mday404 9 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
                                                                                                                  • icantevenhold 3 hours ago
                                                                                                                    Aaaand I’m addicted to gambling now
                                                                                                                    • ljubomirsinadin 6 hours ago
                                                                                                                      cool game for time wasting
                                                                                                                    • NooneAtAll5 10 hours ago
                                                                                                                      another gambling website?
                                                                                                                      • hsng95 7 hours ago
                                                                                                                        [dead]
                                                                                                                        • RemingtonDavies 9 hours ago
                                                                                                                          [dead]