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:
Name | Type | Required | Info |
---|---|---|---|
vaultAddress | string | Yes | The address of the vault |
ltvPercent | bigint | Yes | sdk.vault.getVault |
mintedAssets | bigint | Yes | sdk.osToken.getPosition |
stakedAssets | bigint | Yes | sdk.vault.getStakeBalance |
Returns:
type Output = bigint
Example:
await sdk.vault.getMaxWithdraw({
ltvPercent: 0n,
mintedAssets: 0n,
stakedAssets: 0n,
vaultAddress: '0x...',
})