deposit ​
Deposit a specified amount of USDC and mint vault shares to a receiver.
Signature ​
solidity
function deposit(uint256 assets, address receiver) external returns (uint256 shares);Parameters ​
| Name | Type | Description |
|---|---|---|
assets | uint256 | Amount of USDC to deposit, in 6-decimal base units. |
receiver | address | Address that will receive the minted vault shares. |
Returns ​
| Name | Type | Description |
|---|---|---|
shares | uint256 | Amount of shares minted (18 decimals). |
Preconditions ​
depositsPaused()must befalse— otherwise reverts.assets > 0— depositing zero reverts.receivermust be a non-zero address.- The caller must have approved at least
assetsUSDC to the vault (see Getting Started -> Approving USDC). - The caller must hold at least
assetsUSDC.
Events emitted ​
solidity
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Transfer(address indexed from, address indexed to, uint256 value); // share mint, from = 0x0Example — deposit 1,000 USDC ​
ts
import { parseUnits } from 'viem'
import { publicClient, walletClient } from './client'
import { liteUsdVaultAbi } from './abi'
import { VAULT, USDC_DECIMALS } from './constants'
const account = walletClient.account!
const assets = parseUnits('1000', USDC_DECIMALS)
// (Approve USDC first — see Getting Started.)
const { request, result: shares } = await publicClient.simulateContract({
account,
address: VAULT,
abi: liteUsdVaultAbi,
functionName: 'deposit',
args: [assets, account.address],
})
console.log('Will mint', shares, 'shares')
const hash = await walletClient.writeContract(request)
const receipt = await publicClient.waitForTransactionReceipt({ hash })
console.log('Deposited in tx', receipt.transactionHash)Notes ​
- If you want to know the share amount without simulating, call the read function
previewDeposit(assets). - To deposit on behalf of another wallet, set
receiverto that wallet's address. The shares are minted directly toreceiver; the caller still pays the USDC.

