浏览代码

chore(dev-hub) Price Feeds Core Migration part 2

Aditya Arora 2 周之前
父节点
当前提交
9f38d1d13e
共有 57 个文件被更改,包括 967 次插入16 次删除
  1. 7 0
      apps/developer-hub/content/docs/price-feeds/core/api-instances-and-providers/meta.json
  2. 6 0
      apps/developer-hub/content/docs/price-feeds/core/api-reference/meta.json
  3. 12 12
      apps/developer-hub/content/docs/price-feeds/core/contract-addresses/meta.json
  4. 5 3
      apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/evm/meta.json
  5. 1 1
      apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/evm/part-1.mdx
  6. 5 0
      apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/meta.json
  7. 7 0
      apps/developer-hub/content/docs/price-feeds/core/error-codes.mdx
  8. 28 0
      apps/developer-hub/content/docs/price-feeds/core/error-codes/evm.mdx
  9. 7 0
      apps/developer-hub/content/docs/price-feeds/core/error-codes/index.mdx
  10. 3 0
      apps/developer-hub/content/docs/price-feeds/core/error-codes/meta.json
  11. 45 0
      apps/developer-hub/content/docs/price-feeds/core/fetch-price-updates.mdx
  12. 33 0
      apps/developer-hub/content/docs/price-feeds/core/getting-started.mdx
  13. 30 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/cross-chain.mdx
  14. 47 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/ema-price-aggregation.mdx
  15. 17 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/fees.mdx
  16. 36 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/hermes.mdx
  17. 21 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/index.mdx
  18. 11 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/meta.json
  19. 20 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/oracle-program.mdx
  20. 66 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/price-aggregation.mdx
  21. 23 0
      apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/pythnet.mdx
  22. 27 0
      apps/developer-hub/content/docs/price-feeds/core/index.mdx
  23. 26 0
      apps/developer-hub/content/docs/price-feeds/core/market-hours.mdx
  24. 35 0
      apps/developer-hub/content/docs/price-feeds/core/meta.json
  25. 9 0
      apps/developer-hub/content/docs/price-feeds/core/migrate-an-app-to-pyth/index.mdx
  26. 3 0
      apps/developer-hub/content/docs/price-feeds/core/migrate-an-app-to-pyth/meta.json
  27. 24 0
      apps/developer-hub/content/docs/price-feeds/core/price-feeds/asset-classes.mdx
  28. 39 0
      apps/developer-hub/content/docs/price-feeds/core/price-feeds/index.mdx
  29. 6 0
      apps/developer-hub/content/docs/price-feeds/core/price-feeds/meta.json
  30. 8 0
      apps/developer-hub/content/docs/price-feeds/core/publish-data/meta.json
  31. 10 0
      apps/developer-hub/content/docs/price-feeds/core/push-feeds/meta.json
  32. 7 0
      apps/developer-hub/content/docs/price-feeds/core/pythnet-reference/meta.json
  33. 7 0
      apps/developer-hub/content/docs/price-feeds/core/schedule-price-updates/meta.json
  34. 6 0
      apps/developer-hub/content/docs/price-feeds/core/troubleshoot/meta.json
  35. 60 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/index.mdx
  36. 5 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/meta.json
  37. 83 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/aptos.mdx
  38. 30 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx
  39. 137 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/evm.mdx
  40. 15 0
      apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/meta.json
  41. 二进制
      apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png
  42. 二进制
      apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png
  43. 二进制
      apps/developer-hub/public/images/EMA_Price_Aggregation_1.png
  44. 二进制
      apps/developer-hub/public/images/EMA_Price_Aggregation_2.png
  45. 二进制
      apps/developer-hub/public/images/Price_Aggregation_1.png
  46. 二进制
      apps/developer-hub/public/images/Price_Aggregation_2.png
  47. 二进制
      apps/developer-hub/public/images/Price_Aggregation_3.png
  48. 二进制
      apps/developer-hub/public/images/Price_Aggregation_4.png
  49. 二进制
      apps/developer-hub/public/images/Price_Aggregation_5.png
  50. 二进制
      apps/developer-hub/public/images/Price_Aggregation_6.png
  51. 二进制
      apps/developer-hub/public/images/Price_Aggregation_7.png
  52. 二进制
      apps/developer-hub/public/images/Pull-Architecture-Hermes.png
  53. 二进制
      apps/developer-hub/public/images/guides/gelato/dedicated-msg-sender.png
  54. 二进制
      apps/developer-hub/public/images/guides/gelato/deposit-usdc.png
  55. 二进制
      apps/developer-hub/public/images/guides/gelato/storage-pyth-config.png
  56. 二进制
      apps/developer-hub/public/images/guides/gelato/task-creation-gist-id.png
  57. 二进制
      apps/developer-hub/public/images/guides/gelato/task-execution.png

+ 7 - 0
apps/developer-hub/content/docs/price-feeds/core/api-instances-and-providers/meta.json

@@ -0,0 +1,7 @@
+{
+  "pages": [
+    "[Hermes](./hermes)",
+    "[Benchmarks / Historical Prices](./benchmarks)",
+    "[Pythnet RPC](./pythnet-rpc)"
+  ]
+}

+ 6 - 0
apps/developer-hub/content/docs/price-feeds/core/api-reference/meta.json

@@ -0,0 +1,6 @@
+{
+  "pages": [
+    "[EVM \u2197](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)",
+    "[Hermes \u2197](https://hermes.pyth.network/docs/)"
+  ]
+}

+ 12 - 12
apps/developer-hub/content/docs/price-feeds/core/contract-addresses/meta.json

@@ -1,16 +1,16 @@
 {
   "pages": [
-    "[EVM](./contract-addresses/evm)",
-    "[Solana/SVM](./contract-addresses/solana)",
-    "[Aptos](./contract-addresses/aptos)",
-    "[Sui](./contract-addresses/sui)",
-    "[IOTA](./contract-addresses/iota)",
-    "[Movement](./contract-addresses/movement)",
-    "[TON](./contract-addresses/ton)",
-    "[Fuel](./contract-addresses/fuel)",
-    "[CosmWasm](./contract-addresses/cosmwasm)",
-    "[NEAR](./contract-addresses/near)",
-    "[Starknet](./contract-addresses/starknet)",
-    "[Pythnet](./contract-addresses/pythnet)"
+    "[EVM](./evm)",
+    "[Solana / SVM](./solana)",
+    "[Aptos](./aptos)",
+    "[Sui](./sui)",
+    "[IOTA](./iota)",
+    "[Movement](./movement)",
+    "[TON](./ton)",
+    "[Fuel](./fuel)",
+    "[CosmWasm](./cosmwasm)",
+    "[NEAR](./near)",
+    "[Starknet](./starknet)",
+    "[Pythnet](./pythnet)"
   ]
 }

+ 5 - 3
apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/evm/meta.json

@@ -1,6 +1,8 @@
 {
+  "title": "on EVM",
   "pages": [
-    "[Part 1: Create Pyth App](./create-your-first-pyth-app/evm/part-1)",
-    "[Part 2: Deploy Pyth App](./create-your-first-pyth-app/evm/part-2)"
-  ]
+    "[Part 1: Create Pyth App](/price-feeds/core/tutorials/create-your-first-pyth-app/evm/part-1)",
+    "[Part 2: Deploy Pyth App](/price-feeds/core/tutorials/create-your-first-pyth-app/evm/part-2)"
+  ],
+  "defaultOpen": true
 }

+ 1 - 1
apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/evm/part-1.mdx

@@ -19,7 +19,7 @@ This tutorial will cover the following topics:
 This tutorial is divided into two parts:
 
 - [Part 1:](./part-1) Create a contract and fetch prices from Pyth oracles. \
