From 8300eec57b8243734a0a39bac3a47aa876619de2 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 9 Jan 2025 15:18:11 -0600 Subject: [PATCH 1/3] adding pyth as an oracle --- .../for-devs/oracles/oracles-content-map.mdx | 6 ++ arbitrum-docs/for-devs/oracles/pyth/pyth.mdx | 76 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 arbitrum-docs/for-devs/oracles/pyth/pyth.mdx diff --git a/arbitrum-docs/for-devs/oracles/oracles-content-map.mdx b/arbitrum-docs/for-devs/oracles/oracles-content-map.mdx index 9e9b8cf0d..df7a8799d 100644 --- a/arbitrum-docs/for-devs/oracles/oracles-content-map.mdx +++ b/arbitrum-docs/for-devs/oracles/oracles-content-map.mdx @@ -39,6 +39,12 @@ Learn how to run an Arbitrum node. href="/for-devs/oracles/ora/" target="_blank" /> + Date: Thu, 9 Jan 2025 15:22:40 -0600 Subject: [PATCH 2/3] small correction --- arbitrum-docs/for-devs/oracles/pyth/pyth.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx b/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx index a7bdfc7bf..bf9e662c8 100644 --- a/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx +++ b/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx @@ -17,6 +17,7 @@ The network comprises some of the world’s [largest exchanges, market makers, a The Pyth network introduces an innovative low-latency [pull oracle design](https://docs.pyth.network/price-feeds/pull-updates), where users can pull price updates on-chain when needed, enabling everyone in the blockchain environment to access that data point. Pyth network updates the prices every 400ms, making Pyth the fastest on-chain oracle. Here is a working example of a contract that fetches the latest price of ARB/USD on the Arbitrum network. + You have to pass Pyth's contract address for Arbitrum mainnet/testnet and the desired price feed ID to fetch the latest price. Install the Pyth SDK Solidity package in your project: @@ -52,7 +53,7 @@ contract MyFirstPythContract { } ``` -Here you can fetch the updateData from Pyth's [Hermes](https://hermes.pyth.network/docs/) feed, which listens to Pythnet and Wormhole for price updates; or you can use the [pyth-evm-js](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts#L15) SDK. Check [How to Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) to pull the latest data. +Here you can fetch the `updateData` from Pyth's [Hermes](https://hermes.pyth.network/docs/) feed, which listens to Pythnet and Wormhole for price updates; or you can use the [pyth-evm-js](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts#L15) SDK. Check [How to Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) to pull the latest data. ## Pyth Entropy @@ -65,7 +66,7 @@ Check [how to generate random numbers in EVM contracts](https://docs.pyth.networ - Arbitrum: [`0x7698E925FfC29655576D0b361D75Af579e20AdAc`](https://arbiscan.io/address/0x7698E925FfC29655576D0b361D75Af579e20AdAc) - Arbitrum Sepolia: [`0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440`](https://sepolia.arbiscan.io/address/0x549Ebba8036Ab746611B4fFA1423eb0A4Df61440) -## Additoinal resources +## Additional resources Check out the following links to get started with Pyth: From 7473be559fe8a63d3b4f5f85ec441ce4c17fa129 Mon Sep 17 00:00:00 2001 From: Pete Date: Fri, 10 Jan 2025 15:27:04 -0600 Subject: [PATCH 3/3] Update arbitrum-docs/for-devs/oracles/pyth/pyth.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gaël Blanchemain --- arbitrum-docs/for-devs/oracles/pyth/pyth.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx b/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx index bf9e662c8..6354b5f06 100644 --- a/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx +++ b/arbitrum-docs/for-devs/oracles/pyth/pyth.mdx @@ -26,7 +26,7 @@ Install the Pyth SDK Solidity package in your project: npm install @pythnetwork/pyth-sdk-solidity ``` -And then simply in 3 lines of code you can fetch the latest price on Arbitrum network. +And then, in a few lines of code you can fetch the latest price on the Arbitrum network. ```solidity // SPDX-License-Identifier: UNLICENSED