Skip to main content

getMaxWithdraw

Description:

How much a user can withdraw. Use this method if the user has mintedAssets, if minted balance is null then maxWithdraw will be equal to stakedAssests.

Arguments:

NameTypeRequiredInfo
vaultAddressstringYesThe address of the vault
ltvPercentbigintYessdk.vault.getVault
mintedAssetsbigintYessdk.osToken.getPosition
stakedAssetsbigintYessdk.vault.getStakeBalance

Returns:

type Output = bigint

Example:

await sdk.vault.getMaxWithdraw({
ltvPercent: 0n,
mintedAssets: 0n,
stakedAssets: 0n,
vaultAddress: '0x...',
})