casesandberg / play-money

Simple prediction market platform
https://playmoney.dev
12 stars 10 forks source link

Implement Uniswap AMM #20

Closed gbear605 closed 4 months ago

gbear605 commented 4 months ago

Implements an automated market maker using the basic Uniswap algorithm from https://manifoldmarkets.notion.site/Maniswap-ce406e1e897d417cbd491071ea8a0c39.

Currently branched off of https://github.com/casesandberg/play-money/pull/10, so it will need a rebase after that is finished and merged in.

vercel[bot] commented 4 months ago

@GabrielleVivissi is attempting to deploy a commit to the Ltd Team on Vercel.

A member of the Team first needs to authorize it.

gbear605 commented 4 months ago

One thing that this didn't try to address, but will need to be handled soon, is that the AMM amounts are floats. I think ideally all money should be integer (or perhaps, fixed point decimal).

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
play-money-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:31pm
play-money-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:31pm
casesandberg commented 4 months ago

One thing that this didn't try to address, but will need to be handled soon, is that the AMM amounts are floats. I think ideally all money should be integer (or perhaps, fixed point decimal).

Yeah, likely we want to be using a special decimal datatype instead of number. I did a little digging and decimal.js and bignumber.js seem to be well maintained and pretty popular. Heres a wiki about the differences of them: https://github.com/MikeMcl/big.js/wiki

casesandberg commented 4 months ago

This looks great!!

casesandberg commented 4 months ago

Closes https://github.com/casesandberg/play-money/issues/18