Skip to main content
Fetch real-time price data from Pyth Network’s decentralized oracle network. Access price feeds for various crypto assets with support for symbol lookup and price formatting.

Core Features

  1. Price Feed Management
    • Symbol-based feed lookup
    • Price feed ID resolution
    • Real-time price fetching
    • Decimal adjustment
  2. Price Operations
    • Multi-symbol support
    • Price scaling
    • Error handling
    • Format conversion

Usage

Get Price Feed ID

Fetch Current Price

Example Prompts

Natural Language Prompts

LangChain Tool Prompts

Fetch Price

Direct Feed Query

Implementation Details

Price Feed ID Lookup

Price Fetching

Response Formats

Price Feed ID Response

Price Response

Error Handling

Best Practices

  1. Feed ID Management
    • Cache common feeds
    • Validate symbols
    • Handle multiple matches
    • Monitor updates
  2. Price Fetching
    • Handle decimals properly
    • Validate responses
    • Consider staleness
    • Format consistently
  3. Error Handling
    • Implement retries
    • Validate inputs
    • Check feed status
    • Log errors
  4. Performance
    • Cache feed IDs
    • Batch requests
    • Monitor latency
    • Handle timeouts

Common Issues

  1. Feed Lookup
    • Invalid symbols
    • Multiple matches
    • Missing feeds
    • Network errors
  2. Price Fetching
    • Stale prices
    • Decimal errors
    • Format issues
    • Connection problems
  3. Data Quality
    • Price accuracy
    • Update frequency
    • Feed reliability
    • Data consistency

Common Price Feeds

Price Update Frequency

  • Most feeds update every 400ms
  • Updates depend on market conditions
  • Consider confidence intervals
  • Monitor update timestamps

Integration Tips

  1. Price Monitoring
  2. Error Recovery
  • getTokenData: Get token information
  • trade: Execute trades
  • fetchMarketData: Get market info
  • calculatePositionValue: Value positions