diff --git a/builders/integrations/oracles/api3.md b/builders/integrations/oracles/api3.md index 4d32abbd8..9dfce781d 100644 --- a/builders/integrations/oracles/api3.md +++ b/builders/integrations/oracles/api3.md @@ -85,11 +85,11 @@ contract Requester is RrpRequesterV0 { } ``` -You can also try [deploying the example contract on Remix](https://remix.ethereum.org/#url=https://github.com/vanshwassan/RemixContracts/blob/master/contracts/Requester.sol&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js){target=_blank}. +You can also try [deploying the example contract on Remix](https://remix.ethereum.org/#url=https://github.com/api3-ecosystem/remix-contracts/blob/master/contracts/Requester.sol&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js){target=_blank}. ### Contract Addresses {: #contract-addresses } -The `_rrpAddress` is the main `airnodeRrpAddress`. The RRP Contracts have already been deployed on-chain. The [addresses for the `_rrpcAddress`](https://docs.api3.org/reference/airnode/latest/){target=_blank} on Moonbeam networks are as follows: +The `_rrpAddress` is the main `airnodeRrpAddress`. The RRP Contracts have already been deployed on-chain. The [addresses for the `_rrpcAddress`](https://docs.api3.org/reference/airnode/latest/){target=_blank} on Moonbeam networks are as follows: === "Moonbeam" @@ -141,12 +141,26 @@ Due to being composed of first-party data feeds, dAPIs offer security, transpare *To learn more about how dAPIs work, please refer to [API3's documentation*](https://docs.api3.org/explore/dapis/what-are-dapis.html){target=_blank}*. -### Access Self-Funded dAPIs {: #self-funded-dapis} +### Types of dAPIs {: #types-of-dapis } + +There are two types of dAPIs: [self-funded](https://docs.api3.org/reference/dapis/understand/self-funded.html){target=_blank} and [managed](https://docs.api3.org/reference/dapis/understand/managed.html){target=_blank}. Managed dAPIs are only available on MainNets, and self-funded dAPIs are available on both MainNets and TestNets. The process to read from a dAPI proxy remains the same for both self-funded and managed dAPIs. + +#### Self-funded dAPIs {: #self-funded-dapis } -Self-funded dAPIs offer developers the opportunity to experience data feeds with minimal up-front commitment, providing a low-risk option prior to using managed dAPIs +[Self-funded dAPIs](https://docs.api3.org/reference/dapis/understand/self-funded.html){target=_blank} are single-source data feeds that are funded by the users with their own funds. They offer developers the opportunity to experience data feeds with minimal up-front commitment, providing a low-risk option prior to using managed dAPIs. With self-funded dAPIs, you can fund the dAPI with your own funds. The amount of gas you supply will determine how long your dAPI will be available for use. If you run out of gas, you can fund the dAPI again to keep it available for use. +You can read more about [self-funded dAPIs on API3's documentation site](https://docs.api3.org/guides/dapis/subscribing-self-funded-dapis/){target=_blank}. + +#### Managed dAPIs {: #managed-dapis } + +[Managed dAPIs](https://docs.api3.org/reference/dapis/understand/managed.html) are sourced directly from multiple [first-party](https://docs.api3.org/explore/airnode/why-first-party-oracles.html){target=_blank} data providers running an Airnode and aggregated using Airnode's signed data using a median function. The gas costs and availability of managed dAPIs are managed by the [API3 DAO](https://docs.api3.org/explore/dao-members/){target=_blank}. + +You can read more about [managed dAPIs on API3's documentation site](https://docs.api3.org/reference/dapis/understand/managed.html){target=_blank}. + +### Access Self-Funded dAPIs {: #self-funded-dapis} + The process for accessing self-funded data feeds is as follows: 1. Explore the API3 Market and select a dAPI @@ -160,6 +174,10 @@ The process for accessing self-funded data feeds is as follows: The [API3 Market](https://market.api3.org/dapis){target=_blank} enables users to connect to a dAPI and access the associated data feed services. It provides a list of all of the dAPIs available across multiple chains including testnets. You can filter the list by chains and data providers. You can also search for a specific dAPI by name. You can click on a dAPI to land on the details page where you can find more information about the dAPI. +You can then decide if you want to use self-funded or managed dAPIs. + +![API3 Dapi Page](/images/builders/integrations/oracles/api3/api3-5.png) + #### Fund a Sponsor Wallet {: #fund-sponsor-wallet } Once you have selected your dAPI, you can activate it by using the [API3 Market](https://market.api3.org/){target=_blank} to send funds (DEV, MOVR, or GLMR) to the `sponsorWallet`. Make sure your: @@ -169,11 +187,11 @@ Once you have selected your dAPI, you can activate it by using the [API3 Market] To fund the dAPI, you need to click on the **Fund Gas** button. Depending upon if a proxy contract is already deployed, you will see a different UI. -![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-5.png) +![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-6.png) Use the gas estimator to select how much gas is needed by the dAPI. Click on **Send DEV** to send the entered amount to the sponsor wallet of the respective dAPI. -![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-6.png) +![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-7.png) Once the transaction is broadcasted & confirmed on the blockchain a transaction confirmation screen will appear. @@ -186,13 +204,33 @@ Smart contracts can interact and read values from contracts that are already dep If you are deploying a proxy contract during the funding process, clicking on the **Get proxy** button will initiate a transaction to your wallet that will deploy a proxy contract. -![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-7.png) +![API3 Remix deploy](/images/builders/integrations/oracles/api3/api3-8.png) Once the transaction is broadcasted & confirmed on the blockchain, the proxy contract address will be shown on the UI. -#### Read From a Self-Funded dAPI {: #read-dapis } +### Access Managed dAPIs {: #managed-dapis} + +If you are trying to access managed dAPIs, once you have selected your dAPI, you will then be presented with the option to choose from either **Managed** or **Self-funded**. Select **Managed dAPIs**. + +Managed dAPIs give you the option to configure the dAPI's [devation threshold](https://docs.api3.org/reference/dapis/understand/deviations.html){target=_blank} and [heartbeat](https://docs.api3.org/reference/dapis/understand/deviations.html#heartbeat){target=_blank}. For managed dAPIs, you will have the following options to choose from: + +| Deviation | Heartbeat | +| --------- | --------- | +| 0.25% | 2 minutes | +| 0.25% | 24 hours | +| 0.5% | 24 hours | +| 1% | 24 hours | + +!!! note + Not all dAPIs support all the configurations. It depends on the asset and chain. Check the [API3 Market](https://market.api3.org){target=_blank} for more information. + +After selecting the required deviation threshold and heartbeat, check the final price, and select **Add to Cart**. You can add more dAPIs on the same network to your cart. Once you are done, click on **Checkout**. Make sure you check the order details and the final price on the payment page. Once you are ready, connect your wallet and pay for the order. + +After placing the order, you will have to wait for the dAPI to get updated. It usually takes five business days for the dAPI team to update the dAPI for the requested configuration. Once the dAPI is updated, you can start using it in your dApp. + +#### Read From a dAPI {: #read-dapis } -Here's an example of a basic contract that reads from a self-funded dAPI: +Here's an example of a basic contract that reads from a dAPI: ```solidity // SPDX-License-Identifier: MIT @@ -228,9 +266,9 @@ The example contract contains two functions: - `setProxy()` - used to set the address of the dAPI Proxy Contract - `readDataFeed()` - a `view` function that returns the latest price of the set dAPI -[Try deploying it on Remix!](https://remix.ethereum.org/#url=https://gist.githubusercontent.com/vanshwassan/1ec4230956a78c73a00768180cba3649/raw/176b4a3781d55d6fb2d2ad380be0c26f412a7e3c/DapiReader.sol){target=_blank} +[Try deploying it on Remix!](https://remix.ethereum.org/#url=https://github.com/api3-ecosystem/remix-contracts/blob/master/contracts/DataFeedReader.sol&lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.18+commit.87f61d96.js){target=_blank} -You can read more about dAPIs on [API3's documentation site](https://docs.api3.org/guides/dapis/subscribing-self-funded-dapis/){target=_blank}. +You can read more about dAPIs on [API3's documentation site](https://docs.api3.org/guides/dapis/subscribing-managed-dapis/){target=_blank}. ## API3 QRNG {: #api3-qrng } @@ -310,7 +348,7 @@ contract RemixQrngExample is RrpRequesterV0 { The example contract contains these three functions: -- `setRequestParameters` - accepts and sets the following three request parameters: +- `setRequestParameters` - accepts and sets the following three request parameters: - `airnode` - address of an Airnode that will be called to retrieve QRNG data - `endpointIdUint256` - the endpoint ID of the Airnode - `sponsorWallet` - the address of the sponsor wallet @@ -320,7 +358,7 @@ The example contract contains these three functions: !!! note You can get the `airnode` address and `endpointIdUint256` from the [QRNG Providers](#qrng-providers) section below. -[Try deploying it on Remix!](https://remix.ethereum.org/#url=https://github.com/vanshwassan/RemixContracts/blob/master/contracts/QrngRequester.sol&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js){target=_blank} +[Try deploying it on Remix!](https://remix.ethereum.org/#url=https://github.com/api3-ecosystem/remix-contracts/blob/master/contracts/QrngRequesterUpdated.sol&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.9+commit.e5eed63a.js&lang=en){target=_blank} ### QRNG Airnode and Endpoint Providers {: #qrng-providers } @@ -363,5 +401,6 @@ Here are some additional developer resources: - [QRNG Docs](https://docs.api3.org/explore/qrng/){target=_blank} - [API3 DAO GitHub](https://github.com/api3dao/){target=_blank} - [API3 Medium](https://medium.com/api3){target=_blank} +- [API3 YouTube](https://www.youtube.com/API3DAO){target=_blank} ---8<-- 'text/disclaimers/third-party-content.md' \ No newline at end of file +--8<-- 'text/disclaimers/third-party-content.md' diff --git a/images/builders/integrations/oracles/api3/api3-5.png b/images/builders/integrations/oracles/api3/api3-5.png index 8f4942335..1e1ebab85 100644 Binary files a/images/builders/integrations/oracles/api3/api3-5.png and b/images/builders/integrations/oracles/api3/api3-5.png differ diff --git a/images/builders/integrations/oracles/api3/api3-6.png b/images/builders/integrations/oracles/api3/api3-6.png index 5360bc67a..8f4942335 100644 Binary files a/images/builders/integrations/oracles/api3/api3-6.png and b/images/builders/integrations/oracles/api3/api3-6.png differ diff --git a/images/builders/integrations/oracles/api3/api3-7.png b/images/builders/integrations/oracles/api3/api3-7.png index d6d08a7eb..5360bc67a 100644 Binary files a/images/builders/integrations/oracles/api3/api3-7.png and b/images/builders/integrations/oracles/api3/api3-7.png differ diff --git a/images/builders/integrations/oracles/api3/api3-8.png b/images/builders/integrations/oracles/api3/api3-8.png new file mode 100644 index 000000000..d6d08a7eb Binary files /dev/null and b/images/builders/integrations/oracles/api3/api3-8.png differ