TheoDepositVault
Last updated
Last updated
TheoDepositVault
is the vault contract responsible for Straddle deposits. Users deposit ETH or WETH in exchange for ERC20 vault shares which entitle them to strategy profits.
The vault operates in one week rounds.
Rounds are rolled over when the rollToNextRound
method is called by VaultKeeper
, a Theo smart contract.
When rolling over, the VaultKeeper
provides the currentBalance
(i.e. the total value of the strategy's assets), thereby determining the pricePerShare
.
Deposits and withdrawals are only processed when rounds roll over, at the given pricePerShare
.
Deposits ETH into the vault (for WETH-denominated vaults). This function can only be called if the vault is set to public.
Name | Type | Description |
---|---|---|
Deposits the vault asset (including WETH) into the vault. This function can only be called if the vault is set to public.
Before depositing, the sender must approve the vault to transfer the ERC20 token on their behalf.
Deposits ETH into the vault (for WETH-denominated vaults). This function is used for private vaults and can only be called if the sender is whitelisted.
The proof
should be obtained from an off-chain service e.g. the Theo user interface.
Parameters
Deposits the vault asset (including WETH) into the vault. This function is used for private vaults and can only be called if the sender is whitelisted.
The proof
should be obtained from an off-chain service e.g. the Theo user interface.
Instantly withdraws the specified amount of the vault asset from a pending deposit made in the current round.
Initiates a withdrawal of the specified number of shares that can be processed once the round completes.
If the sender has a pending withdrawal from a past round, they must first call completeWithdraw
before initiating a new withdrawal.
Completes a withdrawal initiated in a past round. Uses the finalized price per share for that round.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
msg.value
uint256
The amount of ETH to be deposited.
amount
uint256
The amount of the asset to deposit.
proof
bytes32[]
The Merkle proof for the whitelist verification.
msg.value
uint256
The amount of ETH to be deposited.
amount
uint256
The amount of the asset to deposit.
proof
bytes32[]
The Merkle proof for the whitelist verification.
amount
uint256
The amount of the asset to withdraw.
numShares
uint256
The number of shares to withdraw.