Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.raydium.io/llms.txt

Use this file to discover all available pages before exploring further.

What this chapter is. Three end-to-end Node scripts you can paste into a file, set a few env vars, and run. Each one performs a real on-chain operation against Raydium. Use these to validate your setup before building anything bigger.What this chapter is not. Reference documentation. For the full builder API, parameter reference, and corner cases, see SDK & API and the per-product code-demos pages.

Prerequisites

Run this once:
mkdir raydium-quickstart && cd raydium-quickstart
npm init -y
npm install @raydium-io/raydium-sdk-v2 @solana/web3.js @solana/spl-token bn.js
You need:
  • Node 18+ with ESM support ("type": "module" in package.json or .mjs extension).
  • A Solana keypair at ~/.config/solana/id.json (or anywhere — set KEYPAIR).
  • A funded wallet. ~0.05 SOL covers any single script in this chapter.
  • An RPC URL. Free public RPC works for testing; for anything more than a smoke test, use a paid provider.
Set these once per shell:
export RPC_URL="https://api.mainnet-beta.solana.com"
export KEYPAIR="$HOME/.config/solana/id.json"
Cluster. All three scripts default to mainnet. To run on devnet, set RPC_URL=https://api.devnet.solana.com and change cluster: "mainnet" to cluster: "devnet" inside the script. Be aware that pool seed liquidity on devnet is sparse; expect to mint your own test tokens.

The three scripts

Swap from CLI

Swap one token for another through any CPMM pool. Fastest “I can hit Raydium from a script” check.

Deploy a CPMM pool

Spin up a new CPMM pool for a token pair you choose. Picks the 0.25% fee tier and seeds initial liquidity.

Deploy a CLMM pool

Spin up a new CLMM pool with a fee tier of your choice and a single concentrated position.

After this chapter

Each script ends with a minimal output (pool ID, tx signature) and a single line pointing at the next page in the SDK & API chapter for the operation it performed. When you’re ready to write your own integration:

Version banner

SDK:       @raydium-io/raydium-sdk-v2@0.2.42-alpha
Programs:  see /reference/program-addresses
Cluster:   mainnet-beta (also runs on devnet with the change noted above)
Verified:  2026-04
If a script breaks on a newer SDK version, check the SDK’s release notes — the builder return shapes have evolved between minor releases.