CalcsVaultSimulatedTime ​
this is the exact same code as in vault protocol codebase, just that it supports a simulated block.timestamp to expose historical calculations.
State Variables ​
X16 ​
solidity
uint256 internal constant X16 = 0xffff;
X64 ​
solidity
uint256 internal constant X64 = 0xffffffffffffffff;
Functions ​
updateExchangePrices ​
Calculates new vault exchange prices.
solidity
function updateExchangePrices(
uint256 vaultVariables2_,
uint256 vaultRates_,
uint256 liquiditySupplyExchangePricesAndConfig_,
uint256 liquidityBorrowExchangePricesAndConfig_,
uint256 blockTimestamp_
)
internal
pure
returns (
uint256 liqSupplyExPrice_,
uint256 liqBorrowExPrice_,
uint256 vaultSupplyExPrice_,
uint256 vaultBorrowExPrice_
);
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 |
Returns
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 |
Errors ​
FluidCalcsVaultSimulatedTimeError ​
solidity
error FluidCalcsVaultSimulatedTimeError();