Cronos zkEVM Docs
  • Getting Started
    • πŸš€Getting started
    • Network status
    • πŸ—οΈArchitecture
    • πŸͺ™About zkCRO, vETH, vUSD
      • zkCRO
      • vETH
        • ybETH & vETH
      • vUSD
        • ybUSD & vUSD
    • πŸ“ƒzkEVM Litepaper v1.0
    • πŸ—ΊοΈCronos roadmap
  • For Users
    • πŸ’³Crypto.com Card Top Up
    • πŸ”₯Crypto Wallets
      • 🦁Crypto.com Onchain Wallet configuration
      • 🐰Rabby Configuration
      • 🦊MetaMask Configuration
      • 🦁Brave Wallet Configuration
      • 🧠Holdstation Smart Wallet
      • Zerion
    • πŸŒ‰Cronos zkEVM Bridge
    • πŸŒ‰Independent bridges
    • πŸ‘‘Pioneer Program
    • πŸ‘‘Yield rewards
    • πŸ“³Dapps
    • πŸ’‘FAQs
  • For Developers
    • πŸ”—Resources for Developers
    • πŸ’»Develop Smart Contracts and Dapps
      • Contract Deployment and Verification
      • Contract Verification Guide for the Cronos zkEVM Explorer
    • πŸ”§Developer Tools
      • Cronos zkEVM Developer Portal and APIs
      • Band Protocol (Oracle)
      • Covalent (Analytics)
      • Cronos Safe (Multi-sig)
      • Crypto.com AI Agent SDK (AI)
      • Debank (Analytics)
      • Dextools (Analytics)
      • deBridge (Bridge)
      • Eliza (AI)
      • Getblock (Node infra)
      • Goldsky (Subgraph hosting)
      • Google Bigquery (Analytics)
      • NFTs2Me (No code)
      • Pyth (Oracle)
      • Secret Network (Computing)
      • Sentio (Analytics)
      • Subquery (Analytics)
      • Thirdweb (App development)
      • txSync (Paymaster)
      • VIA Labs (Bridge)
      • XY Finance (Bridge)
      • Zyfi (Paymaster)
    • πŸ“’Contract Addresses
    • πŸ—³οΈAccount abstraction
    • πŸŒ‰Using zkCRO, vETH and vUSD
      • zkCRO
      • vETH
      • vUSD
      • Yield rewards
    • πŸŽ›οΈJSON-RPC API Overview
      • ZKs specific JSON-RPC API
      • Ethereum JSON-RPC API
  • FOR NODE HOSTS
    • ⛓️Running nodes
      • Cronos zkEVM Mainnet
      • Cronos zkEVM Sepolia Testnet
  • Resources
    • πŸ“šMedia/Brand Kit
Powered by GitBook
On this page
  • Overview
  • Using Pyth Network on Cronos zkEVM
  • Pyth on Cronos zkEVM
  • Using Pyth as a PUSH Oracle
  • Developers and community
  1. For Developers
  2. Developer Tools

Pyth (Oracle)

PreviousNFTs2Me (No code)NextSecret Network (Computing)

Last updated 6 months ago

Overview

is one of the largest first-party Oracle network, delivering real-time data across . The network comprises some of the world’s . These publish proprietary data on-chain for aggregation and distribution to smart contract applications.

Using Pyth Network on Cronos zkEVM

The Pyth introduces an innovative low-latency , where users can pull price updates onchain when needed, enabling everyone in the onchain environment to access that data point most efficiently. Pyth network updates the prices every 400ms.

Developers Cronos zkEVM have permissionless access to any of for equities, ETFs, commodities, foreign exchange pairs, and cryptocurrencies.

Example

Here is a working example of a contract that fetches the latest price of ETH/USD on the Cronos zkEVM. You have to pass for Cronos zkEVM mainnet/testnet and the desired to fetch the latest price.

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
import "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";

contract MyFirstPythContract {
    IPyth pyth;

    constructor(address _pyth) {
        pyth = IPyth(_pyth);
    }

    function fetchPrice(
        bytes[] calldata updateData,
        bytes32 priceFeed
    ) public payable returns (int64) {
		    // Fetch the priceUpdate from hermes.
        uint updateFee = pyth.getUpdateFee(updateData);
        pyth.updatePriceFeeds{value: updateFee}(updateData);

        // Fetch the latest price
        PythStructs.Price memory price = pyth.getPrice(priceFeed);
        return price.price;
    }
}

Pyth on Cronos zkEVM

Deployment status

Using Pyth as a PUSH Oracle

Developers and community

Check out the following links to get started with Pyth.

Here you can fetch the updateData from Pyth's , which listens to Pythnet and Wormhole for price updates; or you can use the SDK. Check to pull the latest data.

This provides utilities for consuming prices from the Pyth network oracle using Solidity. Also, it contains the that you can use in your libraries to communicate with the Pyth contract.

It is generally recommended to follow the when consuming Pyth data.

For more information, check out the official . There are details on the various functions available for interacting with the Pyth smart contract in the .

Cronos zkEVM Mainnet (Chain-id : 388 )

Mainnet deployment completed -

Cronos zkEVM Sepolia Testnet (Chain-id : 282 )

Testnet deployment completed -

Additionally, click to access the .

Pyth Oracle can be used as a Push oracle by running a scheduler which can update the prices in the backend. It will make sure that the your dapp will be updated with latest prices as per your configuration. Checkout the open source app to get started with the scheduler.

The Pyth network provides additional tools to developers, such as , or the .

πŸ”§
βœ…
βœ…
Pyth Network
a vast number of chains
largest exchanges, market makers, and financial services providers
pull oracle design
Pyth’s price feeds
Pyth's contract address
price feed id
Hermes
pyth-evm-js
How to Fetch Price Updates
package
Pyth Interface ABI
consumer best practices
Pyth documentation
API Reference section
0x056f829183ec806a78c26c98961678c24fab71af
0xB1DB1498902F08E16E11F1a423ec9CCB9537E1D6
Pyth price-feed IDs
price pusher
TradingView Integration
Gelato web3 functions
Pyth EVM Integration Guide
Pyth Docs
Pyth API Reference
Pyth Examples
Pyth Price Feed Ids
Website
Twitter