You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move 'Why Update Prices' section to Understanding Pyth (#909)
* 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]>
* Apply prettier formatting to EVM guide warning
Co-Authored-By: Nidhi Singh <[email protected]>
* Address PR feedback: fix terminology and move page to top-level nav
- Changed 'pull-based oracle model' to 'pull oracle model' (2 occurrences)
- Changed 'Pull integration pattern' to 'pull integration pattern' (lowercase)
- Moved why-update-prices.mdx from how-pyth-works/ to price-feeds/ level
- Updated navigation to show in main 'Understanding Pyth' section
- Updated all links to reflect new file location
Co-Authored-By: Nidhi Singh <[email protected]>
* Apply prettier formatting to EVM guide callout
Co-Authored-By: Nidhi Singh <[email protected]>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Nidhi Singh <[email protected]>
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
-
65
49
<Callouttype="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 oracle model that requires users to update
51
+
prices on-chain before reading them. If you don't update the price or if the
52
+
on-chain price becomes too stale, calls to `getPriceNoOlderThan()` will revert
53
+
with a `StalePrice` error (0x19abf40e). Learn more about [why you need to
54
+
update prices](../../why-update-prices) and see [how to fetch price
55
+
updates](../../fetch-price-updates) for implementation details.
Pyth uses a pull 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](./how-pyth-works/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.
0 commit comments