Skip to main content
Solana Agent Kit provides integration with Switchboard for simulating oracle price feeds. This integration allows you to fetch simulated price data for any Switchboard feed on mainnet.

Key Features

  • Price feed simulation
  • Customizable Crossbar endpoint
  • Mainnet feed support
  • LangChain tool integration
  • Error handling and validation

Basic Usage

Simulating a Price Feed

Input Parameters

Feed Simulation Parameters

Response Type

LangChain Integration

Solana Agent Kit provides a LangChain tool for feed simulation:

Simulate Feed Tool

Example Prompts

For LangChain AI tools, here are example prompts:

Feed Simulation

Important Notes

  1. Feed Public Keys
    • Must be valid Switchboard feed addresses
    • Only mainnet feeds are supported
    • Feed hash must be base58 encoded
  2. Crossbar Configuration
  3. Response Handling
    • Values are returned as integers
    • Empty results indicate invalid feed hash
    • Network errors are propagated

Best Practices

  1. Error Handling
  2. Feed Validation
  3. Response Processing

Technical Details

Constants

CrossbarClient Configuration

Common Feed Addresses

Network Configuration

Error Messages

Common error messages and their meanings:

Examples

  1. Basic Feed Simulation
  2. Custom Crossbar Instance
  3. Error Handling