1. Empiric Oracle Quickstart

Empiric’s Oracle provides data feeds: it tells you the price of crypto (ETH, BTC, etc) in terms of fiat (USD, EUR, etc) at a certain time, for example, ETH is $1,600 on November 1st at 2pm . However what makes Empiric compelling is that it does not use 1 source for its data feed. The data feed is aggregated over multiple sources: GEMINI, BITSTAMP, CEX, etc. You can find the current price (AKA the spot price) or historical prices.

In order to consume data in your smart contract, simply grab the oracle interface and address from the snippet below and get going!

You can find the list of supported assets here, the example below is for the ETH/USD feed.

The Empiric Network Oracle is deployed on both Polygon and Optimism testnets. Both are identical, so you can choose which testnet you prefer. Addresses are:

Network Address Block Explorer Link
Polygon Testnet Mumbai 0x8bB539897994476bc99f4F33C267AAEE4cf4325B https://goerli-optimism.etherscan.io/address/0x8bB539897994476bc99f4F33C267AAEE4cf4325B#readProxyContract
Optimism Goerli Testnet 0x8bB539897994476bc99f4F33C267AAEE4cf4325B https://goerli-optimism.etherscan.io/address/0x8bB539897994476bc99f4F33C267AAEE4cf4325B#readProxyContract

Steps

  1. Copy the code snippet below and replace line 22 (// Your smart contract logic!) with your code that makes use of the data feed.
  2. Compile and deploy the contract on Polygon or Optimism.

2. Technical Specification

Function: getSpot

Function: getSpotEntries

3. Any Questions?

Feel free to talk to us (Sara “the Comp Feed Queen”, Estragon “the Dragon”, Rob “the Irishman”). We are friendly people! If you need any help with the Empiric Oracle smart contract or need any Goerli Eth (MATIC for Polygon or Optimism Eth), feel free to talk to us.

Overall, we suggest you to interact with the smart contract first through the block explorer (shown 2 sections below) where you can click instead of code. Feel free to ask us questions.