The changes implement an adapter for the AmmModule which supports Arrakis Vaults holding UniswapV3 positions.
The goal is to be able to create and hold Uniswap's V3 Liquidity Provision tokens (LP tokens) inside of a Set Token.
There is a challenge caused by UniV3's LP tokens being ERC721s (NFTs). And since AmmModule.sol assumes amm pool tokens to follow IERC20, UniswapV3 Pools aren't directly integrable.
So are using Arrakis (Arrakis V1 Doc) that creates and holds Uniswap V3 Liquidity Position and issues fungible ERC20 tokens to anyone who adds more liquidity.
There are three main contracts being used in the implementation:
Using Arrakis Factory, anyone can create new Arrakis Vaults (analogous to Token Pools) which hold UniswapV3 liquidity position for a pair of ERC20 tokens for a given price range bound (assuming there already exists a pool for the same pair of tokens in UniswapV3).
Once Vault is created, it works similar to UniswapV2 liquidity pools and can be passed to AmmModule contract as ammPool, which then will call ArrakisUniswapV3Adapter returning calldata with Arrakis Router, which handles adding and removing liquidity and minting/burning ERC20 Tokens to the caller (in our case it is SetToken).
The router in the ArrakisUniswapV3Adapter.sol is the address to the Arrakis Router contract which is passed in the constructor along with UniswapV3 Factory address. The overall approach is now very similar to how UniswapV2AmmAdapter is implemented with the following correlations:
The changes implement an adapter for the AmmModule which supports Arrakis Vaults holding UniswapV3 positions.
The goal is to be able to create and hold Uniswap's V3 Liquidity Provision tokens (LP tokens) inside of a Set Token. There is a challenge caused by UniV3's LP tokens being ERC721s (NFTs). And since
AmmModule.sol
assumes amm pool tokens to follow IERC20, UniswapV3 Pools aren't directly integrable.So are using Arrakis (Arrakis V1 Doc) that creates and holds Uniswap V3 Liquidity Position and issues fungible ERC20 tokens to anyone who adds more liquidity.
There are three main contracts being used in the implementation:
Other Relevant Contracts - Link
Using Arrakis Factory, anyone can create new Arrakis Vaults (analogous to Token Pools) which hold UniswapV3 liquidity position for a pair of ERC20 tokens for a given price range bound (assuming there already exists a pool for the same pair of tokens in UniswapV3).
Once Vault is created, it works similar to UniswapV2 liquidity pools and can be passed to
AmmModule
contract as ammPool, which then will callArrakisUniswapV3Adapter
returning calldata with Arrakis Router, which handles adding and removing liquidity and minting/burning ERC20 Tokens to the caller (in our case it is SetToken).The
router
in theArrakisUniswapV3Adapter.sol
is the address to the Arrakis Router contract which is passed in the constructor along with UniswapV3 Factory address. The overall approach is now very similar to howUniswapV2AmmAdapter
is implemented with the following correlations: