Pyth
Search…
Pyth on EVM-Based Chains
Consume Pyth Network prices in applications on EVM-based chains

Pyth prices are published on Pythnet and relayed to EVM chains using the Wormhole Network as a cross-chain message passing bridge. The Wormhole Network observes when Pyth prices on Pythnet have changed and publishes an off-chain signed message attesting to this fact. This process is explained in more detail here.
This signed price update message can then be submitted to the Pyth contract. The contract verifies the Wormhole message and updates the on-chain Pyth price to the new price.
Pyth does not automatically submit the prices to the EVM networks; Protocols and users are responsible for updating the on-chain Pyth price before using it.
There are two different ways for protocols to perform these updates:

When a consumer needs to use the value of a price, they should first submit the latest Wormhole update for that price to the Pyth contract on their target EVM network. Updating prices on-demand will make the most recent price update available for EVM contracts to use.
This approach has many advantages for Pyth and its consuming protocols:
  • Gas efficient: Prices will get updated only when they are needed. So no gas will be used to update a price that no one won't use.
  • Access to low-latency prices: This approach allows protocols to use low-latency prices without sacrificing the gas.
  • More price feeds: By doing so, Pyth can publish thousands of price feeds without paying extra costs to submit them on-chain.
In this approach, protocols will update the prices in the same transaction that uses the prices. The calling contract method will get the prices update data as an argument, (1) update the on-chain Pyth prices, and (2) use the prices in the contract. The pyth-evm-js library makes it easy for users to craft the necessary price update transactions. The library documentation has a worked example showing how to write the on-chain program and the frontend code to use Pyth based on this model.

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 their desired time. Protocols can configure the frequency and conditions of pushing price updates to the EVM network based on their needs. This service is useful for protocols that already depend on regular push updates and want to facilitate their migration to Pyth. Please see the price pusher documentation for more information on its usage.

On-chain programs can use our Solidity SDK to read Pyth prices. Please see the SDK documentation for more information on expected usage and example code.

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

Mainnet contracts are still being tested. Please do not rely on them in production.
Network
Contract address
Avalanche
0x4305FB66699C3B2702D4d05CF36551390A4c69C6
Fantom
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Polygon
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
BNB
0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594
Ethereum
0x4305FB66699C3B2702D4d05CF36551390A4c69C6
Optimism
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Aurora
0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9
Arbitrum
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C

Network
Contract address
Goerli (Ethereum testnet)
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Ropsten (Ethereum testnet)
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Fuji (Avalanche testnet)
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Fantom testnet
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
Mumbai (Polygon testnet)
0xff1a0f4744e8582DF1aE09D5611b887B6a12925C
BNB testnet
0xd7308b14BF4008e7C7196eC35610B1427C5702EA
Aurora testnet
0x4305FB66699C3B2702D4d05CF36551390A4c69C6

All EVM chains share the same price feed IDs, which are listed here
Copy link
On this page
How Pyth Works on EVM Chains
On-demand price updates
EVM price pusher
How to use Pyth on-chain
Networks
Mainnet
Testnet
Price Feed IDs