Skip to content

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 ​

NameTypeDescription
sharesuint256Exact number of shares to burn (18 decimals).
receiveraddressAddress that will receive the USDC.
owneraddressAddress whose shares will be burned.

Returns ​

NameTypeDescription
assetsuint256Amount of USDC sent to receiver, after the withdrawal fee.

Preconditions ​

  • withdrawalsPaused() must be false.
  • shares > 0 and <= balanceOf(owner).
  • receiver and owner must be non-zero addresses.
  • If owner != msg.sender, the caller needs allowance(owner, msg.sender) >= shares on 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 used

Example — 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).