pyth

Integrate Pyth Network real-time price feeds into Solana programs and TypeScript clients.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill pyth-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pyth
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/solana-dev/ext/sendai/skills/pyth
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill pyth-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Solana developers need trustworthy real-time price data for DeFi logic like swaps, liquidations, and collateral valuation, but integrating an oracle correctly requires handling fixed-point prices, staleness checks, confidence intervals, and feed verification. ## Core Features & Use Cases - Off-Chain Price Fetching: Fetch and stream real-time prices via the Hermes client, with validation helpers for staleness and confidence bounds. - On-Chain Anchor Integration: Consume PriceUpdateV2 accounts in Rust/Anchor programs with feed ID verification, EMA prices, and slippage protection patterns. - Use Case: Build a lending program that values SOL collateral using a verified Pyth SOL/USD feed, rejecting prices older than 60 seconds or with confidence wider than 2%. ## Quick Start Use the pyth skill to fetch the latest SOL/USD price from Hermes and show me how to read it in an Anchor program.

Frequently Asked Questions about pyth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch Pyth price feeds in TypeScript?▼

Use the HermesClient from @pythnetwork/hermes-client and call getLatestPriceUpdates with an array of hex feed IDs. The response includes parsed price, confidence, exponent, and publish time, which you convert with price * 10^expo.

How to use Pyth prices in an Anchor Solana program?▼

Add pyth-solana-receiver-sdk to Cargo.toml and accept a PriceUpdateV2 account in your instruction. Call get_price_no_older_than with the Clock sysvar and a max age in seconds to get a validated price.

Does Pyth support real-time streaming price updates?▼

Yes, the Hermes client provides getPriceUpdatesStream, which delivers price updates over Server-Sent Events. You subscribe with feed IDs and handle updates in an onmessage callback, closing the EventSource when done.

Why does my Pyth integration return a PriceTooOld error?▼

PriceTooOld occurs when the on-chain price update is older than your max_age_secs parameter. Post a fresh price update in the same transaction before consuming it, or increase the allowed staleness window.

What is the difference between Pyth spot price and EMA price?▼

The spot price is the latest aggregate price, while the EMA price is an exponential moving average over roughly one hour weighted by inverse confidence. EMA is recommended for sensitive operations like liquidations to reduce manipulation risk.

What are the rate limits of the public Pyth Hermes endpoint?▼

The public Hermes endpoint allows about 10 requests per second, 5 concurrent connections, and up to 100 feeds per request. For production workloads, obtain a dedicated endpoint from a Pyth data provider.