This repo contains the rust program and test code that allows you to swap USDC for SOL on the Solana blockchain (devnet) using the Pyth oracle. User can input the amount they want to send in USDC and the program will calculate the live exchange rate and send the appropriate amount of SOL to the user's wallet.
- Clone the repo
- Run
anchor build
to build the program - Run
anchor deploy
to deploy the program to the devnet - Copy the deployed program id from the terminal to the
Anchor.toml
file anddeclare_id!()
line in thelib.rs
- Run
anchor build
&anchor deploy
again - Run
anchor test
to run the test code
PYTH Devnet USDC/SOL price feed: "J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix"