zama-ai / fhevm-contracts

A standard contract library for the fhEVM ecosystem
Other
4 stars 0 forks source link

Write Blogpost for the fhEVM DEX #16

Open jatZama opened 4 months ago

jatZama commented 3 months ago

Done first version here : https://docs.google.com/document/d/14GOdAb2HHO4FqCnBpGNUOWkfu4yTm4bOOHMRDd8YieQ/edit But unfortunately, this is going to be in pending for a while because we need to add many features following discussion with Rand:

1/ Need to update protocol to async decrypt case (asked by Rand) - note : to avoid locking the pool for addLiquidity it is possible to fragment the pool in two pools so at least one would always stay unlocked. 2/ Rand also wants to first add support for scalar opeartion with euint128 to support euint64 tokens. 3/ also Upgrade AMM formula to more fair one using quadratic equation (see discussion on fhEVM explorers telegram) 4/ add partial fill with global slippage to limit griefing attack by a whale in the same batch.

I think this would deserve a whole article on arxiv, it might be a better idea to write a whitepaper than a blogpost if the protocol becomes so complex and we want users to deploy it in production. There are also many computations on paper and simulations I did in Python to compare my implementation with results from Tarun's paper that would be nice to see in a scientific paper. Wdyt @immortal-tofu ?