Integration Details

There are 2 ways of reading Umbrella on-chain data feeds:

  1. Direct Access: reading the data directly from the Umbrella feeds smart contract. This method has lower gas requirements.
  2. Via Reader: For those projects who need to integrate but cannot change their smart contract, they can read the data from the Umbrella Feeds Reader smart contracts. The Umbrella Feeds Reader connects to the Umbrella feeds smart contract. This method is more costly in terms of gas a it has one additional step compared to the Direct Access.


Prices are stored under a key. key is constant, and it is the hash of the feed name (eg hash("UMB-USD") ).

Smart Contract hierarchy

Getting the address of the latest UmbrellaFeeds smart contract

Address of the lastest UmbrellaFeeds smart contract can be resolved by using the Umbrella Registry smart contract.


Addresses of the Umbrella Registry contracts for the different blockchains can be found in here.

Address can be resolved with the following method:


Direct access

It is recommended option as it is the most gas effective.

The UmbrellaFeedssmart contract is where all prices are submitted by the on-chain data feature of the Umbrella Oracle. Use getPriceData(key) method to get price data about a specific key.

Price data structure contains:

struct PriceData {  
    uint8 data; // not in use, reserved for future  
    uint24 heartbeat; // if price is flat, how often it will be updated  
    uint32 timestamp; // last update  
    uint128 price; // 8 decimals  

Via reader

There is the option to create dedicated contract reader which emulates interface of other leader oracles. As a first stage, we are implementing a contract with a Chainlink-like interface..

In order to instantiate a new Reader contract for a given data point:

  1. Go to UmbrellaFeedsReaderFactorysmart contract and use the deployed(key) method to check whether there is already a Reader contract for your key.
  2. if not, use the UmbrellaFeedsReaderFactory.deploy(key) method to create a new instance of the UmbrellaFeedsReader contract, dedicated for provided key.
    1. Use deployed(key) method to read address of deployed contract.
    2. In case contract code is not verified automatically, you can use (UmbrellaFeedsReader standard JSON)[./flattened/UmbrellaFeedsReader.stdandard.json] to verify its code.

UmbrellaFeedsReader provides few methods that you can use depending on the case:

  • latestRoundData(): it follows chainlink interface to easier migration process from Chainlink to Umbrella.



Only answer and updatedAtfield are in use.

  • getPriceData(): it returns PriceData.

Fallback mechanism

A Fallback mechanism has been included in the Feeds smart contract to ensure you will be able to read data even if there is a new version of the Feeds smart contract.

Like a Proxy

While proxy contracts are forced to read implementation address all the time, the fallback mechanism searches for a new address ONLY when it is needed, and only then, additional cost is added to the transaction.

Redeployments of contracts are very rare, so it is more effective to simply update contract address when needed than paying additional fee every time we read the price.