VPOOL
VPool
All Vesper pools are implementations of VPOOL. This contract performs the core functions for all Vesper pools, including deposits, withdrawals, fee calculation
VERSION
MAX_BPS
ONE_YEAR
UpdatedMaximumProfitAsFee
UpdatedMinimumDepositLimit
Deposit
Withdraw
UpdatedUniversalFee
UpdatedPoolRewards
UpdatedWithdrawFee
UniversalFeePaid
constructor
initialize
Equivalent to a constructor for the proxy. It can be called only once per proxy.
deposit
Deposit ERC20 tokens and receive pool shares depending on the current share price.
depositAndClaim
Deposit ERC20 tokens and claim rewards, if there are any.
depositWithPermit
Deposit ERC20 tokens with permit, aka gasless approval.
whitelistedWithdraw
Withdraw collateral based on given shares and the current share price. Burn remaining shares and return collateral. Claim rewards if there are any
Deprecated method. Keeping this method here for backward compatibility.
withdraw
Withdraw collateral based on given shares and the current share price. Burn remaining shares and return collateral.
withdrawAndClaim
Withdraw collateral and claim rewards, if any.
multiTransfer
Transfer tokens to multiple recipients
Address array and amount array are 1:1 and are in order.
reportEarning
Strategy call this in regular interval. Only strategy function.
reportLoss
Report loss outside of rebalance activity.
Some strategies pay deposit fee thus realizing loss at deposit. For example: Curve's 3pool has some slippage due to deposit of one asset in 3pool. Strategy may want report this loss instead of waiting for next rebalance.
sweepERC20
Transfer given ERC20 token to governor
availableCreditLimit
Get available credit limit of strategy. This is the amount strategy can borrow from pool
Available credit limit is calculated based on current debt of pool and strategy, current debt limit of pool and strategy. credit available = min(pool's debt limit, strategy's debt limit, max debt per rebalance) when some strategy do not pay back outstanding debt, this impact credit line of other strategy if totalDebt of pool >= debtLimit of pool
calculateUniversalFee
Calculate universal fee for calling strategy. This is only strategy function.
Earn strategies will call this during rebalance.
excessDebt
Debt above current debt limit
getStrategies
totalDebt
Get total debt of pool
totalDebtOf
Get total debt of given strategy
totalDebtRatio
Get total debt ratio. Total debt ratio helps us keep buffer in pool
calculateMintage
Calculate how much shares user will get for given amount. Also return externalDepositFee if any.
Amount should be >= minimum deposit limit which default to 1
getWithdrawQueue
pricePerShare
Get price per share
Return value will be in token defined decimals.
strategy
tokensHere
Returns the token stored in the pool. It will be in token defined decimals.
totalValue
Returns sum of token locked in other contracts and token stored in the pool. It will be in token defined decimals.
_beforeBurning
Before burning hook. withdraw amount from strategies
_calculateShares
Calculate shares to mint/burn based on the current share price and given amount.
_calculateUniversalFee
Calculate universal fee based on strategy's TVL, profit earned and duration between rebalance and now.
_calculateUniversalFee
migrateStrategy
Migrate existing strategy to new strategy.
Migrating strategy aka old and new strategy should be of same type.
setup
OnlyGovernor:: Helper function for V5 upgrade
updateMaximumProfitAsFee
Only Governor:: Update maximum profit that can be used as universal fee
updateMinimumDepositLimit
Only Governor:: Update minimum deposit limit
updateUniversalFee
Update universal fee for this pool
Format: 1500 = 15% fee, 100 = 1%
updatePoolRewards
Update pool rewards address for this pool
pause
unpause
shutdown
open
keepers
Return list of keepers
isKeeper
addKeeper
Add given address in keepers list.
removeKeeper
Remove given address from keepers list.
maintainers
Return list of maintainers
isMaintainer
addMaintainer
Add given address in maintainers list.
removeMaintainer
Remove given address from maintainers list.
Last updated