Skip to main content

BLVaultLusd

Git Source

Inherits: IBLVault, Clone

State Variables

lastDeposit

The last timestamp a deposit was made. Used for enforcing minimum deposit lengths.

uint256 public lastDeposit;

_OHM_DECIMALS

uint256 private constant _OHM_DECIMALS = 1e9;

_LUSD_DECIMALS

uint256 private constant _LUSD_DECIMALS = 1e18;

_reentrancyStatus

uint256 private _reentrancyStatus;

_ohmIndex

uint8 private constant _ohmIndex = 1;

_lusdIndex

uint8 private constant _lusdIndex = 0;

Functions

constructor

constructor();

initializeClone

function initializeClone() external;

owner

function owner() public pure returns (address);

manager

function manager() public pure returns (BLVaultManagerLusd);

TRSRY

function TRSRY() public pure returns (address);

MINTR

function MINTR() public pure returns (address);

ohm

function ohm() public pure returns (OlympusERC20Token);

lusd

function lusd() public pure returns (ERC20);

aura

function aura() public pure returns (ERC20);

bal

function bal() public pure returns (ERC20);

vault

function vault() public pure returns (IVault);

liquidityPool

function liquidityPool() public pure returns (IBasePool);

pid

function pid() public pure returns (uint256);

auraBooster

function auraBooster() public pure returns (IAuraBooster);

auraRewardPool

function auraRewardPool() public pure returns (IAuraRewardPool);

fee

function fee() public pure returns (uint64);

onlyOwner

modifier onlyOwner();

onlyWhileActive

modifier onlyWhileActive();

onlyWhileInactive

modifier onlyWhileInactive();

nonReentrant

modifier nonReentrant();

deposit

Mints OHM against a pair token deposit and uses the OHM and pair tokens to add liquidity to a Balancer pool

Can only be called by the owner of the vault

function deposit(uint256 amount_, uint256 minLpAmount_)
external
override
onlyWhileActive
onlyOwner
nonReentrant
returns (uint256 lpAmountOut);

Parameters

NameTypeDescription
amount_uint256The amount of pair tokens to deposit
minLpAmount_uint256The minimum acceptable amount of LP tokens to receive back

Returns

NameTypeDescription
lpAmountOutuint256The amount of LP tokens received by the transaction

withdraw

Withdraws LP tokens from Aura and Balancer, burns the OHM side, and returns the pair token side to the user

Can only be called by the owner of the vault

function withdraw(
uint256 lpAmount_,
uint256[] calldata minTokenAmountsBalancer_,
uint256 minTokenAmountUser_,
bool claim_
) external override onlyOwner nonReentrant returns (uint256, uint256);

Parameters

NameTypeDescription
lpAmount_uint256The amount of LP tokens to withdraw from Balancer
minTokenAmountsBalancer_uint256[]The minimum acceptable amounts of OHM (first entry), and pair tokens (second entry) to receive back from Balancer
minTokenAmountUser_uint256The minimum acceptable amount of pair tokens to receive back from the vault
claim_boolWhether to claim outstanding rewards from Aura

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM received
<none>uint256

emergencyWithdraw

Withdraws LP tokens from Aura and Balancer, returns the pair tokens to the user

Can only be called by the owner of the vault. Can only be called when the vault is paused

function emergencyWithdraw(uint256 lpAmount_, uint256[] calldata minTokenAmounts_)
external
override
onlyWhileInactive
onlyOwner
nonReentrant
returns (uint256, uint256);

Parameters

NameTypeDescription
lpAmount_uint256The amount of LP tokens to withdraw from Balancer
minTokenAmounts_uint256[]The minimum acceptable amounts of OHM (first entry), and pair tokens (second entry) to receive back from Balancer

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM received
<none>uint256

claimRewards

Claims outstanding rewards from Aura

Can only be called by the owner of the vault

function claimRewards() external override onlyWhileActive onlyOwner nonReentrant;

canWithdraw

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

function canWithdraw() external view override returns (bool);

Returns

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

getLpBalance

Gets the LP balance of the contract based on its deposits to Aura

function getLpBalance() public view override returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 LP balance deposited into Aura

getUserPairShare

Gets the contract's claim on pair tokens based on its LP balance deposited into Aura

function getUserPairShare() public view override returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Claim on pair tokens

getOutstandingRewards

Returns the vault's unclaimed rewards in Aura

function getOutstandingRewards() public view override returns (RewardsData[] memory);

Returns

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

_joinBalancerPool

function _joinBalancerPool(uint256 ohmAmount_, uint256 lusdAmount_, uint256 minLpAmount_) internal;

_exitBalancerPool

function _exitBalancerPool(uint256 lpAmount_, uint256[] calldata minTokenAmounts_) internal;

_sendRewards

function _sendRewards() internal;

Events

Deposit

event Deposit(uint256 ohmAmount, uint256 lusdAmount);

Withdraw

event Withdraw(uint256 ohmAmount, uint256 lusdAmount);

RewardsClaimed

event RewardsClaimed(address indexed rewardsToken, uint256 amount);

Errors

BLVaultLusd_AlreadyInitialized

error BLVaultLusd_AlreadyInitialized();

BLVaultLusd_OnlyOwner

error BLVaultLusd_OnlyOwner();

BLVaultLusd_Active

error BLVaultLusd_Active();

BLVaultLusd_Inactive

error BLVaultLusd_Inactive();

BLVaultLusd_Reentrancy

error BLVaultLusd_Reentrancy();

BLVaultLusd_AuraDepositFailed

error BLVaultLusd_AuraDepositFailed();

BLVaultLusd_AuraWithdrawalFailed

error BLVaultLusd_AuraWithdrawalFailed();

BLVaultLusd_WithdrawFailedPriceImbalance

error BLVaultLusd_WithdrawFailedPriceImbalance();

BLVaultLusd_WithdrawalDelay

error BLVaultLusd_WithdrawalDelay();