SwEthSpotOracle
Inherits: SpotOracle
The swETH spot oracle.
State Variables
POOL
SECONDS_AGO
Functions
constructor
Creates a new SwEthSpotOracle
instance.
Parameters
Name | Type | Description |
---|---|---|
|
| The loan to value ratio for swETH. |
|
| The associated reserve oracle. |
|
| swETH/Eth Uniswap pool address. |
|
| 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 |
---|---|---|
|
| price of swETH in ETH. [WAD] |
_getPriceInWadFromSqrtPriceX96
Converts a sqrtPriceX96 to a price in WAD.
Parameters
Name | Type | Description |
---|---|---|
|
| Price in sqrtPriceX96. |