Public ABI Description
EIP-4626 Standard (Borrow Vault)
EIP-4626 read methods/view function
-
totalAssets() → uint256- Type:
view - Outputs:
uint256- The total amount of borrowed assets in the vault - Description: This function returns the total borrowed assets in the vault, including real and future auction assets.
- Type:
-
totalAssets(bool isDeposit) → uint256- Type:
view - Inputs:
isDeposit (bool)- Whether this is for deposit operations (true) or withdrawal operations (false) - Outputs:
uint256- Returns the total amount of borrow assets managed by the vault - Description: This function returns the total borrow assets with context-aware pricing. When
isDeposit = true, uses optimistic pricing (rounds up collateral, rounds down borrow). WhenisDeposit = false,uses conservative pricing (rounds down collateral, rounds up borrow).
- Type:
-
convertToShares(uint256 assets) → uint256- Type:
view - Inputs:
assets (uint256)- The amount of borrowed assets to convert - Outputs:
uint256- The number of shares based on the assets - Description: This function returns how many vault shares are obtained for a certain amount of borrowed assets.
- Type:
-
convertToAssets(uint256 shares) → uint256- Type:
view - Inputs:
shares (uint256)- The number of shares to convert - Outputs:
uint256- The amount of borrowed assets based on the shares - Description: This function returns how many borrowed assets are obtained for a certain number of vault shares.
- Type:
-
maxDeposit(address receiver) → uint256- Type:
view - Inputs:
receiver (address)- The address to check deposit limits - Outputs:
uint256- The maximum amount of borrowed assets that can be deposited - Description: The function returns the maximum borrowed assets that the receiver can deposit.
- Type:
-
maxMint(address receiver) → uint256- Type:
view - Inputs:
receiver (address)- The address to check mint limits - Outputs:
uint256- The maximum number of shares that can be minted for the receiver - Description: This function shows the maximum vault shares that can be minted for the receiver.
- Type:
-
maxWithdraw(address owner) → uint256- Type:
view - Inputs:
owner (address)- The address to check withdrawal limits - Outputs:
uint256- The maximum amount of borrowed assets that can be withdrawn - Description: This function returns the maximum borrowed assets the owner can withdraw.
- Type:
-
maxRedeem(address owner) → uint256- Type:
view - Inputs:
owner (address)- The address to check redemption limits - Outputs:
uint256- The maximum number of shares that can be redeemed - Description: This function returns the maximum shares the owner can redeem.
- Type:
-
previewDeposit(uint256 assets) → uint256- Type:
view - Inputs:
assets (uint256)- The amount of borrowed assets to deposit - Outputs:
uint256- The estimated number of shares received - Description: This function returns the estimates of how many vault shares you get for depositing a specified amount of borrowed assets.
- Type:
-
previewMint(uint256 shares) → (uint256 assets)
- Type:
view - Inputs:
shares (uint256)- The number of shares to mint - Outputs:
uint256- The estimated amount of borrowed assets needed - Description: This function returns the estimates of how many borrowed assets are needed to mint a specified number of shares.
previewWithdraw(uint256 assets) → (uint256 shares)- Type:
view - Inputs:
assets (uint256)- The amount of borrowed assets to withdraw - Outputs:
uint256 shares- The estimated number of shares to be burned - Description: This function returns the estimates of how many shares must be burned to withdraw the specified amount of borrowed assets.
- Type:
previewRedeem(uint256 shares) → (uint256 assets)- Type:
view - Inputs:
shares (uint256)- The number of shares to redeem - Outputs:
uint256 assets- The estimated amount of borrowed assets to be received - Description: This function returns the estimates of how many borrowed assets to get for redeeming the specified number of shares.
- Type:
EIP-4626 write methods
deposit(uint256 assets, address receiver) → uint256- Type:
impure - Inputs:
assets (uint256)- The amount of borrowed assets to depositreceiver (address)- The address to receive the minted shares
- Outputs:
uint256- The number of shares minted for the receiver - Description: The function deposits borrowed assets and mints vault shares to the receiver. This may trigger rebalancing to maintain the target loan-to-value (LTV) ratio.
- Type:
mint(uint256 shares, address receiver) → (uint256 assets)- Type:
impure - Inputs:
shares (uint256)- The number of shares to mintreceiver (address)- The address to receive the minted shares
- Outputs:
uint256- The amount of borrowed assets used to mint the shares - Description: This function mints vault shares in exchange for borrowed assets. The required asset amount is calculated based on current exchange rates.
- Type:
withdraw(uint256 assets, address receiver, address owner) → uint256
- Type:
impure - Inputs:
assets (uint256)- The amount of borrowed assets to withdrawreceiver (address)- The address to receive the withdrawn assetsowner (address)- The address whose shares will be burned
- Outputs:
uint256- The number of shares burned from the owner- Description: This function withdraws borrowed assets by burning shares from the owner and transferring the assets to the receiver.
redeem(uint256 shares, address receiver, address owner) → (uint256 assets)
- Type:
impure - Inputs:
shares (uint256)- The number of shares to redeemreceiver (address)- The address to receive the withdrawn assetsowner (address)- The address whose shares will be burned
- Outputs:
uint256 assets- The amount of borrowed assets transferred to the receiver - Description: This function redeems shares and transfers the corresponding borrowed assets.
EIP-4626 Collateral Extension
EIP-4626 read methods/view function
maxDepositCollateral(address receiver) → uint256- Type:
view - Inputs:
receiver (address)- The address to check for how much collateral can be deposited. - Outputs:
uint256- The maximum amount of collateral that can be deposited. - Description: This function returns the maximum collateral assets the receiver can deposit.
- Type:
maxMintCollateral(address receiver) → uint256- Type:
view - Inputs:
receiver (address)- The address to check for how much collateral can be minted. - Outputs:
uint256- The maximum number of collateral shares that can be minted. - Description: This function returns how many collateral shares can be minted for the receiver.
- Type:
maxRedeemCollateral(address owner) → uint256- Type:
view - Inputs:
owner (address)- The address to check for how much collateral can be redeemed. - Outputs:
uint256- The maximum number of collateral shares that can be redeemed. - Description: This function returns how many collateral shares the owner can redeem.
- Type:
maxWithdrawCollateral(address owner) → uint256- Type:
view - Inputs:
owner (address)- The address to check for how much collateral can be withdrawn. - Outputs:
uint256- The maximum amount of collateral assets that can be withdrawn. - Description: This function returns the maximum collateral assets the owner can withdraw.
- Type:
previewDepositCollateral(uint256 collateralAssets) → uint256- Type:
view - Inputs:
collateralAssets (uint256)- The amount of collateral assets to deposit. - Outputs:
uint256- The estimated number of collateral shares to receive. - Description: This function estimates how many collateral shares to get for depositing a specific amount of collateral assets.
- Type:
previewMintCollateral(uint256 shares) → (uint256 collateralAssets)- Type:
view - Inputs:
shares (uint256)- The number of collateral shares to mint. - Outputs: uint256 - The estimated amount of collateral assets needed.
- Description: This function estimates how much collateral is required to mint a specific number of shares.
- Type:
previewRedeemCollateral(uint256 shares) → (uint256 assets)- Type:
view - Inputs:
shares (uint256)- The number of collateral shares to redeem. - Outputs:
uint256 assets- The estimated amount of collateral assets to receive. - Description: This function returns an estimate of how much collateral to get for redeeming a specific number of shares.
- Type:
previewWithdrawCollateral(uint256 assets) → (uint256 shares)- Type:
view - Inputs:
assets (uint256)- The amount of collateral assets to withdraw. - Outputs:
uint256 shares- The estimated number of collateral shares that will be burned. - Description: This function returns the estimated number of collateral shares that need to be burned to withdraw a specific amount of collateral assets.
- Type:
totalAssetsCollateral() → uint256- Type:
view - Outputs:
uint256- The total amount of collateral assets managed by the vault. - Description: This function returns the total collateral assets in the vault using conservative pricing
(isDeposit = false).
- Type:
totalAssetsCollateral(bool isDeposit) → uint256- Type:
view - Inputs:
isDeposit (bool)- Whether this is for a deposit operation (true) or withdrawal operation (false). - Outputs:
uint256- The total amount of collateral assets managed by the vault. - Description: This function returns the total collateral assets with context-aware pricing. Use
isDeposit = truefor deposit operations (optimistic pricing) andisDeposit = falsefor withdrawal operations (conservative pricing).
- Type:
EIP-4626 write methods
depositCollateral(uint256 collateralAssets, address receiver) → uint256- Type:
impure - Inputs:
collateralAssets (uint256)- The amount of collateral assets to deposit.receiver (address)- The address to receive the minted collateral shares.
- Outputs:
uint256- The number of collateral shares minted to the receiver. - Description: This function deposits collateral assets and mints collateral shares to the receiver.
- Type:
mintCollateral(uint256 shares, address receiver) → (uint256 collateralAssets)- Type:
impure - Inputs:
shares (uint256)- The number of collateral shares to mint.receiver (address)- The address to receive the minted shares.
- Outputs:
uint256 collateralAssets- The amount of collateral assets used to mint the shares. - Description: This function mints collateral shares in exchange for collateral assets.
- Type:
withdrawCollateral(uint256 collateralAssets, address receiver, address owner) → uint256- Type:
impure - Inputs:
collateralAssets (uint256)- The amount of collateral assets to withdraw.receiver (address)- The address to receive the withdrawn collateral assets.owner (address)- The address whose collateral shares will be burned.
- Outputs:
uint256- The number of collateral shares burned from the owner. - Description: This function withdraws collateral assets by burning collateral shares from the owner.
- Type:
redeemCollateral(uint256 shares, address receiver, address owner) → (uint256 collateralAssets)- Type:
impure - Inputs:
shares (uint256)- The number of collateral shares to redeem.receiver (address)- The address to receive the withdrawn collateral assets.owner (address)- The address whose collateral shares will be burned.
- Outputs:
uint256 collateralAssets- The amount of collateral assets transferred to the receiver. - Description: This function redeems collateral shares and transfers the corresponding collateral assets to the receiver.
- Type:
ERC-20 Standard
ERC-20 read methods/view function
balanceOf(address owner) → uint256- Type:
view - Inputs:
owner (address)- The address to check the balance for. - Outputs:
uint256- The token balance of the owner. - Description: This function returns the vault share token balance of the specified address.
- Type:
totalSupply() → uint256- Type:
view - Outputs:
uint256- The total supply of vault share tokens. - Description: This function returns the total supply of vault share tokens.
- Type:
decimals() → uint8- Type:
view - Outputs:
uint8- The number of decimal places for the token. - Description: This function returns the number of decimal places for the vault share token.
- Type:
name() → string- Type:
view - Outputs:
string- The token name. - Description: This function returns the name of the vault share token.
- Type:
symbol() → string- Type:
view - Outputs:
string- The token symbol. - Description: This function returns the symbol of the vault share token.
- Type:
allowance(address owner, address spender) → uint256- Type:
view - Inputs:
owner (address)- The token owner address.spender (address)- The spender address.
- Outputs:
uint256- The remaining allowance amount. - Description: This function returns the remaining number of tokens that spender can use on behalf of the owner.
- Type:
ERC-20 write methods
approve(address spender, uint256 amount) → bool- Type:
impure - Inputs:
spender (address)- The address to approve for spending.amount (uint256)- The amount of tokens to approve.
- Outputs:
bool- The success status. - Description: This function approves the spender to use an amount of tokens on behalf of the caller.
- Type:
transfer(address recipient, uint256 amount) → bool- Type:
impure - Inputs:
recipient (address)- The address to transfer tokens to.amount (uint256)- The amount of tokens to transfer.
- Outputs:
bool- The success status. - Description: This function transfers amount tokens to the recipient.
- Type:
transferFrom(address sender, address recipient, uint256 amount) → bool- Type:
impure - Inputs:
sender (address)- The address to transfer tokens from.recipient (address)- The address to transfer tokens to.amount (uint256)- The amount of tokens to transfer.
- Outputs:
bool- The success status. - Description: This function transfers amount tokens from sender to recipient using allowance.
- Type:
Auction System
Auction read methods/view function
startAuction() → uint256- Type:
view - Outputs:
uint256- The timestamp when the auction started. - Description: This function returns the timestamp when the current auction started, or 0 if no auction is active.
- Type:
previewExecuteAuctionBorrow(int256 deltaUserBorrowAssets) → int256- Type:
view - Inputs:
deltaUserBorrowAssets (int256)- The change in user borrow assets (positive to receive, negative to provide). - Outputs:
int256- The estimated amount of borrow assets user needs to give/receive. - Description: This function estimates the amount of borrow assets a user needs to give or receive to execute the auction with the specified delta.
- Type:
previewExecuteAuctionCollateral(int256 deltaUserCollateralAssets) → int256- Type:
view - Inputs:
deltaUserCollateralAssets (int256)- The change in user collateral assets (positive to receive, negative to provide). - Outputs:
int256- The estimated amount of collateral assets user needs to give/receive. - Description: This function estimates the amount of collateral assets a user needs to give or receive to execute the auction with the specified delta.
- Type:
Auction write methods
executeAuctionBorrow(int256 deltaUserBorrowAssets) → int256- Type:
impure - Inputs:
deltaUserBorrowAssets (int256)- The change in user borrow assets (positive to receive, negative to provide). - Outputs:
int256- The actual amount of borrow assets transferred. - Description: This function executes an auction for borrow assets, allowing users to participate in rebalancing for rewards.
- Type:
executeAuctionCollateral(int256 deltaUserCollateralAssets) → int256- Type:
impure - Inputs:
deltaUserCollateralAssets (int256)- The change in user collateral assets (positive to receive, negative to provide). - Outputs:
int256- The actual amount of collateral assets transferred. - Description: This function executes an auction for collateral assets, allowing users to participate in rebalancing for rewards.
- Type:
Low level rebalance
Low level rebalance read methods/view function
previewLowLevelRebalanceShares(int256 deltaShares) → (int256 deltaCollateral, int256 deltaBorrow)- Type:
view - Inputs:
deltaShares (int256)- The amount of shares to mint or burn (positive for mint). - Outputs:
deltaCollateral (int256)- The amount of collateral assets user will receive or provide.deltaBorrow (int256)- The amount of borrow assets user will receive or provide.
- Description: This function previews low level rebalance execution with input in shares. Positive deltaShares mints shares, negative burns shares.
- Type:
previewLowLevelRebalanceBorrow(int256 deltaBorrowAssets) → (int256 deltaCollateral, int256 deltaShares)- Type: view
- Inputs:
deltaBorrowAssets (int256)- The amount of borrow assets to withdraw or deposit (negative to send borrow assets). - Outputs:
deltaCollateral (int256)- The amount of collateral assets user will receive or provide.deltaShares (int256)- The amount of shares user will receive or burn.
- Description: This function previews low level rebalance execution with input in borrow assets. Negative
deltaCollateralmeans protocol sends collateral to user, positive means user provides collateral. PositivedeltaSharesmeans user receives shares, negative means shares are burned.
previewLowLevelRebalanceCollateral(int256 deltaCollateralAssets) → (int256 deltaBorrow, int256 deltaShares)- Type:
view - Inputs:
deltaCollateralAssets (int256)- The amount of collateral assets to withdraw or deposit (positive to send collateral assets). - Outputs:
deltaBorrow (int256)- The amount of borrow assets user will receive or provide.deltaShares (int256)- The amount of shares user will receive or burn.
- Description: This function previews low level rebalance execution with input in collateral assets. Positive
deltaBorrowmeans protocol sends borrow assets to user, negative means user provides borrow assets.
- Type:
previewLowLevelRebalanceBorrowHint(int256 deltaBorrowAssets, bool isSharesPositiveHint) → (int256 deltaCollateral, int256 deltaShares)- Type:
view - Inputs:
deltaBorrowAssets (int256)- The amount of borrow assets to withdraw or deposit (negative to send borrow assets).isSharesPositiveHint (bool)- The hint indicating if user expects to mint shares (saves gas).
- Outputs:
deltaCollateral (int256)- The amount of collateral assets user will receive or provide.deltaShares (int256)- The amount of shares user will receive or burn.
- Description: This function is the same as
previewLowLevelRebalanceBorrowbut with a hint to optimize gas usage.
- Type:
previewLowLevelRebalanceCollateralHint(int256 deltaCollateralAssets, bool isSharesPositiveHint) → (int256 deltaBorrow, int256 deltaShares)- Type:
view - Inputs:
deltaCollateralAssets (int256)- The amount of collateral assets to withdraw or deposit (positive to send collateral assets).isSharesPositiveHint (bool)- The hint indicating if user expects to mint shares (saves gas).
- Outputs:
deltaBorrow (int256)- The amount of borrow assets user will receive or provide.deltaShares (int256)- The amount of shares user will receive or burn.
- Description: This function is the same as
previewLowLevelRebalanceCollateralbut with a hint to optimize gas usage.
- Type:
maxLowLevelRebalanceShares() → int256- Type:
view - Outputs:
int256- The maximum amount of shares that can be minted or burned in low level rebalance. - Description: This function returns the maximum amount of shares that can be minted (positive) or burned (negative) in a low level rebalance operation.
- Type:
maxLowLevelRebalanceBorrow() → int256- Type:
view - Outputs:
int256- The maximum amount of borrow assets that can be used in low level rebalance. - Description: This function returns the maximum amount of borrow assets that can be withdrawn (positive) or deposited (negative) in a low level rebalance operation.
- Type:
maxLowLevelRebalanceCollateral() → int256- Type:
view - Outputs:
int256- The maximum amount of collateral assets that can be used in low level rebalance. - Description: This function returns the maximum amount of collateral assets that can be withdrawn (positive) or deposited (negative) in a low level rebalance operation.
- Type:
Low level rebalance write methods
executeLowLevelRebalanceBorrow(int256 deltaBorrowAssets) → (int256, int256)- Type:
impure - Inputs:
deltaBorrow (int256)- The amount of borrow assets to withdraw or deposit (negative to send borrow assets). - Outputs:
int256- The amount of collateral assets transferred.int256- The amount of shares minted or burned.
- Description: This function executes low level rebalance with input in borrow assets. This is a core rebalancing function that maintains the target LTV ratio.
- Type:
executeLowLevelRebalanceCollateral()(int256 deltaCollateralAssets) → (int256, int256)- Type:
impure - Inputs:
deltaCollateral (int256)- The amount of collateral assets to withdraw or deposit (positive to send collateral assets). - Outputs:
int256- The amount of borrow assets transferred.int256- The amount of shares minted or burned.
- Description: This function executes low level rebalance with input in collateral assets.
- Type:
executeLowLevelRebalanceShares(int256 deltaShares) → (int256, int256)- Type:
impure - Inputs:
deltaShares (int256)- The amount of shares to mint or burn (positive for mint). - Outputs:
int256- The amount of collateral assets transferred.int256- The amount of borrow assets transferred.
- Description: This function executes low level rebalance with input in shares.
- Type:
executeLowLevelRebalanceBorrowHint(int256 deltaBorrow, bool isSharesPositiveHint) → (int256, int256)- Type:
impure - Inputs:
deltaBorrow (int256)- The amount of borrow assets to withdraw or deposit (negative to send borrow assets).isSharesPositiveHint (bool)- The hint indicating if user expects to mint shares.
- Outputs:
int256- The amount of collateral assets transferred.int256- The amount of shares minted or burned.
- Description: This function is the same as
executeLowLevelBorrow, but with a hint to optimize gas usage.
- Type:
executeLowLevelRebalanceCollateralHint(int256 deltaCollateral, bool isSharesPositiveHint) → (int256, int256)- Type:
impure - Inputs:
deltaCollateral (int256)- The amount of collateral assets to withdraw or deposit (positive to send collateral assets).isSharesPositiveHint (bool)- The hint indicating if user expects to mint shares.
- Outputs:
int256- The amount of borrow assets transferred.int256- The amount of shares minted or burned.
- Description: This function is the same as executeLowLevelCollateral but with a hint to optimize gas usage.
- Type:
State Representation
State read methods/view function
borrowToken() → address- Type:
view - Outputs:
address- The borrow token contract address. - Description: This function returns the address of the borrow token (e.g., USDC, DAI).
- Type:
collateralToken() → address- Type:
view - Outputs:
address- The collateral token contract address. - Description: This function returns the address of the collateral token (e.g., ETH, WBTC).
- Type:
futureBorrowAssets() → int256- Type:
view - Outputs:
int256- The current auction borrow assets. - Description: This function returns the current amount of borrow assets in the auction system.
- Type:
futureCollateralAssets() → int256- Type:
view - Outputs:
int256- The current auction collateral assets. - Description: This function returns the current amount of collateral assets in the auction system.
- Type:
futureRewardBorrowAssets() → int256- Type:
view - Outputs:
int256- The current auction reward in borrow assets. - Description: This function returns the current auction reward denominated in borrow assets.
- Type:
futureRewardCollateralAssets() → int256- Type:
view - Outputs:
int256- The current auction reward in collateral assets. - Description: This function returns the current auction reward denominated in collateral assets.
- Type:
getRealBorrowAssets(bool isDeposit) → uint256- Type: view
- Inputs:
isDeposit (bool)- Whether this is for deposit operations (true) or withdrawal operations (false). - Outputs:
uint256- The protocol's current debt in lending protocol. - Description: This function returns the protocol's current debt position in the underlying lending protocol in borrow assets with context-aware pricing.
getRealCollateralAssets(bool isDeposit) → uint256- Type:
view - Inputs:
isDeposit (bool)- Whether this is for deposit operations (true) or withdrawal operations (false). - Outputs:
uint256- The protocol's current collateral in lending protocol. - Description: This function returns the protocol's current collateral position in the underlying lending protocol in collateral assets with context-aware pricing.
- Type:
maxSafeLTV() → uint128- Type:
view - Outputs:
uint128- The maximum safe loan-to-value ratio. - Description: This function returns the maximum safe LTV ratio that the protocol will maintain.
- Type:
maxTotalAssetsInUnderlying() → uint256- Type:
view - Outputs:
uint256- The protocol top border in underlying oracle assets. - Description: This function returns the maximum total assets the protocol can manage in underlying oracle assets.
- Type:
minProfitLTV() → uint128- Type:
view - Outputs:
uint128- The minimum profitable LTV. - Description: This function returns the minimum profitable LTV ratio for the protocol.
- Type:
targetLTV() → uint128- Type:
view - Outputs:
uint128- The target loan-to-value ratio. - Description: This function returns the target LTV ratio that the protocol aims to maintain.
- Type:
oracleConnector() → address- Type:
view - Outputs:
address- The oracle connector address. - Description: This function returns the address of the oracle connector that provides price feeds.
- Type:
lendingConnector() → address- Type:
view - Outputs:
address- The lending protocol connector address. - Description: This function returns the address of the lending protocol connector (e.g., Aave V3, Morpho Blue).
- Type:
feeCollector() → address- Type:
view - Outputs:
address- The fee collector address. - Description: This function returns the address that receives protocol fees.
- Type:
baseTotalSupply() → uint256- Type:
view - Outputs:
uint256- The base total supply of vault shares. - Description: This function returns the base total supply of vault shares, excluding any growth fees.
- Type:
maxGrowthFee() → uint256- Type:
view - Outputs:
uint256- The maximum growth fee percentage. - Description: This function returns the maximum growth fee that can be charged by the protocol.
- Type:
lastSeenTokenPrice() → uint256- Type:
view - Outputs:
uint256- The last seen token price from the oracle. - Description: This function returns the most recent token price observed from the oracle connector.
- Type:
isDepositDisabled() → bool- Type:
view - Outputs:
bool- Whether deposits are currently disabled. - Description: This function returns true if deposit functionality is currently disabled by the guardian.
- Type:
isWithdrawDisabled() → bool- Type:
view - Outputs:
bool- Whether withdrawals are currently disabled. - Description: This function returns true if withdrawal functionality is currently disabled by the guardian.
- Type:
isWhitelistActivated() → bool- Type:
view - Outputs:
bool- Whether the whitelist is currently activated. - Description: This function returns true if the whitelist functionality is currently active.
- Type:
getLendingConnector() → address- Type:
view - Outputs:
address- The lending protocol connector contract address. - Description: This function returns the address of the lending protocol connector that handles lending operations.
- Type:
maxDeleverageFee() → uint256- Type:
view - Outputs:
uint256- The maximum deleverage fee percentage. - Description: This function returns the maximum fee charged when users deleverage their positions.
- Type:
Ownership
Ownership read methods/view function
owner() → address- Type:
view - Outputs:
address- The current owner address. - Description: This function returns the address of the current contract owner.
- Type:
governor() → address- Type:
view - Outputs:
address- The current governor address. - Description: This function returns the address of the current governor who can modify protocol parameters.
- Type:
guardian() → address- Type:
view - Outputs:
address- The current guardian address. - Description: This function returns the address of the current guardian who can disable functions and perform emergency actions.
- Type:
emergencyDeleverager() → address- Type:
view - Outputs:
address- The current emergency deleverager address. - Description: This function returns the address of the emergency deleverager who can perform emergency deleveraging operations.
- Type:
Ownership write methods
transferOwnership(address newOwner)- Type:
impure - Inputs:
newOwner (address)- The new owner address. - Description: This function transfers contract ownership to the new owner.
- Type:
renounceOwnership()- Type:
impure - Description: This function renounces ownership of the contract, making it ownerless.
- Type:
initialize(StateInitData memory stateInitData, IModules modules)- Type:
impure - Inputs:
stateInitData (StateInitData)- Initial state configuration data including target LTV, max safe LTV, min profit LTV, and other parameters.modules (IModules)- The modules interface containing vault modules and connectors.
- Description: This function initializes the LTV vault with the provided state data and modules. Can only be called once during deployment.
- Type:
Administration
Administration write methods
setTargetLTV(uint128 value)- Type:
impure - Inputs:
value (uint128)- The new target LTV value. - Description: This function sets the protocol's new target LTV ratio (governor only).
- Type:
setMaxSafeLTV(uint128 value)- Type:
impure - Inputs:
value (uint128)- The new max safe LTV value. - Description: This function sets the protocol's new maximum safe LTV ratio (governor only).
- Type:
setMinProfitLTV(uint128 value)- Type:
impure - Inputs:
value (uint128)- The new min profit LTV value. - Description: This function sets the protocol's new minimum profitable LTV ratio (governor only).
- Type:
setFeeCollector(address _feeCollector)- Type:
impure - Inputs:
_feeCollector (address)- The new fee collector address. - Description: This function sets the protocol's new fee collector address (governor only).
- Type:
setMaxTotalAssetsInUnderlying(uint256 _maxTotalAssetsInUnderlying)- Type:
impure - Inputs:
_maxTotalAssetsInUnderlying (uint256)- The new maximum total assets value. - Description: This function sets the protocol's maximum total assets in underlying oracle assets (governor only).
- Type:
setMaxDeleverageFee(uint256 value)- Type:
impure - Inputs:
value (uint256)- The new max deleverage fee value. - Description: This function sets the protocol's maximum deleverage fee (governor only).
- Type:
setIsWhitelistActivated(bool activate)- Type:
impure - Inputs:
activate (bool)- Whether to activate the whitelist. - Description: This function activates or deactivates the whitelist functionality (governor only).
- Type:
setWhitelistRegistry(address value)- Type:
impure - Inputs:
value (IWhitelistRegistry)- The new whitelist registry address. - Description: This function sets the protocol's whitelist registry address (governor only).
- Type:
setSlippageProvider(ISlippageProvider _slippageProvider)- Type:
impure - Inputs:
_slippageProvider (ISlippageProvider)- The new slippage provider address. - Description: This function sets the protocol's slippage provider address (governor only).
- Type:
allowDisableFunctions(bytes4[] memory signatures, bool isDisabled)- Type:
impure - Inputs:
signatures (bytes4[])- Array of function signatures to enable/disable.isDisabled (bool)- Whether to disable the functions.
- Description: This function allows the guardian to disable or enable specific functions (guardian only).
- Type:
setMaxGrowthFee(uint256 _maxGrowthFee)- Type:
impure - Inputs:
_maxGrowthFee (uint256)- The new max growth fee value. - Description: This function sets the protocol's maximum growth fee (governor only).
- Type:
setModules(IModules _modules)- Type:
impure - Inputs:
_modules (IModules)- The new modules provider address. - Description: This function sets the modules provider address (owner only).
- Type:
setIsDepositDisabled(bool value)- Type:
impure - Inputs:
value (bool)- Whether to disable deposits. - Description: This function disables or enables deposit functionality (guardian only).
- Type:
setIsWithdrawDisabled(bool value)- Type:
impure - Inputs:
value (bool)- Whether to disable withdrawals. - Description: This function disables or enables withdrawal functionality (guardian only).
- Type:
setLendingConnector(address _lendingConnector)- Type:
impure - Inputs:
_lendingConnector (address)- The new lending connector address. - Description: This function sets the lending protocol connector address (owner only).
- Type:
setOracleConnector(address _oracleConnector)- Type:
impure - Inputs:
_oracleConnector (address)- The new oracle connector address. - Description: This function sets the oracle connector address (owner only).
- Type:
deleverageAndWithdraw(uint256 closeAmountBorrow, uint256 deleverageFee)- Type:
impure - Inputs:
closeAmountBorrow (uint256)- The amount of borrow assets to close.deleverageFee (uint256)- The deleverage fee to charge.
- Description: This function performs emergency deleveraging and withdrawal of all assets (emergency deleverager only).
- Type:
updateEmergencyDeleverager(address newEmergencyDeleverager)- Type:
impure - Inputs:
newEmergencyDeleverager (address)- The new emergency deleverager address. - Description: This function updates the emergency deleverager address (owner only).
- Type:
updateGovernor(address newGovernor)- Type:
impure - Inputs:
newGovernor (address)- The new governor address. - Description: This function updates the governor address (owner only).
- Type:
updateGuardian(address newGuardian)- Type:
impure - Inputs:
newGuardian (address)- The new guardian address. - Description: This function updates the guardian address (owner only).
- Type:
Function control
_isFunctionDisabled(bytes4 signature) → bool- Type:
view - Inputs:
signature (bytes4)- The function signature to check. - Outputs:
bool- Whether the function is disabled. - Description: This function returns true if the specified function signature is currently disabled.
- Type:
allowDisableFunctions(bytes4[] memory signatures, bool isDisabled)- Type:
impure - Inputs:
signatures (bytes4[])- Array of function signatures to enable/disable.isDisabled (bool)- Whether to disable the functions.
- Description: This function allows the guardian to disable or enable specific functions (guardian only).
- Type:
Events
EIP-4626 Events
Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares)- Description: This event is emitted when borrow assets are deposited and shares are minted.
- Parameters:
sender (address)- The address that initiated the deposit.owner (address)- The address that receives the minted shares.assets (uint256)- The amount of borrow assets deposited.shares (uint256)- The number of shares minted.
Withdraw(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares)- Description: This event is emitted when borrow assets are withdrawn and shares are burned.
- Parameters:
sender (address)- The address that initiated the withdrawal.receiver (address)- The address that receives the withdrawn assets.owner (address)- The address whose shares are burned.assets (uint256)- The amount of borrow assets withdrawn.shares (uint256)- The number of shares burned.
DepositCollateral(address indexed sender, address indexed owner, uint256 collateralAssets, uint256 shares)- Description: This event is emitted when collateral assets are deposited and shares are minted.
- Parameters:
sender (address)- The address that initiated the deposit.owner (address)- The address that receives the minted shares.collateralAssets (uint256)- The amount of collateral assets deposited.shares (uint256)- The number of shares minted.
WithdrawCollateral(address indexed sender, address indexed receiver, address indexed owner, uint256 collateralAssets, uint256 shares)- Description: This event is emitted when collateral assets are withdrawn and shares are burned.
- Parameters:
sender (address)- The address that initiated the withdrawal.receiver (address)- The address that receives the withdrawn assets.owner (address)- The address whose shares are burned.collateralAssets (uint256)- The amount of collateral assets withdrawn.shares (uint256)- The number of shares burned.
ERC-20 Events
Approval(address indexed owner, address indexed spender, uint256 value)- Description: This event is emitted when an approval is granted.
- Parameters:
owner (address)- The token owner.spender (address)- The approved spender.value (uint256)- The approved amount.
Transfer(address indexed from, address indexed to, uint256 value)- Description: This event is emitted when tokens are transferred.
- Parameters:
from (address)- The sender address.to (address)- The recipient address.value (uint256)- The transfer amount.
Auction Events
AuctionExecuted(address executor, int256 deltaRealCollateralAssets, int256 deltaRealBorrowAssets)- Description: This event is emitted when an auction is executed.
- Parameters:
executor (address)- The address that executed the auction.deltaRealCollateralAssets (int256)- The change in real collateral assets.deltaRealBorrowAssets (int256)- The change in real borrow assets.
State Update Events
StateUpdated(int256 oldFutureBorrowAssets, int256 oldFutureCollateralAssets, int256 oldFutureRewardBorrowAssets, int256 oldFutureRewardCollateralAssets, uint256 oldStartAuction, int256 newFutureBorrowAssets, int256 newFutureCollateralAssets, int256 newFutureRewardBorrowAssets, int256 newFutureRewardCollateralAssets, uint256 newStartAuction)- Description: This event is emitted when the protocol state is updated.
- Parameters:
oldFutureBorrowAssets (int256)- The previous future borrow assets.oldFutureCollateralAssets (int256)- The previous future collateral assets.oldFutureRewardBorrowAssets (int256)- The previous future reward borrow assets.oldFutureRewardCollateralAssets (int256)- The previous future reward collateral assets.oldStartAuction (uint256)- The previous auction start timestamp.newFutureBorrowAssets (int256)- The new future borrow assets.newFutureCollateralAssets (int256)- The new future collateral assets.newFutureRewardBorrowAssets (int256)- The new future reward borrow assets.newFutureRewardCollateralAssets (int256)- The new future reward collateral assets.newStartAuction (uint256)- The new auction start timestamp.
Initialized(uint64 version)- Description: This event is emitted when the contract is initialized.
- Parameters:
version (uint64)- The initialization version.
Administration Events
TargetLTVChanged(uint128 oldValue, uint128 newValue)- Description: This event is emitted when the target LTV is changed.
- Parameters:
oldValue (uint128)- The previous target LTV value.newValue (uint128)- The new target LTV value.
MaxSafeLTVChanged(uint128 oldValue, uint128 newValue)- Description: This event is emitted when the maximum safe LTV is changed.
- Parameters:
oldValue (uint128)- The previous maximum safe LTV value.newValue (uint128)- The new maximum safe LTV value.
MinProfitLTVChanged(uint128 oldValue, uint128 newValue)- Description: This event is emitted when the minimum profitable LTV is changed.
- Parameters:
oldValue (uint128)- The previous minimum profitable LTV value.newValue (uint128)- The new minimum profitable LTV value.
FeeCollectorUpdated(address oldValue, address newValue)- Description: This event is emitted when the fee collector address is updated.
- Parameters:
oldValue (address)- The previous fee collector address.newValue (address)- The new fee collector address.
MaxTotalAssetsInUnderlyingChanged(uint256 oldValue, uint256 newValue)- Description: This event is emitted when the maximum total assets in underlying is changed.
- Parameters:
oldValue (uint256)- The previous maximum total assets value.newValue (uint256)- The new maximum total assets value.
MaxDeleverageFeeChanged(uint256 oldValue, uint256 newValue)- Description: This event is emitted when the maximum deleverage fee is changed.
- Parameters:
oldValue (uint256)- The previous maximum deleverage fee value.newValue (uint256)- The new maximum deleverage fee value.
MaxGrowthFeeChanged(uint256 oldValue, uint256 newValue)- Description: This event is emitted when the maximum growth fee is changed.
- Parameters:
oldValue (uint256)- The previous maximum growth fee value.newValue (uint256)- The new maximum growth fee value.
IsWhitelistActivatedChanged(bool oldValue, bool newValue)- Description: This event is emitted when the whitelist activation status is changed.
- Parameters:
oldValue (bool)- The previous whitelist activation status.newValue (bool)- The new whitelist activation status.
IsDepositDisabledChanged(bool oldValue, bool newValue)- Description: This event is emitted when the deposit disabled status is changed.
- Parameters:
oldValue (bool)- The previous deposit disabled status.newValue (bool)- The new deposit disabled status.
IsWithdrawDisabledChanged(bool oldValue, bool newValue)- Description: This event is emitted when the withdraw disabled status is changed.
- Parameters:
oldValue (bool)- The previous withdraw disabled status.newValue (bool)- The new withdraw disabled status.
LendingConnectorUpdated(address oldValue, address newValue)- Description: This event is emitted when the lending connector address is updated.
- Parameters:
oldValue (address)- The previous lending connector address.newValue (address)- The new lending connector address.
OracleConnectorUpdated(address oldValue, address newValue)- Description: This event is emitted when the oracle connector address is updated.
- Parameters:
oldValue (address)- The previous oracle connector address.newValue (address)- The new oracle connector address.
SlippageProviderUpdated(address oldValue, address newValue)- Description: This event is emitted when the slippage provider address is updated.
- Parameters:
oldValue (address)- The previous slippage provider address.newValue (address)- The new slippage provider address.
WhitelistRegistryUpdated(address oldValue, address newValue)- Description: This event is emitted when the whitelist registry address is updated.
- Parameters:
oldValue (address)- The previous whitelist registry address.newValue (address)- The new whitelist registry address.
VaultBalanceAsLendingConnectorUpdated(address oldValue, address newValue)- Description: This event is emitted when the vault balance as lending connector address is updated.
- Parameters:
oldValue (address)- The previous vault balance as lending connector address.newValue (address)- The new vault balance as lending connector address.
GovernorUpdated(address oldValue, address newValue)- Description: This event is emitted when the governor address is updated.
- Parameters:
oldValue (address)- The previous governor address.newValue (address)- The new governor address.
GuardianUpdated(address oldValue, address newValue)- Description: This event is emitted when the guardian address is updated.
- Parameters:
oldValue (address)- The previous guardian address.newValue (address)- The new guardian address.
EmergencyDeleveragerUpdated(address oldValue, address newValue)- Description: This event is emitted when the emergency deleverager address is updated.
- Parameters:
oldValue (address)- The previous emergency deleverager address.newValue (address)- The new emergency deleverager address.
Ownership Events
OwnershipTransferred(address indexed previousOwner, address indexed newOwner)- Description: This event is emitted when ownership is transferred.
- Parameters:
previousOwner (address)- The previous owner address.newOwner (address)- The new owner address.
Errors
InvalidInitialization()- Description: This error is thrown when the contract is initialized incorrectly.
NotInitializing()- Description: This error is thrown when a function is called during initialization but the contract is not being initialized.
OwnableInvalidOwner(address owner)- Description: This error is thrown when an invalid owner address is provided.
- Parameters:
owner (address)- The invalid owner address.
OwnableUnauthorizedAccount(address account)- Description: This error is thrown when an unauthorized account tries to perform an owner-only operation.
- Parameters:
account (address)- The unauthorized account address.
ReentrancyGuardReentrantCall()- Description: This error is thrown when a reentrant call is detected.
Connectors
Read Connector Address
oracleConnector() → address- Type:
view - Outputs:
address- The oracle connector contract address. - Description: This function returns the address of the oracle connector that provides price feeds for collateral and borrow tokens.
- Type:
lendingConnector() → address- Type:
view - Outputs:
address- The lending protocol connector contract address. - Description: This function returns the address of the lending protocol connector that handles lending operations.
- Type:
slippageProvider() → address- Type:
view - Outputs:
address- The slippage provider address. - Description: This function returns the address of the slippage provider that manages slippage parameters.
- Type:
vaultBalanceAsLendingConnector() → address- Type:
view - Outputs:
address- The vault balance as lending connector address. - Description: This function returns the address of the vault balance as lending connector.
- Type:
whitelistRegistry() → address- Type:
view - Outputs:
address- The whitelist registry address. - Description: This function returns the address of the whitelist registry that manages access control.
- Type: