Pyth on Aptos
Consume Pyth Network prices in applications on Aptos
Aptos contracts can update and fetch the Pyth prices using the Pyth Aptos Contract, which has been deployed on Mainnet. The documented source code can be found here.
The mechanism by which 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 be passed to the
pyth::update_price
on-chain function.- Full-stack React app and on-chain contract which uses the pyth-aptos-js package to update the price used by the contract.
- In-depth explanation of how Pyth works on Aptos and how to integrate Pyth data in your application from one of our contributor.
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 Address | Value |
---|---|
pyth | 0x7e783b349d3e89cf5931af376ebeadbfab855b3fa239b7ada8f5a92fbea6b387 |
wormhole | 0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625 |
deployer | 0xb31e712b26fd295357355f6845e77c888298636609e93bc9b05f0f604049f434 |
deployer
and wormhole
are implementation details of the Pyth contract: you will not need to interact with these.Network | Available Price Feeds |
---|---|
Aptos Testnet | |
Aptos Mainnet |
Last modified 1mo ago