# Pyth Core — Quick Start > Decentralized pull-based price oracle delivering 500+ feeds with 400ms updates across 100+ chains. > This file contains a curated quick-start. For full docs, fetch individual pages below. ## Overview Pyth Core is a pull-based oracle providing real-time, low-latency price data from 120+ first-party publishers including major exchanges, trading firms, and market makers. Unlike push oracles, Pyth Core lets applications fetch prices on-demand, paying gas only when needed. The pull model works in three steps: (1) fetch signed price data from the off-chain Hermes service, (2) submit it to the on-chain Pyth contract for verification, and (3) read the verified price. This happens in a single transaction. Supported chains: EVM, Solana, and Sui. All 500+ feeds are available on all chains. The on-chain contracts are permissionless — anyone can push a price update — but the Hermes API requires a Pyth API Key. ## Key Concepts **Pull Oracle Model**: Your app requests price updates from Hermes (off-chain API), submits them on-chain for verification, and reads the result — all in one transaction. Cheaper and fresher than push oracles. **Price Structure**: Each price contains four fields: - `price` (int64) — Price as integer, multiply by 10^expo for actual value - `conf` (uint64) — Confidence interval (same scale as price) - `expo` (int32) — Exponent, typically -8 (divide by 10^8) - `publishTime` (uint) — Unix timestamp of publication **Confidence Intervals**: Statistical range where the true price likely falls (95% coverage). Use (price - conf) for conservative valuations, (price + conf) for liability protection. Pause activity if conf/price ratio exceeds your threshold. **Staleness**: Prices become stale if not recently updated or outside market hours. Always use `getPriceNoOlderThan()` with an appropriate age threshold rather than `getPriceUnsafe()`. **Hermes Authentication**: Since **August 26, 2026**, every `hermes.pyth.network` request requires a Pyth API Key. Send it as an `Authorization: Bearer $PYTH_API_KEY` header, or pass it as the `accessToken` option to the SDK clients (`HermesClient`, `SuiPriceServiceConnection`). Get a key at https://app.pyth.com/signup?utm_source=developer-hub&utm_campaign=llms-txt&utm_content=llms-price-feeds-core. The on-chain Pyth contracts stay permissionless and need no key. **Update Fees**: The update fee is 0 on every supported network — Pyth governance zeroed it in OP-PIP-128. Call `getUpdateFee()` for the authoritative amount before submitting. ## Integration Code ### EVM (Solidity) ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@pythnetwork/pyth-sdk-solidity/IPyth.sol"; import "@pythnetwork/pyth-sdk-solidity/PythStructs.sol"; contract MyContract { IPyth pyth; constructor(address pythContract) { pyth = IPyth(pythContract); } function getPrice( bytes32 priceId, bytes[] calldata priceUpdateData ) public payable returns (int64 price, uint64 conf, int32 expo) { // Step 1: Pay the fee and update the price uint fee = pyth.getUpdateFee(priceUpdateData); pyth.updatePriceFeeds{value: fee}(priceUpdateData); // Step 2: Read the price (reverts if older than 60 seconds) PythStructs.Price memory p = pyth.getPriceNoOlderThan(priceId, 60); return (p.price, p.conf, p.expo); } } ``` Install: `npm install @pythnetwork/pyth-sdk-solidity` ### TypeScript (Hermes Client) ```typescript import { HermesClient } from "@pythnetwork/hermes-client"; const client = new HermesClient("https://hermes.pyth.network", { accessToken: process.env.PYTH_API_KEY, }); const ETH_USD = "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace"; // Fetch latest price update const priceUpdates = await client.getLatestPriceUpdates([ETH_USD]); const parsed = priceUpdates.parsed[0]; console.log("Price:", parsed.price.price); console.log("Confidence:", parsed.price.conf); // The binary data to submit on-chain const updateData = priceUpdates.binary.data; ``` Install: `npm install @pythnetwork/hermes-client` ### Streaming (Server-Sent Events) ```typescript const eventSource = await client.getPriceUpdatesStream([ETH_USD]); eventSource.onMessage((update) => { console.log("New price:", update.parsed[0].price.price); }); // Note: SSE streams auto-close after 24 hours — implement reconnection logic ``` ## Contract Addresses ### EVM Mainnet - Ethereum: **Updated Address** - Arbitrum: **Updated Address** - Base: **Updated Address** - Optimism: **Updated Address** - Polygon: **Updated Address** - Avalanche: **Updated Address** - BNB Chain: **Updated Address** ### Solana - Mainnet: FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH - Devnet: gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s Full list: https://docs.pyth.network/pro/contract-addresses ## Popular Feed IDs - BTC/USD: 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 - ETH/USD: 0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace - SOL/USD: 0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d - USDC/USD: 0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a - Full catalog: https://pyth.network/developers/price-feed-ids ## Hermes API - Base URL: https://hermes.pyth.network - Auth: `Authorization: Bearer $PYTH_API_KEY` on every request (required since August 26, 2026) - Upgraded drop-in endpoint: https://pyth.dourolabs.app/hermes (same routes and response shapes, same API key) - GET /v2/updates/price/latest?ids[]=FEED_ID — Get latest prices - GET /v2/updates/price/stream?ids[]=FEED_ID — SSE streaming prices - OpenAPI spec: https://hermes.pyth.network/docs ## SDKs | Language | Package | Import | |----------|---------|--------| | Solidity | @pythnetwork/pyth-sdk-solidity | IPyth, PythStructs | | TypeScript | @pythnetwork/hermes-client | HermesClient | | Python | pythclient | — | | Rust | pyth-sdk-rs | — | ## Common Patterns ### Stale Price Handling Always use `getPriceNoOlderThan(priceId, maxAge)` instead of `getPrice()` or `getPriceUnsafe()`. Recommended maxAge values: - DeFi lending/borrowing: 60 seconds - Derivatives/perpetuals: 10–30 seconds - Display/analytics: 300+ seconds ### Confidence Interval Usage For lending protocols, use conservative pricing: - Collateral valuation: price - confidence (lower bound) - Debt valuation: price + confidence (upper bound) Pause activity if the confidence-to-price ratio exceeds your threshold (e.g., conf/price > 2%). ### Multi-Feed Batch Updates Submit multiple feeds in a single `updatePriceFeeds()` call to save gas: ```typescript const ids = [ETH_USD, BTC_USD, SOL_USD]; const updates = await client.getLatestPriceUpdates(ids); // Submit updates.binary.data on-chain — one transaction updates all feeds ``` ### Delayed Settlement for Derivatives Separate order commitment from execution to prevent latency exploitation: 1. User commits order (no price selected yet) 2. Wait N blocks 3. Execute using price from after commitment ## Troubleshooting ### StalePrice (0x19_ab_f4_0e) Price hasn't been updated within the specified age parameter. **Fix**: Call `updatePriceFeeds()` with fresh data from Hermes before reading the price. ### PriceFeedNotFound (0x14_ae_be_68) Price feed doesn't exist on-chain or the feed ID is wrong. **Fix**: Verify the price feed ID is correct. Call `updatePriceFeeds()` first. Verify the Pyth contract address matches the chain. ### InsufficientFee (0x025dbdd4) Not enough native token sent for the update fee. **Fix**: Call `getUpdateFee(priceUpdateData)` and pass the result as `msg.value`. ### Anchor Version Mismatch (Solana) `E0277: PriceUpdateV2: anchor_lang::AccountDeserialize not satisfied` **Fix**: Align anchor-lang versions between your program and pyth-solana-receiver-sdk: `cargo update -p anchor-lang@[SDK_VERSION] --precise [YOUR_VERSION]` ## Deep Dive Pages For complete documentation, fetch any page as plain markdown: - https://docs.pyth.network/pro/use-prices-on-blockchain.mdx — Entry point: chain guides for the Pyth Core and Pyth Pro contracts, and fetching or streaming Hermes price updates (section "Price Updates for the Pyth Core Contracts") - https://docs.pyth.network/pro/pyth-core-upgrade.mdx — What the August 26, 2026 upgrade changed, the Hermes API key, and moving Sui integrations - https://docs.pyth.network/pro/best-practices.mdx — Safety patterns: staleness, confidence intervals, latency (section "Pyth Core Contracts") - https://docs.pyth.network/pro/contract-addresses.mdx — Full contract address list - https://docs.pyth.network/pro/on-chain-fees.mdx — Why update fees are zero - https://docs.pyth.network/pro/price-feed-ids.mdx — Complete feed catalog