Skip to content

Commit

Permalink
Suggested improvements and corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
TucksonDev committed May 10, 2023
1 parent 03d9104 commit e6655b0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions arbitrum-docs/devs-how-tos/how-to-use-oracles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import PublicPreviewBannerPartial from '../partials/_public-preview-banner-parti

<PublicPreviewBannerPartial />

In this how-to, you’ll learn how to incorporate popular Oracle services into your Arbitrum dApps. Specifically, each section will provide step-by-step instructions on how to obtain current asset prices from oracles, helping you seamlessly integrate these services.
Oracles are web services that provide a connection between smart contracts and the outside world. They let decentralized apps (dApps) interact with off-chain data and services.

This guide assumes that you're familiar with the concept of [Oracles](../for-devs/concepts/oracles.mdx) and have a basic understanding of smart contracts and blockchain development. If you’re new to blockchain development, consider going through our [Quickstart: Build a dApp with Arbitrum (Solidity, Hardhat)](../for-devs/quickstart-solidity-hardhat) before proceeding.
Familiarity with [Oracles](../for-devs/concepts/oracles.mdx), smart contracts, and blockchain development is expected. If you’re new to blockchain development, consider reviewing our [Quickstart: Build a dApp with Arbitrum (Solidity, Hardhat)](../for-devs/quickstart-solidity-hardhat) before proceeding.

## Chainlink

[Chainlink](https://chain.link/) is a widely-recognized Web3 services platform that specializes in decentralized oracle networks. It allows developers to create versatile Web3 applications that can effortlessly connect to real-world data and off-chain computation on Arbitrum and many other blockchain networks. Chainlink offers a variety of data feeds, including asset prices, weather data, random number generation, and many more.
[Chainlink](https://chain.link/) is a widely-recognized Web3 services platform that specializes in decentralized oracle networks. It lets you build Ethereum and Arbitrum dApps that connect to a variety of off-chain data feeds and APIs, including those that provide asset prices, weather data, random number generation, and more.

### Querying the price of $ARB through Chainlink

Expand Down Expand Up @@ -73,23 +73,23 @@ You can adapt this contract to your needs. Just remember to use the address of t

### More examples

Refer to [Chainlink’s documentation](https://docs.chain.link/) for more examples for querying price feeds plus other data feeds available.
Refer to [Chainlink’s documentation](https://docs.chain.link/) for more examples of querying price feeds plus other data feeds available.

## API3

[API3](https://api3.org/) is a collaborative project to deliver traditional API services to smart contract platforms in a decentralized and trust-minimized way. API3 provides the technology for Airnodes to push off-chain data to on-chain contracts. This data can then be queried directly through the Airnode (initiating a “pull-type” request) or through dAPIs (datafeeds of up-to-date off-chain data).
[API3](https://api3.org/) is a collaborative project to deliver traditional API services to smart contract platforms in a decentralized and trust-minimized way. API3 provides the technology for Airnodes to push off-chain data to on-chain contracts. This data can then be queried directly through the Airnode (initiating a “pull-type” request) or through dAPIs (data feeds of up-to-date off-chain data).

### Querying the price of $ARB through API3

Here’s an example on how to use an API3 datafeed to query the current price of $ARB on-chain. The [API3 market](https://market.api3.org/) provides a list of all the dAPIs available across multiple chains including testnets. These dAPIs are self-funded so, before querying it, we must make sure they have enough funds to cover our test.
Here’s an example on how to use an API3 data feed to query the current price of $ARB on-chain. The [API3 market](https://market.api3.org/) provides a list of all the dAPIs available across multiple chains including testnets. These dAPIs are self-funded so, before querying it, we must make sure they have enough funds to cover our test.

API3 provides an npm package with the contracts needed to access their feeds. We first install that package in our project:

```bash
yarn add @api3/contracts
```

To use a datafeed, we retrieve the information through the specific proxy address for that feed. We’ll use the IProxy interface to do so.
To use a data feed, we retrieve the information through the specific proxy address for that feed. We’ll use the IProxy interface to do so.

```solidity
import "@api3/contracts/v0.8/interfaces/IProxy.sol";
Expand Down Expand Up @@ -127,7 +127,7 @@ You can adapt this contract to your needs. Just remember to use the address of t

### Querying a random number through API3

[API3 QRNG](https://docs.api3.org/explore/qrng/) is a public utility provided with the courtesy of [Australian National University (ANU)](https://www.anu.edu.au/). It is served as a public good and is free of charge (apart from the gas costs), and it provides quantum randomness when requiring RNG on-chain.
[API3 QRNG](https://docs.api3.org/explore/qrng/) is a public utility provided with the courtesy of [Australian National University (ANU)](https://www.anu.edu.au/). It is served as a public good, it is free of charge (apart from the gas costs), and it provides quantum randomness when requiring RNG on-chain.

To request randomness on-chain, the requester submits a request for a random number to `AirnodeRrpV0`. The ANU Airnode gathers the request from the `AirnodeRrpV0` protocol contract, retrieves the random number off-chain, and sends it back to `AirnodeRrpV0`. Once received, it performs a callback to the requester with the random number.

Expand Down Expand Up @@ -203,7 +203,7 @@ You can adapt this contract to your needs. Just remember to use the addresses of

### More examples

Refer to [API3’s documentation](https://docs.api3.org/) for more examples for querying other data feeds and Airnodes.
Refer to [API3’s documentation](https://docs.api3.org/) for more examples of querying other data feeds and Airnodes.

## Tellor

Expand Down Expand Up @@ -251,4 +251,4 @@ You can adapt this contract to your needs. Just remember to use the ticker of th

### More examples

Refer to [Tellor’s documentation](https://docs.tellor.io/) for more examples for querying price feeds plus other data feeds available.
Refer to [Tellor’s documentation](https://docs.tellor.io/) for more examples of querying price feeds plus other data feeds available.

0 comments on commit e6655b0

Please sign in to comment.