Skip to main content

Vault

IVaultDomain

Addresses

ChainAddress

Types

Signature

EIP-712 signature

struct Signature {
uint8 v;
bytes32 r;
bytes32 s;
}

WithdrawRequest

A request to withdraw or redeem shares

Fields

NameTypeDescription
assetsuint256The asset value of shares when the request was made. Redemptions will be processed at a rate no better than this.
sharesSharesSize of the request
sharesRedeemedSharesNumber of shares that have been redeemed using this request
penaltyuint64Seconds of penalty which were applied to this request
beginsAtuint64Timestamp when this request will become available
durationuint64Length (after beginsAt) until 100% of shares can be redeemed
struct WithdrawRequest {
uint256 assets;
Shares shares;
Shares sharesRedeemed;
uint64 penalty;
uint64 beginsAt;
uint64 duration;
}

IVaultErrors

Addresses

ChainAddress

Errors

MintRateExceeded

Attempted to mint, but more than maxAssets would have been required ($/LP price too high).

error MintRateExceeded(Shares shares, uint256 assetsRequired, uint256 maxAssets)

Parameters

NameTypeDescription
sharesSharesRequested shares to mint
assetsRequireduint256Assets that were actually required to mint shares
maxAssetsuint256Maximum assets user was willing to spend

DepositRateExceeded

Attempted to deposit, but less than minShares would have been yielded ($/LP price too high).

error DepositRateExceeded(uint256 assets, Shares sharesMinted, Shares minShares)

Parameters

NameTypeDescription
assetsuint256Requested collateral to deposit
sharesMintedSharesShares that actually would have been minted
minSharesSharesMinimum acceptable shares to mint in exchange for assets

WithdrawRateUnmet

Attempted to withdraw, but more than maxShares would have been required ($/LP price too low).

error WithdrawRateUnmet(uint256 assets, Shares shares, Shares maxShares)

Parameters

NameTypeDescription
assetsuint256Requested collateral to withdraw
sharesSharesShares that actually would have to have been burnt
maxSharesSharesMaximum acceptable shares to burn in exchange for withdraw

RedeemRateUnmet

Attempted to redeem, but less than maxAssets would have been yielded ($/LP price too low).

error RedeemRateUnmet(Shares shares, uint256 assets, uint256 minAssets)

Parameters

NameTypeDescription
sharesSharesRequested shares to redeem
assetsuint256Assets that were actually offered in exchange for shares
minAssetsuint256Minimum acceptable assets to receive for shares

DepositsDisabled

This action cannot be performed because user deposits and withdraws are disabled

error DepositsDisabled()

ZeroSharesRequested

cannot redeem zero shares

error ZeroSharesRequested()

FeeDistributorOnly

error FeeDistributorOnly()

MaxCollateralExceeded

Attempted donation would have brought balance above maxCollateral

error MaxCollateralExceeded()

DomFiPerpOnly

error DomFiPerpOnly()

NoWithdrawAssets

This request could not be simulated or executed because it would yield 0 assets.

error NoWithdrawAssets()

Overspecified

Internal assertion, should not be encountered in the wild.

error Overspecified()

InsufficientVaultBalance

error InsufficientVaultBalance()

ActiveWithdrawRequest

Transfers are prohibited if they would lower the balance of an address below the remaining part of an active withdraw request.

error ActiveWithdrawRequest(address from, Shares lockedShares, Shares newBalance)

Parameters

NameTypeDescription
fromaddressAddress from which transfer would be made
lockedSharesSharesshares still "locked" by the withdraw request
newBalanceSharesThe share balance of from after the transfer attempt

PendingPenalty

Transfers are prohibited if the equivalent withdraw request would be blocked by a penalty. You'll have to wait until penalty + penaltyStart.

error PendingPenalty(address from, Shares amount, uint64 penalty, uint64 penaltyStart)
Dev note

see _afterTokenTransfer.

Parameters

NameTypeDescription
fromaddressAddress from which transfer would be made
amountSharesShare size of attempted transfer
penaltyuint64Total penalty that would have been applied to a request this size. That is, if from had made this request, they would have had to wait penalty seconds before beginning to withdraw.
penaltyStartuint64The timestamp at which the penalty would have started