Use Prices on Blockchains
Use Pyth Pro and Pyth Core contracts to verify prices on blockchains
The following guides demonstrate how to integrate and verify prices on blockchains.
Choose a Contract
Pyth offers two ways to use prices on blockchains: Pyth Pro and Pyth Core contracts. Both contracts deliver the same prices from the same backend. They differ in how an application consumes them.
Traditionally, applications have used Pyth Core contracts to verify prices on-chain. Pyth Core contracts allow applications to store a price on-chain for other contracts to read. Pyth Core contracts were upgraded on August 26, 2026 to use the Pyth Pro backend. Pyth Core Upgrade lists what changed for integrations.
| Pyth Pro contracts | Pyth Core contracts | |
|---|---|---|
| Use them to | Verify a signed price inside each transaction | Store a price on-chain for other contracts to read, or keep an existing integration on the Pyth Core interface |
| Where the price lives | Each transaction carries a signed price, verified on the spot. The contract stores none. | A signed update is verified and stored on-chain. Any contract can read the stored price until a newer update replaces it. |
| Typical uses | Perps and RFQ | Lending markets, CDPs and vaults |
| Sponsored updates | No | For the feeds in Sponsored Feeds |
| Feed IDs | Numeric | 32-byte hexadecimal |
The two types of contracts use different contracts, interfaces and feed IDs, so an integration built for one doesn't work with the other. For a lending example, see Use Pyth for Morpho Markets.
Chain Guides
Each guide covers the Pyth Pro contracts first, then the Pyth Core contracts where they run on that chain.
| Chain guide | Pyth Pro contracts | Pyth Core contracts |
|---|---|---|
| Solana and SVM chains | Solana, Fogo | Solana, Eclipse, Sonic, Atlas, Fogo |
| EVM chains | ✓ | ✓ |
| Sui | ✓ | ✓ |
| IOTA | ✓ | ✗ |
| Cardano | ✓ | ✗ |
| Stellar | ✓ | ✗ |
Pyth Pro price updates can also be used in off-chain applications. See the subscribe to prices guide and the Terms of Service for more information.
Fetch Signed Price Updates
The Pyth Pro contracts verify a signed price inside each transaction, so the application fetches a signed update and submits it with the transaction. The WebSocket stream carries signed updates when the subscription sets formats to evm or solana, as Subscribe to Prices shows. To fetch one update on demand, call the Pyth Pro Router over REST:
https://pyth-lazer.dourolabs.app| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /v1/latest_price | Yes | Fetch the latest price for one or more price feeds |
| POST | /v1/price | Yes | Fetch price data at a specific historical timestamp |
Use these endpoints when the application needs the signature. Otherwise, stream prices over WebSocket or use the REST API.
POST /v1/latest_price
Returns the most recent price data for the requested feeds. The request body follows the same schema as the WebSocket subscribe message — see the Payload Reference for full details.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Subscription channel. One of: real_time, fixed_rate@50ms, fixed_rate@200ms, fixed_rate@1000ms |
Each feed has a minimum supported channel (min_channel), discoverable via
/v1/symbols. You must use a
channel at or above the feed's min_channel. See Symbology & Reference
Data for every field the symbols
endpoint returns.
POST /v1/price
Returns price data at a specific historical timestamp.
Request Body
All fields from /v1/latest_price, plus:
| Field | Type | Required | Description |
|---|---|---|---|
timestamp | u64 | Yes | Unix timestamp in microseconds. Must be a raw integer — do not quote it. |
For the full response schema — including price feed fields, signed payloads, and available properties — see the Payload Reference.
Authentication
POST /v1/latest_price and POST /v1/price require API-key authentication.
Pass your Pro API key as a bearer token:
curl -X POST -H "Authorization: Bearer $PRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"priceFeedIds":[1,2],"properties":["price"],"formats":["solana"],"channel":"fixed_rate@200ms","timestamp":1704067200000000}' \
"https://pyth-lazer.dourolabs.app/v1/price"Do not embed your Pro API key in frontend or browser applications. The key
must stay server-side. Route requests through your own backend, which injects
the Authorization header before forwarding to this API. For browser/frontend
apps that cannot hold a secret, see
Frontend Authentication.
See Acquire an API Key to obtain a key.
OpenAPI Schema
These endpoints are part of the Pyth Pro Router API. The full OpenAPI specification is available at:
Price Updates for the Pyth Core Contracts
To verify prices on a blockchain with the Pyth Core contracts, fetch price updates from Hermes. Choose a Contract explains when to use the Pyth Core contracts.
Hermes takes the same API key and the 32-byte hexadecimal IDs from Price Feed IDs. GET /v2/updates/price/latest returns the latest update for one or more feeds, here BTC/USD and ETH/USD:
curl -H "Authorization: Bearer $PYTH_API_KEY" \
'https://pyth.dourolabs.app/hermes/v2/updates/price/latest?ids[]=0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43&ids[]=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace'binary.data holds the update to submit to a Pyth Core contract, and parsed holds the decoded prices. From TypeScript, getLatestPriceUpdates in HermesClient makes the same request. The Hermes API reference lists every endpoint.
The /v2/updates/price/stream endpoint streams updates over Server-Sent Events:
curl -N -H "Authorization: Bearer $PYTH_API_KEY" \
'https://pyth.dourolabs.app/hermes/v2/updates/price/stream?ids[]=0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43'Hermes closes each stream after 24 hours. Reconnect when it does. From TypeScript, getStreamingPriceUpdates in HermesClient opens the same stream.
No Longer Supported
Pyth Core contracts previously supported Aptos, CosmWasm, Fuel, IOTA, Movement, NEAR, Stacks, Starknet, and TON. They no longer support those chains. IOTA supports Pyth Pro. Contact the team to request a deployment.