diff --git a/apps/developer-hub/content/docs/price-feeds/core/price-feeds/price-feed-ids.mdx b/apps/developer-hub/content/docs/price-feeds/core/price-feeds/price-feed-ids.mdx index 528048811b..7d2b4e6f4a 100644 --- a/apps/developer-hub/content/docs/price-feeds/core/price-feeds/price-feed-ids.mdx +++ b/apps/developer-hub/content/docs/price-feeds/core/price-feeds/price-feed-ids.mdx @@ -8,7 +8,7 @@ import { Callout } from "fumadocs-ui/components/callout"; import { Suspense } from "react"; import { PriceFeedIdsCoreTable } from "../../../../../src/components/PriceFeedIdsCoreTable"; -The following table lists the price feed IDs for all the assets supported by Pyth Core. +The following table lists the price feed IDs for all the assets supported by Pyth Core. The two Solana columns show each feed's shard-0 price feed account address under the current and upgraded Pyth Core program IDs — see the [Pyth Core upgrade contract addresses](/price-feeds/core/upgrade/contracts) page for the program-ID pair and the August 18, 2026 switchover context. Pyth Core Price Feed IDs **are different** from Pyth Pro Price Feed IDs. diff --git a/apps/developer-hub/content/docs/price-feeds/core/upgrade/contracts.mdx b/apps/developer-hub/content/docs/price-feeds/core/upgrade/contracts.mdx index b475516d18..e284eb3279 100644 --- a/apps/developer-hub/content/docs/price-feeds/core/upgrade/contracts.mdx +++ b/apps/developer-hub/content/docs/price-feeds/core/upgrade/contracts.mdx @@ -98,6 +98,8 @@ Each Solana push feed lives at a PDA derived from the Price Feed program ID and hideAccountAddress /> +To look up the upgraded price feed account address for any Pyth Core feed — sponsored or not — see the [Price Feed IDs](/price-feeds/core/price-feeds/price-feed-ids) page, which lists the current and upgraded shard-0 addresses for every feed. + ### Pyth Pro program diff --git a/apps/developer-hub/src/components/PriceFeedIdsCoreTable/index.tsx b/apps/developer-hub/src/components/PriceFeedIdsCoreTable/index.tsx index 83883c207b..0f0b592279 100644 --- a/apps/developer-hub/src/components/PriceFeedIdsCoreTable/index.tsx +++ b/apps/developer-hub/src/components/PriceFeedIdsCoreTable/index.tsx @@ -1,13 +1,16 @@ "use client"; -// eslint-disable-next-line unicorn/prefer-node-protocol -import { Buffer as IsomorphicBuffer } from "buffer"; import { Paginator } from "@pythnetwork/component-library/Paginator"; import { SearchInput } from "@pythnetwork/component-library/SearchInput"; import type { ColumnConfig } from "@pythnetwork/component-library/Table"; import { Table } from "@pythnetwork/component-library/Table"; import { useQueryParamFilterPagination } from "@pythnetwork/component-library/useQueryParamsPagination"; -import { getPriceFeedAccountForProgram } from "@pythnetwork/pyth-solana-receiver"; +import { + getPriceFeedAccountForProgram, + PRO_COMPATIBLE_PUSH_ORACLE_PROGRAM_ID, +} from "@pythnetwork/pyth-solana-receiver"; +// eslint-disable-next-line unicorn/prefer-node-protocol +import { Buffer as IsomorphicBuffer } from "buffer"; import { Callout } from "fumadocs-ui/components/callout"; import { matchSorter } from "match-sorter"; import { useEffect, useState } from "react"; @@ -30,10 +33,17 @@ export const PriceFeedIdsCoreTable = () => { }, []); const columns: ColumnConfig[] = [ - { id: "symbol", name: "Symbol", isRowHeader: true }, + { id: "symbol", isRowHeader: true, name: "Symbol" }, { id: "stableFeedId", name: "Stable Price Feed ID" }, { id: "betaFeedId", name: "Beta Price Feed ID" }, - { id: "solanaPriceFeedAccount", name: "Solana Price Feed Account" }, + { + id: "solanaPriceFeedAccount", + name: "Current Solana Price Feed Account", + }, + { + id: "upgradedSolanaPriceFeedAccount", + name: "Upgraded Solana Price Feed Account", + }, ]; const { @@ -59,10 +69,11 @@ export const PriceFeedIdsCoreTable = () => { "stableFeedId", "betaFeedId", "solanaPriceFeedAccount", + "upgradedSolanaPriceFeedAccount", ], }); }, - { defaultSort: "symbol", defaultPageSize: 10 }, + { defaultPageSize: 10, defaultSort: "symbol" }, ); if (state.type === StateType.Error) { @@ -73,49 +84,55 @@ export const PriceFeedIdsCoreTable = () => { state.type === StateType.Loading || state.type === StateType.NotLoaded; const rows = paginatedItems.map((feed) => ({ - id: feed.symbol, data: { - symbol: feed.symbol, - stableFeedId: feed.stableFeedId ? ( - - ) : undefined, betaFeedId: feed.betaFeedId ? ( - + ) : undefined, solanaPriceFeedAccount: feed.solanaPriceFeedAccount ? ( - + + ) : undefined, + stableFeedId: feed.stableFeedId ? ( + + ) : undefined, + symbol: feed.symbol, + upgradedSolanaPriceFeedAccount: feed.upgradedSolanaPriceFeedAccount ? ( + ) : undefined, }, + id: feed.symbol, })); return ( <> {...(isLoading ? { isLoading: true } : { isLoading: false, rows })} - label="Price feed ids" columns={columns} + fill + label="Price feed ids" onSortChange={updateSortDescriptor} + rounded sortDescriptor={sortDescriptor} stickyHeader="top" - fill - rounded /> ); @@ -139,13 +156,13 @@ enum StateType { } const State = { - NotLoaded: () => ({ type: StateType.NotLoaded as const }), - Loading: () => ({ type: StateType.Loading as const }), + Failed: (error: unknown) => ({ error, type: StateType.Error as const }), Loaded: (feeds: Awaited>) => ({ - type: StateType.Loaded as const, feeds, + type: StateType.Loaded as const, }), - Failed: (error: unknown) => ({ type: StateType.Error as const, error }), + Loading: () => ({ type: StateType.Loading as const }), + NotLoaded: () => ({ type: StateType.NotLoaded as const }), }; type State = ReturnType<(typeof State)[keyof typeof State]>; @@ -165,15 +182,22 @@ const getFeeds = async () => { stableFeedId?: string; betaFeedId?: string; solanaPriceFeedAccount?: string; + upgradedSolanaPriceFeedAccount?: string; } >(); for (const feed of pythnet ?? []) { + const feedIdBuffer = IsomorphicBuffer.from(feed.id, "hex"); feeds.set(feed.attributes.symbol, { - stableFeedId: `0x${feed.id}`, solanaPriceFeedAccount: getPriceFeedAccountForProgram( 0, - IsomorphicBuffer.from(feed.id, "hex"), + feedIdBuffer, + ).toBase58(), + stableFeedId: `0x${feed.id}`, + upgradedSolanaPriceFeedAccount: getPriceFeedAccountForProgram( + 0, + feedIdBuffer, + PRO_COMPATIBLE_PUSH_ORACLE_PROGRAM_ID, ).toBase58(), }); } @@ -203,9 +227,14 @@ const getFeedsFromHermes = async ( const hermesSchema = z.array( z.object({ - id: z.string(), attributes: z.object({ symbol: z.string() }), + id: z.string(), }), ); -type Col = "symbol" | "stableFeedId" | "betaFeedId" | "solanaPriceFeedAccount"; +type Col = + | "symbol" + | "stableFeedId" + | "betaFeedId" + | "solanaPriceFeedAccount" + | "upgradedSolanaPriceFeedAccount";