Skip to main content

OsTokenUtils

Git Source ↗

Includes functionality for handling osToken redemptions

State Variables​

_wad​

uint256 private constant _wad = 1e18

_hfLiqThreshold​

uint256 private constant _hfLiqThreshold = 1e18

_maxPercent​

uint256 private constant _maxPercent = 1e18

_disabledLiqThreshold​

uint256 private constant _disabledLiqThreshold = type(uint64).max

Functions​

calculateReceivedAssets​

Calculates the amount of received assets during osToken redemption

function calculateReceivedAssets(
IOsTokenConfig osTokenConfig,
IOsTokenVaultController osTokenVaultController,
RedemptionData memory data
) external view returns (uint256 receivedAssets);

Parameters

NameTypeDescription
osTokenConfigIOsTokenConfigThe address of the osToken config contract
osTokenVaultControllerIOsTokenVaultControllerThe address of the osToken vault controller contract
dataRedemptionDataThe redemption data

Returns

NameTypeDescription
receivedAssetsuint256The amount of received assets

Structs​

RedemptionData​

Struct for storing redemption data

struct RedemptionData {
uint256 mintedAssets;
uint256 depositedAssets;
uint256 redeemedOsTokenShares;
uint256 availableAssets;
bool isLiquidation;
}

Properties

NameTypeDescription
mintedAssetsuint256The amount of minted assets
depositedAssetsuint256The amount of deposited assets
redeemedOsTokenSharesuint256The amount of redeemed osToken shares
availableAssetsuint256The amount of available assets
isLiquidationboolWhether the redemption is a liquidation