Vault

The Vault is a contract for storing and transferring funds for liquidity pools. It is designed to support internal transfers between liquidity pools to reduce gas costs and potential transfer taxes.

The Vault supports deposit, withdrawal, and transfers with native ETH and ERC20 tokens. Additionally, the Vault has integrated the flash loan feature.

wETH

The vault integrates wETH by nature. All wETH deposits will be immediately unwrapped to native ETH and will wrap ETH on withdrawing wETH. The reserve and balance of wETH and ETH are the same value.

For native ETH, the vault uses the zero address as its address placeholder.

You can use the following functions to get the wETH address.

// Returns address of the wETH contract.
function wETH() external view returns (address);

Balance

You can use the following functions to get the token balance of an account in the vault. The balance of wETH and ETH is the same value.

// Returns token balance of the owner.
// Use `address(0)` or wETH address for ETH balance.
function balanceOf(address token, address owner) external view returns (uint balance);

Reserve

The reserve is the total amount of specific token in the vault since the token's last event (deposit, transfer, or withdraw).

You can use the following functions to query the reserve of a token.

Deposit

By depositing to the vault, the corresponding token balance of the account will be increased. All wETH deposits will be immediately unwrapped to native ETH.

You can use the following functions to deposit.

Transfer

The vault transfer allows moving balances between accounts without actually transferring the token to reduce gas costs or avoid transfer taxes.

You can use the following functions to transfer.

Withdraw

By withdrawing, the account's balance will be decreased, and the underlying assets will be transferred out.

You can use the following functions to withdraw.

Flash Loan

WIP

Interface

Last updated