diff --git a/next.config.js b/next.config.js index cc9b8b2e..99fa6d84 100644 --- a/next.config.js +++ b/next.config.js @@ -86,7 +86,11 @@ const permanentRedirectArray = [ ["/pythnet-price-feeds/hermes", "/price-feeds/how-pyth-works/hermes"], [ "/documentation/pythnet-price-feeds/scheduler", + "/price-feeds/schedule-price-updates/using-price-pusher", + ], + [ "/price-feeds/schedule-price-updates/using-scheduler", + "/price-feeds/schedule-price-updates/using-price-pusher", ], [ "/documentation/pythnet-price-feeds/off-chain", @@ -121,6 +125,13 @@ const permanentRedirectArray = [ ], ["/benchmarks/api-instances", "/price-feeds/api-reference/"], ["/benchmarks/rate-limits", "/price-feeds/rate-limits/"], + + ["/price-feeds/sponsored-feeds", "/price-feeds/push-feeds"], + + [ + "/price-feeds/use-real-time-data/:path((?!pull-integration(?:/|$)).*)", + "/price-feeds/use-real-time-data/pull-integration/:path", + ], ]; /** @type {import('next').NextConfig} */ diff --git a/pages/price-feeds/_meta.json b/pages/price-feeds/_meta.json index 8e90c268..71e6bd4a 100644 --- a/pages/price-feeds/_meta.json +++ b/pages/price-feeds/_meta.json @@ -42,7 +42,7 @@ "api-reference": "API Reference", "price-feeds": "Price Feeds", "current-fees": "Current Fees", - "sponsored-feeds": "Sponsored Feeds", + "push-feeds": "Push Feeds", "market-hours": "Market Hours", "best-practices": "Best Practices", "error-codes": "Error Codes", diff --git a/pages/price-feeds/index.mdx b/pages/price-feeds/index.mdx index 354dd122..2d3e494b 100644 --- a/pages/price-feeds/index.mdx +++ b/pages/price-feeds/index.mdx @@ -5,7 +5,11 @@ import { LightningIcon, MultiChainIcon, ShieldIcon, + CodeIcon, } from "../../components/icons/ProductIcons"; +import ContractIcon from "../../components/icons/ContractIcon"; +import SearchIcon from "../../components/icons/SearchIcon"; +import { Cards, Card } from "nextra/components"; # Introduction to Pyth Price Feeds @@ -14,44 +18,145 @@ Data is sourced from 120+ first-party providers including major exchanges and ma ## Key Features -- **1600+ price feeds** across all major asset classes +- **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 ## Our Products -
+{/* Real-Time Price Feeds - Two Column Layout */} + +
+
+ {/* Left Column - Product Information */} +
+
+
+ Core +
+
+
+ +

+ Real-Time Price Feeds +

+ +

+ Real-time, high-fidelity market data for smart contracts. +

+ + {/* Features */} +
+
+
+ +
+ + Real-time price feeds + +
+
+
+ +
+ + 400ms frequency updates + +
+
+
+ +
+ + 100+ blockchains (EVM, Solana, Aptos, Sui, etc.) + +
+
+ +
+ + Explore Price Feeds + + + + +
+
+ + {/* Right Column - Integration Methods */} +
+

Integration Methods

+
+ {/* Pull Integration */} +
+
+
+
Pull Integration
+
+

+ Update 2000+ prices on-demand, permissionlessly every 400ms. +

+ +
+ + {/* Push Feeds */} +
+
+
+
Push Integration
+
+

+ Consume Pyth real-time prices without pulling them explicitly. +

+ +
+
+
+ +
+
+ +{/* Other Products Grid */} + +
} - title="Real-Time Price Feeds" - description="Real-time, high-fidelity market data for smart contracts." + badge="Benchmarks" + icon={} + title="Historical Data" + description="Access to historical price data for settlement and backtesting." features={[ - { icon: , text: "Real-time price feeds" }, - { icon: , text: "High-frequency data" }, - { icon: , text: "Multi-chain support" } + { icon: , text: "Signed data" }, + { icon: , text: "Verifiable prices" }, + { icon: , text: "Time-stamped prices" }, ]} - ctaText="Explore Price Feeds" - href="./price-feeds/use-real-time-data" + ctaText="Access Historical Data" + href="./price-feeds/use-historic-price-data" /> -{" "} - -} - title="Historical Data" - description="Access to historical price data for settlement and backtesting." - features={[ - { icon: , text: "Signed data" }, - { icon: , text: "Verifiable prices" }, - { icon: , text: "Time-stamped prices" }, - ]} - ctaText="Access Historical Data" - href="./price-feeds/use-historic-price-data" -/> - } @@ -69,6 +174,30 @@ Data is sourced from 120+ first-party providers including major exchanges and ma ## Quick Start -Follow the [Getting Started](price-feeds/getting-started.mdx) guide to integrate Pyth Price Feeds into your application. - -For contract addresses and deployment details, see [Contract Addresses](./price-feeds/contract-addresses). + + } + title="Getting Started" + href="./price-feeds/getting-started" + /> + } + title="Contract Addresses" + href="./price-feeds/contract-addresses" + /> + } + title="Push Feeds" + href="./price-feeds/push-feeds" + /> + } + title="API Reference" + href="./price-feeds/api-reference" + /> + } + title="Price Feed IDs" + href="./price-feeds/price-feeds" + /> + diff --git a/pages/price-feeds/push-feeds.mdx b/pages/price-feeds/push-feeds.mdx new file mode 100644 index 00000000..6cb3aef6 --- /dev/null +++ b/pages/price-feeds/push-feeds.mdx @@ -0,0 +1,37 @@ +import { Callout } from "nextra/components"; + +# Push Feeds + +The Pyth Data Association **pushes** price updates for various feeds on some networks. +These feeds are updated at a specific heartbeat rate or when the price changes by a specific percentage. +Applications can depend on receiving updates for these feeds, without having to pull them explicitly. + +The feeds can vary by network. Please see the relevant section below for the network of interest. + +- [EVM](push-feeds/evm) +- [Solana](push-feeds/solana) +- [Fogo](push-feeds/fogo) +- [Aptos](push-feeds/aptos) +- [Movement](push-feeds/movement) +- [Sui](push-feeds/sui) + + + Deviation thresholds can be customized to fit builders' needs, and additional + feeds can be requested for this list. If you need custom thresholds or would + like to see additional feeds, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + + + Push feeds are subject to change with prior notice. Please refer to the [dev- + forum](https://dev-forum.pyth.network/c/announcements/6) for the latest + changes. + + + + DISCLAIMER: While the Pyth Data Association strives to deliver timely updates, + these push feeds may occasionally experience delays in updates caused by chain + halts, gas estimations and other issues. Applications are advised to run their + own price-pusher. Find out how you can run your own price-pusher + [here](/price-feeds/schedule-price-updates/using-price-pusher). + diff --git a/pages/price-feeds/sponsored-feeds/_meta.json b/pages/price-feeds/push-feeds/_meta.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/_meta.json rename to pages/price-feeds/push-feeds/_meta.json diff --git a/pages/price-feeds/push-feeds/aptos.mdx b/pages/price-feeds/push-feeds/aptos.mdx new file mode 100644 index 00000000..ddae8ac5 --- /dev/null +++ b/pages/price-feeds/push-feeds/aptos.mdx @@ -0,0 +1,15 @@ +import { Callout } from "nextra/components"; + +import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; +import aptosMainnet from "../push-feeds/data/aptos/aptos_mainnet.json"; + +# Push Feeds on Aptos + +## Aptos Mainnet + + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + + diff --git a/pages/price-feeds/sponsored-feeds/data/aptos/aptos_mainnet.json b/pages/price-feeds/push-feeds/data/aptos/aptos_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/aptos/aptos_mainnet.json rename to pages/price-feeds/push-feeds/data/aptos/aptos_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/arbitrum_mainnet.json b/pages/price-feeds/push-feeds/data/evm/arbitrum_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/arbitrum_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/arbitrum_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/avalanche_mainnet.json b/pages/price-feeds/push-feeds/data/evm/avalanche_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/avalanche_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/avalanche_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/base_mainnet.json b/pages/price-feeds/push-feeds/data/evm/base_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/base_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/base_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/berachain_mainnet.json b/pages/price-feeds/push-feeds/data/evm/berachain_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/berachain_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/berachain_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/ethereum_mainnet.json b/pages/price-feeds/push-feeds/data/evm/ethereum_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/ethereum_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/ethereum_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/hyperevm_mainnet.json b/pages/price-feeds/push-feeds/data/evm/hyperevm_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/hyperevm_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/hyperevm_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/linea_mainnet.json b/pages/price-feeds/push-feeds/data/evm/linea_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/linea_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/linea_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/soneium_mainnet.json b/pages/price-feeds/push-feeds/data/evm/soneium_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/soneium_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/soneium_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/evm/sonic_mainnet.json b/pages/price-feeds/push-feeds/data/evm/sonic_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/evm/sonic_mainnet.json rename to pages/price-feeds/push-feeds/data/evm/sonic_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/movement/movement_mainnet.json b/pages/price-feeds/push-feeds/data/movement/movement_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/movement/movement_mainnet.json rename to pages/price-feeds/push-feeds/data/movement/movement_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/sui/sui_mainnet.json b/pages/price-feeds/push-feeds/data/sui/sui_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/sui/sui_mainnet.json rename to pages/price-feeds/push-feeds/data/sui/sui_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/svm/fogo_testnet.json b/pages/price-feeds/push-feeds/data/svm/fogo_testnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/svm/fogo_testnet.json rename to pages/price-feeds/push-feeds/data/svm/fogo_testnet.json diff --git a/pages/price-feeds/sponsored-feeds/data/svm/solana_mainnet.json b/pages/price-feeds/push-feeds/data/svm/solana_mainnet.json similarity index 100% rename from pages/price-feeds/sponsored-feeds/data/svm/solana_mainnet.json rename to pages/price-feeds/push-feeds/data/svm/solana_mainnet.json diff --git a/pages/price-feeds/sponsored-feeds/evm.mdx b/pages/price-feeds/push-feeds/evm.mdx similarity index 57% rename from pages/price-feeds/sponsored-feeds/evm.mdx rename to pages/price-feeds/push-feeds/evm.mdx index 4ec74a86..c2508ddc 100644 --- a/pages/price-feeds/sponsored-feeds/evm.mdx +++ b/pages/price-feeds/push-feeds/evm.mdx @@ -1,17 +1,19 @@ +import { Callout } from "nextra/components"; + import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import arbitrumMainnet from "../sponsored-feeds/data/evm/arbitrum_mainnet.json"; -import avalancheMainnet from "../sponsored-feeds/data/evm/avalanche_mainnet.json"; -import baseMainnet from "../sponsored-feeds/data/evm/base_mainnet.json"; -import berachainMainnet from "../sponsored-feeds/data/evm/berachain_mainnet.json"; -import ethereumMainnet from "../sponsored-feeds/data/evm/ethereum_mainnet.json"; -import hyperevmMainnet from "../sponsored-feeds/data/evm/hyperevm_mainnet.json"; -import soneiumMainnet from "../sponsored-feeds/data/evm/soneium_mainnet.json"; -import sonicMainnet from "../sponsored-feeds/data/evm/sonic_mainnet.json"; -import lineaMainnet from "../sponsored-feeds/data/evm/linea_mainnet.json"; +import arbitrumMainnet from "../push-feeds/data/evm/arbitrum_mainnet.json"; +import avalancheMainnet from "../push-feeds/data/evm/avalanche_mainnet.json"; +import baseMainnet from "../push-feeds/data/evm/base_mainnet.json"; +import berachainMainnet from "../push-feeds/data/evm/berachain_mainnet.json"; +import ethereumMainnet from "../push-feeds/data/evm/ethereum_mainnet.json"; +import hyperevmMainnet from "../push-feeds/data/evm/hyperevm_mainnet.json"; +import soneiumMainnet from "../push-feeds/data/evm/soneium_mainnet.json"; +import sonicMainnet from "../push-feeds/data/evm/sonic_mainnet.json"; +import lineaMainnet from "../push-feeds/data/evm/linea_mainnet.json"; -# Sponsored Feeds on EVM +# Push Feeds on EVM -The following EVM chains have sponsored price feeds: +The following EVM chains have push feeds: - [Arbitrum Mainnet](#arbitrum-mainnet) - [Avalanche Mainnet](#avalanche-mainnet) @@ -23,6 +25,11 @@ The following EVM chains have sponsored price feeds: - [Soneium Mainnet](#soneium-mainnet) - [Sonic Mainnet](#sonic-mainnet) + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + ## Arbitrum Mainnet diff --git a/pages/price-feeds/push-feeds/fogo.mdx b/pages/price-feeds/push-feeds/fogo.mdx new file mode 100644 index 00000000..73a38d4a --- /dev/null +++ b/pages/price-feeds/push-feeds/fogo.mdx @@ -0,0 +1,15 @@ +import { Callout } from "nextra/components"; + +import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; +import fogoTestnet from "../push-feeds/data/svm/fogo_testnet.json"; + +# Push Feeds on Fogo + +## Fogo Testnet + + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + + diff --git a/pages/price-feeds/push-feeds/movement.mdx b/pages/price-feeds/push-feeds/movement.mdx new file mode 100644 index 00000000..5d135de7 --- /dev/null +++ b/pages/price-feeds/push-feeds/movement.mdx @@ -0,0 +1,15 @@ +import { Callout } from "nextra/components"; + +import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; +import movementMainnet from "../push-feeds/data/movement/movement_mainnet.json"; + +# Push Feeds on Movement + +## Movement Mainnet + + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + + diff --git a/pages/price-feeds/push-feeds/solana.mdx b/pages/price-feeds/push-feeds/solana.mdx new file mode 100644 index 00000000..145e492e --- /dev/null +++ b/pages/price-feeds/push-feeds/solana.mdx @@ -0,0 +1,20 @@ +import { Callout } from "nextra/components"; + +import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; +import solanaMainnet from "../push-feeds/data/svm/solana_mainnet.json"; + +# Push Feeds on Solana + + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + +## Solana Mainnet + + + +Note: The addresses represent the price feed account for shard 0 of the relevant price feed id. diff --git a/pages/price-feeds/push-feeds/sui.mdx b/pages/price-feeds/push-feeds/sui.mdx new file mode 100644 index 00000000..a09eb1fd --- /dev/null +++ b/pages/price-feeds/push-feeds/sui.mdx @@ -0,0 +1,15 @@ +import { Callout } from "nextra/components"; + +import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; +import suiMainnet from "../push-feeds/data/sui/sui_mainnet.json"; + +# Push Feeds on Sui + + + If you would like to see additional feeds on this list, please fill in this + [form](https://tally.so/r/nGz2jj) to signal your interest. + + +## Sui Mainnet + + diff --git a/pages/price-feeds/schedule-price-updates.mdx b/pages/price-feeds/schedule-price-updates.mdx index 8c362b20..ac6d8db0 100644 --- a/pages/price-feeds/schedule-price-updates.mdx +++ b/pages/price-feeds/schedule-price-updates.mdx @@ -14,7 +14,7 @@ There are also three different tools to schedule price updates: - [Adrastia's Pyth Price Feed Updater](schedule-price-updates/using-adrastia) is a white-glove service that automates price updates based on time and price deviations, supporting any EVM chain. - [Gelato](schedule-price-updates/using-gelato) provides a turnkey automation solution for scheduled updates. -- [Scheduler](schedule-price-updates/using-scheduler) is a service that developers can run to trigger price updates when certain time or price change conditions are met. +- [Price Pusher](schedule-price-updates/using-price-pusher) is a service that developers can run to trigger price updates when certain time or price change conditions are met. For developers comparing these three options, Adrastia and Gelato are simpler, in that they do not require you to operate a service. diff --git a/pages/price-feeds/schedule-price-updates/_meta.json b/pages/price-feeds/schedule-price-updates/_meta.json index cea14c6e..30143971 100644 --- a/pages/price-feeds/schedule-price-updates/_meta.json +++ b/pages/price-feeds/schedule-price-updates/_meta.json @@ -1,5 +1,5 @@ { "using-adrastia": "Using Adrastia", "using-gelato": "Using Gelato", - "using-scheduler": "Using Scheduler" + "using-price-pusher": "Using Price Pusher" } diff --git a/pages/price-feeds/schedule-price-updates/using-scheduler.mdx b/pages/price-feeds/schedule-price-updates/using-price-pusher.mdx similarity index 82% rename from pages/price-feeds/schedule-price-updates/using-scheduler.mdx rename to pages/price-feeds/schedule-price-updates/using-price-pusher.mdx index d4eb8c2d..01fb49c0 100644 --- a/pages/price-feeds/schedule-price-updates/using-scheduler.mdx +++ b/pages/price-feeds/schedule-price-updates/using-price-pusher.mdx @@ -1,6 +1,6 @@ -# Scheduler +# Price Pusher -The [scheduler](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/price_pusher) (previously known as "price pusher") +The [Price Pusher](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/price_pusher) is an off-chain application that regularly pulls price updates on to a blockchain. Anyone can run this service to regularly update the on-chain Pyth price based on various conditions, such as a minimum update frequency, or a price change threshold. This service can simplify the process of migrating to Pyth from other oracles. diff --git a/pages/price-feeds/sponsored-feeds.mdx b/pages/price-feeds/sponsored-feeds.mdx deleted file mode 100644 index f2edbdb0..00000000 --- a/pages/price-feeds/sponsored-feeds.mdx +++ /dev/null @@ -1,37 +0,0 @@ -import { Callout } from "nextra/components"; - -# Sponsored Feeds - -The Pyth Data Association sponsors price updates for some feeds on some networks. -Sponsored feeds are updated at a specific heartbeat rate or when the price changes by a specific percentage. -Developers don't need to [pull prices](./fetch-price-updates.mdx) for sponsored feeds, unless they required short update intervals. - -The sponsored feeds can vary by network. Please see the relevant section below for the network of interest. - -- [EVM](sponsored-feeds/evm) -- [Solana](sponsored-feeds/solana) -- [Fogo](sponsored-feeds/fogo) -- [Aptos](sponsored-feeds/aptos) -- [Sui](sponsored-feeds/sui) -- [Movement](sponsored-feeds/movement) - - - Sponsored feeds are subject to change with prior notice. Please refer to the - [dev forum](https://dev-forum.pyth.network/c/announcements/6) for the latest - updates. - - - - Deviation thresholds can be customized to fit builders’ needs. For thresholds - lower than those offered by our sponsored feeds, please reach out. - - - - DISCLAIMER: While the Pyth Data Association strives to deliver timely updates, - these sponsored feeds may occasionally experience delays in updates caused by - chain halts, gas estimations and other issues. Applications are advised to run - their own scheduler. Find out how you can run your own scheduler - [here](/price-feeds/schedule-price-updates/using-scheduler). - - -If you would like to see additional feeds on this list, please fill in this [form](https://tally.so/r/nGz2jj) to signal your interest. diff --git a/pages/price-feeds/sponsored-feeds/aptos.mdx b/pages/price-feeds/sponsored-feeds/aptos.mdx deleted file mode 100644 index 15e020aa..00000000 --- a/pages/price-feeds/sponsored-feeds/aptos.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import aptosMainnet from "../sponsored-feeds/data/aptos/aptos_mainnet.json"; - -# Sponsored Feeds on Aptos - -## Aptos Mainnet - - diff --git a/pages/price-feeds/sponsored-feeds/fogo.mdx b/pages/price-feeds/sponsored-feeds/fogo.mdx deleted file mode 100644 index fd9e3a94..00000000 --- a/pages/price-feeds/sponsored-feeds/fogo.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import fogoTestnet from "../sponsored-feeds/data/svm/fogo_testnet.json"; - -# Sponsored Feeds on Fogo - -## Fogo Testnet - - diff --git a/pages/price-feeds/sponsored-feeds/movement.mdx b/pages/price-feeds/sponsored-feeds/movement.mdx deleted file mode 100644 index 0b8d9e46..00000000 --- a/pages/price-feeds/sponsored-feeds/movement.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import movementMainnet from "../sponsored-feeds/data/movement/movement_mainnet.json"; - -# Sponsored Feeds on Movement - -## Movement Mainnet - - diff --git a/pages/price-feeds/sponsored-feeds/solana.mdx b/pages/price-feeds/sponsored-feeds/solana.mdx deleted file mode 100644 index 2b321aea..00000000 --- a/pages/price-feeds/sponsored-feeds/solana.mdx +++ /dev/null @@ -1,13 +0,0 @@ -import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import solanaMainnet from "../sponsored-feeds/data/svm/solana_mainnet.json"; - -# Sponsored Feeds on Solana - -## Solana Mainnet - - - -Note: The addresses represent the price feed account for shard 0 of the relevant price feed id. diff --git a/pages/price-feeds/sponsored-feeds/sui.mdx b/pages/price-feeds/sponsored-feeds/sui.mdx deleted file mode 100644 index 9b761dfc..00000000 --- a/pages/price-feeds/sponsored-feeds/sui.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { SponsoredFeedsTable } from "../../../components/SponsoredFeedsTableWithData"; -import suiMainnet from "../sponsored-feeds/data/sui/sui_mainnet.json"; - -# Sponsored Feeds on Sui - -## Sui Mainnet - - diff --git a/pages/price-feeds/use-pyth-for-morpho.mdx b/pages/price-feeds/use-pyth-for-morpho.mdx index 369e6ca2..66c56243 100644 --- a/pages/price-feeds/use-pyth-for-morpho.mdx +++ b/pages/price-feeds/use-pyth-for-morpho.mdx @@ -8,24 +8,26 @@ Pyth provides a wrapper which implements Morpho's `IOracle` interface called [`p There are two steps to use Pyth price feeds for Morpho markets: -1. Run the price pusher or scheduler. +1. Schedule Price Updates. 2. Deploy the [`MorphoPythOracle.sol`](https://github.com/pyth-network/pyth-morpho-wrapper/blob/main/src/morpho-pyth/MorphoPythOracle.sol) contract for the respective price feed pair. -### Run the price pusher or scheduler +### Schedule Price Updates As a pull oracle, Pyth's users are typically responsible for updating the state of on-chain feeds. Please see [What is a Pull Oracle?](/price-feeds/pull-updates) to learn more about pull updates. +Consult [Schedule Price Updates](/price-feeds/schedule-price-updates) guide for more information. + The Pyth Data Association sponsors regular on-chain updates for some price feeds. See [Sponsored Feeds](./sponsored-feeds.mdx) for the current list of feeds and their update parameters. -If you don't find relevant price IDs in the [Sponsored Feeds](./sponsored-feeds.mdx) list, please contact the Pyth team [here](https://tally.so/r/nGz2jj) to run the scheduler/price pusher for the price feed you need. +If you don't find relevant price IDs in the [Sponsored Feeds](./sponsored-feeds.mdx) list, please contact the Pyth team [here](https://tally.so/r/nGz2jj) to run the Price Pusher for the price feed you need. ### Deploy the Morpho oracle contract -After running the price pusher or scheduler, you can deploy the Morpho oracle contract using the MorphoPythOracle.sol contract. +After running the [Price Pusher](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/price_pusher), you can deploy the Morpho oracle contract using the MorphoPythOracle.sol contract. To deploy a MorphoPythOracle on an EVM chain, we highly recommend using the factory MorphoPythOracleFactory. Please refer to the factory addresses [here](https://github.com/pyth-network/pyth-morpho-wrapper?tab=readme-ov-file#factory-addresses). diff --git a/pages/price-feeds/use-real-time-data.mdx b/pages/price-feeds/use-real-time-data.mdx index ce0a9d02..fc3af2c4 100644 --- a/pages/price-feeds/use-real-time-data.mdx +++ b/pages/price-feeds/use-real-time-data.mdx @@ -1,22 +1,51 @@ +import { Callout } from "nextra/components"; + # How to Use Real-Time Price Data 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 price data, i.e., the price data must +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 [webserveice](./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. + + + All feeds are available through both integration methods. However, for the to + use push integration, the application needs to submit the prices to the + on-chain smart contract as part of the transaction. Check out the [Push + Integration](use-real-time-data/push-integration) guide to get started. + + +## 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.md) +- [CosmWasm](use-real-time-data/pull-integration/cosmwasm.md) +- [Sui](use-real-time-data/pull-integration/sui.md) +- [IOTA](use-real-time-data/pull-integration/iota.md) +- [Near](use-real-time-data/pull-integration/near.md) + +## 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) -If your blockchain is not supported, please [ask in Discord](https://discord.gg/invite/PythNetwork). -Then, consult the relevant ecosystem guide to get started using Pyth real-time price data: +This guide will walk you through the steps to use real-time price data using push integration in every ecosystem. -- [EVM](use-real-time-data/evm) -- [Solana](use-real-time-data/solana) -- [Aptos](use-real-time-data/aptos.md) -- [CosmWasm](use-real-time-data/cosmwasm.md) -- [Sui](use-real-time-data/sui.md) -- [IOTA](use-real-time-data/iota.md) -- [Near](use-real-time-data/sui.md) +## 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. @@ -24,6 +53,4 @@ Developers building such applications can consult the following guide: - [Off-chain Apps](use-real-time-data/off-chain.md) -Off-chain application developers should also consider using [Benchmarks](../benchmarks). -In addition to real-time data, Benchmarks provides access to historical Pyth prices. -These historical prices are useful for building price charts or graphs. +To fetch historical prices, application developers can check out the [Use Historic Price Data](use-historic-price-data) guide. diff --git a/pages/price-feeds/use-real-time-data/_meta.json b/pages/price-feeds/use-real-time-data/_meta.json index ec7a0445..e558db33 100644 --- a/pages/price-feeds/use-real-time-data/_meta.json +++ b/pages/price-feeds/use-real-time-data/_meta.json @@ -1,14 +1,4 @@ { - "evm": "in EVM Contracts", - "solana": "in Solana and SVM Programs", - "starknet": "in Starknet Contracts", - "fuel": "in Fuel Contracts", - "stacks": "in Stacks Contracts", - "aptos": "in Aptos Contracts", - "sui": "in Sui Contracts", - "iota": "in IOTA Contracts", - "ton": "in TON Contracts", - "cosmwasm": "in CosmWasm Contracts", - "near": "in Near Contracts", - "off-chain": "in Off-Chain Applications" + "pull-integration": "using Pull Integration", + "push-integration": "using Push Integration" } diff --git a/pages/price-feeds/use-real-time-data/off-chain.mdx b/pages/price-feeds/use-real-time-data/off-chain.mdx deleted file mode 100644 index e0cdc788..00000000 --- a/pages/price-feeds/use-real-time-data/off-chain.mdx +++ /dev/null @@ -1,13 +0,0 @@ -import { Callout } from "nextra/components"; - -# How to Use Real-Time Data in Off-Chain Applications - -This guide explains how to fetch the latest prices and subscribe to real-time price updates in off-chain applications. - - - [`price-service-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) was is deprecated and replaced by the [`hermes-client`](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). - It can be used for fetching prices for off-chain applications as well as fetching price updates. - -Please refer to the [fetch-price-updates](../fetch-price-updates) guide for the details. - - diff --git a/pages/price-feeds/use-real-time-data/pull-integration/_meta.json b/pages/price-feeds/use-real-time-data/pull-integration/_meta.json new file mode 100644 index 00000000..b060d1f9 --- /dev/null +++ b/pages/price-feeds/use-real-time-data/pull-integration/_meta.json @@ -0,0 +1,13 @@ +{ + "evm": "in EVM Contracts", + "solana": "in Solana and SVM Programs", + "starknet": "in Starknet Contracts", + "fuel": "in Fuel Contracts", + "stacks": "in Stacks Contracts", + "aptos": "in Aptos Contracts", + "sui": "in Sui Contracts", + "iota": "in IOTA Contracts", + "ton": "in TON Contracts", + "cosmwasm": "in CosmWasm Contracts", + "near": "in Near Contracts" +} diff --git a/pages/price-feeds/use-real-time-data/aptos.mdx b/pages/price-feeds/use-real-time-data/pull-integration/aptos.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/aptos.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/aptos.mdx diff --git a/pages/price-feeds/use-real-time-data/cosmwasm.mdx b/pages/price-feeds/use-real-time-data/pull-integration/cosmwasm.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/cosmwasm.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/cosmwasm.mdx diff --git a/pages/price-feeds/use-real-time-data/evm.mdx b/pages/price-feeds/use-real-time-data/pull-integration/evm.mdx similarity index 87% rename from pages/price-feeds/use-real-time-data/evm.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/evm.mdx index 5ec23531..f497a6e1 100644 --- a/pages/price-feeds/use-real-time-data/evm.mdx +++ b/pages/price-feeds/use-real-time-data/pull-integration/evm.mdx @@ -1,10 +1,21 @@ ---- -description: Consume Pyth Network prices in EVM applications ---- +import { Callout } from "nextra/components"; # How to Use Real-Time Data in EVM Contracts -This guide explains how to use real-time Pyth data in EVM contracts. For an interactive playground to explore the methods supported by the Pyth contract, see the [EVM API reference](../api-reference/evm/). +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/evm/). + + + 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). + +For complete example, refer to the [Push Integration guide](../push-integration). + + ## Install Pyth SDK diff --git a/pages/price-feeds/use-real-time-data/fuel.mdx b/pages/price-feeds/use-real-time-data/pull-integration/fuel.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/fuel.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/fuel.mdx diff --git a/pages/price-feeds/use-real-time-data/iota.mdx b/pages/price-feeds/use-real-time-data/pull-integration/iota.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/iota.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/iota.mdx diff --git a/pages/price-feeds/use-real-time-data/near.mdx b/pages/price-feeds/use-real-time-data/pull-integration/near.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/near.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/near.mdx diff --git a/pages/price-feeds/use-real-time-data/solana.mdx b/pages/price-feeds/use-real-time-data/pull-integration/solana.mdx similarity index 99% rename from pages/price-feeds/use-real-time-data/solana.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/solana.mdx index 262e442c..224cfbae 100644 --- a/pages/price-feeds/use-real-time-data/solana.mdx +++ b/pages/price-feeds/use-real-time-data/pull-integration/solana.mdx @@ -140,8 +140,8 @@ const solUsdPriceFeedAccount = pythSolanaReceiver Additionally, updating a price feed is a permissionless operation, and anyone can run this process. Please see [Using -Scheduler](/price-feeds/schedule-price-updates/using-scheduler) for more -information. Running the scheduler can help with reliability and update +Price Pusher](/price-feeds/schedule-price-updates/using-price-pusher) for more +information. Running the Price Pusher can help with reliability and update feed/shard pairs that are not part of the default schedule. diff --git a/pages/price-feeds/use-real-time-data/stacks.mdx b/pages/price-feeds/use-real-time-data/pull-integration/stacks.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/stacks.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/stacks.mdx diff --git a/pages/price-feeds/use-real-time-data/starknet.mdx b/pages/price-feeds/use-real-time-data/pull-integration/starknet.mdx similarity index 99% rename from pages/price-feeds/use-real-time-data/starknet.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/starknet.mdx index dfb901f8..587cdf14 100644 --- a/pages/price-feeds/use-real-time-data/starknet.mdx +++ b/pages/price-feeds/use-real-time-data/pull-integration/starknet.mdx @@ -22,7 +22,7 @@ Pyth also provides a javascript SDK to interact with the Pyth contract on Starkn ```sh copy - npm install --save @pythnetwork/pyth-starknet-js + npm install --save @pythnetwork/pyth-starknet-js ``` diff --git a/pages/price-feeds/use-real-time-data/sui.mdx b/pages/price-feeds/use-real-time-data/pull-integration/sui.mdx similarity index 100% rename from pages/price-feeds/use-real-time-data/sui.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/sui.mdx diff --git a/pages/price-feeds/use-real-time-data/ton.mdx b/pages/price-feeds/use-real-time-data/pull-integration/ton.mdx similarity index 98% rename from pages/price-feeds/use-real-time-data/ton.mdx rename to pages/price-feeds/use-real-time-data/pull-integration/ton.mdx index 53dd0473..f80319ef 100644 --- a/pages/price-feeds/use-real-time-data/ton.mdx +++ b/pages/price-feeds/use-real-time-data/pull-integration/ton.mdx @@ -14,15 +14,15 @@ Install the Pyth TON SDK and other necessary dependencies using npm: - ```sh copy + ```sh copy npm install @pythnetwork/pyth-ton-js @pythnetwork/hermes-client - @ton/core @ton/ton @ton/crypto + @ton/core @ton/ton @ton/crypto ``` - ```sh copy + ```sh copy yarn add @pythnetwork/pyth-ton-js @pythnetwork/hermes-client - @ton/core @ton/ton @ton/crypto + @ton/core @ton/ton @ton/crypto ``` diff --git a/pages/price-feeds/use-real-time-data/push-integration.mdx b/pages/price-feeds/use-real-time-data/push-integration.mdx new file mode 100644 index 00000000..73509237 --- /dev/null +++ b/pages/price-feeds/use-real-time-data/push-integration.mdx @@ -0,0 +1,71 @@ +# How to Use Real-Time Data using Push Integration + +This guide will walk you through the steps to use real-time price data using push integration in various ecosystems. + +To use the push integration, developers first need to ensure the feeds used by their application are being updated on-chain. +Refer to the [Push Feeds page](../push-feeds) to see which feeds are being updated on each blockchain. +If your feeds are not listed there, you have several options: + +- **Request Feeds**: Fill out [this form](https://tally.so/r/nGz2jj) to request the feeds you need. This is the fastest and simplest way to get your feeds pushed on chain. +- **Run Price Pusher**: Set up and run a [Price Pusher](/price-feeds/schedule-price-updates/using-price-pusher) to automate the process of updating the on-chain price + +To use real-time price data using push feeds, developers can use the following code snippet based on the ecosystem: + +### EVM + +Developers building on EVM chains can use push feeds to consume real-time price data by reading the price from the Pyth oracle smart contract. + +```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). + +Sample code snippet: + +```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 using Push Integration. + */ + function exampleMethod() public { + // 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); + } +} + +``` + +### SVM + +Developers building on SVM chains can use Price Feed Accounts to integrate Pyth using push integration. +The [SVM guide](../use-real-time-data/solana#price-feed-accounts) explains in detail how to integrate Pyth using Price Feed Accounts. + +### Aptos + +Developers building on Aptos can use push feeds to consume real-time price data by reading the price from the Pyth Oracle smart contract on Aptos. + +```rust copy +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) +```