Comment on page
Deploy Your ArrakisV2 Vault
Now we run a command to initialize a private ArrakisV2 Vault on the DAI/WETH token pair and deposit an initial 1 DAI into the vault:
yarn tutorial1-init --network goerli
Congrats! You instantiated a private ArrakisV2 vault. At the end of the script you should see the address of your newly created DAI/WETH vault:

console readout
Copy and keep this vault address and you are ready to move on.
Notice that 4 transactions were done to initialize a vault in the "private" setting:
- 1.
deployVault
: called on theArrakisV2Factory
this deploys a fresh vault instance (sets initial vault params, for instance your EOA as the vault'sowner
andmanager
).const tx = await arrakisV2Factory.deployVault({feeTiers: feeTiers, // [500, 3000]token0: token0, // DAI token addresstoken1: token1, // WETH token addressowner: userAddr, // your addressinit0: init0, // 1 DAIinit1: init1, // 0 WETHmanager: userAddr, // your addressrouters: [], // no swap routers},true // isBeacon = true (beacon proxy)); - 2.
setRestrictedMint
: called on theArrakisV2
vault contract by the vaultowner
this restricts who can call the vault'smint
function to a single address (your EOA), rendering the vault "private" (without this, anyone can add liquidity into your vault and mint vault shares).const tx2 = await vaultContract.setRestrictedMint(userAddr // your address); - 3.
approve
: called on the DAI token contract this approves 1 DAI to be transferred to the vault in the subsequent step.const tx3 = await daiTokenContract.approve(vault, // vault addressoneDai // 1 DAI); - 4.
mint
: called on theArrakisV2
vault, this mints the initial ArrakisV2 shares and deposits 1 DAI (because of #2, this only works from your address).const tx4 = await vaultContract.mint(oneDai, // 1 DAIuserAddr // your address (recipient));
Last modified 10mo ago