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
Name | Type | Description |
---|---|---|
vaultVariables2_ | uint256 | vaultVariables2 read from storage for the vault (VaultResolver.getRateRaw) |
vaultRates_ | uint256 | rates read from storage for the vault (VaultResolver.getVaultVariables2Raw) |
liquiditySupplyExchangePricesAndConfig_ | uint256 | exchange prices and config packed uint256 read from storage for supply token |
liquidityBorrowExchangePricesAndConfig_ | uint256 | exchange prices and config packed uint256 read from storage for borrow token |
blockTimestamp_ | uint256 | simulated block.timestamp |
Return Values
Name | Type | Description |
---|---|---|
liqSupplyExPrice_ | uint256 | latest liquidity's supply token supply exchange price |
liqBorrowExPrice_ | uint256 | latest liquidity's borrow token borrow exchange price |
vaultSupplyExPrice_ | uint256 | latest vault's supply token exchange price |
vaultBorrowExPrice_ | uint256 | latest vault's borrow token exchange price |