in-solana by Supanode

Orca Whirlpools — Program ID & Overview

whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc

Orca Whirlpools is a concentrated liquidity AMM on Solana. It allows liquidity providers to deposit tokens within specific price ranges, concentrating capital where trading activity occurs. Whirlpools is one of the most liquid DEX venues on Solana.

Program ID

whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc

Architecture

Account typeDescription
WhirlpoolsConfigGlobal configuration: fee authority, protocol fee
WhirlpoolIndividual pool state: current tick, sqrt price, liquidity
TickArrayArray of 88 ticks storing liquidity data
PositionLP position: tick range, liquidity amount, fees owed

Fee tiers

Fee tierTick spacingTypical use
1 bps1Stableswaps
4 bps2Correlated tokens
8 bps8Mid-tier pairs
30 bps64Standard pairs
100 bps128Volatile pairs
200 bps256Exotic pairs

Key instructions

InstructionDescription
InitializePoolCreate a new Whirlpool with initial sqrt price
OpenPositionOpen an LP position with a tick range
IncreaseLiquidityAdd tokens to a position
DecreaseLiquidityRemove tokens from a position
SwapExecute a swap
CollectFeesClaim trading fees
CollectRewardClaim reward emissions

SDK integration

Orca provides a TypeScript SDK for interacting with Whirlpools.

import { WhirlpoolContext, buildWhirlpoolClient, ORCA_WHIRLPOOL_PROGRAM_ID } from "@orca-so/whirlpools-sdk";

const ctx = WhirlpoolContext.from(connection, wallet, ORCA_WHIRLPOOL_PROGRAM_ID);
const client = buildWhirlpoolClient(ctx);

const poolAddress = new PublicKey("...");
const whirlpool = await client.getPool(poolAddress);

const poolData = whirlpool.getData();
console.log("Current price:", poolData.sqrtPrice);
console.log("Liquidity:", poolData.liquidity);

Swap via SDK

const quote = await swapQuoteByInputToken(
  whirlpool,
  inputMint,
  new BN(amountIn),
  slippageTolerance,
  ctx.program.programId,
  ctx.fetcher,
);

const tx = await whirlpool.swap(quote);
const sig = await tx.buildAndExecute();

FAQ

How does Orca Whirlpools differ from Raydium CLMM? Both implement concentrated liquidity with tick-based pricing. The main differences are SDK ergonomics, fee tier options, and the ecosystem of tools around them. Many tokens have active pools on both.

What is a TickArray? A TickArray is an on-chain account that stores 88 consecutive tick states. Ticks track how much liquidity enters or exits at each price point. Swaps must include the relevant TickArray accounts in the transaction.

Can I earn rewards beyond trading fees? Yes. Pool creators can attach up to three reward emissions to a Whirlpool. LPs in positions that overlap the current price earn a share of these rewards proportional to their liquidity.

Updated: