Inherits: SpotOracle
The swETH spot oracle.
Creates a new SwEthSpotOracle
instance.
Parameters
_ltv
uint256
The loan to value ratio for swETH.
_reserveOracle
address
The associated reserve oracle.
_uniswapPool
address
swETH/Eth Uniswap pool address.
_secondsAgo
uint32
The TWAP period in seconds.
Gets the price of swETH in ETH.
Uniswap returns price in swETH per ETH. This needs to be inversed.
Returns
ethPerSwEth
uint256
price of swETH in ETH. [WAD]
Converts a sqrtPriceX96 to a price in WAD.
Parameters
sqrtPriceX96
uint256
Price in sqrtPriceX96.