Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Latest commit

 

History

History
89 lines (72 loc) · 9.14 KB

File metadata and controls

89 lines (72 loc) · 9.14 KB
description
Consume Pyth Network prices in EVM applications

Pyth on EVM

On-chain EVM programs can use the Solidity SDK to read Pyth prices. The off-chain portion of the application can use pyth-evm-js to generate price update transactions. This repository's Quickstart includes an example of both the on- and off-chain code necessary to integrate with Pyth.

Example - Oracle Swap

Oracle Swap is an end-to-end example application that uses Pyth Network. This application is an AMM that allows users to swap two assets at the Pyth-provided exchange rate. This application contains both the contract, and the frontend to interact with the contract.

EVM price pusher

Pyth EVM price pusher is a service that regularly pushes price updates to the on-chain Pyth contract. Protocols can run this service to push regular updates to the on-chain Pyth price based on various conditions, such as a minimum update frequency, or a price change threshold. This service is useful for protocols that already depend on regular push updates and want to simplify migrating to Pyth. Please see the github readme for additional information on this service.

In addition, you can find an in-depth explanation from one of our contributors, Ali: How to Build with Pyth Data on EVM Chains (with Pusher): Pyth Tutorials

Networks

Pyth is currently available on the following EVM-based chains:

Mainnet

Network Contract address
Avalanche 0x4305FB66699C3B2702D4d05CF36551390A4c69C6
Fantom 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Polygon 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
BNB 0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594
Ethereum 0x4305FB66699C3B2702D4d05CF36551390A4c69C6
Optimism 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Aurora 0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9
Arbitrum 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Celo 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
KCC 0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B
Cronos 0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B
zkSync Era 0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834
EVMOS 0x354bF866A4B006C9AF9d9e06d9364217A8616E12
Polygon zkEVM 0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65
Meter 0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16
Conflux eSpace 0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc
Canto 0x98046Bd286715D3B0BC227Dd7a956b83D8978603
Kava 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Gnosis 0x2880aB155794e7179c9eE2e38200202908C17B43
WEMIX '0xA2aa501b19aff244D90cc15a4Cf739D2725B5729`

Testnet

Network Contract address
Goerli (Ethereum testnet) 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Fuji (Avalanche testnet) 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Fantom testnet 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Mumbai (Polygon testnet) 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
BNB testnet 0xd7308b14BF4008e7C7196eC35610B1427C5702EA
Aurora testnet 0x4305FB66699C3B2702D4d05CF36551390A4c69C6
Optimism Goerli (testnet) 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Celo Alfajores (testnet) 0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
KCC testnet 0x15D35b8985e350f783fe3d95401401E194ff1E6f
Cronos testnet 0xBAEA4A1A2Eaa4E9bb78f2303C213Da152933170E
Arbitrum Goerli (testnet) 0x939C0e902FF5B3F7BA666Cc8F6aC75EE76d3f900
zkSync Era Goerli (testnet) 0xC38B1dd611889Abc95d4E0a472A667c3671c08DE
Base Goerli (testnet) 0x5955C1478F0dAD753C7E2B4dD1b4bC530C64749f
Shimmer testnet 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Chiado (Gnosis testnet) 0xdDAf6D29b8bc81c1F0798a5e4c264ae89c16a72B
EVMOS testnet 0x354bF866A4B006C9AF9d9e06d9364217A8616E12
Neon devnet 0x2FF312f50689ad279ABb164dB255Eb568733BD6c
Polygon zkEVM testnet 0xd54bf1758b1C932F86B178F8b1D5d1A7e2F62C2E
Canto testnet 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Meter testnet 0x5fF5B9039FbD8256864A4460B7EA77093A65B1b5
Mantle testnet 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Conflux eSpace testnet 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729
Kava testnet 0x98046Bd286715D3B0BC227Dd7a956b83D8978603
WEMIX testnet 0xA2aa501b19aff244D90cc15a4Cf739D2725B5729

Price Feed IDs

The price feed IDs for EVM chains differs depending on whether they are a mainnet or testnet (see above):