Skip to main content

Migrate from 2.x to 3.x

Breaking changes

Removed methods:

  • sdk.vault.getScorePercentiles
  • sdk.osToken.getAvgRewardsPerSecond
  • sdk.vault.getSnapshots ( Use getVaultStats instead )
  • sdk.osToken.getConfig ( Use getVault instead to get the result in osTokenConfig field )

getHarvestParams

New output format:

type Output = {
canHarvest: boolean
params: {
reward: string
proof: Array<string>
rewardsRoot: string
unlockedMevReward: string
}
}
NameDescription
canHarvestDefines whether the vault can harvest new rewards
rewardThe vault reward used to submit state update proof
proofThe vault rewards root proof used to submit state update proof
rewardsRootThe vault rewards root
unlockedMevRewardThe vault unlocked MEV reward used to submit state update proof

getPosition

Removed minted fee field

type RemovedOutput = {
minted: {
fee: 'bigint'
}
}

getStakeBalance

Removed output field

type RemovedOutput = {
shares: 'bigint'
}

getUserRewards

Update output format:

type Output = Array<{
date: number
dailyRewards: number
dailyRewardsEur: number
dailyRewardsGbp: number
dailyRewardsUsd: number
}>

New arguments:

NameTypeTypeDescription
dateFromnumberYesTime to start in milliseconds
dateTonumberYesTime to end in milliseconds
userAddressstringYesThe user address
vaultAddressstringYesThe address of the vault

getExitQueuePositions

Changed output field

// Output changed type from bigint to string
`positions[number]['exitQueueIndex']`

operate

Removed input fields:

type RemovedInput = {
depositDataManager: string
depositDataRoot: string
}

Updates

getVault

New output field:

type AddedOutput = {
osTokenConfig: {
ltvPercent: string
thresholdPercent: string
}
queuedShares: string
maxBoostApy: number
isGenesis: boolean
}
NameDescription
osTokenConfigcontains the ltvPercent, which is the percentage used to calculate how much a user can mint in OsToken shares, and thresholdPercent, which is the liquidation threshold percentage used to calculate the health factor for the OsToken position
isGenesisThis vault is owned by stakewise
maxBoostApyThe vault average max boost APY
queuedSharesThe total number of queued shares

getExitQueuePositions

Added optional input field:

NameTypeRequired
isClaimedbooleanNo

New methods

Vault:

Boost:

Utils: