### Install Quickstart Dependencies Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/fuel/sdk/js/README.md Install the required dependencies for the quickstart guide, including `fuels` and `@pythnetwork/hermes-client`. These are necessary for interacting with Pyth price feeds and the Fuel network. ```bash $ npm install --save fuels @pythnetwork/hermes-client ``` ```bash $ yarn add fuels @pythnetwork/hermes-client ``` -------------------------------- ### Copy Example Configuration Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/pyth-lazer-pusher/bulk-trade-pusher/README.md Copy the example configuration file to start customizing settings. ```bash cp config.example.toml config.toml ``` -------------------------------- ### Run the Basic WebSocket Example Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/pro/getting-started.mdx Execute the start script to run the basic example. This connects to Pyth Pro and begins receiving streaming price updates for specified feeds. ```bash pnpm run start ``` -------------------------------- ### Initialize Project and Install Dependencies Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/entropy/create-your-first-entropy-app.mdx Set up a new Foundry project and install the Pyth Entropy SDK for Solidity. Ensure you are in the 'contracts' directory when installing the SDK. ```bash mkdir coin-flip cd coin-flip forge init contracts cd contracts npm init -y npm install @pythnetwork/entropy-sdk-solidity ``` -------------------------------- ### Local MCP Server Setup Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/pro/mcp.mdx Clone the repository, install dependencies, and build the MCP server for local development. Configure your client to use stdio transport with the local server. ```bash git clone https://github.com/pyth-network/pyth-crosschain.git cd pyth-crosschain pnpm install pnpm --filter @pythnetwork/mcp build ``` -------------------------------- ### Start Development Server Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/README.md Starts the development server using pnpm and turbo. ```bash pnpm turbo run start:dev ``` -------------------------------- ### Start Tilt Development Environment Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/pyth-lazer-pusher/README.md Navigates to the tilt/bulk directory and starts the Tilt development environment. ```bash cd tilt/bulk && tilt up ``` -------------------------------- ### Get Help for Price Pusher Arguments Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/price_pusher/README.md View available command-line arguments for the price pusher. Use the `--help` flag with the start command or specify a network for network-specific arguments. ```bash pnpm run start --help ``` ```bash pnpm run start {network} --help ``` -------------------------------- ### Clone Pyth Examples Repository Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/pro/getting-started.mdx Clone the official Pyth examples repository to access the JavaScript SDK example. Navigate into the cloned directory to proceed. ```bash git clone https://github.com/pyth-network/pyth-examples.git cd pyth-examples/lazer/js ``` -------------------------------- ### Install and Initialize Aptos CLI Source: https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/aptos/README.md Install the Aptos CLI using Homebrew and initialize it for the devnet network. ```shell brew install aptos aptos --version aptos init --network devnet ``` -------------------------------- ### Initialize Project and Install Dependencies Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/entropy/create-your-first-entropy-app.mdx Initializes a new Node.js project and installs the necessary web3 and Entropy SDK libraries. ```bash npm init -y npm install web3 @pythnetwork/entropy-sdk-solidity ``` -------------------------------- ### Get Product Response Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/publish-data/pyth-client-websocket-api.mdx Example response for the `get_product` method, providing comprehensive details about a product, including its price accounts and publisher information. ```json { "jsonrpc": "2.0", "result": { "account": "4aDoSXJ5o3AuvL7QFeR6h44jALQfTmUUCTVGDD6aoJTM", "attr_dict": { "asset_type": "Crypto", "symbol": "BTC/USD", "country": "US", "quote_currency": "USD", "description": "BTC/USD", "tenor": "Spot", "generic_symbol": "BTCUSD" }, "price_accounts": [ { "account": "GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU", "price_type": "price", "price_exponent": -8, "status": "trading", "price": 4426101900000, "conf": 4271150000, "ema_price": 4433467600000, "ema_confidence": 1304202670, "valid_slot": 91402257, "pub_slot": 91402259, "prev_slot": 91402256, "prev_price": 4425895500000, "prev_conf": 3315350000, "publisher_accounts": [ { "account": "HekM1hBawXQu6wK6Ah1yw1YXXeMUDD2bfCHEzo25vnEB", "status": "trading", "price": 4426958500000, "conf": 1492500000, "slot": 91402255 }, { "account": "GKNcUmNacSJo4S2Kq3DuYRYRGw3sNUfJ4tyqd198t6vQ", "status": "trading", "price": 4424690000000, "conf": 3690000000, "slot": 91402256 } ] } ] }, "id": 1 } ``` -------------------------------- ### Install Pyth Sui JS SDK Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/sui/sdk/js/README.md Navigate to the crosschain root directory and install dependencies using pnpm. ```bash cd to crosschain root $ pnpm install ``` -------------------------------- ### Setup Sui Client Configuration Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/sui/vendor/wormhole_iota_testnet/NOTES.md Resets the Sui client configuration, imports a new key, and starts the client. It also includes a command to update the active address in the client.yaml file. ```shell # setup the client.yaml ``` sh % rm -rf $HOME/.sui % sui keytool import "daughter exclude wheat pudding police weapon giggle taste space whip satoshi occur" ed25519 % sui client ``` point it at http://localhost:9000. The key you create doesn't matter. # edit $HOME/.sui/sui_config/client.yaml ``` sh sed -i -e 's/active_address.*/active_address: "0x13b3cb89cf3226d3b860294fc75dc6c91f0c5ecf"/' ~/.sui/sui_config/client.yaml ``` ``` -------------------------------- ### Install uv and Run Pusher Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hip-3-pusher/README.md Installs the uv package manager, copies a sample configuration, installs dependencies, and runs the pusher in dry-run or debug mode. ```bash # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh cd apps/hip-3-pusher # Copy sample config cp config/config.pyth.testnet.toml config/config.toml # Edit config.toml with your settings (see Configuration Guide below) # Install dependencies uv sync # Run (dry-run mode - set enable_publish = false first) uv run -m pusher.main -c config/config.toml # Run with debug logging LOG_LEVEL=DEBUG uv run -m pusher.main -c config/config.toml ``` -------------------------------- ### Example: BTC Price at Start of Each Month Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/mcp/skills/pyth-time-series-snapshots/SKILL.md Demonstrates fetching the price of BTC at the beginning of each month for the current year. This involves discovering the feed, generating specific Unix timestamps (ensuring they are after April 2025), and making a separate API call for each timestamp. ```json get_historical_price({ "symbols": ["Crypto.BTC/USD"], "timestamp": 1743465600 }) ``` ```json get_historical_price({ "symbols": ["Crypto.BTC/USD"], "timestamp": 1746057600 }) ``` ```json get_historical_price({ "symbols": ["Crypto.BTC/USD"], "timestamp": 1748736000 }) ``` ```json get_historical_price({ "symbols": ["Crypto.BTC/USD"], "timestamp": 1751328000 }) ``` -------------------------------- ### Install Pyth Solana Receiver SDK Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/sdk/js/pyth_solana_receiver/README.md Install the package using NPM or Yarn. ```bash npm install @pythnetwork/pyth-solana-receiver ``` ```bash yarn add @pythnetwork/pyth-solana-receiver ``` -------------------------------- ### Build and Start Production Servers Source: https://context7.com/pyth-network/pyth-crosschain/llms.txt Builds and starts all servers in production mode across the workspace using turbo. ```bash # Build and start all servers in production mode pnpm turbo start:prod ``` -------------------------------- ### Install Price Service Client via npm Source: https://github.com/pyth-network/pyth-crosschain/blob/main/price_service/client/js/README.md Install the price service client package using npm. ```bash npm install --save @pythnetwork/price-service-client ``` -------------------------------- ### Install Price Service Client via Yarn Source: https://github.com/pyth-network/pyth-crosschain/blob/main/price_service/client/js/README.md Install the price service client package using Yarn. ```bash yarn add @pythnetwork/price-service-client ``` -------------------------------- ### Install Pyth Entropy SDK for Foundry Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/entropy/generate-random-numbers-evm.mdx Install the Solidity SDK using npm for Foundry projects and configure remappings. ```shell npm init -y npm install @pythnetwork/entropy-sdk-solidity ``` ```text @pythnetwork/entropy-sdk-solidity/=node_modules/@pythnetwork/entropy-sdk-solidity ``` -------------------------------- ### Install Pyth SDK for Foundry Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/README.md Install the Pyth SDK using npm for Foundry projects and configure remappings. ```bash npm init -y npm install @pythnetwork/pyth-sdk-solidity ``` ```text @pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity ``` -------------------------------- ### Install TypeScript SDKs Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/solana.mdx Install the necessary npm packages for fetching Pyth prices and submitting them to the blockchain in your off-chain application. ```bash npm install --save @pythnetwork/hermes-client @pythnetwork/pyth-solana-receiver ``` -------------------------------- ### Install Pyth Entropy SDK for Hardhat Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/entropy/generate-random-numbers-evm.mdx Install the Solidity SDK using npm for Hardhat projects. ```shell npm install @pythnetwork/entropy-sdk-solidity ``` -------------------------------- ### Install SDK with Foundry Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/pulse_sdk/solidity/README.md Install the Pyth Pulse Solidity SDK for Foundry projects. Requires initializing an NPM project and configuring remappings. ```bash npm init -y npm install @pythnetwork/pulse-sdk-solidity ``` ```text @pythnetwork/pulse-sdk-solidity/=node_modules/@pythnetwork/pulse-sdk-solidity ``` -------------------------------- ### Install SDK with Truffle/Hardhat Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/pulse_sdk/solidity/README.md Install the Pyth Pulse Solidity SDK using NPM for Truffle or Hardhat projects. ```bash npm install @pythnetwork/pulse-sdk-solidity ``` -------------------------------- ### Install Pyth Lazer Sui SDK Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/pro/integrate-as-consumer/sui.mdx Install the necessary SDK for building Sui transactions that parse and verify Pyth price updates. ```bash npm install @pythnetwork/pyth-lazer-sui-js ``` -------------------------------- ### Install Pyth Aptos JS SDK Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/aptos/sdk/js/README.md Install the Pyth Aptos JS SDK using npm or Yarn. ```bash npm install --save @pythnetwork/pyth-aptos-js ``` ```bash yarn add @pythnetwork/pyth-aptos-js ``` -------------------------------- ### Install Project Dependencies and Build Contract Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/contracts/README.md Installs required dependencies for the contract and builds the Pyth EVM contract using pnpm and turbo. ```bash pnpm i pnpm turbo build --filter @pythnetwork/pyth-evm-contract ``` -------------------------------- ### Manual Smoke Test for Pyth MCP Server Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/mcp/docs/PLAN.md This section provides a step-by-step guide for manually testing the Pyth MCP server. It includes installation, configuration for Claude Desktop, and example queries for different tools. ```bash # 1. Install and run PYTH_PRO_ACCESS_TOKEN=your_token npx @pyth-network/mcp-server stdio # 2. In Claude Desktop config, add: { "mcpServers": { "pyth-pro": { "command": "npx", "args": ["@pyth-network/mcp-server", "stdio"], "env": { "PYTH_PRO_ACCESS_TOKEN": "your_token" } } } } # 3. Test queries: # "What crypto feeds are available on Pyth Pro?" → get_symbols # "What's the current price of BTC?" → get_latest_price # "Show me ETH/USD daily candles for the last month" → get_candlestick_data # "Give me a market snapshot" → market_snapshot prompt ``` -------------------------------- ### Set up .env for Tilt Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/pyth-lazer-pusher/README.md Copies the example .env file to be used with Tilt. ```bash cp tilt/bulk/.env.example tilt/bulk/.env ``` -------------------------------- ### Get Product List Response Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/publish-data/pyth-client-websocket-api.mdx Example response structure for the `get_product_list` method, detailing product accounts, attributes, and price information. ```json { "jsonrpc": "2.0", "result": [ { "account": "9F6eBgAfktth93C9zmtKDXFXNjZkq6JwJR56VPKqWmJm", "attr_dict": { "symbol": "SYMBOL1/USD", "asset_type": "Equity", "country": "USA", "description": "pyth example product #1", "quote_currency": "USD", "tenor": "Spot", "cms_symbol": "SYMBOL1", "cqs_symbol": "SYMBOL1", "nasdaq_symbol": "SYMBOL1" }, "price": [ { "account": "CrZCEEt3awgkGLnVbsv45Pp4aLhr7fZfZr3ubzrbNXaq", "price_exponent": -4, "price_type": "price" } ] } ], "id": null } ``` -------------------------------- ### Fork Anvil RPC with CreateX Contract Source: https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/evm/README.md This command starts an Anvil node by forking an RPC URL that has a functional CreateX contract deployed. Ensure you have Anvil installed. ```shell anvil --fork-url "https://sepolia.drpc.org" ``` -------------------------------- ### Copy Environment File Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hyperliquid-recorder/README.md Copies the example environment file to a local configuration file. Ensure your QuickNode token and endpoint are placed in the `.env` file. ```bash cp .env.example .env ``` -------------------------------- ### Initialize Web3 and Contracts Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/entropy/create-your-first-entropy-app.mdx Sets up Web3, connects to the RPC, adds an account, and initializes CoinFlip and Entropy contracts using their ABIs and addresses. ```javascript const { Web3 } = require("web3"); const CoinFlipAbi = require("../contracts/out/CoinFlip.sol/CoinFlip.json"); const EntropyAbi = require("@pythnetwork/entropy-sdk-solidity/abis/IEntropyV2.json"); async function main() { const web3 = new Web3(process.env["RPC_URL"]); const { address } = web3.eth.accounts.wallet.add( process.env["PRIVATE_KEY"], )[0]; web3.eth.defaultBlock = "finalized"; const coinFlipContract = new web3.eth.Contract( CoinFlipAbi.abi, process.env["COINFLIP_ADDRESS"], ); const entropyContract = new web3.eth.Contract( EntropyAbi, process.env["ENTROPY_ADDRESS"], ); } main(); ``` -------------------------------- ### Run Fetch and Verify Example Source: https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/sui/sdk/js/README.md Execute the example script to fetch and verify a Pyth Lazer price update on Sui. Ensure environment variables for Sui key, state ID, and Lazer token are set. ```sh # Your Sui private key in Bech32 format # export SUI_KEY= # Lazer contract state ID # STATE_ID= # Your Lazer API token # LAZER_TOKEN= SUI_FULLNODE_URL="https://fullnode.mainnet.sui.io:443" pnpm run example:fetch-and-verify \ --base-url "$SUI_FULLNODE_URL" \ --state-id "$STATE_ID" \ --lazer-token "$LAZER_TOKEN" ``` -------------------------------- ### Get All Products Response Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/publish-data/pyth-client-websocket-api.mdx This is an example response for the `get_all_products` request, showing the detailed structure of product data, including price accounts, publisher information, and price details. It illustrates the format of data you can expect when querying for all products. ```json { "jsonrpc": "2.0", "result": [ { "account": "5uKdRzB3FzdmwyCHrqSGq4u2URja617jqtKkM71BVrkw", "attr_dict": { "asset_type": "Crypto", "symbol": "BCH/USD", "country": "US", "quote_currency": "USD", "description": "BCH/USD", "tenor": "Spot", "generic_symbol": "BCHUSD" }, "price_accounts": [ { "account": "5ALDzwcRJfSyGdGyhP3kP628aqBNHZzLuVww7o9kdspe", "price_type": "price", "price_exponent": -8, "status": "trading", "price": 60282000000, "conf": 26000000, "ema_price": 60321475000, "ema_confidence": 22504746, "valid_slot": 91402601, "pub_slot": 91402604, "prev_slot": 91402600, "prev_price": 60282000000, "prev_conf": 26000000, "publisher_accounts": [ { "account": "HekM1hBawXQu6wK6Ah1yw1YXXeMUDD2bfCHEzo25vnEB", "status": "trading", "price": 60282000000, "conf": 26000000, "slot": 91402599 }, { "account": "2V7t5NaKY7aGkwytCWQgvUYZfEr9XMwNChhJEakTExk6", "status": "unknown", "price": 0, "conf": 0, "slot": 0 } ] } ] } ], "id": 1 } ``` -------------------------------- ### Example: Current BTC and ETH Funding Rates Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/mcp/skills/pyth-funding-rate-monitor/SKILL.md This example demonstrates discovering BTC and ETH funding rate feeds, fetching their current rates, and presenting the results in a table. ```json get_symbols({ "asset_type": "funding-rate" }) ``` ```json get_latest_price({ "access_token": "", "symbols": ["FundingRate.BTC/USD", "FundingRate.ETH/USD"] }) ``` -------------------------------- ### Basic Usage Example: Fetching and Updating Price Feeds Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ton/sdk/js/README.md Demonstrates how to connect to the TON client, interact with the Pyth contract to get guardian set index and BTC price, fetch price updates from Hermes, calculate update fees, and send an update transaction using a wallet. ```typescript import { TonClient, Address, WalletContractV4 } from "@ton/ton"; import { toNano } from "@ton/core"; import { mnemonicToPrivateKey } from "@ton/crypto"; import { HermesClient } from "@pythnetwork/hermes-client"; import { PythContract, PYTH_CONTRACT_ADDRESS_TESTNET, calculateUpdatePriceFeedsFee, } from "@pythnetwork/pyth-ton-js"; const BTC_PRICE_FEED_ID = "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43"; async function main() { const client = new TonClient({ endpoint: "https://testnet.toncenter.com/api/v2/jsonRPC", apiKey: "your-api-key-here", // Optional, but note that without api-key you need to send requests once per second }); const contractAddress = Address.parse(PYTH_CONTRACT_ADDRESS_TESTNET); const contract = client.open(PythContract.createFromAddress(contractAddress)); const guardianSetIndex = await contract.getCurrentGuardianSetIndex(); console.log("Guardian Set Index:", guardianSetIndex); const price = await contract.getPriceUnsafe(BTC_PRICE_FEED_ID); console.log("BTC Price from TON contract:", price); const hermesEndpoint = "https://hermes.pyth.network"; const hermesClient = new HermesClient(hermesEndpoint); const priceIds = [BTC_PRICE_FEED_ID]; const latestPriceUpdates = await hermesClient.getLatestPriceUpdates( priceIds, { encoding: "hex", } ); console.log("Hermes BTC price:", latestPriceUpdates.parsed?.[0].price); const numUpdates = 1; // Only BTC price const updateData = Buffer.from(latestPriceUpdates.binary.data[0], "hex"); console.log("Update data:", updateData); // NOTE: As of 2025/10/19 There's a bug with TON Access (https://ton.access.orbs.network) RPC service where if you provide an // update data buffer with length of more than ~320 then the rpc returns error 404 and the function fails. In this case you can use the // contract.getSingleUpdateFee() method to get the single update fee and multiply it by the number of updates you want to perform. const updateFee = await contract.getUpdateFee(updateData); console.log("Update fee:", updateFee); const mnemonic = "your mnemonic here"; const key = await mnemonicToPrivateKey(mnemonic.split(" ")); const wallet = WalletContractV4.create({ publicKey: key.publicKey, workchain: 0, }); const provider = client.open(wallet); await contract.sendUpdatePriceFeeds( provider.sender(key.secretKey), updateData, calculateUpdatePriceFeedsFee(numUpdates) + BigInt(updateFee) ); console.log("Price feeds updated successfully."); const updatedPrice = await contract.getPriceUnsafe(BTC_PRICE_FEED_ID); console.log("Updated BTC Price from TON contract:", updatedPrice); } main().catch(console.error); ``` -------------------------------- ### Run Example: Fetch BTC and ETH Price Feeds Source: https://github.com/pyth-network/pyth-crosschain/blob/main/price_service/client/js/README.md Execute the example client to fetch and display BTC and ETH price feeds from a specified Hermes endpoint. This command demonstrates how to pass endpoint and price ID arguments. ```bash npm run example -- \ --endpoint https://hermes.pyth.network \ --price-ids \ 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \ 0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace ``` -------------------------------- ### Install Build Dependencies Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/sui/vendor/wormhole_iota_mainnet/NOTES.md Installs CMake and the Rust toolchain for building the project. Ensure you have Homebrew installed for macOS. ```shell brew install cmake rustup install stable-x86_64-apple-darwin #rustup target add stable-x86_64-apple-darwin rustup target add x86_64-apple-darwin ``` -------------------------------- ### Run Development Server Source: https://github.com/pyth-network/pyth-crosschain/blob/main/governance/xc_admin/packages/xc_admin_frontend/README.md Execute this command in the project root to start the development server. Open http://localhost:3003 in your browser to view the application. ```bash pyth-crosschain % pnpm start:dev ``` -------------------------------- ### Install Specific Rust Toolchain Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hermes/server/README.md Installs Rust toolchain version 1.82.0. Ensure you have Rust installed first. ```bash rustup toolchain install 1.82.0 ``` -------------------------------- ### Start Development Server for Pyth Web App Source: https://github.com/pyth-network/pyth-crosschain/blob/main/packages/create-pyth-package/src/templates/web-app/README.md Use this command from the repository root to start the development server for a specific Pyth web application. Replace '{{relativeFolder}}' with the actual relative path to your application. ```bash pnpm turbo run start:dev --filter ./{{relativeFolder}} ``` -------------------------------- ### Start Local Stack with Tilt Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hyperliquid-recorder/README.md Initiates the local development environment including the recorder, ClickHouse, and Prometheus. Verify health and observability endpoints after startup. ```bash tilt up ``` -------------------------------- ### Product Account Example (BTC/USD) Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/pythnet-reference/account-structure.mdx Shows the reference attributes for the BTC/USD product account. This example highlights the 'Crypto' asset type and its specific fields like generic_symbol. ```sh product_account .. 3m1y5h2uv7EQL3KaJZehvAJa4yDNvgc5yAdL9KPMKwvk symbol.......... Crypto.BTC/USD asset_type...... Crypto quote_currency.. USD description..... BTC/USD generic_symbol.. BTCUSD base............ BTC price_account .. HovQMDrbAgAYPCmHVSrezcSmkMtXSSUsLDFANExrZh2J ``` -------------------------------- ### Install Dependencies Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/README.md Installs project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Install Pyth IOTA JS SDK via Yarn Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/sui/sdk/js-iota/README.md Install the Pyth IOTA JS SDK using Yarn. This is an alternative package manager for installing the SDK. ```bash yarn add @pythnetwork/pyth-iota-js ``` -------------------------------- ### Run Hermes Client Example Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hermes/client/js/README.md Execute the integrated example for HermesClient within the Pyth monorepo using pnpm turbo. This command allows specifying the Hermes endpoint and price IDs for testing. ```bash pnpm turbo --filter @pythnetwork/hermes-client example -- \ --endpoint https://hermes.pyth.network \ --price-ids \ 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43 \ 0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace ``` -------------------------------- ### Install Rust Toolchain and Target Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/cosmwasm/examples/cw-contract/Developing.md Ensures the necessary Rust toolchain and the wasm32-unknown-unknown target are installed for CosmWasm development. Verify installations and add the target if it's missing. ```sh rustc --version cargo --version rustup target list --installed # if wasm32 is not listed above, run this rustup target add wasm32-unknown-unknown ``` -------------------------------- ### Install Workspace Dependencies Source: https://context7.com/pyth-network/pyth-crosschain/llms.txt Installs all dependencies for the monorepo workspace using pnpm. ```bash # Install all workspace dependencies pnpm install ``` -------------------------------- ### Quickstart: Fetch Latest Price Feeds Source: https://github.com/pyth-network/pyth-crosschain/blob/main/price_service/client/js/README.md Instantiate the PriceServiceConnection and fetch the latest price feeds for specified price IDs. Set `binary: true` for on-chain use to retrieve signed price updates. ```typescript const connection = new PriceServiceConnection("https://hermes.pyth.network", { priceFeedRequestConfig: { // Provide this option to retrieve signed price updates for on-chain contracts. // Ignore this option for off-chain use. binary: true, }, }); // See Hermes endpoints section below for other endpoints const priceIds = [ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price id "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price id ]; // Get the latest values of the price feeds as json objects. // If you set `binary: true` above, then this method also returns signed price updates for the on-chain Pyth contract. const currentPrices = await connection.getLatestPriceFeeds(priceIds); // You can also call this function to get price updates for the on-chain contract directly. const priceUpdateData = await connection.getLatestVaas(priceIds); ``` -------------------------------- ### Install Pyth TON SDK with yarn Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/ton.mdx Install the Pyth TON SDK and other required dependencies using yarn. This command installs packages for TON interaction and Pyth's Hermes client. ```bash yarn add @pythnetwork/pyth-ton-js @pythnetwork/hermes-client @ton/core @ton/ton @ton/crypto ``` -------------------------------- ### Install Pyth TON SDK with npm Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/ton.mdx Install the Pyth TON SDK and other required dependencies using npm. This command installs packages for TON interaction and Pyth's Hermes client. ```bash npm install @pythnetwork/pyth-ton-js @pythnetwork/hermes-client @ton/core @ton/ton @ton/crypto ``` -------------------------------- ### Install Pyth SDK for Foundry Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/developer-hub/content/docs/price-feeds/core/use-real-time-data/pull-integration/evm.mdx Install the Pyth Solidity SDK for Foundry projects. This involves initializing an npm project and adding a remapping to your remappings.txt file. ```bash npm init -y npm install @pythnetwork/pyth-sdk-solidity ``` -------------------------------- ### Start Mock Validator Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/pyth-lazer-pusher/README.md Starts a mock validator on port 8080 for testing purposes. ```bash cargo run -p bulk-trade-mock-validator -- --port 8080 ``` -------------------------------- ### Example: Has ETH dropped 5% today? Source: https://github.com/pyth-network/pyth-crosschain/blob/main/apps/mcp/skills/pyth-alert-conditions/SKILL.md Demonstrates calculating the percentage change from today's open price and comparing it against a threshold. ```json get_symbols({ "query": "ETH" }) // -> "Crypto.ETH/USD" get_candlestick_data({ "symbol": "Crypto.ETH/USD", "from": 1751241600, "to": 1751328000, "resolution": "D" }) ``` ```json get_latest_price({ "access_token": "", "symbols": ["Crypto.ETH/USD"] }) ``` -------------------------------- ### Start All Development Servers Source: https://context7.com/pyth-network/pyth-crosschain/llms.txt Starts all development servers in parallel across the workspace using turbo. ```bash # Start all development servers in parallel pnpm turbo start:dev ``` -------------------------------- ### Install and Configure Rust Toolchain Source: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/sui/vendor/wormhole_movement_m2_devnet/NOTES.md Installs the stable Rust toolchain and the necessary target for cross-compilation on macOS. ```shell rustup install stable-x86_64-apple-darwin #rustup target add stable-x86_64-apple-darwin rustup target add x86_64-apple-darwin ```