aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

feat: AMM

Open benesjan opened this issue 1 year ago • 1 comments

This is an implementation of a Uni v2 style DEX pool. One of the main goals of this PR was to figure out what kind of token flows we will need.

Note for reviewers

I put a lot of comments and some questions in the code. The code does not yet compile as the token is not yet updated with the flows we need but I have a high confidence that it's very close to final.

Problems

There were a couple problems I have stumbled upon:

  1. The need for having the liquidity token be separate from the DEX/pair contract itself. This is because we don't have inheritance in Noir and copying the contract code into the DEX is not something I am willing to go through.
  2. We don't have a large enough integer type that is not terrible - (U128 is too cumbersome to use because of #8271). I currently use u64 everywhere but that is not sufficiently large for DeFi.

benesjan avatar Sep 19 '24 14:09 benesjan

  • #9934 Graphite
  • #8644 Graphite 👈
  • #9950 Graphite
  • #9943 Graphite
  • master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @benesjan and the rest of your teammates on Graphite Graphite

benesjan avatar Sep 19 '24 14:09 benesjan

Superceded by https://github.com/AztecProtocol/aztec-packages/pull/8644

nventuro avatar Nov 22 '24 20:11 nventuro