getUnderlyingDecimals()
Returns the number of decimals used by the vault's underlying ERC20 token. Useful when formatting amounts or constructing BigInt inputs.
Parameters
- None
Returns
Promise<number>: decimals used by the underlying ERC20 (for example6for USDC,18for WETH).
Example
const decimals = await vault.getUnderlyingDecimals();
console.log("Underlying decimals:", decimals);
const oneUnit = BigInt(10) ** BigInt(decimals);
console.log("One unit in base:", oneUnit.toString());
Example response
18