Skip to main content

Pyth Network

Consume Pyth Network prices on Aptos

Aptos contracts can update and fetch Pyth prices using the Pyth Aptos package, which has been deployed on Mainnet. The documented source code can be found here.

Use cases for Pyth with Econia

The core variable utilized by decentralized derivative exchanges, traditionally perpetual futures, is the oracle index price, which powers the exchange’s funding rate mechanism and liquidation engine. Without a reliable and secure oracle provider, innovative on-chain platforms of this nature cannot be built.

By leveraging Pyth’s price data feeds to build these exchange components, and combining them with Econia’s hyper-parallelized order book to match and settle trades, developers can build a high performance perpetual derivatives trading platform.

Perps components using Econia and Pyth

Updating price feeds

The mechanism by which Pyth price feeds are updated on Aptos is explained here. The pyth-aptos-js package can be used to fetch price feed update data, which can then be passed to the pyth::update_price on-chain function.



Pyth is currently deployed on Aptos Mainnet and Testnet.


When deploying contracts using Pyth, the named addresses pyth, wormhole and deployer need to be defined at compile time. These addresses are the same across both Testnet and Mainnet.

Named AddressValue

deployer and wormhole are implementation details of the Pyth contract: you will not need to interact with these.

Price feeds

NetworkAvailable price Feeds
Aptos Testnet
Aptos Mainnet

Notable price feeds (testnet)

PairPrice feed ID
APT / USD0x44a93dddd8effa54ea51076c4e851b6cbbfd938e82eb90197de38fe8876bb66e
BTC / USD0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b
ETH / USD0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6
USDC / USD0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722
USDT / USD0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588