Practical overview
When it fits
Use it when a developer needs a compact, configurable command-line reference for Raydium AMM swaps on Solana, especially before adapting the transaction flow into another service.
Who it is for
- Solana developers
- TypeScript developers exploring Raydium SDK v2
- Engineers testing swap parameters and transaction settings
- Teams evaluating a backend or self-hosted swap integration
Documented uses
- Configure a Raydium pool and input token for a swap
- Fetch pool data through Raydium API/RPC access
- Build and simulate a versioned Solana swap transaction
- Optionally submit the transaction with a configured wallet
- Adjust slippage, priority fees and retry settings
Requirements & limits
The repository is publicly accessible and open source under the MIT license. The documented setup requires local Node.js and Yarn, an RPC endpoint, and wallet private-key configuration.
- Simulation is controlled by
executeSwap, allowing the documented default to avoid submission. - The example builds versioned (v0) transactions and supports a configurable priority fee.
- Pool, mint, amount, slippage, retry and execution settings are edited in a dedicated configuration file.
- Execution requires a funded Solana wallet and valid RPC and private-key configuration.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up and run a simulated Raydium swap
Install the example, configure a Solana RPC endpoint and wallet, then simulate a configured swap.
Before you start
- Node.js v18 or above recommended
- Yarn
- A Solana wallet with some SOL for testing
- An RPC URL and wallet private key
- A local clone of the repository
Steps
Clone the repository, enter its directory and install dependencies with
yarn.Add
RPC_URLandWALLET_PRIVATE_KEYto a.envfile.In
src/swapConfig.ts, set the pool ID, input mint, amount, slippage and priority fee, leavingexecuteSwapset tofalsefor simulation.Run
yarn swap.
Expected outcome
The configured swap is simulated rather than submitted.
Guide limitations
- The documented example uses a Raydium AMM v4 pool and defaults to SOL-USDC.
- The setup requires private-key configuration and a suitable RPC endpoint.
- The README documents simulation and submission settings but does not provide a user-interface workflow.
Compare options for DEX swap integration
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Raydium SDK Swap Example | Configure a Raydium pool and input token for a swap | CLI, Self-hosted, Server | The repository is publicly accessible and open source under the MIT license. The documented setup requires local Node.js and Yarn, an RPC endpoint, and wallet private-key configuration. |
| VIA SDK | Find swap or bridge routes using source and destination chains, token addresses, and an amount. | Web | The package is installed through npm and the documented client uses an API key. The README says the default key is limited to one request per second per IP and directs developers seeking higher limits to contact VIA. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 1 October 2026
- Original website title
- chainstacklabs/raydium-sdk-swap-example-typescript · Official homepage title · retained in its source language

