Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit aef4a37

Browse files
Move 'Why Update Prices' section to Understanding Pyth
- Created new page at pages/price-feeds/how-pyth-works/why-update-prices.mdx - Updated EVM guide warning to link to the new page - Added new page to navigation in _meta.json Co-Authored-By: Nidhi Singh <[email protected]>
1 parent ac2f3d1 commit aef4a37

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

pages/price-feeds/how-pyth-works/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"pythnet": "Pythnet",
33
"oracle-program": "Oracle Program",
44
"cross-chain": "Cross-chain",
5+
"why-update-prices": "Why Update Prices",
56
"fees": "Fees",
67
"hermes": "Hermes",
78
"price-aggregation": "Price Aggregation",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Why Update Prices
2+
3+
Pyth uses a pull-based oracle model. Unlike traditional push oracles that automatically update prices on-chain at regular intervals, Pyth requires users to explicitly update the on-chain price before reading it.
4+
5+
This design offers several advantages:
6+
7+
- **Lower costs**: You only pay for price updates when you need them
8+
- **Lower latency**: You can fetch the latest price update directly from Pyth's low-latency oracle network and submit it on-chain immediately
9+
- **Flexibility**: Different applications can update prices at different frequencies based on their needs
10+
11+
In the Pull integration pattern, your contract must:
12+
13+
1. Accept `priceUpdate` data from the caller (fetched from [Hermes](./hermes))
14+
2. Call `updatePriceFeeds()` to submit this data on-chain before reading prices
15+
3. Pay a small fee for each update (calculated via `getUpdateFee()`)
16+
17+
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. See [how to fetch price updates](../fetch-price-updates) for more details on obtaining price updates.

pages/price-feeds/use-real-time-data/pull-integration/evm.mdx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,8 @@ Then add the following line to your `remappings.txt` file:
4646
@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity
4747
```
4848

49-
## Why Update Prices
50-
51-
Pyth uses a pull-based oracle model. Unlike traditional push oracles that automatically update prices on-chain at regular intervals, Pyth requires users to explicitly update the on-chain price before reading it.
52-
53-
This design offers several advantages:
54-
55-
- **Lower costs**: You only pay for price updates when you need them
56-
- **Lower latency**: You can fetch the latest price update directly from Pyth's low-latency oracle network and submit it on-chain immediately
57-
- **Flexibility**: Different applications can update prices at different frequencies based on their needs
58-
59-
In the Pull integration pattern, your contract must:
60-
61-
1. Accept `priceUpdate` data from the caller (fetched from [Hermes](../../how-pyth-works/hermes))
62-
2. Call `updatePriceFeeds()` to submit this data on-chain before reading prices
63-
3. Pay a small fee for each update (calculated via `getUpdateFee()`)
64-
6549
<Callout type="warning" emoji="⚠️">
66-
**Important**: If you don't update the price or if the on-chain price becomes
67-
too stale, calls to `getPriceNoOlderThan()` will revert with a `StalePrice`
68-
error (0x19abf40e). See [how to fetch price
69-
updates](../../fetch-price-updates) for more details.
50+
**Important**: Pyth uses a pull-based 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](../../how-pyth-works/why-update-prices) and see [how to fetch price updates](../../fetch-price-updates) for implementation details.
7051
</Callout>
7152

7253
## Write Contract Code

0 commit comments

Comments
 (0)