Skip to main content

Prerequisites

Before you start, ensure you have Rust installed. To ensure compatibility with the Solana SDK v3, we recommend using rustc 1.86.0.

1. Initialize a new project

Initialize a new Rust project:
Add the necessary dependencies to your project:
Note: If you’re using the Rust SDK in an already existing project which does not use the latest version of Solana SDK, you may need to apply a patchfile lock with the following command:
You might also have to apply lockfile patches for solana-program, solana-client, solana-account-decoder, spl-token, spl-memo, spl-token-2022, spl-associated-token-account.

2. Wallet Management

You can generate a file system wallet using the Solana CLI and load it in your program.
⚠️ Important: Never share your private key publicly.

3. Airdrop SOL to Your Wallet

Once your wallet is created, you will need some SOL to pay for transactions. You can request an airdrop of SOL from the network, but this is only available on Solana Devnet.

4. Set the default funder for Transactions

After funding your wallet, you can set the wallet as the FUNDER for future transactions within the SDK. The funder is the account that will cover the transaction costs for initializing pools, providing liquidity, etc.

Next steps

Once you’ve completed the setup, you can move on to building more complex functionalities using the Orca SDK, such as creating and managing pools, providing liquidity, etc. Refer to individual function documentation to use this wallet setup in action.