You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Morpho Blue Oracles are contracts that can be used as oracles for markets on [Morpho Blue](https://github.com/morpho-org/morpho-blue).
5
4
The oracles implement the `IOracle` interface defined in [`IOracle.sol`](https://github.com/morpho-org/morpho-blue/blob/main/src/interfaces/IOracle.sol#L9): they return the price of 1 asset of collateral token quoted in 1 asset of loan token.
6
5
7
-
## ChainlinkOracle
6
+
## MorphoChainlinkOracleV2
8
7
9
-
The `ChainlinkOracle` is an oracle that uses Chainlink-compliant feeds to provide price data.
8
+
The `MorphoChainlinkOracleV2` is an oracle that uses Chainlink-compliant feeds to provide price data.
10
9
11
10
This oracle handles the following cases among others (let's say that our pair is A/B):
11
+
12
12
- A/B is a feed (typically, stETH/ETH).
13
13
- B/A is a feed (typically, ETH/USDC).
14
14
- A/C and B/C are feeds (typically, stETH/ETH and USDC/ETH).
@@ -18,6 +18,34 @@ This oracle handles the following cases among others (let's say that our pair is
18
18
- A/C and C/B are feeds (typically, WBTC/BTC and BTC/ETH).
19
19
- A'/C and B/C are feeds, and there is an exchange rate between A and A'. (typically A=sDAI and A'=DAI).
20
20
21
+
## WstETH/stETH Exchange Rate Adapter
22
+
23
+
A specific implementation, the WstEthStEthExchangeRateChainlinkAdapter, provides the exchange rate between wstETH and stETH using Chainlink. This adapter is designed for precise, decentralized price feeds on Ethereum, ensuring compatibility with the MorphoChainlinkOracleV2 for markets involving these assets.
24
+
25
+
Deployed on Ethereum Mainnet, this adapter can be found in Ethereum Mainnet at the address [0x905b7dAbCD3Ce6B792D874e303D336424Cdb1421](https://etherscan.io/address/0x905b7dabcd3ce6b792d874e303d336424cdb1421#code). It's recommended for use as a reliable price feed source in Morpho oracles.
26
+
27
+
## MorphoChainlinkOracleV2Factory
28
+
29
+
The `MorphoChainlinkOracleV2Factory` is a factory that deploys `MorphoChainlinkOracleV2` instances.
30
+
31
+
The factory facilitates the easy creation and indexing of MorphoChainlinkOracleV2 oracles. Developed by Morpho Labs, this factory contract streamlines the process of deploying new oracles, catering to various market pairs without the need for deploying individual contracts manually for each pair.
32
+
33
+
### Usage
34
+
35
+
The Ethereum Mainnet address of this factory is [0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766](https://etherscan.io/address/0x3a7bb36ee3f3ee32a60e9f2b33c1e5f2e83ad766#code).
36
+
37
+
To create a new `MorphoChainlinkOracleV2` oracle using the factory, call the createMorphoChainlinkOracleV2 function with the following parameters:
38
+
39
+
-`baseVault`: The ERC4626 token vault for the base asset.
40
+
-`baseVaultConversionSample`: A sample size for converting base vault units.
41
+
-`baseFeed1`, `baseFeed2`: Chainlink-interface-compliant data feeds for the base asset.
42
+
-`baseTokenDecimals`: Decimal precision of the base asset.
43
+
-`quoteVault`: The ERC4626 token vault for the quote asset.
44
+
-`quoteVaultConversionSample`: A sample size for converting quote vault units.
45
+
-`quoteFeed1`, `quoteFeed2`: Chainlink-interface-compliant data feeds for the quote asset.
46
+
-`quoteTokenDecimals`: Decimal precision of the quote asset.
47
+
-`salt`: A unique identifier to create deterministic addresses for deployed oracles.
48
+
21
49
## Getting Started
22
50
23
51
Install dependencies: `forge install`
@@ -28,22 +56,54 @@ Run test: `forge test`
28
56
29
57
## Deploy an Oracle
30
58
31
-
For example, to deploy a `ChainlinkOracle` on the Ethereum mainnet for the sDAI/USDC market, run:
0 commit comments