Deposits and Withdrawals
The entry-point for LP deposits and withdrawals is the Validly contract itself.
Deposits
On deposits, the user first calls Validly's deposit
function:
The deposit function contains most of the business logic, including minting shares
worth of LP tokens in the Validly contract, representing pro-rata ownership of the liquidity pool. The actual token balances are stored in the Sovereign Pool. Source: https://github.com/ValantisLabs/Validly/blob/main/src/Validly.sol#L123-L191
Withdrawals
On withdrawals, Validly's withdraw
function is the first to get called:
The LP can call withdraw
to redeem _shares
worth of liquidity for the equivalent amount of token0
and token1
balances. Upon burning the LP tokens, token0
and token1
amounts get transferred from the Sovereign Pool into _recipient
. Source: https://github.com/ValantisLabs/Validly/blob/main/src/Validly.sol#L193-L237
Last updated