Pyth Crosschain

repository·main·Indexed 42 days ago

https://github.com/pyth-network/pyth-crosschain

A monorepo containing core Pyth protocol components, including on-chain contracts, off-chain services like Hermes (price update service) and Fortuna (Entropy protocol randomness service), and data pushers like Pyth Lazer Pusher. Includes the @pythnetwork/hermes-client for consuming real-time prices via HTTP or SSE and @pythnetwork/contract-manager v1.1.0 for managing Pyth contracts.

Tokens
262K
Snippets
867
Records
1.2K
Agent score
51%

What's inside Pyth Crosschain

  1. What is Pyth price pusher

    main

    Pyth price pusher is a service designed to regularly push price updates to on-chain Pyth contracts based on configurable conditions.

    This service is an alternative to on-demand updates, where a protocol packages a Pyth price update within the transaction that depends on it. While on-demand updates minimize latency and gas costs by updating only when needed, the price pusher is intended for protocols that require a continuous stream of regular push updates.

  2. Overview of Pyth on Sui components

    main

    The target_chains/sui directory provides the complete infrastructure for using Pyth on the Sui blockchain. It is organized into three main functional areas:

    • Deployment & Management: The cli folder contains tools for deploying and upgrading the Pyth contract on Sui.
    • Smart Contracts: The contracts folder contains the core Pyth contract source code written in Move.
    • dApp Integration: The sdk folder contains the Pyth JavaScript SDK, which is the recommended tool for dApp developers to integrate Pyth price feeds into their Sui-based applications.

    For detailed integration guides and technical documentation, refer to the official Pyth Sui documentation.

  3. Overview of Pyth Lazer EVM Contract and SDK

    main

    The Pyth Lazer EVM package provides on-chain infrastructure for managing and validating Pyth Lazer payloads. It consists of two primary components:

    1. PythLazer: An EVM on-chain contract that tracks trusted signers of Pyth Lazer payloads. It enables consumers to verify signature validity while supporting key rotation.
    2. PythLazerReceiver: A utility contract containing functions to validate and parse Pyth Lazer payloads. To use these utilities, your own contracts should inherit from PythLazerReceiver (either as the base contract or one of the base contracts).
  4. What is Hermes?

    main

    Hermes is a web service that monitors both Pythnet and the Wormhole Network to provide the next generation of Pyth price updates. It replaces the legacy Pyth Price Service and offers updates through two primary interfaces:

    1. REST API: For querying recent price updates.
    2. Websocket: For subscribing to real-time updates.

    Hermes maintains compatibility with the Price Service API, meaning the Price Service JS client can be used to connect to a Hermes instance to fetch on-demand price updates.

  5. Overview of HIP-3 Pusher

    main
    The hip-3-pusher is an oracle updater designed for HIP-3 markets on Hyperliquid. It aggregates prices from multiple sources (Pyth Lazer, SEDA, and Hyperliquid) and uses a waterfall price resolution mechanism with automatic failover to ensure reliable price updates. It supports AWS KMS and multisig signing for secure key management and provides Prometheus metrics for observability.
  6. Overview of the Pyth Pro MCP Server

    main

    The Pyth Pro MCP (Model Context Protocol) server is a TypeScript-based implementation designed to provide AI agents and assistants with low-latency, cross-asset market data. It wraps two primary Pyth Pro APIs:

    • Router API (https://pyth-lazer.dourolabs.app): Provides real-time/latest prices. Requires a bearer token.
    • History API (https://pyth.dourolabs.app): Provides symbols (public), OHLC, and historical prices (token-gated).

    The server is designed to reduce integration friction by allowing LLMs to fetch prices, analyze history, and generate integration code directly through tool calls.

  7. Overview of Pyth Pulse

    main

    Pyth Pulse is a push-style service that regularly updates on-chain Pyth price feeds based on user-defined conditions. Unlike the standard Pyth pull model where users trigger updates immediately before use, Pulse uses a decentralized keeper network to ensure prices remain up-to-date automatically. This is ideal for protocols that want to consume a continuous stream of prices without managing their own update infrastructure.

    Key benefits include:

    • Automation: Prices are updated based on time (heartbeat) or price deviation thresholds.
    • Operational Simplicity: Removes the need for users to manually push updates.
    • Stability: Replaces the legacy 'scheduler' or 'price pusher' services.
  8. Overview of Pyth Lazer Pusher crates

    main

    The Pyth Lazer Pusher application is composed of several specialized crates:

    Core Crates:

    • bulk-trade-pusher: Pushes prices to Bulk Trade validators.
    • bulk-trade-cli: Used for cluster monitoring and key management.
    • bulk-trade-mock-validator: A mock validator used for testing purposes.

    Shared Libraries:

    • pusher-base: Provides the Lazer client, feed configuration, and base metrics.
    • pusher-utils: Provides runtime utilities such as graceful shutdown.
    • websocket-delivery: A multi-endpoint WebSocket client.