CalcsVaultSimulatedTime

this is the exact same code as in vault protocol codebase, just that it supports a simulated block.timestamp to expose historical calculations.

FluidCalcsVaultSimulatedTimeError

error FluidCalcsVaultSimulatedTimeError()

X16

uint256 X16

X64

uint256 X64

updateExchangePrices

function updateExchangePrices(uint256 vaultVariables2_, uint256 vaultRates_, uint256 liquiditySupplyExchangePricesAndConfig_, uint256 liquidityBorrowExchangePricesAndConfig_, uint256 blockTimestamp_) internal pure returns (uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_)

Calculates new vault exchange prices.

Parameters

NameTypeDescription
vaultVariables2_uint256vaultVariables2 read from storage for the vault (VaultResolver.getRateRaw)
vaultRates_uint256rates read from storage for the vault (VaultResolver.getVaultVariables2Raw)
liquiditySupplyExchangePricesAndConfig_uint256exchange prices and config packed uint256 read from storage for supply token
liquidityBorrowExchangePricesAndConfig_uint256exchange prices and config packed uint256 read from storage for borrow token
blockTimestamp_uint256simulated block.timestamp

Return Values

NameTypeDescription
liqSupplyExPrice_uint256latest liquidity's supply token supply exchange price
liqBorrowExPrice_uint256latest liquidity's borrow token borrow exchange price
vaultSupplyExPrice_uint256latest vault's supply token exchange price
vaultBorrowExPrice_uint256latest vault's borrow token exchange price