Coder Social home page Coder Social logo

morpho-blue-oracles's Introduction

Morpho Blue Oracles

Morpho Blue Oracles are contracts that can be used as oracles for markets on Morpho Blue. The oracles implement the IOracle interface defined in IOracle.sol: they return the price of 1 asset of collateral token quoted in 1 asset of loan token.

ChainlinkOracle

The ChainlinkOracle is an oracle that uses Chainlink-compliant feeds to provide price data.

This oracle handles the following cases among others (let's say that our pair is A/B):

  • A/B is a feed (typically, stETH/ETH).
  • B/A is a feed (typically, ETH/USDC).
  • A/C and B/C are feeds (typically, stETH/ETH and USDC/ETH).
  • A/C, C/D and B/D are feeds (typically, WBTC/BTC, BTC/USD, USDC/USD).
  • A/D, and B/C, C/D are feeds (typically, USDC/USD, WBTC/BTC, BTC/USD).
  • A/C, C/D and B/E, E/D are feeds.
  • A/C and C/B are feeds (typically, WBTC/BTC and BTC/ETH).
  • A'/C and B/C are feeds, and there is an exchange rate between A and A'. (typically A=sDAI and A'=DAI).

Getting Started

Install dependencies: forge install

In a .env file, set ETH_RPC_URL to the URL of an Ethereum provider.

Run test: forge test

Deploy an Oracle

For example, to deploy a ChainlinkOracle on the Ethereum mainnet, for the sDAI/USDC market:

forge create src/ChainlinkOracle.sol:ChainlinkOracle --constructor-args "0x83F20F44975D03b1b09e64809B757c47f942BEeA" "0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9" "0x0000000000000000000000000000000000000000" "0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6" "0x0000000000000000000000000000000000000000" "1000000000000000000" "18" "6" --rpc-url https://eth-mainnet.g.alchemy.com/v2/<alchemy-key> --from <deployer-address> --ledger

Audits

All audits are stored in the audits' folder.

License

Morpho Blue Oracles are licensed under GPL-2.0-or-later, see LICENSE.

morpho-blue-oracles's People

Contributors

merlinegalite avatar mathisgd avatar rubilmax avatar qgarchery avatar jean-grimal avatar msabvid avatar julien-devatom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.