| ▲ | Show HN: Quantifying opportunity cost with a deliberately "simple" web app(shouldhavebought.com) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 points by b0bbi a day ago | 47 comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hi HN, A while ago I had a mildly depressing realization. Back in 2010, I had around $60k. Like a "responsible" person, I used it as a down payment on an apartment. Recently, out of curiosity, I calculated what would have happened if I had instead put that money into NVIDIA stock. I should probably add some context. For over 10 years I've worked as a developer on trading platforms and financial infrastructure. I made a rule for myself - never trade on the market. In 2015, when Bitcoin traded about 300 usd, my brother and I were talking about whether it was a bubble. He made a bold claim that one day it might reach $100k per coin. I remember thinking it sounded unrealistic - and even if it wasn't, I wasn't going to break my rule. That internal tension - building systems around markets while deliberately staying out of them is probably what made the "what if?" question harder to ignore years later. The result was uncomfortable. The opportunity cost came out to tens of millions of dollars. That thought stuck with me longer than it probably should have, so I decided to build a small experiment to make this kind of regret measurable: https://shouldhavebought.com At its core, the app does one basic thing: you enter an asset, an amount, and two dates, and it gives you a plain numeric result - essentially a receipt for a missed opportunity. I intentionally designed the UI to feel raw and minimal, almost like a late-90s terminal. No charts, no images, no emotional cushioning - just a number staring back at you. What surprised me wasn't the result, but how much modern web infrastructure it took to build something that looks so simple. Although the app is a single page with almost no UI elements, it still required: - Client-side reactivity for a responsive terminal-like experience (Alpine.js) - A traditional backend (Laravel) to validate inputs and aggregate historical market data - Normalizing time-series data across different assets and events (splits, gaps, missing days) - Dynamic OG image generation for social sharing (with color/state reflecting gain vs loss) - A real-time feed showing recent calculations ("Wall of Pain"), implemented with WebSockets instead of a hosted service - Caching and performance tuning to keep the experience instant - Dealing with mobile font rendering and layout quirks, despite the "simple" UI - Cron and queueing for historical data updates All of that just to show a number. Because markets aren't one-directional, I also added a second mode that I didn't initially plan: "Bullet Dodged". If someone almost bought an asset right before a major crash, the terminal flips state and shows how much capital they preserved by doing nothing. In practice, this turned out to be just as emotionally charged as missed gains. Building this made me reflect on how deceptive "simplicity" on the web has become. As a manager I know says: "Just add a button". But even recreating a deliberately primitive experience today requires understanding frontend reactivity, backend architecture, real-time transport, social metadata, deployment, and performance tradeoffs. I didn't build this as a product so much as an experiment - part personal curiosity, part technical exploration. I'd be very interested to hear how others think about: Where they personally draw the line on stack complexity for small projects? Whether they would have gone fully static + edge functions for something like this? How much infrastructure is "too much" for a deliberately minimal interface? And, optionally, what your worst "should have bought" moment was? Happy to answer any technical questions or dig into specific implementation details if useful. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | nkrisc 3 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I first heard about bitcoin sometime in college (2007-2011). At the time I thought about buying a couple just for fun (might have been a few dollars worth? Can’t remember). But I decided it was a waste of money. And at the time, it was a complete waste of money. I don’t regret it at all. Only with knowledge of the future would it have been worthwhile. But today when I see what cryptocurrency has become, I regret my decision even less. There are countless ways I could have made millions if I knew the future. I don’t waste my time regretting those. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | PowerElectronix 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The first thing one has to do when analysing past money decisions is to judge the decision based on the information available at the time. I too watched from the sidelines as btc, nvda and others went to the moon. But with the information available at the time, investing in those was not a sound strategy. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Propelloni an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I applaud the technical journey, but I really do not understand the purpose. What's the point of knowing last week's lottery numbers? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Bishonen88 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hindsight is 20/20. If I'd known that Nvda, Aapl, Amzn etc. would go up, it's easy to now to regret how much money we'd have. Same thing with "RSU's" we get at FAANG. I often hear from coworkers that if they wouldn't have sold them when they got them, they'd be rich right now. Yes, they would be - but in an alternate universe, they'd have little/nothing and wouldn't have bought the car/camera/vacation they got out of the money when they sold the RSUs. I added something related to this idea to my life-planning app: what if for projections. I track all my expenses/incomes/investments in my app. I then can with 1 click run a scenario where I move certain expenses to investments. I.e. cancelling netflix for 10 years, or xbox gamepass etc. and seeing what it would actually do to my 10 year projection (which already accounts for ETFs/Stock with variable return rates etc.). i.e.: Exclude Recurring Expenses Simulate cutting these expenses and investing the savings Redirecting €19.99/month to investments Then I see black on white what would happen if I get rid of all the 'small' subscriptions, on a visual chart. It's eye opening when one selects items that add up to a ~100 Euro ++ a month. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | intheitmines 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Crudely, if my aunt had a dick she'd be my uncle. In terms of feedback: - need BTC prices pre 2014 to really feel the pain - The date format for earliest date available is different to the date format then used in the input below | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | z3t4 an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The opportunity cost is what I can do instead. The opportunity cost of investing is just a 3% return really. So much that we do in life is just throwing the money away though. You should just go to work, invest all your money, then when you are 65 you will be able to live off your savings. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | fancyfredbot an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If you'd bought every fad coin your brother recommended to you, even though it was a bad idea in your own judgement then I think you'd have zero dollars. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | nothrabannosir 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> He made a bold claim that one day it might reach $100k per coin. I remember thinking it sounded unrealistic - and even if it wasn't, I wasn't going to break my rule. > ... The opportunity cost came out to tens of millions of dollars. It doesn't sound, though, like you'd have held until 100k. This calculation only applies to people who'd have held for some reason; e.g. just after the conversation, you slipped into a coma and you just woke up now. But I usually hear it from people who "could've bought at $2 but didn't!" If you didn't buy at $2, you wouldn't have held at $4. If you didn't buy at $300, you wouldn't have held at $600. Etc. Me neither fwiw :) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | con 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Why stop at financial loss? I did https://whentheywere.com - enter your DOB and get a feel on how you compare to Einstein, Michael Jordan, Steve Jobs and others. Here's one for 01/01/1990: https://whentheywere.com/?date=1990-01-01 You can subscribe to a calendar and get notified when you are exactly the age someone was, when they achieved something. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | eru 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wouldn't this need to know what I actually did instead? When I use it, it tells me that the form was incomplete. I tried to figure out how much I regret having bought 0 bitcoin so far. Perhaps needs a better error message? I think it actually doesn't like the zero, but prevents it doesn't like incomplete data. Zero is also a number. > CAUSALITY_ERROR: You cannot SELL before you BUY. https://en.wikipedia.org/wiki/Short_(finance) Needs at least a better error message that short sells aren't supported, instead of trying to be too clever by half about causality. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jbjbjbjb 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Most reasonable people will not have enough conviction to make a serious amount of money even if they’re right. I think a better question is how much would you have invested to make $500k/ $1mn (or whatever a life changing sum is for you) on the investment then you can consider whether you had the stomach to do that. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | endymion-light 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is quite a fun website, what have you used for the backend, i've been wanting to get more deployments for small web tools but the hug of death always worries me | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | rf15 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's true, most investors quit right before they're about to hit it big! ...or alternatively, you live a decent life without associating with any of this. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | renewiltord 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Oh good grief. $2.5m. That’s pretty funny. Hard to imagine I would have held through the ride but a pretty penny nonetheless. Not as bad as my buddy who sold his $200k grant in 2017 to buy a San Jose townhome that costs exactly the same today hahaha! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | dvh 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Is it $149 or $149000? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | fragmede 3 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
My question is, why would you do that to yourself? Living with regrets of the past that would never have been, anyway, seems like a recipe for sadness and despair. Maybe my sense of fun or humor or whatever is off, but I just don't get doing this to yourself, man. You could have hooked into them and thought $1,000 is the highest it'll go and sold them all them. Who knows‽ No offense meant. Just my two Satoshis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||