Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is really cool =)...

Do you mind if I dig into the code and figure out how it works?

I'm really finding the market that you've got going interesting, how in-depth is it?

I've got a thing[0] I've been prototyping which does a market simulation that I'm working on and I'd be curious how far you've gone down that rabbit hole? =)...

- [0]: https://folcon.itch.io/fruit-economy



Supply/Demand was pretty simple on the individual level, just had to aggregate it: https://github.com/Aperocky/prehistoric-simulation/tree/mast...


Sure, but how that translates to a price is an interesting question.


The simple model consist of buy and sell orders, buys come with a max price, sell comes with a min price, both come with quantities.

Just have to meet in the middle by dynamically accumulating orders by quantity from both sides and after the prices met, set that as the actual sell price and discard the rest of the order as not filled.


Hmm, ok, really similar to how an order book does it I think?

Pretty different from my approach, so that's worth trying, thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: