redeem ​
Burn an exact number of vault shares from owner and send the resulting USDC to receiver.
Signature ​
solidity
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);Parameters ​
| Name | Type | Description |
|---|---|---|
shares | uint256 | Exact number of shares to burn (18 decimals). |
receiver | address | Address that will receive the USDC. |
owner | address | Address whose shares will be burned. |
Returns ​
| Name | Type | Description |
|---|---|---|
assets | uint256 | Amount of USDC sent to receiver, after the withdrawal fee. |
Preconditions ​
withdrawalsPaused()must befalse.shares > 0and<= balanceOf(owner).receiverandownermust be non-zero addresses.- If
owner != msg.sender, the caller needsallowance(owner, msg.sender) >= shareson the vault.
Events emitted ​
solidity
event Withdraw(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares);
event Transfer(address indexed from, address indexed to, uint256 value); // share burn
event Approval(address indexed owner, address indexed spender, uint256 value); // only if allowance was usedExample — fully exit a position ​
ts
import { erc20Abi } from 'viem'
import { publicClient, walletClient } from './client'
import { liteUsdVaultAbi } from './abi'
import { VAULT } from './constants'
const account = walletClient.account!
// Vault shares are an ERC-20 — read your balance with the standard ABI.
const balance = await publicClient.readContract({
address: VAULT,
abi: erc20Abi,
functionName: 'balanceOf',
args: [account.address],
})
const { request, result: usdcOut } = await publicClient.simulateContract({
account,
address: VAULT,
abi: liteUsdVaultAbi,
functionName: 'redeem',
args: [balance, account.address, account.address],
})
console.log('Will receive', usdcOut, 'USDC (raw, 6 decimals)')
const hash = await walletClient.writeContract(request)
await publicClient.waitForTransactionReceipt({ hash })The erc20Abi import comes from viem's bundled standard ABIs, so we don't need to extend the snippet.
When to use this vs withdraw ​
Use redeem when you want to exit a known share amount — most commonly a full or proportional exit. Use withdraw when you need a precise USDC amount out (e.g., paying back a fixed-USDC obligation).

