Skip to main content

unlock

Description:

Unboost your boosted osToken

Arguments:

NameTypeRequiredDescription
percentnumberYesThe percent to unboost (100 at max)
userAddressstringYesThe user address
vaultAddressstringYesThe address of the vault where the osTokens boosted
leverageStrategyDataLeverageStrategyDataNoLeverage strategy data from sdk.boost.getLeverageStrategyData. If not provided, it will be fetched automatically during the transaction
type LeverageStrategyData = {
version: number
isRequired: boolean
}

Example:

const leverageStrategyData = await sdk.boost.getLeverageStrategyData({
userAddress: '0x...',
vaultAddress: '0x...',
})

const params = {
percent: 100,
userAddress: '0x...',
vaultAddress: '0x...',
leverageStrategyData,
}

// Send transaction
const hash = await sdk.boost.unlock(params)
// When you sign transactions on the backend (for custodians)
// `lockTxData` will always be returned, while `upgradeLeverageStrategyTxData` will be returned if the leverage strategy contract upgrade is required
const { lockTxData, upgradeLeverageStrategyTxData } = await sdk.boost.unlock.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.boost.unlock.estimateGas(params)