Technical
August 11, 2021
min read

Build All The World’s Data Into Powerful dApps. The Chainlink Oracles Are Now Live On The Elrond Devnet.

We are excited to announce that Chainlink oracles have been deployed to the Elrond devnet. Developers can now explore supercharging their dApps with reliable off-chain data from one of the most powerful decentralized data providers.

The blockchain use case with the most significant importance in the current evolution of dApps is decentralized finance. Real-time price feeds are a mandatory component for keeping on-chain financial applications in sync with the global market movements. This makes oracles an essential prerequisite for a thriving DeFi environment.

The Maiar Exchange launch is about to kick start the economic advancement engines in the Elrond ecosystem. Its liquidity will fuel virtually all the DeFi products that will launch on our blockchain. DeFi apps connecting to our DEX AMM will require reliable price feeds from oracles.

This is why we are excited to have completed the integration of Chainlink oracles on the Elrond blockchain in a timely manner. After rigorous internal testing, it is now time for the Elrond partners and developer community to integrate external price feeds into their DeFi applications ahead of deploying them to the Elrond mainnet.

“The Elrond partners and devs are already hard at work using our devkit. With the deployment of Chainlink oracles on our devnet, they get a new and critical component required for deploying Elrond dApps with unlimited scope.” said Lucian Mincu, Elrond Network CIO.

Technical Details

Three different Chainlink price feed smart contracts have been deployed, one for each shard:

  • shard-0: erd1qqqqqqqqqqqqqpgqsj7m22r09nu8seqmdrcmn5f6038qqdq7707qvs0pe0
  • shard-1: erd1qqqqqqqqqqqqqpgqcwt9uwvhds6nm46vmg68p9899v8zsjyuu00s5u60yz
  • shard-2: erd1qqqqqqqqqqqqqpgqjrl8qg7n6f594zvg6hpvrmtmcrvee3yzcvpqx8z6zj

You can query either of the smart contract addresses above - select the one in the same shard as the sender wallet for the best response time - for the latest asset price by sending a transaction as follows:

To: (SC address mentioned above)
Gas limit: 50,000,000
Data: latestPriceFeed@(asset 1)@(asset 2)

Where you should replace (asset 1) and (asset 2) with the HEX encoding of the asset ticker. For example, if you want EGLD/USD you should use

latestPriceFeed@45474C44@555344

The following assets are available in this test version:

EGLD/USD, BTC/USD, AAVE/USD, LINK/USD, SOL/USD, SNX/USD

Here’s an example of a successful price request for EGLD/USD:

https://devnet-explorer.elrond.com/transactions/3d62e66a3e6840b5f7ee06b2eda8d6379ef3f706457552865cbb0ed29e128772

If you want to get all the price feeds for all the available assets, simply query the smart contracts with a similar transaction that has “latestRoundData” in the data field, without any arguments, like so:

https://devnet-explorer.elrond.com/transactions/0c3da0602ec64f952400134d8dd3e739accb8c71fba26ef18f7f98e45340780f

Price data is updated in rounds that take about 10 minutes to complete.

Dive into the Chainlink smart contracts, all the available endpoints, and other relevant information here:

https://github.com/ElrondNetwork/sc-chainlink-rs

Chainlink node runners, make sure to deploy the Elrond adapter and scripts to run your oracles by using these resources:

https://github.com/ElrondNetwork/sc-chainlink-rs/tree/master/elrond-adapter

Start building with Chainlink oracles on the Elrond devnet, contribute and tell us what you think in our dedicated Telegram community:

https://t.me/ElrondDevelopers

Author Profile Picture
Lucian Mincu
Co-founder & CIO

Lucian Mincu, co-founder and CIO of MultiversX, is a self-taught tech prodigy, previously engineer at Uhrenwerk 24, Cetto, and Liebl Systems. and co-founder & CTO of MetaChain Capital. His ability to navigate complex challenges and carve out solutions is nothing short of extraordinary, making him a driving force behind the success of MultiversX.

Published by
Author Profile Picture
Lucian Mincu
Co-founder & CIO
Published on
August 11, 2021
Share this article