Cross-Tick Swaps
We have made great progress so far and our Uniswap V3 implementation is quite close to the original one! However, our implementation only supports swaps within a price range–and this is what we’re going to improve in this milestone.
In this milestone, we’ll:
- update the
mint
function to provide liquidity in different price ranges; - update the
swap
function to cross price ranges when there’s not enough liquidity in the current price range; - learn how to calculate liquidity in smart contracts;
- implement slippage protection in the
mint
andswap
functions; - update the UI application to allow to add liquidity at different price ranges;
- learn a little bit more about fixed-point numbers.
In this milestone, we’ll complete swapping, the core functionality of Uniswap!
Let’s begin!
You’ll find the complete code of this chapter in this Github branch.
This milestone introduces a lot of code changes in existing contracts. Here you can see all changes since the last milestone
If you have any questions feel free to ask them in the GitHub Discussion of this milestone!