Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

pyth-network/pyth-neon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyth on Neon

This repo contains a smart contract making Pyth price feeds available on Neon EVM.

It is strongly recommended to follow the consumer best practices when consuming Pyth data.

How to use

To consume prices, you need to look up the price feed ID for the symbol you're interested in. The Pyth Network website lists the NEON price feed IDs for devnet and mainnet.

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

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

contract ExampleContract {

    function getBTCUSDPrice() public returns (PythStructs.Price memory) {

        // The NEON Devnet price feed ID of BTC/USD
        bytes32 priceID = 0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b;

        return pyth.getCurrentPrice(priceID);
    }
    
}

How to deploy

  1. Create a .secret file containing the private key or mnemonic of the account you want to use to deploy the contracts.
  2. Optional: Edit truffle-config.js to add the neon network you want to deploy to.
  3. Run truffle migrate --network neon_devnet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •