Loading video player...
Need reliable, real-time crypto prices in your smart contract? In this tutorial, we walk through exactly how to integrate Pyth Network's low-latency price feeds on any EVM chain using Solidity and Foundry. We break down the "Pull Oracle" model, show you how to handle stale price errors, and demonstrate a live deployment on the Base Sepolia testnet. In this video, you’ll learn: - Setup: How to clone and configure the Pyth examples repository. - The Code: A line-by-line walkthrough of the `PythSample` smart contract. - Debugging: Understanding the "Stale Price" error and how to fix it. - Hermes API: How to fetch price update data offchain and push it onchain. - Deployment: engaging with the contract using Foundry (Forge/Cast). Timestamps: 0:31 - Setting up the Pyth Examples Repo 0:49 - Smart Contract Walkthrough 2:29 - Understanding the code and project structure 5:50 - Follow along Demo 7:45 - Preparing for Deployment on Base Sepolia 8:10 - Configuring Environment Variables 10:53 - The "Stale Price" Error Explained 12:07 - Fetching Price Updates 13:47 - Updating the Price Onchain via Hermes REST API 14:51 - Reading the Real-Time Price of ETH/USD Resources: - Pyth Network Docs: https://docs.pyth.network/price-feeds/core/use-real-time-data/pull-integration/evm - Pyth Examples Repo: https://github.com/pyth-network/pyth-examples - Chainlist (RPCs): https://chainlist.org/ #PythNetwork #Web3Developer #MarketData #Blockchain #PriceFeeds Explore the Price Layer: • Website: https://pyth.network • X: https://x.com/PythNetwork • LinkedIn: https://www.linkedin.com/company/pyth-network/ Pyth Community: • Discord: https://discord.com/invite/PythNetwork • Telegram: https://t.me/Pyth_Network • Staking: https://staking.pyth.network