Skip to content

Commit

Permalink
fix: market UI updates and guides (#748)
Browse files Browse the repository at this point in the history
* fix: market updates and guides

* fix: qrng providers

---------

Co-authored-by: vanshwassan <vanshwassan@users.noreply.github.com>
  • Loading branch information
vanshwassan and vanshwassan authored Jun 7, 2024
1 parent 3ad4f9f commit d2d23e5
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 82 deletions.
36 changes: 21 additions & 15 deletions docs/guides/airnode/calling-an-airnode/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ requests data from an Airnode, via the

::: warning Check your Network!

Make sure you're on a Testnet before trying to deploy the contracts on-chain!
Make sure you're on a Ethereum Sepolia testnet before trying to deploy the
contracts on-chain!

:::

Expand All @@ -44,6 +45,9 @@ Given below is an example of a basic
data from any Airnode. To follow along, you can open the following contract in
Remix and try deploying your own Requester Contract.

In this example, you will be calling the Coingecko Airnode to request the latest
price of an asset on Ethereum Sepolia.

[Open in Remix](https://remix.ethereum.org/#url=https://github.com/api3-ecosystem/remix-contracts/blob/master/contracts/RequesterWithWithdrawal.sol&lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js)

```solidity
Expand Down Expand Up @@ -199,15 +203,16 @@ It calls the `requestWithdrawal` function of the `airnodeRrp` contract.
:::warning Set up your Testnet Metamask Account!

Make sure you've already configured your Metamask wallet and funded it with some
testnet ETH before moving forward. You can request some from
[here](https://faucet.paradigm.xyz/)
testnet Sepolia ETH before moving forward. You can request some from
[here](https://www.alchemy.com/faucets/ethereum-sepolia)

:::

You now need to deploy the Requester Contract and call it through Remix. It will
be calling the Coingecko Airnode to request the latest price of Ethereum.
be calling the Coingecko Airnode to request the latest price of Bitcoin on
Ethereum Sepolia testnet.

### Compile and Deploy the Requester Contract on Goerli Testnet
### Compile and Deploy the Requester Contract on Sepolia Testnet

- [Click here](https://remix.ethereum.org/#url=https://github.com/api3-ecosystem/remix-contracts/blob/master/contracts/RequesterWithWithdrawal.sol&lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js)
to open the Requester Contract in Remix.
Expand All @@ -221,7 +226,7 @@ be calling the Coingecko Airnode to request the latest price of Ethereum.
- Head to Deploy and run Transactions and select Injected Provider — MetaMask
option under Environment. Connect your MetaMask. Make sure you’re on the
Goerli Testnet.
Sepolia Testnet.

- The `_rrpAddress` is the main `airnodeRrpAddress`. The RRP Contracts have
already been deployed on-chain. You can check for your specific chain
Expand All @@ -237,23 +242,24 @@ needs to be derived from the requester's contract address, the Airnode address,
and the Airnode xpub. The wallet is used to pay gas costs of the transactions.
The sponsor wallet must be derived using the command
[derive-sponsor-wallet-address](/reference/airnode/latest/developers/requesters-sponsors.md#how-to-derive-a-sponsor-wallet)
from the Admin CLI. Use the value of the sponsor wallet address that the command
outputs while making the request. **This wallet needs to be funded.**
from the [Admin CLI](/reference/airnode/latest/packages/admin-cli). Use the
value of the sponsor wallet address that the command outputs while making the
request. **This wallet needs to be funded.**

::: details Coingecko's Airnode Details
::: details Coingecko's Airnode Details on Sepolia Testnet

```
Coingecko's Airnode Address = 0x478f9e54E5B2ee1D0A05cae1FaA3591CAA1b7091
Coingecko's Airnode XPUB = xpub6CnJr6BxgEpTBs9Aso71S5EkcRsR4MHzzKGTRA8aoyYhyvqgcacZFnx6a6quX47Vo97oACohk2isNAz68jnmDqrxQ9C1dKWMZtDN6tyVHaG
Coingecko's Endpoint ID (`/simple/price`) = 0xfb87102cdabadf905321521ba0b3cbf74ad09c5d400ac2eccdbef8d6143e78c4
Coingecko's Airnode Address = 0x5231b5b98A43F2E25806193dE21e200a1468093f
Coingecko's Airnode XPUB = xpub6Ce9SBpTarEP5BZV5qH8ZfQjLmwfJT2SZQMKAtkV2F3cj1zXB8pUzpDa3RpDuT2xHAwQ2v7vtkPeMargby67NVNCtEBzRNvdAi4Z5yaHhUC
Coingecko's Endpoint ID (`/simple/price`) = 0x5dbf4e8c53ad4ffdec277ec4df847e6272597fd851f147c93208e0cff99df72d
```

:::

```sh
npx @api3/airnode-admin derive-sponsor-wallet-address \
--airnode-xpub xpub6CnJr6BxgEpTBs9Aso71S5EkcRsR4MHzzKGTRA8aoyYhyvqgcacZFnx6a6quX47Vo97oACohk2isNAz68jnmDqrxQ9C1dKWMZtDN6tyVHaG \
--airnode-address 0x478f9e54E5B2ee1D0A05cae1FaA3591CAA1b7091 \
--airnode-xpub xpub6Ce9SBpTarEP5BZV5qH8ZfQjLmwfJT2SZQMKAtkV2F3cj1zXB8pUzpDa3RpDuT2xHAwQ2v7vtkPeMargby67NVNCtEBzRNvdAi4Z5yaHhUC \
--airnode-address 0x5231b5b98A43F2E25806193dE21e200a1468093f \
--sponsor-address <Use the address of your Deployed Requester>

Sponsor wallet address: 0x6394...5906757
Expand Down Expand Up @@ -314,7 +320,7 @@ click on Transact.

> ![Making the Request](src/s5.png)
Head over to [Goerli Testnet Explorer](https://goerli.etherscan.io/) and check
Head over to [Sepolia Testnet Explorer](https://sepolia.etherscan.io/) and check
your `sponsorWallet` for any new transactions.

> ![Making the Request](src/s6.png)
Expand Down
Binary file modified docs/guides/airnode/calling-an-airnode/src/s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/airnode/calling-an-airnode/src/s8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guides/assets/images/dapi-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/assets/images/dapi-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/assets/images/dapi-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/guides/assets/images/dapi-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guides/assets/images/dapi-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guides/assets/images/dapi-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/guides/dapis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ grouped by asset type(s) of supplied data:

Each dAPI has a [proxy contract](/reference/dapis/understand/proxy-contracts)
that is used to read the value of the dAPI. The proxy contract is linked to a
mapping that maps to a `beaconId` or `beaconSetId` and an OEV beneficiary
address. The `beaconId` for each dAPI gets updated when the price hits the set
mapping that maps to a `beaconId` or `beaconSetId`. The `beaconId` for each dAPI
gets updated when the price hits the set
[deviation threshold](/reference/dapis/understand/deviations.md)/[heartbeat](/reference/dapis/understand/deviations.md#heartbeat)
.

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/dapis/read-a-dapi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:

This guide requires a proxy contract address for a particular dAPI you are
interested in. You can find them in the [API3 Market](https://market.api3.org)
website. If a proxy contract has not been created for a particular dAPI use the
website. If a proxy contract has not been created for a particular dAPI, use the
API3 Market UI to do so, see the guide
[Subscribing to dAPIs](/guides/dapis/subscribing-to-dapis/).

Expand Down
45 changes: 13 additions & 32 deletions docs/guides/dapis/subscribing-to-dapis/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ seamlessly access dAPI services. This end-to-end process consists of:
<br/>
- [Activating your dAPI](/guides/dapis/subscribing-to-dapis/#activating-your-dapi)
<br/>
- [Setting up OEV and getting the proxy address](/guides/dapis/subscribing-to-dapis/#setting-up-oev-and-getting-the-proxy-address)
- [Getting the proxy address](/guides/dapis/subscribing-to-dapis/#getting-the-proxy-address)
<br/>

<img src="../../assets/images/dapi-1.png" style="width:100%"/>

## Exploring, selecting and configuring your dAPI

The [API3 Market](https://market.api3.org/) provides a list of all the dAPIs
Expand Down Expand Up @@ -74,7 +76,7 @@ more if you are unsure what suits your dApp_

If a dAPI is already activated, make sure to check the expiration date and
update parameters. You can update the parameters and extend the subscription by
purchasing a new configuration.
purchasing a new configuration or read the dAPI directly by using the proxy.

:::

Expand All @@ -90,43 +92,22 @@ Once the transaction is confirmed, you will be presented with a confirmation
page for the order. You can now go back and check the updated configuration for
the dAPI.

## Setting up OEV and getting the proxy address
<img src="../../assets/images/dapi-8.png" style="width:60%"/>

## Getting the Proxy Address

Once you are done configuring and activating the dAPI, you can now integrate it.
To do so, click on the **Integrate** button on the dAPI details page.

<img src="../../assets/images/dapi-5.png" style="width:100%"/>

To read from the dAPI, you will need the proxy contract address. Select **Get
Proxy Address** to get the proxy contract address.

<img src="../../assets/images/dapi-6.png" style="width:100%"/>

Before you can start reading from the dAPI, you will need to set your **OEV
beneficiary address**. This is the address that will receive the OEV proceeds
through the OEV Network.

::: info Note

The OEV beneficiary address must be an EOA or a smart contract address that can
call the `Api3ServerV1` contract to withdraw funds to itself.
<img src="../../assets/images/dapi-9.png" style="width:100%"/>

<!-- Click here to read more about the [OEV beneficiary](). -->

:::
To read from the dAPI, you will need the
[proxy contract](/reference/dapis/understand/proxy-contracts) address. Copy the
displayed proxy address.

Once you have entered a valid address, click on **Deploy Proxy**. Confirm the
transaction in your wallet.

<img src="../../assets/images/dapi-7.png" style="width:100%"/>

You can now see the deployed proxy contract address. You can now use this to
read from the configured dAPI.
<img src="../../assets/images/dapi-5.png" style="width:100%"/>

In order for OEV Searchers to be able to find your dApp and participate in the
OEV auctions, you must register your dApp and all the proxies with
[API3 Ecosystem](https://ecosystem.api3.org/). To do this, click on **Register
Proxy** and fill out all the details about your dApp.
You can now use this to read from the configured dAPI.

To get started with using dAPIs, you can follow the
[Reading a dAPI Proxy guide](/guides/dapis/read-a-dapi/).
Expand Down
12 changes: 7 additions & 5 deletions docs/guides/qrng/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@ directly operated by the QRNG API providers. You can read more about QRNG

## How many providers are there for QRNG?

Currently, there are 3 providers for QRNG:
Currently, there are 4 providers for QRNG:

- [Australian National University](https://quantumnumbers.anu.edu.au/)
- [Quintessence Labs](https://www.quintessencelabs.com/)
- [Nodary (Testnet)](https://nodary.io/)
- [Quantum Blockchains Random Numbers](https://www.quantumblockchains.io)
- [Testnet Random Numbers](/reference/qrng/providers.html#testnet-random-numbers)

[Click here to view the list of providers](/reference/qrng/providers.md).

Both ANU and Quintessence Labs are running Airnodes in production serving 20+
chains. Nodary is a testnet provider. It emulates QRNG using pseudorandom
numbers on testnets chains.
ANU, Quintessence Labs and Quantum Blockchains are running Airnodes in
production serving 20+ chains. Testnet Random Numbers emulates QRNG using
[pseudorandom numbers](https://www.mathworks.com/help/stats/generating-random-data.html)
on testnets.

[Click here to view the list of chains where QRNG is available](/reference/qrng/chains.md).

Expand Down
11 changes: 7 additions & 4 deletions docs/reference/dapis/understand/deviations.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ the heartbeat) the dAPI value is forcibly updated. For example:

## Testnet dAPIs

Testnet dAPIs are only available on the API3 Market with a deviation threshold
of 1% and a [heartbeat](/reference/dapis/understand/deviations.md#heartbeat) of
24 hours.
Testnet dAPIs are available on the API3 Market with multiple deviation
thresholds and [heartbeat](/reference/dapis/understand/deviations.md#heartbeat)
settings.

| Deviation | Heartbeat |
| --------- | --------- |
| 0.25% | 24 hours |
| 0.5% | 24 hours |
| 1% | 24 hours |
| 5% | 24 hours |

## Mainnet dAPIs

Mainnet dAPIs will be available on the API3 Market with multiple deviation
Mainnet dAPIs are available on the API3 Market with multiple deviation
thresholds and [heartbeat](/reference/dapis/understand/deviations.md#heartbeat)
settings.

Expand Down
62 changes: 39 additions & 23 deletions docs/reference/dapis/understand/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,41 @@ team to ensure the highest quality data availability for the listed dAPIs.
dAPIs are available on both major EVM-compatible testnets and mainnets. The
chains that are currently supported are listed below:

| Mainnet | Testnet |
| --------------- | ----------------------------- |
| Arbitrum One | Arbitrum Sepolia Testnet |
| Avalanche | Avalanche Testnet |
| Base | Base Sepolia Testnet |
| Blast | Blast Sepolia Testnet |
| BNB Smart Chain | BNB Smart Chain Testnet |
| Ethereum | Ethereum Sepolia Testnet |
| Fantom | Fantom Testnet |
| Gnosis Chain | Gnosis Chain Testnet |
| Kava | Kava Testnet |
| Linea | Linea Sepolia Testnet |
| Mantle | |
| Moonbeam | Moonbeam Testnet |
| Moonriver | |
| Optimism | Optimism Sepolia Testnet |
| Polygon zkEVM | Polygon zkEVM Sepolia Testnet |
| Polygon | |
| Mainnet | Testnet |
| ---------------- | ----------------------------- |
| Arbitrum One | Arbitrum Sepolia Testnet |
| Astar zkEVM | Astar zkEVM Sepolia Testnet |
| Avalanche | Avalanche Testnet |
| Base | Base Sepolia Testnet |
| Blast | Blast Sepolia Testnet |
| Bob | Bob Sepolia Testnet |
| BNB Smart Chain | BNB Smart Chain Testnet |
| BSquared Network | BSquared Network Testnet |
| Core | Core Testnet |
| Ethereum | Ethereum Sepolia Testnet |
| Fantom | Fantom Testnet |
| Fraxtal | Fraxtal Holesky Testnet |
| Gnosis Chain | Gnosis Chain Testnet |
| inEVM | inEVM Testnet |
| Kava | Kava Testnet |
| Kroma | Kroma Sepolia Testnet |
| LightLink | LightLink Sepolia Testnet |
| Linea | Linea Sepolia Testnet |
| Lukso | Lukso Testnet |
| Mantle | |
| Merlin | Merlin Testnet |
| Metis | Metis Sepolia Testnet |
| Mode | Mode Sepolia Testnet |
| Moonbeam | Moonbeam Testnet |
| Moonriver | |
| opBNB | opBNB Testnet |
| Optimism | Optimism Sepolia Testnet |
| Polygon zkEVM | Polygon zkEVM Sepolia Testnet |
| Polygon | |
| RARI Chain | |
| Sei | Sei Testnet |
| Taiko | Taiko Holesky Testnet |
| X Layer | X Layer Sepolia Testnet |

Head over to the [API3 Market](https://market.api3.org/) to see the list of all
available dAPIs and their chains.
Expand All @@ -130,15 +147,14 @@ the mapping for the dAPI will be updated to point to the particular

::: info Note

If you have already deployed your proxy contract to read from the dAPI, it will
remain the same. Purchasing a better configuration will not change your proxy
contract address for the dAPI.
Purchasing a better configuration will not change the proxy contract address for
the dAPI.

:::

With dAPIs, dApps can have an option to configure the deviation threshold and
heartbeat. For mainnet feeds, dApps have the following options to choose from
based on the chain and dAPI:
heartbeat. For both mainnet and testnet feeds, dApps have the following options
to choose from based on the chain and dAPI:

| Deviation | Heartbeat |
| --------- | --------- |
Expand Down

0 comments on commit d2d23e5

Please sign in to comment.