Skip to main content

getUnstakeAmountForBurn

Description:

Returns how much can be unstaked if you burn shares of osToken. You get the vault shares to send to the exit queue and their value in underlying tokens.

The result never breaks the vault's LTV limit, so the burn and the exit can go in one transaction. If the position is already above the limit, the result is lowered to fit.

Arguments:

NameTypeRequiredDescription
vaultAddressstringYesThe address of the vault
userAddressstringYesThe user address
sharesbigintYesThe amount of osToken to burn

Returns:

type Output = {
receivedAssets: bigint
exitQueueShares: bigint
}

Example:

const { exitQueueShares, receivedAssets } = await sdk.osToken.getUnstakeAmountForBurn({
userAddress: '0x...',
vaultAddress: '0x...',
shares: 1000000000000000000n,
})