For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deposits

Topping up an existing vault is a standard ERC‑4626 deposit call. No additional authorization or signatures are required — the wallet that created the vault (or any wallet explicitly granted deposit rights) can deposit at any time.

Approve the vault

await walletClient.writeContract({
  address: underlyingToken,
  abi: erc20Abi,
  functionName: 'approve',
  args: [vault, amount],
})

Deposit

const vaultAbi = [{
  type: 'function', stateMutability: 'nonpayable', name: 'deposit',
  inputs: [
    {name: 'assets',   type: 'uint256'},
    {name: 'receiver', type: 'address'},
  ],
  outputs: [{name: 'shares', type: 'uint256'}],
}] as const

const hash = await walletClient.writeContract({
  address: vault,
  abi: vaultAbi,
  functionName: 'deposit',
  args: [amount, receiver],  // receiver is usually the same wallet
})

Shares are minted to receiver immediately. The share price reflects the accumulated yield at the time of the transaction.

Using mint instead of deposit

Standard ERC‑4626 semantics apply:

  • deposit(assets, receiver) — you specify the asset amount, the vault calculates and mints shares.

  • mint(shares, receiver) — you specify the share amount, the vault calculates and pulls assets.

Use deposit when you know the asset amount (most common). Use mint when you want a precise share count (rare).

Using permit (one transaction)

For underlying tokens that support EIP‑2612 (e.g. USDC), you can skip the separate approval and deposit in a single transaction:

depositWithPermit runs the permit and the deposit atomically — if the permit signature is invalid or expired but the wallet already has sufficient allowance, the deposit still succeeds; otherwise the transaction reverts.

New shares start earning immediately

Deposited assets sit in the vault until Tesseract's next management cycle picks them up and allocates them into positions. From your perspective, share price continues to accrue as before — you don't need to wait for allocation before shares start representing a yield-bearing position.


Continue to Instant Withdrawals for the withdrawal flow.

Last updated

Was this helpful?