Phase 0: Vault Creation
These steps assume a
VaultFactory has already been deployed and configured with valid vault and adapter types.createAdapter(adapterTypeId, poolAddress, data)— Deploys and initializes an adapter for a specific Uniswap V3 poolcreateVault(vaultTypeId, adapterAddress)— Deploys a vault; caller must own the adapter, and the adapter must not already be linked to a vaultinitializeVault(vaultId, fixedSideCapacity, variableSideCapacity, duration, variableAsset, expectedFeeBps)— Sets the vault parameters and binds the adapter
Phase 1: Depositing
Two deposit paths exist: fixed side and variable side.Fixed Side
vault.deposit(amount, FIXED, deployCapitalData)
- The
amountmust be 0 — token amounts are derived fromfixedSideCapacityand current pool price deployCapitalDataencodes slippage protection (amount0Min,amount1Min) and a transactiondeadline- Adapter mints a Uniswap V3 LP position; depositor receives 1
claimToken - There is only one fixed side depositor per vault
Variable Side
vault.deposit(amount, VARIABLE, deployCapitalData)
- Mints
variableBearerToken1:1 with the deposit deployCapitalDataoptionally encodes a minimum accepted amount (for partial fills near capacity)
fixedSideCapacity and variableSideCapacity.
Phase 2: Vault Start
Once both sides reach capacity, the vault starts automatically.Phase 3: Earning Period
The Uniswap V3 position accrues trading fees for the configured duration. No withdrawals are permitted during this phase. After the vault starts, the fixed side depositor may claim their premium:vault.claim()
- Transfers a proportional share of variable side deposits (the fixed premium) to the caller
- Burns the caller’s
claimTokenand mints an equivalentfixedBearerToken - Can be called at any time after the vault starts
Phase 4: Settlement and Withdrawal
Once maturity is reached, the first withdrawal triggerssettleEarnings() and mints the protocol fee (in variableBearerToken to the vault for the current feeReceiver()).
Fixed Side
vault.withdraw(FIXED, removeLiquidityData)
- Removes all liquidity from Uniswap V3 and returns the underlying tokens (
token0andtoken1) to the depositor
Variable Side
vault.withdraw(VARIABLE, "")
- Returns a proportional share of the Uniswap trading fees collected during the vault’s lifetime, minus the protocol fee