Skip to content

Concepts ​

ERC-4626 in one minute ​

The vault holds an underlying asset (USDC) and issues shares (an ERC-20 token) representing a depositor's claim on the pool. As the vault accrues yield, the exchange price — assets per share — increases. Two operations enter the vault:

  • deposit(assets, receiver) — caller specifies how much USDC to put in
  • mint(shares, receiver) — caller specifies how many shares to receive

Two operations exit:

  • withdraw(assets, receiver, owner) — caller specifies how much USDC to receive
  • redeem(shares, receiver, owner) — caller specifies how many shares to burn

deposit/redeem are the most common in practice; mint/withdraw are useful when you need an exact share or asset amount.

Shares vs assets ​

Shares and assets are not 1:1. The conversion is:

assets = shares * exchangePrice / 1e18
shares = assets * 1e18 / exchangePrice

Use previewDeposit, previewMint, previewWithdraw, previewRedeem (read functions) to get an exact quote before sending the tx.

Withdrawal fee ​

Withdrawals charge a configurable basis-point fee (withdrawalFeeBPS). The fee is taken from the assets returned to the caller. There is no deposit fee.

You can read the current fee with withdrawalFeeBPS() (a uint256 in 1e4 basis points, so 10 means 0.1%).

Pause flags ​

Two independent flags gate the vault:

  • depositsPaused — when true, both deposit and mint revert
  • withdrawalsPaused — when true, both withdraw and redeem revert

Read them with depositsPaused() / withdrawalsPaused() before submitting state-changing calls.

Approvals — two layers ​

There are two distinct approvals you may need:

  1. USDC → Vault. Required before deposit / mint, because the vault calls transferFrom on USDC to pull funds from the caller.
  2. Vault shares → some operator. Only needed if you want a third party to call withdraw or redeem on your behalf, or to call transferFrom for share transfers. Set this with the vault's own approve function.