Introduction

This guide provides comprehensive documentation for third-party developers integrating with the Pyth Lazer Agent. The Pyth Lazer Agent acts as a middleware service that enables publishers to submit price feeds to the Pyth Lazer network with automatic batching, signing, and transaction management.

Additional References:

<aside> 🤝

If you have any questions, please contact Douro Labs through your designated communication channel.

</aside>

Agent Architecture

The Pyth Lazer Agent serves as a crucial middleware component between price feed publishers and the Pyth Lazer network:

  1. Publishers connect to Pyth Lazer Agent via WebSocket using JSON-RPC API
  2. Pyth Lazer Agent receives price updates, batches them according to configured intervals, signs transactions using Ed25519 cryptography, and forwards them to Lazer relayers. Additionally it provides feed information including symbols, asset types, and configuration details via the Metadata Service.
  3. Lazer Relayers receive signed transaction batches and submit them to the Pyth Lazer network

Pyth Lazer Agent handles automatic retry logic, connection management, and provides health check endpoints for monitoring.

Setting up and running Pyth Lazer Agent

Install using Cargo

# Download the cargo package
cargo install pyth-lazer-agent

# Add .cargo/bin to PATH
export PATH="$PATH:~/.cargo/bin"

# Run Pyth Lazer Agent
pyth-lazer-agent --help

Building from Source

# Clone the repository
git clone <https://github.com/pyth-network/pyth-crosschain.git>
cd pyth-crosschain/apps/pyth-lazer-agent

# Build the binary
cargo build --release

# Run Pyth Lazer Agent 
./target/release/pyth-lazer-agent --config /path/to/your/config.toml

Using Pre-built Images