SwEthSpotOracle
Inherits: SpotOracle
The swETH spot oracle.
State Variables
POOL
SECONDS_AGO
Functions
constructor
Creates a new SwEthSpotOracle
instance.
Parameters
Name
Type
Description
_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.
getPrice
Gets the price of swETH in ETH.
Uniswap returns price in swETH per ETH. This needs to be inversed.
Returns
Name
Type
Description
ethPerSwEth
uint256
price of swETH in ETH. [WAD]
_getPriceInWadFromSqrtPriceX96
Converts a sqrtPriceX96 to a price in WAD.
Parameters
Name
Type
Description
sqrtPriceX96
uint256
Price in sqrtPriceX96.