Prerequisites
- Python 3.10 or later.
- A Solana mainnet-beta RPC endpoint. The public endpoint works for reads; use a dedicated provider for trading.
- For steps 3 to 5: a keypair holding USDC (in its associated token account) and a little SOL for transaction fees and, on a first buy, the position account’s rent.
1. Read a market
2. Quote
3. Buy and sell
4. Build, simulate, then send
5. Redeem and close
Handling errors
Next
Runnable examples
Read-and-quote, buy-and-sell, and redeem-and-close scripts.