previewRedeem ​
Quote the USDC you would receive for redeeming an exact share amount.
Signature ​
solidity
function previewRedeem(uint256 shares) external view returns (uint256 assets);Parameters ​
| Name | Type | Description |
|---|---|---|
shares | uint256 | Share amount in 18-decimal base units. |
Returns ​
| Name | Type | Description |
|---|---|---|
assets | uint256 | Estimated USDC out amount (6 decimals). |
Example ​
ts
import { parseUnits } from 'viem'
import { publicClient } from './client'
import { liteUsdVaultAbi } from './abi'
import { VAULT, SHARE_DECIMALS } from './constants'
const shares = parseUnits('100', SHARE_DECIMALS)
const assets = await publicClient.readContract({
address: VAULT,
abi: liteUsdVaultAbi,
functionName: 'previewRedeem',
args: [shares],
})
console.log('Estimated USDC out:', assets)
