{"id":26054850,"url":"https://github.com/morpho-org/morpho-blue-oracles","last_synced_at":"2025-04-06T23:16:11.376Z","repository":{"id":206215933,"uuid":"687551796","full_name":"morpho-org/morpho-blue-oracles","owner":"morpho-org","description":"Morpho Blue Oracles","archived":false,"fork":false,"pushed_at":"2025-01-14T09:55:38.000Z","size":1709,"stargazers_count":61,"open_issues_count":4,"forks_count":35,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-30T22:09:47.048Z","etag":null,"topics":["chainlink","decentralized","defi","lending","morpho","oracle"],"latest_commit_sha":null,"homepage":"https://morpho.org","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morpho-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/2023-11-14-morpho-blue-oracles-cantina-managed-review.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T15:31:48.000Z","updated_at":"2025-03-20T12:42:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"1653c739-8581-492f-8f02-eaec7822aadc","html_url":"https://github.com/morpho-org/morpho-blue-oracles","commit_stats":null,"previous_names":["morpho-org/morpho-blue-oracles"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-oracles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-oracles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-oracles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpho-org%2Fmorpho-blue-oracles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpho-org","download_url":"https://codeload.github.com/morpho-org/morpho-blue-oracles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563935,"owners_count":20958971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chainlink","decentralized","defi","lending","morpho","oracle"],"created_at":"2025-03-08T10:00:25.010Z","updated_at":"2025-04-06T23:16:11.349Z","avatar_url":"https://github.com/morpho-org.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morpho Blue Oracles\n\nMorpho Blue Oracles are contracts that can be used as oracles for markets on [Morpho Blue](https://github.com/morpho-org/morpho-blue).\nThe 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.\n\n## MorphoChainlinkOracleV2\n\nThe `MorphoChainlinkOracleV2` is an oracle that uses Chainlink-interface-compliant feeds to provide price data.\n\nThis oracle handles the following cases among others (let's say that our pair is A/B):\n\n- A/B is a feed (typically, stETH/ETH).\n- B/A is a feed (typically, ETH/USDC).\n- A/C and B/C are feeds (typically, stETH/ETH and USDC/ETH).\n- A/C, C/D and B/D are feeds (typically, WBTC/BTC, BTC/USD, USDC/USD).\n- A/D, and B/C, C/D are feeds (typically, USDC/USD, WBTC/BTC, BTC/USD).\n- A/C, C/D and B/E, E/D are feeds.\n- A/C and C/B are feeds (typically, WBTC/BTC and BTC/ETH).\n- A'/C and B/C are feeds, and there is an exchange rate between A and A'. (typically A=sDAI and A'=DAI).\n\n## Deploy an Oracle\n\nTo deploy a `MorphoChainlinkOracleV2` on Ethereum, it is highly recommended to use the factory `MorphoChainlinkOracleV2Factory`.\nTo do so, call the `createMorphoChainlinkOracleV2` function with the following parameters:\n\n- `baseVault`: The ERC4626 token vault for the base asset.\n- `baseVaultConversionSample`: A sample amount for converting base vault units.\n- `baseFeed1`, `baseFeed2`: Chainlink-interface-compliant data feeds for the base asset.\n- `baseTokenDecimals`: Decimal precision of the base asset.\n- `quoteVault`: The ERC4626 token vault for the quote asset.\n- `quoteVaultConversionSample`: A sample amount for converting quote vault units.\n- `quoteFeed1`, `quoteFeed2`: Chainlink-interface-compliant data feeds for the quote asset.\n- `quoteTokenDecimals`: Decimal precision of the quote asset.\n- `salt`: A unique identifier to create deterministic addresses for deployed oracles.\n\n**Warning:** If there is an ERC4626-compliant vault for `baseVault` or `quoteVault`, the `baseTokenDecimals` or `quoteTokenDecimals` are still the decimals of the underlying asset of the vault, and not the decimals of the Vault itself.\nE.g: for a MetaMorpho WETH vault, as `baseVault`, the `baseTokenDecimals` is 18 as WETH has 18 decimals.\n\n### Addresses\n\nThe address on Ethereum of this factory is [0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766](https://etherscan.io/address/0x3a7bb36ee3f3ee32a60e9f2b33c1e5f2e83ad766#code).\n\n### Examples\n\nBelow are the arguments to fill for the creation of the WETH/USDT oracle:\n\n```json\n\"baseVault\": \"0x0000000000000000000000000000000000000000\",\n\"baseVaultConversionSample\": 1,\n\"baseFeed1\": \"0x0000000000000000000000000000000000000000\",\n\"baseFeed2\": \"0x0000000000000000000000000000000000000000\",\n\"baseTokenDecimals\": 18,\n\"quoteVault\":\"0x0000000000000000000000000000000000000000\",\n\"quoteVaultConversionSample\": 1,\n\"quoteFeed1\": \"0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46\",\n\"quoteFeed2\": \"0x0000000000000000000000000000000000000000\",\n\"quoteTokenDecimals\": 6,\n\"salt\": \"\u003cuser-defined value used to make the address unique\u003e\",\n```\n\nand for the sDAI/USDC oracle:\n\n```json\n\"baseVault\": \"0x83F20F44975D03b1b09e64809B757c47f942BEeA\",\n\"baseVaultConversionSample\": 1000000000000000000,\n\"baseFeed1\": \"0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9\",\n\"baseFeed2\": \"0x0000000000000000000000000000000000000000\",\n\"baseTokenDecimals\": 18,\n\"quoteVault\": \"0x0000000000000000000000000000000000000000\",\n\"quoteVaultConversionSample\": 1,\n\"quoteFeed1\": \"0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6\",\n\"quoteFeed2\": \"0x0000000000000000000000000000000000000000\",\n\"quoteTokenDecimals\": 6,\n\"salt\": \"\u003cuser-defined value used to make the address unique\u003e\",\n```\n\nand for the wstETH/ETH oracle:\n\n```json\n\"baseVault\": \"0x0000000000000000000000000000000000000000\",\n\"baseVaultConversionSample\": 1,\n\"baseFeed1\": \"0x905b7dAbCD3Ce6B792D874e303D336424Cdb1421\",\n\"baseFeed2\": \"0x86392dC19c0b719886221c78AB11eb8Cf5c52812\",\n\"baseTokenDecimals\": 18,\n\"quoteVault\": \"0x0000000000000000000000000000000000000000\",\n\"quoteVaultConversionSample\": 1,\n\"quoteFeed1\": \"0x0000000000000000000000000000000000000000\",\n\"quoteFeed2\": \"0x0000000000000000000000000000000000000000\",\n\"quoteTokenDecimals\": 18,\n\"salt\": \"\u003cuser-defined value used to make the address unique\u003e\",\n```\n\n## WstETH/stETH Exchange Rate Adapter\n\nA specific implementation, the `WstEthStEthExchangeRateChainlinkAdapter`, provides the exchange rate between wstETH and stETH as a Chainlink-interface-compliant feed.\n\nThis adapter is deployed on the Ethereum Mainnet at the address [0x905b7dAbCD3Ce6B792D874e303D336424Cdb1421](https://etherscan.io/address/0x905b7dabcd3ce6b792d874e303d336424cdb1421#code).\n\n## Developers\n\n\u003e [!NOTE]\n\u003e `MorphoChainlinkOracleV2Factory` has been deployed on Ethereum and Base with the [metadata hash](https://docs.soliditylang.org/en/latest/metadata.html) included, which appear at two places in the bytecode as it is a factory.\n\nInstall dependencies: `forge install`\n\nIn a `.env` file, set `ETH_RPC_URL` to the URL of an Ethereum provider.\n\nRun test: `forge test`\n\n## Audits\n\nAll audits are stored in the [audits](./audits/)' folder.\n\n## License\n\nMorpho Blue Oracles are licensed under `GPL-2.0-or-later`, see [`LICENSE`](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-blue-oracles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpho-org%2Fmorpho-blue-oracles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpho-org%2Fmorpho-blue-oracles/lists"}