AmphorSyntheticVault
Solidity version
Inheritance
IERC4626
of OpenZeppelin.ERC20
of OpenZeppelin.
State Variables
decimalsOffset
Type | Scope | Description |
---|---|---|
|
| The decimals offset of the shares token. This is to protect against inflation attacks. |
lastSavedBalance
Type | Scope | Description |
---|---|---|
|
| The total underlying assets amount just before the lock period. |
feesInBps
Type | Scope | Description |
---|---|---|
|
| Performance fees are applied on the absolute returns of the underlying strategy. |
vaultIsOpen
Type | Scope | Description |
---|---|---|
|
| The locking status of the vault. |
Events
EpochStart
Emitted when an epoch starts.
Name | Type | Description |
---|---|---|
|
| The block timestamp of the epoch starts. |
|
| The |
|
| The total number of shares when the vault starts. |
EpochEnd
Emitted when an epoch ends.
Name | Type | Description |
---|---|---|
|
| The block timestamp of the epoch terminates. |
|
| The |
|
| The total amount of underlying assets returned to the vault before collecting fees. |
|
| The amount of fees collected. |
|
| The total amount of shares when the vault terminates. |
FeesChanged
Emitted when fees are changed.
Name | Type | Description |
---|---|---|
|
| The previous performance fees (in bps). |
|
| The newly applied performance fees (in bps). |
|
| The total amount of underlying assets returned to the vault before collecting fees. |
Errors
VaultIsLocked
The vault is in a locked state. Emitted if the transaction cannot happen in this state.
VaultIsOpen
The vault is in an open state. Emitted if the transaction cannot happen in this state.
FeesTooHigh
A rule preventing performance fees from being higher than 30.00%.
CannotClaimAsset
Claiming the underlying assets is not allowed.
ERC4626ExceededMaxDeposit
Attempt to deposit more underlying assets than the maximum allowed amount for receiver
.
Name | Type | Description |
---|---|---|
|
| The |
|
| The amount of underlying assets asked for deposit. |
|
| Number of shares (LP tokens) received in exchange for the specified amount of underlying assets. |
ERC4626ExceededMaxMint
Attempt to mint more shares (LP tokens) than the maximum allowed amount for receiver
.
Name | Type | Description |
---|---|---|
|
| The |
|
| The amount of underlying assets asked to mint shares (LP tokens). |
|
| The maximum number of withdrawable shares (LP tokens). |
ERC4626ExceededMaxWithdraw
Attempt to withdraw more underlying assets than the maximum allowed amount for receiver
.
Name | Type | Description |
---|---|---|
|
| The |
|
| The number of underlying assets asked for withdrawal. |
|
| The maximum amount of withdrawable underlying assets. |
ERC4626ExceededMaxRedeem
Attempt to redeem more shares(LP tokens) than the maximum allowed amount for receiver
.
Name | Type | Description |
---|---|---|
|
| The |
|
| The number of shares (LP tokens) asked to be redeemed. |
|
| The maximum number of redeemable shares (LP tokens). |
ERC4626NotEnoughSharesMinted
Attempted to mint fewer shares (LP tokens) than the minimum amount for receiver
. This error is only thrown when the depositMinShares
function is used.
Name | Type | Description |
---|---|---|
|
| The |
|
| The number of shares (LP tokens) to be converted into underlying assets. |
|
| The minimum amount of shares (LP tokens) to be minted. |
ERC4626TooMuchAssetsDeposited
Attempted to withdraw more underlying assets than the maximum allowed amount for receiver
.
This error is only thrown when the mintMaxAssets
function is used.
Name | Type | Description |
---|---|---|
|
| The |
|
| The amount of underlying assets to be converted into shares (LP tokens). |
|
| The maximum amount of assets to be deposited. |
Functions
asset
The asset
function is used to return the address
of the underlying asset.
Type | Description |
---|---|
|
|
decimals
See {IERC20-decimals}
. The _decimalShares
is equal to underlying asset decimals + decimalsOffset
. See Constructor for more details about this.
Type | Description |
---|---|
| Amount of decimals of the share (LP) token. |
totalAssets
The totalAssets
function is used to calculate the theoretical total underlying assets owned by the vault. If the vault is locked, the last saved balance is added to the current balance.
Type | Description |
---|---|
| Amount of the total underlying assets in the vault. |
convertToShares
See {IERC4626-convertToShares}.
The convertToShares
function is used to calculate the number of shares (LP tokens) received in exchange for the specified amount of underlying assets.
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares . |
convertToAssets
See {IERC4626-convertToAssets}.
The convertToAssets
function is used to calculate the amount of underlying assets received in exchange for the specified number of shares (LP tokens).
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
maxDeposit
The maxDeposit
function is used to calculate the maximum deposit.
If the vault is locked or paused, users are not allowed to mint, the maxMint
is 0
.
Name | Type | Description |
---|---|---|
_ |
| The |
maxMint
The maxMint
function is used to calculate the maximum number of shares (LP tokens) you can mint. If the vault is locked or paused, the maxMint
is 0
.
Name | Type | Description |
---|---|---|
_ |
| The |
maxWithdraw
The maxWithdraw
function is used to calculate the maximum amount of withdrawable underlying assets. If the function is called during the lock period the maxWithdraw
is 0
.
Name | Type | Description |
---|---|---|
|
| The |
maxRedeem
The maxRedemm
function is used to calculate the maximum number of redeemable shares (LP tokens). If the function is called during the lock period, the maxRedeem
is 0
.
Name | Type | Description |
---|---|---|
|
| The |
previewDeposit
The previewDeposit
function is used to calculate the number of shares (LP tokens) received in exchange for the specified underlying asset.
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares (LP tokens). |
previewMint
The previewMint
function is used to calculate the amount of underlying assets received in exchange for the specified number of shares (LP tokens).
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
previewWithdraw
The previewWithdraw
function is used to calculate the number of shares (LP tokens) received in exchange for the specified underlying asset.
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares (LP tokens). |
previewRedeem
The previewRedeem
function is used to calculate the amount of underlying assets received in exchange for the specified number of shares (LP token).
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
deposit
The deposit
function is used to deposit underlying assets into the vault.
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares (LP tokens). |
|
| The |
depositMinShares
The depositMinShares
function is used to deposit underlying assets into the vault. It also checks that the number of minted shares (LP tokens) is greater or equal to the specified minimum quantity.
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares (LP tokens). |
|
| The |
|
| The minimum number of shares (LP tokens) to be minted. |
mint
The mint
function is used to mint the specified number of shares (LP tokens) in exchange for the corresponding amount of underlying assets from owner
.
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
|
| The |
mintMaxAssets
The mintMaxAssets
function is used to mint the specified number of shares (LP tokens) in exchange for the corresponding amount of underlying assets from owner
. It also checks that the amount of assets deposited is less or equal to the specified maximum amount.
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
|
| The |
|
| The maximum amount of assets to be deposited. |
withdraw
The withdraw
function is used to withdraw the specified amount of underlying assets in exchange for a proportional number of shares (LP tokens).
Name | Type | Description |
---|---|---|
|
| The amount of underlying assets to be converted into shares (LP tokens). |
|
| The |
|
| The |
redeem
The redeem
function is used to redeem the specified number of shares (LP tokens) in exchange for the corresponding amount of underlying assets from owner
.
Name | Type | Description |
---|---|---|
|
| The number of shares (LP tokens) to be converted into underlying assets. |
|
| The |
|
| The |
Last updated