Skip to main content

IBLVaultManagerLido

Git Source

Functions

minWithdrawalDelay

The minimum length of time between a deposit and a withdrawal

function minWithdrawalDelay() external returns (uint48);

deployVault

Deploys a personal single sided vault for the user

The vault is deployed with the user as the owner

function deployVault() external returns (address);

Returns

NameTypeDescription
<none>addressvault The address of the deployed vault

mintOhmToVault

Mints OHM to the caller

Can only be called by an approved vault

function mintOhmToVault(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256The amount of OHM to mint

burnOhmFromVault

Burns OHM from the caller

Can only be called by an approved vault. The caller must have an OHM approval for the MINTR.

function burnOhmFromVault(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256The amount of OHM to burn

increaseTotalLp

Increases the tracked value for totalLP

Can only be called by an approved vault

function increaseTotalLp(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256The amount of LP tokens to add to the total

decreaseTotalLp

Decreases the tracked value for totalLP

Can only be called by an approved vault

function decreaseTotalLp(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256The amount of LP tokens to remove from the total

canWithdraw

Returns whether enough time has passed since the last deposit for the user to be ale to withdraw

function canWithdraw(address user_) external view returns (bool);

Parameters

NameTypeDescription
user_addressThe user to check the vault of

Returns

NameTypeDescription
<none>boolbool Whether enough time has passed since the last deposit for the user to be ale to withdraw

getLpBalance

Returns the user's vault's LP balance

function getLpBalance(address user_) external view returns (uint256);

Parameters

NameTypeDescription
user_addressThe user to check the vault of

Returns

NameTypeDescription
<none>uint256uint256 The user's vault's LP balance

getUserPairShare

Returns the user's vault's claim on wstETH

function getUserPairShare(address user_) external view returns (uint256);

Parameters

NameTypeDescription
user_addressThe user to check the vault of

Returns

NameTypeDescription
<none>uint256uint256 The user's vault's claim on wstETH

getOutstandingRewards

Returns the user's vault's unclaimed rewards in Aura

function getOutstandingRewards(address user_) external view returns (RewardsData[] memory);

Parameters

NameTypeDescription
user_addressThe user to check the vault of

Returns

NameTypeDescription
<none>RewardsData[]RewardsData[] The user's vault's unclaimed rewards in Aura

getMaxDeposit

Calculates the max wstETH deposit based on the limit and current amount of OHM minted

function getMaxDeposit() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 The max wstETH deposit

getExpectedLpAmount

Calculates the amount of LP tokens that will be generated for a given amount of wstETH

function getExpectedLpAmount(uint256 amount_) external returns (uint256);

Parameters

NameTypeDescription
amount_uint256The amount of wstETH to calculate the LP tokens for

Returns

NameTypeDescription
<none>uint256uint256 The amount of LP tokens that will be generated

getExpectedTokensOutProtocol

Calculates the amount of OHM and pair tokens that should be received by the vault for withdrawing a given amount of LP tokens

function getExpectedTokensOutProtocol(uint256 lpAmount_) external returns (uint256[] memory expectedTokenAmounts);

Parameters

NameTypeDescription
lpAmount_uint256The amount of LP tokens to calculate the OHM and pair tokens for

Returns

NameTypeDescription
expectedTokenAmountsuint256[]The amount of OHM and pair tokens that should be received

getExpectedPairTokenOutUser

Calculates the amount of pair tokens that should be received by the user for withdrawing a given amount of LP tokens after the treasury takes any arbs

function getExpectedPairTokenOutUser(uint256 lpAmount_) external returns (uint256 expectedTknAmount);

Parameters

NameTypeDescription
lpAmount_uint256The amount of LP tokens to calculate the pair tokens for

Returns

NameTypeDescription
expectedTknAmountuint256The amount of pair tokens that should be received

getRewardTokens

Gets all the reward tokens from the Aura pool

function getRewardTokens() external view returns (address[] memory);

Returns

NameTypeDescription
<none>address[]address[] The addresses of the reward tokens

getRewardRate

Gets the reward rate (tokens per second) of the passed reward token

function getRewardRate(address rewardToken_) external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 The reward rate (tokens per second)

getPoolOhmShare

Returns the amount of OHM in the pool that is owned by this vault system.

function getPoolOhmShare() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM in the pool that is owned by this vault system.

getOhmSupplyChangeData

Gets the net OHM emitted or removed by the system since inception

function getOhmSupplyChangeData() external view returns (uint256, uint256, uint256);

Returns

NameTypeDescription
<none>uint256uint256 Vault system's current claim on OHM from the Balancer pool
<none>uint256uint256 Current amount of OHM minted by the system into the Balancer pool
<none>uint256uint256 OHM that wasn't minted, but was previously circulating that has been burned by the system

getOhmTknPrice

Gets the number of OHM per 1 wstETH using oracle prices

function getOhmTknPrice() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 OHM per 1 wstETH (9 decimals)

getTknOhmPrice

Gets the number of wstETH per 1 OHM using oracle prices

function getTknOhmPrice() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 wstETH per 1 OHM (18 decimals)

getOhmTknPoolPrice

Gets the number of OHM per 1 wstETH using pool prices

function getOhmTknPoolPrice() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 OHM per 1 wstETH (9 decimals)

emergencyBurnOhm

Emergency burns OHM that has been sent to the manager in the event a user had to emergency withdraw

Can only be called by the admin

function emergencyBurnOhm(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256The amount of OHM to burn

setLimit

Updates the limit on minting OHM

Can only be called by the admin. Cannot be set lower than the current outstanding minted OHM.

function setLimit(uint256 newLimit_) external;

Parameters

NameTypeDescription
newLimit_uint256The new OHM limit (9 decimals)

setFee

Updates the fee on reward tokens

Can only be called by the admin. Cannot be set beyond 10_000 (100%). Only is used by vaults deployed after the update.

function setFee(uint64 newFee_) external;

Parameters

NameTypeDescription
newFee_uint64The new fee (in basis points)

setWithdrawalDelay

Updates the minimum holding period before a user can withdraw

Can only be called by the admin

function setWithdrawalDelay(uint48 newDelay_) external;

Parameters

NameTypeDescription
newDelay_uint48The new minimum holding period (in seconds)

changeUpdateThresholds

Updates the time threshold for oracle staleness checks

Can only be called by the admin

function changeUpdateThresholds(
uint48 ohmEthUpdateThreshold_,
uint48 ethUsdUpdateThreshold_,
uint48 stethUsdUpdateThreshold_
) external;

Parameters

NameTypeDescription
ohmEthUpdateThreshold_uint48The new time threshold for the OHM-ETH oracle
ethUsdUpdateThreshold_uint48The new time threshold for the ETH-USD oracle
stethUsdUpdateThreshold_uint48The new time threshold for the stETH-USD oracle

activate

Activates the vault manager and all approved vaults

Can only be called by the admin

function activate() external;

deactivate

Deactivates the vault manager and all approved vaults

Can only be called by the admin

function deactivate() external;

Structs

TokenData

struct TokenData {
address ohm;
address pairToken;
address aura;
address bal;
}

BalancerData

struct BalancerData {
address vault;
address liquidityPool;
address balancerHelper;
}

AuraData

struct AuraData {
uint256 pid;
address auraBooster;
address auraRewardPool;
}

OracleFeed

struct OracleFeed {
AggregatorV3Interface feed;
uint48 updateThreshold;
}