Skip to content
Solana

Docs · Pools

SDK

The reel TypeScript client: program ids, PDAs, account decoders, the launch builders and exact quotes. It lives in the reel repository; the npm package is coming.

Where it is

The client is in the reel repository under sdk/src, built on @solana/web3.js 1.x with no @solana/spl-token dependency. The reel app imports it as @/sdk/src. A published npm package is coming; until then, copy the folder or depend on the repository.

The program ids default to the keys generated for the program and can be overridden with NEXT_PUBLIC_REEL_PROGRAM_ID and NEXT_PUBLIC_REEL_HOOK_PROGRAM_ID. Nothing is deployed yet: check Programs and addresses before you send anything.

What it exports

AreaExports
IdsREEL_PROGRAM_ID, REEL_HOOK_PROGRAM_ID, VAULT_AUTH, token program ids, NATIVE_MINT
PDAsconfigPda, rootPda, launchPda, poolPda, vaultPda, positionPda, ledgerPda, claimsVaultPda, walletCounterPda, savedHookPda, refCodePda, hookHolderPda and the rest of the seeds table
AccountsdecodePool, decodeLaunch, decodePosition, decodeLedger, decodeConfig, decodeRoot, decodeSavedHook, accountFilters for getProgramAccounts
ParamsencodeParams, the PoolParams type and its validation
QuotesquoteSwap, minOut, maxIn: the swap pipeline in TypeScript, atom for atom
Instructionsix.*: one builder per reel and reel-hook instruction
ErrorsparseCustomError, errorName
TokenswrapSolIxs, unwrapSolIx, createAtaIdempotentIx

Building a launch

A launch spans several transactions (see Multi-pool launch). The builders follow the instruction order. PoolParams comes from a builder board through the catalog, so the app, the docs and the SDK agree on every bound.

ts
import { PublicKey, Keypair } from "@solana/web3.js"
import { ix, launchPda, poolPda, rootPda } from "@/sdk/src"
import { poolParams, presetBoard, preset } from "@/lib/blocks"

const mint = Keypair.generate() // a new token's mint signs LaunchCreate
const launch = launchPda(mint.publicKey, 0)

const create = ix.launchCreate({
  creator, mint: mint.publicKey, newToken: true, treasury,
  decimals: 6, supply: 1_000_000_000_000_000n, poolCount: 2,
  weights: [7_000, 3_000], maxRetainedBps: 200, toleranceBps: 100,
  name: "Example", symbol: "EXMPL", uri: "https://example.com/meta.json",
})
const hookMetas = ix.initExtraMetas(creator, mint.publicKey) // same transaction

const board = presetBoard(preset("recommended-new")!)
const initSol = ix.poolInit({
  creator, launch, base: mint.publicKey, quote: NATIVE_MINT, index: 0,
  params: poolParams(board),
})

Then ix.poolSeed for each pool (from the escrow for a new token), an optional ix.devBuy, and ix.launchFinalize with every pool, plus the reference pools when the launch sets an opening price check.

Quotes match the program

quoteSwap runs the same steps as the program's swap: it advances the pool's clock-driven state, applies every charge in order with the same rounding, and returns the input, the output, the full charge breakdown and the pool as it would be afterwards. The SDK's tests check it against vectors produced by running the program itself in LiteSVM (sdk/test-vectors/swaps.json).

Read Swapping and quoting for a complete swap, and SDK for integrators for routers and apps.

How the reel app uses it

The reel app builds its transactions with these builders and reads accounts with the decoders through its server-side RPC proxy. Every transaction goes through one pipeline: build, simulate, sign, send, confirm. A wallet is asked to sign only after the simulation passes, and a failure is reported as a sentence from the program's logs. The app never signs for a wallet.