Adopted from Orca Typescript SDK
Use your environment's package manager to install @orca-so/sdk and other related packages into your project.
yarn add @orca-so/sdk @solana/web3.js decimal.js
- Replace your own private key string
- Use your own rpc and ws url to setup connection
- Randomize the amount to bypass dedup
- Play around with the batchSize parameter
To run txs that swaps SOL for ORCA:
npx ts-node swap_sol2orca.ts
To run txs that swaps ORCA back for SOL:
npx ts-node swap_orca2sol.ts