-- [Part 2:](.//part-2) Deploy Your Pyth App
+- [Part 2:](./part-2) Deploy Your Pyth App
 
 ## Create a contract and fetch prices from Pyth oracles
 

+ 5 - 0
apps/developer-hub/content/docs/price-feeds/core/create-your-first-pyth-app/meta.json

@@ -0,0 +1,5 @@
+{
+  "title": "Create Your First Pyth App",
+  "pages": ["evm"],
+  "defaultOpen": false
+}

+ 7 - 0
apps/developer-hub/content/docs/price-feeds/core/error-codes.mdx

@@ -0,0 +1,7 @@
+---
+title: Error Codes
+description: Reference error codes for Pyth price feeds
+slug: /price-feeds/core/error-codes
+---
+
+- [EVM](error-codes/evm)

+ 28 - 0
apps/developer-hub/content/docs/price-feeds/core/error-codes/evm.mdx

@@ -0,0 +1,28 @@
+---
+title: EVM Error Codes
+description: Decode the error codes emitted by Pyth EVM contracts
+slug: /price-feeds/core/error-codes/evm
+---
+
+The following table contains the errors used in the Pyth Network's [EVM contracts](https://github.com/pyth-network/pyth-crosschain/tree/a888ba318c0325c29070eaf5afcc3a4d443b058c/target_chains/ethereum/contracts/contracts).
+This information is derived from [PythErrors.sol](https://github.com/pyth-network/pyth-crosschain/blob/a888ba318c0325c29070eaf5afcc3a4d443b058c/target_chains/ethereum/sdk/solidity/PythErrors.sol#L8)
+in the Pyth SDK and can be used to decode error codes programmatically.
+
+Consult [Troubleshoot Errors on EVM Price Feeds Contract](../troubleshoot/evm) for more information on how to handle these errors.
+
+| Error Codes | Error                          | Error Description                                                |
+| ----------- | ------------------------------ | ---------------------------------------------------------------- |
+| 0xa9cb9e0d  | InvalidArgument()              | Function Arguments are invalid.                                  |
+| 0xe60dce71  | InvalidUpdateDataSource()      | Invalid data source of the provided updateData.                  |
+| 0xe69ffece  | InvalidUpdateData()            | UpdateData is invalid.                                           |
+| 0x025dbdd4  | InsufficientFee()              | Insufficient fee provided for the operation.                     |
+| 0xde2c57fa  | NoFreshUpdate()                | No new fresh updates available.                                  |
+| 0x45805f5d  | PriceFeedNotFoundWithinRange() | No price feed found within the given range or it doesn't exists. |
+| 0x14aebe68  | PriceFeedNotFound()            | Price feed not found or it is not pushed on-chain yet.           |
+| 0x19abf40e  | StalePrice()                   | The requested price feed has not been updated recently enough.   |
+| 0x2acbe915  | InvalidWormholeVaa()           | Given message is not a valid Wormhole VAA.                       |
+| 0x97363b35  | InvalidGovernanceMessage()     | Governance message is invalid                                    |
+| 0x63daeb77  | InvalidGovernanceTarget()      | Governance message is not for this contract.                     |
+| 0x360f2d87  | InvalidGovernanceDataSource()  | Invalid data source for the governance message.                  |
+| 0x88d1b847  | OldGovernanceMessage()         | Governance message is old.                                       |
+| 0x13d3ed82  | InvalidWormholeAddressToSet()  | The wormhole address to set in SetWormholeAddress is invalid.    |

+ 7 - 0
apps/developer-hub/content/docs/price-feeds/core/error-codes/index.mdx

@@ -0,0 +1,7 @@
+---
+title: Error Codes
+description: Directory of error code references for Pyth price feeds
+slug: /price-feeds/core/error-codes
+---
+
+- [EVM](error-codes/evm)

+ 3 - 0
apps/developer-hub/content/docs/price-feeds/core/error-codes/meta.json

@@ -0,0 +1,3 @@
+{
+  "pages": ["[EVM](./evm)"]
+}

文件差异内容过多而无法显示
+ 45 - 0
apps/developer-hub/content/docs/price-feeds/core/fetch-price-updates.mdx


+ 33 - 0
apps/developer-hub/content/docs/price-feeds/core/getting-started.mdx

@@ -0,0 +1,33 @@
+---
+title: Getting Started
+description: Explore key resources to begin integrating Pyth price feeds
+slug: /price-feeds/core/getting-started
+---
+
+Integrating Pyth price feeds is quick and easy. Pyth price feeds are permissionless and available on-chain. You **don't** need to sign up or request an API key
+
+Pyth offers several different resources to help you get started.
+The [Build](#build) section provides resources for developers integrating Pyth price feeds into their applications.
+The [Learn](#learn) section provides general material for anyone interested in understanding how the protocol works.
+
+## Build
+
+Developers interested in using Pyth can refer to the following resources:
+
+- [Create Your First Pyth App](./create-your-first-pyth-app/) is a tutorial that walks the reader through all of the steps required to develop, test and deploy a contract using Pyth price feeds. This guide is tailored toward new developers with less contract development experience.
+- [Use Real-Time Price Data](./use-real-time-data/) is a how-to guide that provides the minimal steps to integrate price feeds into your app. This guide is targeted towards more experienced developers who know the basics of smart contract development.
+- [Use Historic Price Data](./use-historic-price-data/) is a how-to guide that provides the minimal steps to integrate historic price data into your app.
+- [API Reference](./api-reference) is an interactive playground that provides a detailed overview of the Pyth smart contract's functionality. This guide is useful for developers who want to understand the full capabilities of the Pyth oracles.
+
+In addition to the resources above, the following reference materials will be useful for developers as they integrate:
+
+- [Price Feed IDs](./price-feeds) lists the price feed IDs for all the assets supported by Pyth.
+- [Contract Addresses](./contract-addresses/) provides the contract addresses for Pyth on different chains.
+- [Error Codes](./error-codes) lists the error codes that can be returned by the Pyth contracts.
+- [Best Practices](./best-practices) explains how to use Pyth price feeds safely and effectively in your application.
+
+## Learn
+
+For those interested in learning more about Pyth, the following resources are available:
+
+- [How Pyth Works](./how-pyth-works) provides a high-level overview of Pyth architecture.

+ 30 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/cross-chain.mdx

@@ -0,0 +1,30 @@
+---
+title: Cross-chain
+description: Learn how Pyth prices move from Pythnet to target blockchains
+slug: /price-feeds/core/how-pyth-works/cross-chain
+---
+
+Pyth uses a cross-chain mechanism to transfer prices from [Pythnet](pythnet) to target chains. The diagram below
+shows how prices are delivered from Pythnet to target chains:
+
+![Pyth cross-chain architecture](/images/Pull-Architecture-Hermes.png)
+
+Data providers publish their prices on Pythnet. The on-chain [oracle program](oracle-program) then aggregates prices
+for a feed to obtain the aggregate price and confidence. Next, the Pythnet validators send a Wormhole message on each
+Pythnet slot to the Wormhole contract on Pythnet containing the Merkle root of all the prices. Wormhole guardians
+then observe the Merkle root message and create a signed VAA for the Merkle root message.
+
+[Hermes](./hermes) continually listens to Wormhole for Pyth Merkle roots at each slot. It also
+listens to Pythnet to get all the price messages. It stores the latest price messages with their Merkle proof and signed
+Merkle root in memory and exposes HTTP and server-side streaming APIs for retrieving the latest update. (Anyone can run an instance
+of this webservice, but the Pyth Data Association runs a public instance for convenience.) When a user wants to use a
+Pyth price in a transaction, they retrieve the latest update message from Hermes and submit it in their transaction. The
+update message includes the signed Merkle tree root, along with the Merkle proofs of each included price update. To
+verify the payload, the Pyth Network contract simply checks the Wormhole signatures on the root, then checks the Merkle
+proofs and, if it is valid, stores the new price in its on-chain storage.
+
+Finally, on-chain protocols integrate with the Pyth contract via a simple API that retrieves the current Pyth price from
+its on-chain storage. This API will return the current price as long as it has been updated sufficiently recently; this
+approach works because users will have updated the Pyth price earlier in the same transaction. Protocols can configure
+the recency threshold to suit their needs — e.g., latency sensitive applications can set a lower threshold than the
+default.

+ 47 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/ema-price-aggregation.mdx

@@ -0,0 +1,47 @@
+---
+title: EMA Price Aggregation
+description: See how Pyth computes exponentially weighted price and confidence values
+slug: /price-feeds/core/how-pyth-works/ema-price-aggregation
+---
+
+Pyth network also offers an exponentially-weighted moving average (EMA) price and confidence. These values are time-weighted averages of the aggregate price and confidence. For more details, please read out [Medium Blog](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1) on the topic.
+
+Both the EMA price (ema_price) and confidence (ema_confidence) are available from Pyth price accounts:
+
+```sh copy
+price_account .. CqFJLrT4rSpA46RQkVYWn8tdBDuQ7p7RXcp6Um76oaph
+    price ........ 16297000 x 10^-5
+    conf ......... 27952 x 10^-5
+    price_type ... price
+    exponent ..... -5
+    status ....... trading
+    corp_act ..... nocorpact
+    num_qt ....... 2
+    valid_slot ... 110430111
+    publish_slot . 110430112
+    ema_price ......... 16247409 x 10^-5
+    ema_confidence ......... 19415 x 10^-5
+```
+
+**What is an exponential moving average (EMA)?**
+
+In an EMA the most recent samples receive the most weight, and samples further back in time get exponentially less weight the farther in the past they are. For a 1 hour EMA, the samples 1 hour in the past get 50% of the weighting, samples 2 hours in the past get 25% of the weighting, 3 hours in the past get 12.5% of the weighting, etc.
+
+![EMA price aggregation example 1](/images/EMA_Price_Aggregation_1.png)
+
+While conceptually not as simple as an SMA (Simple Moving Average), the EMA has a particularly simple implementation for streaming applications such as Pyth. The exponential weighting method allows the entire history of prices and weights to be represented by a single number.
+
+Find the implementation in [GitHub](https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h).
+
+**How does Pyth calculate its EMA Price and EMA Confidence?**
+
+The EMA Price (`ema_price`) and EMA Confidence (`ema_confidence`) values are derived directly from the aggregated prices and confidences Pyth has generated on-chain. Publishers do not submit either EMA Price or EMA Confidence values, they only publish to Pythnet a “live” price and its associated confidence interval which will, in turn, be used for EMA Price and EMA Confidence calculation.
+
+The current Pyth averaging method is a slot-weighted, inverse confidence-weighted exponential moving average of the aggregate price (and confidence interval).
+
+- **Slot weighted** — The Pyth EMA uses the Pythnet slot number to measure the passage of time. The averaging period is 5921 slots, which corresponds to approximately 1 hour on Pythnet.
+- **Inverse confidence weighted** — Weighting each sample by 1/Confidence lets the EMA give more weight to samples with tight confidence and ignore samples with very wide confidence. Below is an example of an outlier aggregate price with a wide confidence interval. Notice how the average using inverse confidence weighting does not get pulled up by the outlier sample while the uniform weighted average does.
+
+![EMA price aggregation example 2](/images/EMA_Price_Aggregation_2.png)
+
+For more details and explanations, be sure to read the dedicated blog post on this topic [here](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1).

+ 17 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/fees.mdx

@@ -0,0 +1,17 @@
+---
+title: Fees
+description: Understand how Pyth update fees are determined and paid
+slug: /price-feeds/core/how-pyth-works/fees
+---
+
+The Pyth Network protocol has been designed to allow for the optional enablement of data fees in order to update the state of an on-chain price feeds.
+The ongoing existence of and size of the fee will be determined by governance on a per-blockchain basis; until governance is live, the fee will be 1 of the smallest denomination of the blockchain's native token (e.g., 1 wei on Ethereum).
+The fees collected by the protocol will go toward compensating data providers and possibly other uses as determined by governance.
+
+Note that protocols integrating with Pyth Network can pass these fees along to their users.
+Whenever a user submits a transaction that requires a price update, that transaction can also include payment of the necessary fee.
+This approach charges end users in proportion to their usage of Pyth Network data.
+The Pyth Network SDKs use this approach by default and include all of the necessary logic for computing and sending the fee along with every transaction.
+
+In addition to update fees, end users ultimately bear the gas cost of updating the Pyth Network price feeds, which means that their transactions cost a little more than they would in the push model.
+However, the cost of a single price update is minimal, so the combined gas and update fee should only be a small portion of the overall transaction cost for the end user.

+ 36 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/hermes.mdx

@@ -0,0 +1,36 @@
+---
+title: Hermes
+description: Learn how Hermes delivers Pyth price updates and how to access it
+slug: /price-feeds/core/how-pyth-works/hermes
+---
+
+[Hermes][hermes-repo] is a web service that listens to the Pythnet and the Wormhole Network for Pyth price updates, and
+serves them via a convenient web API. It provides Pyth's latest price update data format that are more cost-effective
+to verify and use on-chain.
+
+Hermes allows users to easily query for recent price updates via a REST API, or subscribe to a server-side events stream
+for streaming updates. The Pyth Network's Javascript SDKs connect to an instance of Hermes to fetch price updates.
+
+[hermes-repo]: https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes
+
+## Documentation
+
+The [Hermes API Documentation](https://hermes.pyth.network/docs) provides a comprehensive explanation of Hermes API for
+user interaction. You can use [the price service client library in
+JS](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) to interact with Hermes.
+
+Here's an example of retrieving the latest update of the ETH/USD price feed using `curl`.
+
+```bash
+# Example API call
+$ curl https://hermes.pyth.network/api/latest_price_feeds?ids[]=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace
+
+# Example Response
+[{"id":"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace","price":{"price":"184136023127","conf":"177166324","expo":-8,"publish_time":1692110601},"ema_price":{"price":"184100641000","conf":"178704085","expo":-8,"publish_time":1692110601}}]
+```
+
+## Accessing Hermes
+
+Hermes is a permissionless service that can either be self-hosted or accessed through a third-party provider (similar to a blockchain RPC).
+The Pyth Data Association also operates a public instance for development purposes.
+Please see [Hermes API Instances and Providers](/price-feeds/core/api-instances-and-providers/hermes) for more details.

+ 21 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/index.mdx

@@ -0,0 +1,21 @@
+---
+title: How Pyth Works
+description: Design Overview - Understand the high-level architecture of the Pyth Network
+slug: /price-feeds/core/how-pyth-works
+---
+
+Pyth is a protocol that allows market participants to publish pricing information on-chain for others to use. The protocol is an interaction between three parties:
+
+1. _Publishers_ submit pricing information to Pyth's oracle program. Pyth has multiple data publishers for every product to improve the accuracy and robustness of the system.
+2. Pyth's _oracle program_ combines publishers' data to produce a single aggregate price and confidence interval.
+3. _Consumers_ read the price information produced by the oracle program.
+
+Pyth's oracle program runs on [Pythnet](how-pyth-works/pythnet).
+The prices constructed on Pythnet are transferred [cross-chain](how-pyth-works/cross-chain) to reach consumers on these blockchains.
+
+The critical component of the system is the [oracle program](how-pyth-works/oracle-program) that combines the data from each individual publisher.
+This program maintains a number of different [SVM accounts](pythnet-reference/account-structure) that list the products on Pyth and their current price data.
+Publishers publish their price and confidence by interacting with the oracle program on every slot.
+The program stores this information in its accounts.
+The first price update in a slot additionally triggers [price aggregation](how-pyth-works/price-aggregation), which combines the price data from the previous slot into a single aggregate price and confidence interval.
+This aggregate price is written to these SVM accounts of Pythnet where it is available for transmission to other blockchains.

+ 11 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/meta.json

@@ -0,0 +1,11 @@
+{
+  "pages": [
+    "[Pythnet](./pythnet)",
+    "[Oracle Program](./oracle-program)",
+    "[Cross-chain](./cross-chain)",
+    "[Fees](./fees)",
+    "[Hermes](./hermes)",
+    "[Price Aggregation](./price-aggregation)",
+    "[EMA Price Aggregation](./ema-price-aggregation)"
+  ]
+}

+ 20 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/oracle-program.mdx

@@ -0,0 +1,20 @@
+---
+title: Oracle Program
+description: Discover how the Pyth oracle program aggregates publisher data
+slug: /price-feeds/core/how-pyth-works/oracle-program
+---
+
+The oracle program is responsible for several tasks:
+
+1. Maintaining the set of price feeds.
+2. Storing the contributions of data providers to each price feed.
+3. Combining the individual data providers' prices into a single aggregate price and confidence interval.
+4. Performing any additional stateful computations on the resulting price series, such as computing moving averages.
+
+The oracle solves these problems by maintaining a collection of [SVM accounts](../pythnet-reference/account-structure) to represent the set of price feeds.
+Each feed has two accounts: a product account to store [metadata](../pythnet-reference/product-metadata) and a price account.
+The price account stores a list of authorized data providers for this specific price feed, and allocates storage space for each data provider's price.
+The oracle program exposes an instruction called `upd_price` that enables an authorized data provider to update the price account with their current estimate of the price and confidence interval.
+Additionally, the first time that `upd_price` is called in a slot, it will [aggregate](price-aggregation) the individual data provider's prices into an aggregate price and confidence interval.
+Only the aggregate price and confidence are made available for use in downstream applications; the individual data providers prices are internal state of the oracle program.
+Finally, the oracle program computes an [exponentially-weighted moving average](ema-price-aggregation) of the oracle price.

+ 66 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/price-aggregation.mdx

@@ -0,0 +1,66 @@
+---
+title: Price Aggregation
+description: Learn how Pyth aggregates publisher prices and confidence intervals
+slug: /price-feeds/core/how-pyth-works/price-aggregation
+---
+
+Price aggregation combines the prices and confidences submitted by individual data providers into a single aggregate price and confidence.
+
+**Design Goals**
+
+The aggregation algorithm is designed to achieve 3 properties. First, it must be **robust to manipulation.** If most publishers are submitting a price of \$100 and one publisher submits a price of \$80, the aggregate price should remain near \$100 and not be overly influenced by the single outlying price. In the figure below, the aggregate price and confidence interval (represented by the blue star) is not influenced by the magenta publisher whose price is far away from the other publishers:
+
+![Price aggregation example 1](/images/Price_Aggregation_1.png)
+
+Second, the **aggregate price should appropriately weight data sources with different levels of accuracy.** Pyth allows publishers to submit a confidence interval because they have varying levels of accuracy in observing the price of a product. This property can result in situations where one publisher reports a price of \$101 +/- 1, and another reports \$110 +/- 10. In these cases, aggregating the price to be closer to \$101 than \$110 is appropriate, as in the figure below.
+
+![Price aggregation example 2](/images/Price_Aggregation_2.png)
+
+Finally, the **aggregate confidence interval should reflect the variation between publishers' prices.**
+Under normal market conditions, it is reasonable to expect a product to trade at a similar price across exchanges.
+In these cases, aggregate confidence interval is preferable to reflect the confidence intervals of the individual data providers, as shown in the figure on the left.
+However, in some rare situations, a product can trade at different prices on different exchanges.
+In these cases, the aggregate confidence interval should widen out to reflect the variation between these prices, as shown in the figure on the right.
+
+![Price aggregation example 3](/images/Price_Aggregation_3.png)
+
+**Algorithm**
+
+The aggregation algorithm itself is a simple two-step process.
+The first step computes the aggregate price by giving each publisher three votes — one vote at their price and one vote at each of their price +/- their confidence interval — then taking the median of all the votes.
+The second step computes the distance from the aggregate price to the 25th and 75th percentiles of the votes, and then selects the larger of the two as the aggregate confidence interval.
+
+This process acts like a hybrid between a mean and a median, giving confident publishers more influence, while still capping the maximum influence of any single publisher.
+The algorithm has an interpretation as computing the minimum of an objective function that penalizes the aggregate price from deviating too far from the publishers' prices.
+This interpretation allows properties of the algorithm's behavior to be proved: for example, the aggregate price will always lie between the 25th and 75th percentiles of the publishers' prices.
+
+**Scenarios**
+
+The operation of this algorithm and objective function can be visualized in the 4 scenarios described above.
+In the following graphs, the colored bars represent each publisher's price and confidence interval, and the grey dashed lines above depict the publisher's contribution to the overall objective function.
+The red line represents the combined objective function, that is, the sum of the dashed grey lines.
+The grey circles represent the 25th and 75th percentiles of the votes — the further one of these from the aggregate price determines the confidence interval’s width.
+Finally, the bold red star depicts the aggregate price and the bold red line depicts the aggregate confidence interval.
+
+In the first scenario, one publisher with a tight confidence interval is an outlier.
+Although this publisher does influence the objective function (the red line is lower on the left side than the right), it does not have enough influence to affect either the aggregate price or confidence interval.
+
+![Price aggregation example 4](/images/Price_Aggregation_4.png)
+
+The second scenario depicts how publishers with tighter confidence intervals can exert more influence over the location of the aggregate price, as long as their prices are consistent with the confidence intervals of other publishers.
+
+![Price aggregation example 5](/images/Price_Aggregation_5.png)
+
+The third scenario demonstrates the typical case where there are many publishers whose prices and confidence intervals roughly agree.
+In this case, the desired behavior is for the aggregate price and confidence to reflect those of the individual publishers.
+
+![Price aggregation example 6](/images/Price_Aggregation_6.png)
+
+Finally, the fourth scenario considers the case where the publishers publish distinct prices with non-overlapping confidence intervals.
+In this case, the confidence interval widens out because the dispersion between publishers creates a large gap between the aggregate price and the 25th/75th percentiles of the votes.
+
+![Price aggregation example 7](/images/Price_Aggregation_7.png)
+
+**Further Reading**
+
+For more details on the aggregation algorithm and some of the theory behind it, please see the [price aggregation blog post](https://pythnetwork.medium.com/pyth-price-aggregation-proposal-770bfb686641).

+ 23 - 0
apps/developer-hub/content/docs/price-feeds/core/how-pyth-works/pythnet.mdx

@@ -0,0 +1,23 @@
+---
+title: Pythnet
+description: Learn about the purpose and design of the Pythnet blockchain
+slug: /price-feeds/core/how-pyth-works/pythnet
+---
+
+Pythnet is an application-specific blockchain operated by Pyth's data providers.
+This blockchain is a computation substrate to securely combine the data provider's prices into a single aggregate price for each Pyth price feed.
+Pythnet forms the core of Pyth's off-chain price feeds that serve all blockchains.
+
+Pythnet is powered by Solana technology: it runs the same validator software but is a Pyth-specific chain that is independent of Solana's mainnet.
+The Pythian Council enables each data provider to operate one validator by delegating them the necessary stake.
+
+The purpose of Pythnet is to provide a secure and reliable computing substrate for Pyth's price aggregation.
+Recall that Pyth's data providers submit their own price measurements for each product.
+The Pyth protocol needs to combine these prices to produce a single aggregate price.
+This computation needs to be performed securely -- prices must be combined correctly -- and reliably -- so that accurate and up-to-date price information is always available for applications.
+Pythnet solves both of these problems.
+First, anyone can validate that the price computation is done correctly by replaying the network's transaction log.
+The Wormhole guardians perform this validation when constructing the Pyth price update messages that are delivered to other blockchains.
+Consequently, as long as 2/3+ of the Wormhole guardians are honest, users of Pyth prices can trust that they were computed accurately.
+Second, the Pythnet blockchain has built-in redundancy to ensure high availability: it is operational as long as 2/3+ of Pythnet validators are online.
+Furthermore, Pythnet remains available even when target chain transaction bandwidth is highly contested, such as during periods of high market volatility.

+ 27 - 0
apps/developer-hub/content/docs/price-feeds/core/index.mdx

@@ -0,0 +1,27 @@
+---
+title: Pyth Core
+description: Pyth core documentation overview
+slug: /price-feeds/core
+---
+
+# Introduction to Pyth Core
+
+Pyth Network provides real-time financial market data to smart contract applications on 100+ blockchains.
+Data is sourced from 120+ first-party providers including major exchanges and market makers.
+
+## Key Features
+
+- **2000+ price feeds** across all major asset classes
+- **Sub-second latency** with high-frequency updates
+- **Cryptographically signed** and verifiable on-chain
+- **Multi-chain support** including EVM, Cosmos, Solana, Aptos, and more
+
+## Quick Start
+
+<Cards>
+  <Card title="Getting Started" href="./core/getting-started" />
+  <Card title="Contract Addresses" href="./core/contract-addresses" />
+  <Card title="API Reference" href="./core/api-reference" />
+  <Card title="Price Feed IDs" href="./core/price-feeds" />
+  <Card title="Push Feeds" href="./core/push-feeds" />
+</Cards>

+ 26 - 0
apps/developer-hub/content/docs/price-feeds/core/market-hours.mdx

@@ -0,0 +1,26 @@
+---
+title: Market Hours
+description: Trading hours followed by Pyth price feeds across asset classes
+slug: /price-feeds/core/market-hours
+---
+
+Pyth price feeds follow the [traditional market hours](https://www.cmegroup.com/trading-hours.html) of each asset classes and will be available at the following hours:
+| Asset Class | Opening Hours | Exceptions |
+| ----------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
+| Crypto | 24/7 | No market close |
+| US Equities | Every weekday from 9.30AM ET to 4PM ET | Markets are closed on weekends, and follow [NYSE Holidays & Trading Hours](https://www.nyse.com/markets/hours-calendars) |
+| EU Equities | Paris, Amsterdam, Ireland: Every weekday from 9AM CET to 5.30PM CET | Markets are closed on weekends, and follow [Euronext Holidays & Trading Hours](https://live.euronext.com/en/resources/trading-hours-holidays) |
+| UK Equities | Every weekday from 8AM UK time to 4.30PM UK time | Markets are closed on weekends, and follow [LSE Holidays & Trading Hours](https://www.londonstockexchange.com/equities-trading/business-days) |
+| DE Equities | Every weekday from 9AM to 5.30PM CET | Markets are closed on weekends, and follow [Xetra Holidays & Trading Hours](https://www.xetra.com/xetra-en/trading/trading-calendar-and-trading-hours) |
+| HK Equities | Every weekday from 9.30AM to 12PM & 1PM to 4PM HKT | Markets are closed on weekends, and follow [HKEX Holidays & Trading Hours](https://www.hkex.com.hk/Services/Trading-hours-and-Severe-Weather-Arrangements/Trading-Hours/Securities-Market?sc_lang=en) |
+| CN Equities | Every weekday from 9.30AM to 11.30AM & 1PM to 2:57PM CST | Markets are closed on weekends, and follow [SSE Holidays & Trading Hours](https://english.sse.com.cn/start/trading/schedule/) |
+| JP Equities | Every weekday from 9AM to 11.30AM & 12.30PM to 3:30PM JST | Markets are closed on weekends, and follow [JPX Holidays & Trading Hours](https://www.jpx.co.jp/english/corporate/about-jpx/calendar/) |
+| FX | From Sunday 5PM ET to Friday 5PM ET | Trading continues during most US holidays |
+| Emerging Markets FX | From Sunday 6PM ET to Friday 5PM ET. For USDBRL, USDCOP, USDCLP and USDPEN, please refer to the [EM FX Market Hours Guide](https://pyth-network.notion.site/EM-FX-Market-Hours-Guide-1de2eecaaac980eea5eddf8f34398309) | Spot EM FX liquidity can be significantly limited at the start of the trading week, outside local market trading hours, and during local holidays, which can lead to wider confidence intervals. Pyth EM FX currencies: INR, IDR, PHP, KRW, TWD, CNH, TRY, ZAR, MXN, BRL, COP, CLP, PEN |
+| Metals | From Sunday 6PM ET to Friday 5PM ET | Daily maintenance window applies from 5PM ET to 6PM ET, Monday to Thursday. Spot gold and silver trading also follow [CME holiday closures](https://www.cmegroup.com/tools-information/holiday-calendar.html)|
+| Rates | Every weekday from 8AM ET to 5PM ET | Markets are closed on weekends, and follow [NYSE Holidays & Trading Hours](https://www.nyse.com/markets/hours-calendars) |
+| Reference Rates | 24/7 | Follow [Federal Reserve Bank of New York Holidays](https://www.newyorkfed.org/aboutthefed/holiday_schedule.html) |
+| Commodities | WTI: From Sunday 6PM ET to Friday 5PM ET | Daily maintenance window applies from 5PM ET to 6PM ET and follow [CME Holidays](https://www.cmegroup.com/tools-information/holiday-calendar.html)|
+| Commodities | BRENT: From Sunday 6PM ET to Friday 6PM ET | Daily maintenance window applies from 6PM ET to 8PM ET, Monday to Thursday and follow [ICE Holidays](https://www.ice.com/publicdocs/Trading_Schedule.pdf)|
+| Commodities | UKOILSPOT CFD: From Monday 1AM GMT to Friday 9:45PM GMT | Daily maintenance window applies from 10PM GMT to 1AM GMT, Monday to Friday and follow [FXCM Holidays](https://www.fxcm.com/markets/help/cfd-trading-what-are-the-cfd-holiday-hours/)|
+| Commodities | USOILSPOT CFD: From Sunday 11PM GMT to Friday 9:45PM GMT | Daily maintenance window applies from 10PM GMT to 11PM GMT, Monday to Friday and follow [FXCM Holidays](https://www.fxcm.com/markets/help/cfd-trading-what-are-the-cfd-holiday-hours/)|

+ 35 - 0
apps/developer-hub/content/docs/price-feeds/core/meta.json

@@ -0,0 +1,35 @@
+{
+  "pages": [
+    "getting-started",
+    "---Tutorials---",
+    "create-your-first-pyth-app",
+    "---How-To Guides---",
+    "use-real-time-data",
+    "[Use Historic Price Data](./core/use-historic-price-data)",
+    "[Fetch Price Updates](./core/fetch-price-updates)",
+    "[Schedule Price Updates](./core/schedule-price-updates)",
+    "[Create TradingView Charts](./core/create-tradingview-charts)",
+    "[Derive Cross Rate](./core/derive-cross-rate)",
+    "[Migrate an App to Pyth](./core/migrate-an-app-to-pyth)",
+    "[Use Pyth for Morpho Markets](./core/use-pyth-for-morpho)",
+    "[Publish Data](./core/publish-data)",
+    "[Troubleshoot Errors](./core/troubleshoot)",
+    "---Reference Material---",
+    "[API Reference](./core/api-reference)",
+    "[Price Feeds](./core/price-feeds)",
+    "[Current Fees](./current-fees)",
+    "[Push Feeds](./push-feeds)",
+    "[Market Hours](./core/market-hours)",
+    "[Best Practices](./core/best-practices)",
+    "[Rate Limits](./core/rate-limits)",
+    "[Error Codes](./core/error-codes)",
+    "[API Instances and Providers](./api-instances-and-providers)",
+    "[Contract Addresses](./contract-addresses)",
+    "[Pythnet Reference](./core/pythnet-reference)",
+    "[Example Applications \u2197](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds)",
+    "---Understanding Pyth---",
+    "[What is a Pull Oracle?](./core/pull-updates)",
+    "[Why Update Prices](./core/why-update-prices)",
+    "[How Pyth Works](./core/how-pyth-works)"
+  ]
+}

+ 9 - 0
apps/developer-hub/content/docs/price-feeds/core/migrate-an-app-to-pyth/index.mdx

@@ -0,0 +1,9 @@
+---
+title: Migrate to Pyth from Another Oracle
+description: Resources to help move existing oracle integrations onto Pyth price feeds
+slug: /price-feeds/core/migrate-an-app-to-pyth
+---
+
+The guides in this section are designed to help developers migrate an application from another oracle to use Pyth price feeds.
+
+- [Chainlink](migrate-an-app-to-pyth/chainlink)

+ 3 - 0
apps/developer-hub/content/docs/price-feeds/core/migrate-an-app-to-pyth/meta.json

@@ -0,0 +1,3 @@
+{
+  "pages": ["[from Chainlink](./chainlink)"]
+}

+ 24 - 0
apps/developer-hub/content/docs/price-feeds/core/price-feeds/asset-classes.mdx

@@ -0,0 +1,24 @@
+---
+title: Asset Classes
+description: Overview of the asset classes covered by Pyth price feeds
+slug: /price-feeds/core/price-feeds/asset-classes
+---
+
+[Pyth price feeds](https://www.pyth.network/price-feeds) provide market data for the following asset classes:
+
+| Asset Class | Subclass         | Definition                                                                                                                                                                                                                       |
+| ----------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Crypto      | Spot Prices      | Real-time prices for cryptocurrencies and digital assets                                                                                                                                                                         |
+|             | Redemption Rates | Real-time swap rates derived from smart contracts for the redemption of liquid staking and liquid restaking tokens (LSTs and LRTs), liquidity provider tokens (LP Tokens) and interest-bearing assets, including tokenised notes |
+|             | Indices          | Real-time prices that measure the performance of baskets of cryptocurrencies and digital assets                                                                                                                                  |
+| US Equities | Spot Prices      | Real-time prices for US equities                                                                                                                                                                                                 |
+| FX          | Spot Prices      | Real-time prices for fiat currency pairs                                                                                                                                                                                         |
+| Metals      | Spot Prices      | Real-time prices for precious metals                                                                                                                                                                                             |
+| Rates       | Future Prices    | Real-time prices for fixed income products, including bond futures                                                                                                                                                               |
+| Commodities | Futures Prices   | Real-time prices for commodity futures                                                                                                                                                                                           |
+| Energy      | Spot Prices      | Real-time prices for a non-expiring Contract for Difference (CFD) that tracks the price of the asset                                                                                                                             |
+|             | Futures Prices   | Real-time prices for energy futures contract                                                                                                                                                                                     |
+
+**NOTE:** When integrating with **Energy Futures Price Feeds**, it is not recommended to rely solely on the first month expiry price feed as there is often lower liquidity towards expiration.
+Best practice is to combine, 1-month, 2-month and 3-month feeds or use the weighted average which is represented by spot price(USOILSPOT or UKOILSPOT).
+Please refer to the [Best Practices](/price-feeds/core/best-practices#pricing-futures-based-assets) page for more information.

+ 39 - 0
apps/developer-hub/content/docs/price-feeds/core/price-feeds/index.mdx

@@ -0,0 +1,39 @@
+---
+title: Price Feeds
+description: Overview of Pyth price feeds, asset classes, and feed IDs
+slug: /price-feeds/core/price-feeds
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+Pyth Price Feeds provide real-time, first-party, market data for a wide range of assets.
+
+Every price feed has a **unique ID**, representing the specific pair of assets being priced.
+These specific pairs are part of an asset class, which is a broader category of assets.
+
+Anyone can fetch available price feeds and their IDs via [Hermes API](https://hermes.pyth.network/docs/#/rest/price_feeds_metadata).
+
+## Asset Classes
+
+Every price feed belongs to an asset class. These asset classes distinguish between different types of assets, such as crypto, US equities, and metals.
+
+Refer to the [Asset Classes](./price-feeds/asset-classes) page to learn more about the existing asset classes.
+
+## Price Feed IDs
+
+Price Feed IDs are unique identifiers for each specific pair of assets being priced (e.g. BTC/USD).
+Every price update is tagged with the corresponding price feed ID.
+
+Applications need to store the IDs of the feeds they wish to read.
+However, the IDs may be represented in different formats (e.g. hex or base58) depending on the blockchain.
+Price feeds also have different IDs in the Stable and Beta channels.
+
+### Feed IDs
+
+Refer to the [Price Feed IDs](/price-feeds/core/price-feeds/price-feed-ids) page for the complete list of price feed IDs.
+
+### Solana Price Feed Accounts
+
+On Solana, each feed additionally has a collection of **price feed accounts** containing the feed's data.
+The addresses of these accounts are programmatically derived from the feed id and a shard id, which is simply a 16-bit number.
+See [How to Use Real-Time Data on Solana](./use-real-time-data/solana#price-feed-accounts) for more information on price feed accounts.

+ 6 - 0
apps/developer-hub/content/docs/price-feeds/core/price-feeds/meta.json

@@ -0,0 +1,6 @@
+{
+  "pages": [
+    "[Price Feed IDs](./price-feed-ids)",
+    "[Asset Classes](./asset-classes)"
+  ]
+}

+ 8 - 0
apps/developer-hub/content/docs/price-feeds/core/publish-data/meta.json

@@ -0,0 +1,8 @@
+{
+  "pages": [
+    "[Understanding Publishing Slots](./understanding-publishing-slots)",
+    "[pyth-client Websocket API](./pyth-client-websocket-api)",
+    "[Confidence Interval and Crypto Exchange Fees](./confidence-interval-and-crypto-exchange-fees)",
+    "[Useful Resources for Publishers](./useful-resources-for-publishers)"
+  ]
+}

+ 10 - 0
apps/developer-hub/content/docs/price-feeds/core/push-feeds/meta.json

@@ -0,0 +1,10 @@
+{
+  "pages": [
+    "[EVM](./evm)",
+    "[Solana](./solana)",
+    "[Fogo](./fogo)",
+    "[Aptos](./aptos)",
+    "[Movement](./movement)",
+    "[Sui](./sui)"
+  ]
+}

+ 7 - 0
apps/developer-hub/content/docs/price-feeds/core/pythnet-reference/meta.json

@@ -0,0 +1,7 @@
+{
+  "pages": [
+    "[Account Structure](./account-structure)",
+    "[Product Metadata](./product-metadata)",
+    "[Schedule Format](./schedule-format)"
+  ]
+}

+ 7 - 0
apps/developer-hub/content/docs/price-feeds/core/schedule-price-updates/meta.json

@@ -0,0 +1,7 @@
+{
+  "pages": [
+    "[Using Adrastia](./using-adrastia)",
+    "[Using Gelato](./using-gelato)",
+    "[Using Price Pusher](./using-price-pusher)"
+  ]
+}

+ 6 - 0
apps/developer-hub/content/docs/price-feeds/core/troubleshoot/meta.json

@@ -0,0 +1,6 @@
+{
+  "pages": [
+    "[EVM Price Feeds Contract](./evm)",
+    "[SVM Price Feeds Contract](./svm)"
+  ]
+}

+ 60 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/index.mdx

@@ -0,0 +1,60 @@
+---
+title: How to Use Real-Time Price Data
+description: Guides for using Pyth real-time price feeds
+slug: /price-feeds/core/use-real-time-data
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+The following guides demonstrate how to consume Pyth real-time prices on various blockchains.
+These guides are intended for developers building on-chain applications that need the latest price data, i.e., the price data must
+be on the blockchain.
+
+Pyth price feeds are available on 100+ blockchain ecosystems.
+Check out the complete list of chains and implementation contract addresses at [Contract Addresses](../contract-addresses).
+If your blockchain is not supported, please [ask in the dev-forum](https://dev-forum.pyth.network/latest).
+
+## Choosing Your Integration Method
+
+**Pull integration** is the default choice for most applications. In this integration, the application retrieves price data from a [webservice](../how-pyth-works/hermes) and submits it to
+an on-chain smart contact as part of the transaction. This integration provides the lowest-latency access to Pyth price data.
+
+**Push integration** is for applications that don't want to pull prices in every transaction and prefer a purely on-chain integration.
+
+<Callout type="info">
+  All feeds are available through both integration methods. However, to use pull
+  integration, the application needs to submit the prices to the on-chain smart
+  contract as part of the transaction. Check out the Pull Integration section
+  below to get started.
+</Callout>
+
+## Pull Integration
+
+Consult the relevant ecosystem guide to get started using **pull integration**:
+
+- [EVM](../use-real-time-data/pull-integration/evm)
+- [Solana](../use-real-time-data/pull-integration/solana)
+- [Starknet](../use-real-time-data/pull-integration/starknet)
+- [Aptos](../use-real-time-data/pull-integration/aptos)
+- [CosmWasm](../use-real-time-data/pull-integration/cosmwasm)
+- [Sui](./pull-integration/sui)
+- [IOTA](./pull-integration/iota)
+- [Near](./pull-integration/near)
+
+## Push Integration
+
+To consume real-time price data using **push** integration, check out the following guides:
+
+- [Using Push Integration](../use-real-time-data/push-integration)
+
+This guide will walk you through the steps to use real-time price data using push integration in every ecosystem.
+
+## Off-Chain Applications
+
+Pyth price feeds can also be used in off-chain applications.
+For example, an application may need to show real-time asset prices on a website.
+Developers building such applications can consult the following guide:
+
+- [Off-chain Apps](../fetch-price-updates)
+
+To fetch historical prices, application developers can check out the [Use Historic Price Data](../use-historic-price-data) guide.

+ 5 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/meta.json

@@ -0,0 +1,5 @@
+{
+  "title": "Use Real-Time Price Data",
+  "pages": ["pull-integration", "push-integration"],
+  "defaultOpen": true
+}

+ 83 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/aptos.mdx

@@ -0,0 +1,83 @@
+---
+title: How to Use Real-Time Data in Aptos Contracts
+description: Consume Pyth Network prices in Aptos applications
+slug: /price-feeds/core/use-real-time-data/pull-integration/aptos
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+This guide explains how to use real-time Pyth data in Aptos applications.
+
+## Configuring the `Move.toml` file
+
+Add the Pyth Contract to your project dependencies in the `Move.toml` file:
+
+```toml copy
+[dependencies]
+Pyth = { git = "https://github.com/pyth-network/pyth-crosschain.git", subdir = "target_chains/aptos/contracts", rev = "main" }
+```
+
+The named addresses of `pyth`, `wormhole`, and `deployers` must be defined at compile time. These addresses are used to interact with the Pyth contract on Aptos.
+
+```toml copy
+[addresses]
+pyth = "0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387"
+deployer = "0xb31e712b26fd295357355f6845e77c888298636609e93bc9b05f0f604049f434"
+wormhole = "0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625"
+```
+
+Consult [Aptos Contract Addresses](../../contract-addresses/aptos) for the complete list of contract addresses on different Aptos networks.
+
+## Write Contract Code
+
+The code snippet below provides an example module fetching the BTC/USD price from Pyth price feeds:
+
+```rust {21} copy
+module example::example {
+    use pyth::pyth;
+    use pyth::price::Price;
+    use pyth::price_identifier;
+    use aptos_framework::coin;
+
+    // Add the pyth_price_update argument to any method on your contract that needs to read the Pyth price.
+    // See https://docs.pyth.network/price-feeds/fetch-price-updates for more information on how to fetch the pyth_price_update.
+    public fun get_btc_usd_price(user: &signer, pyth_price_update: vector<vector<u8>>): Price {
+
+        // First update the Pyth price feeds
+        let coins = coin::withdraw(user, pyth::get_update_fee(&pyth_price_update));
+        pyth::update_price_feeds(pyth_price_update, coins);
+
+        // Read the current price from a price feed.
+        // Each price feed (e.g., BTC/USD) is identified by a price feed ID.
+        // The complete list of feed IDs is available at https://docs.pyth.network/price-feeds/price-feeds
+        // Note: Aptos uses the Pyth price feed ID without the `0x` prefix.
+        let btc_price_identifier = x"e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43";
+        let btc_usd_price_id = price_identifier::from_byte_vec(btc_price_identifier);
+        pyth::get_price(btc_usd_price_id)
+    }
+}
+
+```
+
+<Callout type="info">
+  The `pyth_price_update` argument contains verified prices from Pyth. Calling
+  `pyth::update_price_feeds` with this value updates the on-chain Pyth price and
+  ensures your application has recent price data. The pyth_price_update can be
+  fetched from Hermes; Consult [Fetch Price Updates](../../fetch-price-updates)
+  for more information on how to fetch the `pyth_price_update`.
+</Callout>
+
+The code snippet above does the following things:
+
+1. Call `pyth::get_update_fee` to get the fee required to update the Pyth price feeds.
+1. Call `pyth::update_price_feeds` and pass `pyth_price_update` to update the Pyth price feeds.
+1. Call `pyth::get_price` to read the current price, providing the [price feed ID](../../price-feeds) you wish to read.
+
+## Additional Resources
+
+You may find these additional resources helpful for developing your Aptos application.
+
+### Example Applications
+
+- [Minimal on-chain contract](https://github.com/pyth-network/pyth-examples/blob/main/price_feeds/aptos/fetch_btc_price/sources/example.move), which updates and returns the BTC/USD price from Pyth price feeds.
+- [Mint NFT](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/aptos/mint_nft) that use Pyth price feeds to mint an NFT.

+ 30 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx

@@ -0,0 +1,30 @@
+---
+title: Pyth on Cosmwasm
+description: Consume Pyth Network prices in applications on Cosmwasm
+slug: /price-feeds/core/use-real-time-data/pull-integration/cosmwasm
+---
+
+Cosmwasm contracts can update and fetch the Pyth prices using the Pyth Cosmwasm Contract, deployed on their network.
+The documented source code can be found [here](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/cosmwasm/contracts/pyth).
+
+## Update Price Feeds
+
+The mechanism by which price feeds are updated on Cosmwasm is explained [here](../../pull-updates). The [@pythnetwork/price-service-client](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) typescript package can be used to fetch the latest price feed data which then can be passed to the contract as the `UpdatePriceFeeds` ExecuteMsg.
+
+Pyth publishes prices for two kinds of feeds:
+
+1. Stable price feeds consist of prices generated on the pythnet blockchain. These feeds are available on both mainnet and testnet blockchains. Use stable feeds if you would like your test environment to be identical to your production environment.
+2. Edge price feeds consist of prices generated on the pythtest blockchain, which is Pyth's test environment for new features. Consequently, these feeds are not as reliable as the stable feeds, and there are other differences as well (e.g., different price feed ids). These feeds are only available on testnets.
+
+## Examples
+
+- [Minimal on-chain contract](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/cosmwasm/examples/cw-contract) which queries the Pyth contract.
+
+## Price Feed IDs
+
+The price feed IDs for stable and edge feeds are different and can be found at https://docs.pyth.network/price-feeds/price-feeds.
+
+## Contract Addresses
+
+Developers will need the address of the Pyth price feed contract on their blockchain in order to use Pyth.
+Please consult [CosmWasm Contract Addresses](../../contract-addresses/cosmwasm) to find the address for your blockchain.

+ 137 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/evm.mdx

@@ -0,0 +1,137 @@
+---
+title: How to Use Real-Time Data in EVM Contracts
+description: Use Pyth Network real-time data in EVM contracts using pull integration
+slug: /price-feeds/core/use-real-time-data/pull-integration/evm
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+This guide explains how to use real-time Pyth data in EVM contracts using the pull integration.
+
+For an interactive playground to explore the methods supported by the Pyth contract, see the [EVM API reference](../../../api-reference).
+
+<Callout type="info">
+  If you want to use real-time price data using the push integration instead, you can use the following code snippet:
+  ```solidity copy
+  PythStructs.Price memory price = pyth.getPriceNoOlderThan(priceFeedId, 60);
+  ```
+Developers only need to pass the price feed ID to the above method from the [Push Feeds list](../../../push-feeds/evm).
+
+For complete example, refer to the [Push Integration guide](../../push-integration).
+
+</Callout>
+
+## Install Pyth SDK
+
+Pyth provides a [Solidity SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/solidity) to fetch prices from Pyth contracts.
+The SDK exposes `IPyth` interface to interact with Pyth price feeds.
+
+**Truffle/Hardhat**
+
+If you are using Truffle or Hardhat, simply install the NPM package:
+
+```bash copy
+npm install @pythnetwork/pyth-sdk-solidity
+```
+
+**Foundry**
+
+If you are using Foundry, you will need to create an NPM project if you don't already have one.
+From the root directory of your project, run:
+
+```bash copy
+npm init -y
+npm install @pythnetwork/pyth-sdk-solidity
+```
+
+Then add the following line to your `remappings.txt` file:
+
+```text copy
+@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity
+```
+
+<Callout type="warning">
+  **Important**: Pyth uses a pull oracle model that requires users to update
+  prices on-chain before reading them. If you don't update the price or if the
+  on-chain price becomes too stale, calls to `getPriceNoOlderThan()` will revert
+  with a `StalePrice` error (0x19abf40e). Learn more about [why you need to
+  update prices](../../../why-update-prices) and see [how to fetch price
+  updates](../../../fetch-price-updates) for implementation details.
+</Callout>
+
+## Write Contract Code
+
+The code snippet below provides a general template for what your contract code should look like:
+
+```solidity {30-31} copy
+pragma solidity ^0.8.0;
+
+import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
+import "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";
+
+contract SomeContract {
+  IPyth pyth;
+
+  /**
+   * @param pythContract The address of the Pyth contract
+   */
+  constructor(address pythContract) {
+    // The IPyth interface from pyth-sdk-solidity provides the methods to interact with the Pyth contract.
+    // Instantiate it with the Pyth contract address from https://docs.pyth.network/price-feeds/contract-addresses/evm
+    pyth = IPyth(pythContract);
+  }
+
+  /**
+     * This method is an example of how to interact with the Pyth contract.
+     * Fetch the priceUpdate from Hermes and pass it to the Pyth contract to update the prices.
+     * Add the priceUpdate argument to any method on your contract that needs to read the Pyth price.
+     * See https://docs.pyth.network/price-feeds/fetch-price-updates for more information on how to fetch the priceUpdate.
+
+     * @param priceUpdate The encoded data to update the contract with the latest price
+     */
+  function exampleMethod(bytes[] calldata priceUpdate) public payable {
+    // Submit a priceUpdate to the Pyth contract to update the on-chain price.
+    // Updating the price requires paying the fee returned by getUpdateFee.
+    // WARNING: These lines are required to ensure the getPriceNoOlderThan call below succeeds. If you remove them, transactions may fail with "0x19abf40e" error.
+    uint fee = pyth.getUpdateFee(priceUpdate);
+    pyth.updatePriceFeeds{ value: fee }(priceUpdate);
+
+    // Read the current price from a price feed if it is less than 60 seconds old.
+    // Each price feed (e.g., ETH/USD) is identified by a price feed ID.
+    // The complete list of feed IDs is available at https://docs.pyth.network/price-feeds/price-feeds
+    bytes32 priceFeedId = 0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace; // ETH/USD
+    PythStructs.Price memory price = pyth.getPriceNoOlderThan(priceFeedId, 60);
+  }
+}
+
+```
+
+The code snippet above does the following things:
+
+1. Instantiate the `IPyth` interface from the Solidity SDK using the price feeds [contract address](../../../contract-addresses/evm).
+2. Select the [Price Feed IDs](../../../price-feeds) for the assets you want to fetch prices for. Price feeds come in two varieties, Stable and Beta. You should select Stable feed ids
+3. Call `IPyth.getUpdateFee` to calculate the fee charged by Pyth to update the price.
+4. Call `IPyth.updatePriceFeeds` to update the price, paying the fee calculated in the previous step.
+5. Call `IPyth.getPriceNoOlderThan` to read the current price, providing the [price feed ID](../../../price-feeds) that you wish to read and your acceptable staleness threshold for
+   the price.
+
+## Additional Resources
+
+You may find these additional resources helpful for developing your EVM application.
+
+### API Reference
+
+The [EVM API reference](../../../api-reference) lets you interactively explore the complete API of the Pyth contract.
+
+### Current Fees
+
+The [Current Fees](../../../current-fees) page lists the current fees for each network.
+
+### Error Codes
+
+The [EVM error codes](../../../error-codes/evm) page lists the error codes that the Pyth contract may return.
+
+### Example Applications
+
+[Oracle Swap](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/evm/oracle_swap) is an end-to-end example application that uses Pyth Network price feeds.
+This application is an AMM that allows users to swap two assets at the Pyth-provided exchange rate. The example contains both the contract and a frontend to interact with it.

+ 15 - 0
apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/meta.json

@@ -0,0 +1,15 @@
+{
+  "pages": [
+    "evm",
+    "solana",
+    "starknet",
+    "fuel",
+    "stacks",
+    "aptos",
+    "sui",
+    "iota",
+    "ton",
+    "cosmwasm",
+    "near"
+  ]
+}

二进制
apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png


二进制
apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png


二进制
apps/developer-hub/public/images/EMA_Price_Aggregation_1.png


二进制
apps/developer-hub/public/images/EMA_Price_Aggregation_2.png


二进制
apps/developer-hub/public/images/Price_Aggregation_1.png


二进制
apps/developer-hub/public/images/Price_Aggregation_2.png


二进制
apps/developer-hub/public/images/Price_Aggregation_3.png


二进制
apps/developer-hub/public/images/Price_Aggregation_4.png


二进制
apps/developer-hub/public/images/Price_Aggregation_5.png


二进制
apps/developer-hub/public/images/Price_Aggregation_6.png


二进制
apps/developer-hub/public/images/Price_Aggregation_7.png


二进制
apps/developer-hub/public/images/Pull-Architecture-Hermes.png


二进制
apps/developer-hub/public/images/guides/gelato/dedicated-msg-sender.png


二进制
apps/developer-hub/public/images/guides/gelato/deposit-usdc.png


二进制
apps/developer-hub/public/images/guides/gelato/storage-pyth-config.png


二进制
apps/developer-hub/public/images/guides/gelato/task-creation-gist-id.png


二进制
apps/developer-hub/public/images/guides/gelato/task-execution.png


部分文件因为文件数量过多而无法显示