TheoDepositVault
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.
Overview
The vault operates in one week rounds.
Rounds are rolled over when the
rollToNextRound
method is called byVaultKeeper
, a Theo smart contract.When rolling over, the
VaultKeeper
provides thecurrentBalance
(i.e. total value of the strategy's assets), thereby determining thepricePerShare
.Deposits and withdrawals are only processed when rounds roll over, at the given
pricePerShare
.
Core Methods
depositETH
Deposits ETH into the vault (for WETH-denominated vaults). This function can only be called if the vault is set to public.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of ETH to be deposited. |
deposit
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.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of the asset to deposit. |
privateDepositETH
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
Name | Type | Description |
---|---|---|
|
| The Merkle proof for the whitelist verification. |
|
| The amount of ETH to be deposited. |
privateDeposit
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.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of the asset to deposit. |
|
| The Merkle proof for the whitelist verification. |
withdrawInstantly
Instantly withdraws the specified amount of the vault asset from a pending deposit made in the current round.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of the asset to withdraw. |
initiateWithdraw
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.
Parameters
Name | Type | Description |
---|---|---|
|
| The number of shares to withdraw. |
completeWithdraw
Completes a withdrawal initiated in a past round. Uses the finalized price per share for that round.
Last updated