import { ArrowsOutSimple } from "@phosphor-icons/react/dist/ssr/ArrowsOutSimple"; import { BookOpenText } from "@phosphor-icons/react/dist/ssr/BookOpenText"; import { Browsers } from "@phosphor-icons/react/dist/ssr/Browsers"; import { ShieldChevron } from "@phosphor-icons/react/dist/ssr/ShieldChevron"; import { Badge } from "@pythnetwork/component-library/Badge"; import { Breadcrumbs } from "@pythnetwork/component-library/Breadcrumbs"; import { Button } from "@pythnetwork/component-library/Button"; import { DrawerTrigger, Drawer } from "@pythnetwork/component-library/Drawer"; import { InfoBox } from "@pythnetwork/component-library/InfoBox"; import { Link } from "@pythnetwork/component-library/Link"; import { StatCard } from "@pythnetwork/component-library/StatCard"; import { lookup } from "@pythnetwork/known-publishers"; import { notFound } from "next/navigation"; import type { ReactNode } from "react"; import { getPriceFeeds } from "./get-price-feeds"; import styles from "./layout.module.scss"; import { OisApyHistory } from "./ois-apy-history"; import { PriceFeedDrawerProvider } from "./price-feed-drawer-provider"; import { getPublisherRankingHistory, getPublisherAverageScoreHistory, getPublishers, } from "../../services/clickhouse"; import { getPublisherCaps } from "../../services/hermes"; import { Cluster } from "../../services/pyth"; import { getPublisherPoolData } from "../../services/staking"; import { ChangePercent } from "../ChangePercent"; import { ChangeValue } from "../ChangeValue"; import { ChartCard } from "../ChartCard"; import { Explain } from "../Explain"; import { ExplainAverage, ExplainActive, ExplainInactive, } from "../Explanations"; import { FormattedDate } from "../FormattedDate"; import { FormattedNumber } from "../FormattedNumber"; import { FormattedTokens } from "../FormattedTokens"; import { Meter } from "../Meter"; import { PriceFeedIcon } from "../PriceFeedIcon"; import { PublisherIcon } from "../PublisherIcon"; import { PublisherKey } from "../PublisherKey"; import { PublisherTag } from "../PublisherTag"; import { SemicircleMeter } from "../SemicircleMeter"; import { TabPanel, TabRoot, Tabs } from "../Tabs"; import { TokenIcon } from "../TokenIcon"; type Props = { children: ReactNode; params: Promise<{ key: string; }>; }; export const PublishersLayout = async ({ children, params }: Props) => { const { key } = await params; const [ rankingHistory, averageScoreHistory, oisStats, priceFeeds, publishers, ] = await Promise.all([ getPublisherRankingHistory(key), getPublisherAverageScoreHistory(key), getOisStats(key), getPriceFeeds(Cluster.Pythnet, key), getPublishers(), ]); const currentRanking = rankingHistory.at(-1); const previousRanking = rankingHistory.at(-2); const currentAverageScore = averageScoreHistory.at(-1); const previousAverageScore = averageScoreHistory.at(-2); const knownPublisher = lookup(key); const publisher = publishers.find((publisher) => publisher.key === key); return publisher && currentRanking && currentAverageScore ? ( ({ symbol: feed.symbol, displaySymbol: feed.product.display_symbol, description: feed.product.description, icon: , feedKey: feed.product.price_account, score: ranking?.final_score, rank: ranking?.final_rank, status, }))} >
}, ]} />
, })} />

Each Publisher receives a Ranking which is derived from the number of price feeds the Publisher{" "} is actively publishing.

} data={rankingHistory.map(({ timestamp, rank }) => ({ x: timestamp, y: rank, displayX: ( ), }))} stat={currentRanking.rank} {...(previousRanking && { miniStat: ( {Math.abs(currentRanking.rank - previousRanking.rank)} ), })} /> } data={averageScoreHistory.map(({ time, averageScore }) => ({ x: time, y: averageScore, displayX: ( ), displayY: ( ), }))} stat={ } {...(previousAverageScore && { miniStat: ( ), })} /> Active Feeds } header2={ <> Inactive Feeds } stat1={ {publisher.activeFeeds} } stat2={ {publisher.inactiveFeeds} } miniStat1={ <> % } miniStat2={ <> % } > oisStats.maxPoolSize ? "" : undefined } > % } corner={} > } endLabel={ } /> } >
OIS Pool
} /> } /> } header="Oracle Integrity Staking (OIS)" > OIS allows anyone to help secure Pyth and protect DeFi. Through decentralized staking rewards and slashing, OIS incentivizes Pyth publishers to maintain high-quality data contributions. PYTH holders can stake to publishers to further reinforce oracle security. Rewards are programmatically distributed to high quality publishers and the stakers supporting them to strengthen oracle integrity.
Price Feeds {priceFeeds.length}
), }, ]} /> {children}
) : ( notFound() ); }; const getChangeDirection = (previousValue: number, currentValue: number) => { if (currentValue < previousValue) { return "down"; } else if (currentValue > previousValue) { return "up"; } else { return "flat"; } }; const getOisStats = async (key: string) => { const [publisherPoolData, publisherCaps] = await Promise.all([ getPublisherPoolData(), getPublisherCaps(), ]); const publisher = publisherPoolData.find( (publisher) => publisher.pubkey === key, ); return { apyHistory: publisher?.apyHistory, poolUtilization: (publisher?.totalDelegation ?? 0n) + (publisher?.totalDelegationDelta ?? 0n), maxPoolSize: publisherCaps.parsed?.[0]?.publisher_stake_caps.find( ({ publisher }) => publisher === key, )?.cap ?? 0, }; };