Skip to content
LogoLogo

earn.getWithdrawQuote

Gets the vault shares required for an exact asset output, including fees.

Usage

import { client } from './viem.config'
 
const shareAmount = await client.earn.getWithdrawQuote({
  assetAmount: 100_000_000n,
  vault: '0x0000000000000000000000000000000000000001',
})
100_500_000n

Return Value

bigint

The required vault share input in base units, rounded up.

Parameters

assetAmount

  • Type: bigint

Exact number of assets to receive, in base units.

vault

  • Type: Address

Vault address.

blockNumber (optional)

  • Type: bigint

Block number to read the state from.

blockOverrides (optional)

  • Type: BlockOverrides

Block overrides to apply to the state.

blockTag (optional)

  • Type: BlockTag

Block tag to read the state from.

stateOverride (optional)

  • Type: StateOverride

State override to apply.