`# Pyth Pro — Quick Start > Enterprise-grade, ultra-low latency WebSocket price streaming for professional trading applications. > This file contains a curated quick-start. For full docs, fetch individual pages below. ## Overview Pyth Pro (formerly Lazer) is a subscription-based price streaming service designed for high-frequency trading, MEV strategies, and latency-sensitive applications. It delivers real-time market data via WebSocket with configurable update channels. Unlike Pyth Core (pull-based oracle for DeFi), Pyth Pro provides direct WebSocket streaming optimized for speed. Data can optionally be verified on-chain using signed payloads on EVM, Solana, and Stellar. Access requires an API token from an authorized Pyth Data Distributor. Apply at https://pyth.network/pro. ## Key Concepts **WebSocket Streaming**: Connect to redundant WebSocket endpoints for continuous price delivery. You must connect to all three endpoints simultaneously for reliability. **Channels**: Control update frequency per subscription: - `real_time` — Updates as soon as available (no slower than 50ms) - `fixed_rate@200ms` — Updates every 200ms (most common) - `fixed_rate@50ms` — Updates every 50ms - `fixed_rate@1000ms` — Updates every 1 second **API Keys**: Required for authentication. Pass as `Authorization: Bearer {key}` header. Keys are permissioned for specific asset types and minimum channel rates. Never expose keys in frontend code. **Price Feed IDs**: Pro uses numeric IDs (not hex strings). BTC/USD = 1, ETH/USD = 2, SOL/USD = 5. **Binary Formats**: Payloads can include signed data for on-chain verification: - `evm` — ECDSA signatures for EVM chains - `solana` — Ed25519 signatures for Solana/Fogo - `stellar` — Stellar signatures for Soroban contracts - `leUnsigned` — No signature (offline/testing only) ## Integration Code ### TypeScript (WebSocket Client) ```typescript import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk"; const client = await PythLazerClient.create({ urls: [ "wss://pyth-lazer-0.dourolabs.app/v1/stream", "wss://pyth-lazer-1.dourolabs.app/v1/stream", "wss://pyth-lazer-2.dourolabs.app/v1/stream", ], token: process.env.ACCESS_TOKEN, }); client.addMessageListener((message) => { if (message.type === "streamUpdated") { for (const feed of message.parsed.priceFeeds) { console.log(feed.priceFeedId, feed.price, feed.confidence); } } }); client.subscribe({ type: "subscribe", subscriptionId: 1, priceFeedIds: [1, 2], // BTC/USD, ETH/USD properties: ["price"], formats: ["evm"], // Include EVM-signed payloads deliveryFormat: "json", channel: "fixed_rate@200ms", jsonBinaryEncoding: "hex", }); ``` Install: `npm install @pythnetwork/pyth-lazer-sdk` ### On-Chain Verification (EVM / Solidity) ```solidity import { PythLazer } from "pyth-lazer-sdk/PythLazer.sol"; import { PythLazerLib } from "pyth-lazer-sdk/PythLazerLib.sol"; contract MyContract { PythLazer pythLazer; function verifyPrice(bytes calldata payload) external payable { // Verify signature and parse payload (bytes memory verified, uint fee) = pythLazer.verifyUpdate(payload); // Parse header and feed data from verified bytes // See full guide: docs.pyth.network/pro/use-prices-on-blockchain/evm.mdx } } ``` EVM SDK: Add via git submodule from `pyth-network/pyth-crosschain/lazer/contracts/evm` ### Response Message Structure ```json { "type": "streamUpdated", "subscriptionId": 1, "parsed": { "timestampUs": "1758690761750000", "priceFeeds": [ { "priceFeedId": 1, "price": "11223872331053", "exponent": -8, "confidence": 1373488286, // EXPERIMENTAL: not yet covered by automated data quality assurance "bestBidPrice": "11222498842767", // EXPERIMENTAL: not yet covered by automated data quality assurance "bestAskPrice": "11224513591935", // EXPERIMENTAL: not yet covered by automated data quality assurance "publisherCount": 9, "marketSession": "regular" } ] }, "evm": { "encoding": "hex", "data": "0x..." } } ``` **Experimental Fields**: The `confidence`, `bestBidPrice`, and `bestAskPrice` fields are experimental. They are not yet covered by automated data quality assurance, so their accuracy and reliability may vary. The current quality and uptime focus is on the aggregated `price` field. Use these fields with caution in production systems. Price calculation: `actual_price = price * 10^exponent` ## WebSocket Endpoints (Redundancy Required) You MUST connect to all three endpoints simultaneously. Any single endpoint may go down for deployments. - wss://pyth-lazer-0.dourolabs.app/v1/stream - wss://pyth-lazer-1.dourolabs.app/v1/stream - wss://pyth-lazer-2.dourolabs.app/v1/stream ## API Services | Service | Base URL | Purpose | |---------|----------|---------| | WebSocket | wss://pyth-lazer-{0,1,2}.dourolabs.app/v1/stream | Real-time price streaming | | REST | https://pyth.dourolabs.app/v1 | Prices at a timestamp or over a range, OHLC candlestick data, symbols, TradingView UDF | | Signed price updates | https://pyth-lazer.dourolabs.app | Signed updates for the Pyth Pro contracts | ### REST API (base: https://pyth.dourolabs.app/v1) - GET /{channel}/history — OHLC candlestick data (requires auth) - GET /{channel}/price — Price at specific timestamp (requires auth) - GET /{channel}/price/range — Paginated prices over a time window (requires auth) - GET /symbols — List available symbols (no auth required) - Supports TradingView UDF specification ### Signed price updates (base: https://pyth-lazer.dourolabs.app) - POST /v1/latest_price — Latest signed update for requested feeds; use it when the signature is needed - POST /v1/price — Signed update at a specific timestamp (Unix microseconds) ## MCP for AI Assistants Pyth Pro also provides an MCP server so agents can discover feeds and fetch prices through tool calls. - MCP endpoint: https://mcp.pyth.network/mcp - Tool workflow: `get_symbols` -> `get_latest_price` / `get_historical_price` / `get_price_range` (every update in a window of up to 60 seconds) -> `get_candlestick_data`; `convert_date_to_timestamp` converts dates - Token behavior: `get_latest_price`, `get_historical_price`, `get_price_range` and `get_candlestick_data` need the user's own Pyth Pro API key. Configure it once in the MCP client as an `Authorization: Bearer ` header (or `PYTH_PRO_ACCESS_TOKEN` for a local stdio server); otherwise pass it per call as `access_token`. `get_symbols` works without a key - 9 pre-built skills for Claude Code: price alerts, cross-asset comparison, volatility analysis, FX conversion, portfolio tracking, funding rate monitoring, data export, time-series snapshots, and integration guidance - Client setup and skills docs: https://docs.pyth.network/pro/build-with-ai-agents.mdx ## Contract Addresses ### EVM (same address on all supported networks) - 0xACeA761c27A909d4D3895128EBe6370FDE2dF481 - Deployed on: Base, Ethereal, Polynomial, Soneium (mainnets + testnets) ### Solana - Devnet/Testnet: pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt ### Stellar - Soroban Devnet: sor2xysjdBk2fHxUx3zR5wba6FT6Po9nF5Tdzc5gnPx Full list: https://docs.pyth.network/pro/contract-addresses ## Common Patterns ### Redundant Connection Setup Always connect to all three endpoints. The SDK handles deduplication internally: ```typescript const client = await PythLazerClient.create({ urls: [ "wss://pyth-lazer-0.dourolabs.app/v1/stream", "wss://pyth-lazer-1.dourolabs.app/v1/stream", "wss://pyth-lazer-2.dourolabs.app/v1/stream", ], token: process.env.ACCESS_TOKEN, }); ``` ### Subscribe to Only What You Need Minimize bandwidth by requesting only the properties you need: ```typescript client.subscribe({ type: "subscribe", subscriptionId: 1, priceFeedIds: [1, 2], properties: ["price", "confidence"], // Only these fields returned formats: ["evm"], deliveryFormat: "json", channel: "fixed_rate@200ms", jsonBinaryEncoding: "hex", }); ``` ### Market Session Filtering Use the `marketSession` field to filter updates for equities that have limited trading hours. Values: `regular`, `preMarket`, `postMarket`, `overNight`, `closed`. ## Troubleshooting ### "Client too slow" Error Your message processing can't keep up with the subscription rate. **Fix**: Optimize message handling, reduce subscription rate, or split feeds across connections. ### HTTP 403 Error Wrong endpoint, asset class restriction, or expired token. **Fix**: Verify token permissions, check you're using the correct endpoint, contact your data distributor. ### Stale Prices (2+ seconds old) Do not mix Pyth Core fetch methods with Pyth Pro. Connect directly to the WebSocket endpoints. **Fix**: Ensure all three redundant endpoints are connected. Check network latency. ### Duplicate/Missing Messages Expected behavior during endpoint failovers. The SDK deduplicates across connections. ## Deep Dive Pages For complete documentation, fetch any page as plain markdown: - https://docs.pyth.network/pro/getting-started.mdx — Step-by-step setup guide - https://docs.pyth.network/pro/subscribe-to-prices.mdx — WebSocket authentication and configuration - https://docs.pyth.network/pro/payload-reference.mdx — Complete payload structure and properties - https://docs.pyth.network/pro/how-lazer-works.mdx — Architecture and system components - https://docs.pyth.network/pro/pyth-core-upgrade.mdx — What the August 26, 2026 Pyth Core upgrade changed, and the Hermes API key - https://docs.pyth.network/pro/understanding-price-data.mdx — Confidence intervals, best bid/ask - https://docs.pyth.network/pro/best-practices.mdx — Safety patterns: staleness, confidence intervals, latency - https://docs.pyth.network/pro/acquire-api-key.mdx — Token acquisition and permissions - https://docs.pyth.network/pro/error-codes.mdx — Error responses and handling - https://docs.pyth.network/pro/faq.mdx — Common questions and solutions - https://docs.pyth.network/pro/api/websocket.mdx — WebSocket API reference - https://docs.pyth.network/pro/api/rest.mdx — REST API reference: prices at a timestamp or over a range, OHLC data, symbols - https://docs.pyth.network/pro/use-prices-on-blockchain.mdx — Signed price updates for the Pyth Pro contracts, Hermes updates for the Pyth Core contracts, chain guides - https://docs.pyth.network/pro/corporate-actions.mdx — Corporate actions (dividends, splits, ticker changes) - https://docs.pyth.network/pro/use-prices-on-blockchain/evm.mdx — EVM on-chain verification - https://docs.pyth.network/pro/use-prices-on-blockchain/solana.mdx — Solana/Fogo on-chain verification - https://docs.pyth.network/pro/use-prices-on-blockchain/stellar.mdx — Stellar on-chain verification - https://docs.pyth.network/pro/contract-addresses.mdx — Deployment addresses - https://docs.pyth.network/pro/on-chain-fees.mdx — On-chain verification fees for Pyth contracts - https://docs.pyth.network/pro/price-feed-ids.mdx — Available price feeds - https://docs.pyth.network/pro/build-with-ai-agents.mdx — MCP server and MCP skills catalog (price alerts, portfolio tracking, FX conversion, etc.) `