Index of every page on this site: llms.txt
All skills
Run it yourself

Manage Solana concentrated-liquidity (CLMM/DLMM) LP positions across Orca Whirlpools, Raydium CLMM, and Meteora DLMM, plus the constant-product baselines (Raydium CPMM, Meteora DAMM v2). Track impermanent loss, detect out-of-range positions, and decide + execute rebalances. Use when the user asks about liquidity providing, LP positions, concentrated liquidity, impermanent loss, range management, or rebalancing on Solana.

  • 14 files
  • 74.1 KB
  • MIT
  • Updated 5 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/yusizer/solana-position-manager-skill/skill

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

meteora-damm-v2.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Meteora DAMM v2 — constant-product AMM with NFT positions (scope: fetch + fees + claim)

Meteora DAMM v2 is a constant-product AMM (x·y = k) — the "cp-amm" — with NFT positions, dynamic fees, and an anti-sniper suite. It is the AMM tokens graduate to from Meteora's Dynamic Bonding Curve. Verified against @meteora-ag/cp-amm-sdk 1.4.4 and github.com/MeteoraAg/damm-v2-sdk (docs.md).

Scope note. DAMM v2 is constant-product, so the concentrated-liquidity parts of this skill (range selection, out-of-range drift, amplified IL) do not apply — λ = 1, the full-range case. What does apply is the fetch → fees → claim slice of the lifecycle. Range/rebalance redirect to the v2 case in impermanent-loss.md.

SDK package (2026)

Package Version Notes
@meteora-ag/cp-amm-sdk 1.4.4 "SDK for DAMM v2". Class CpAmm. Deps: @coral-xyz/anchor 0.31.0, @solana/web3.js ^1.95.3, @solana/spl-token ^0.4.8, bn.js, decimal.js.
npm install @meteora-ag/cp-amm-sdk
import { CpAmm } from "@meteora-ag/cp-amm-sdk";
import { Connection, PublicKey } from "@solana/web3.js";
const cpAmm = new CpAmm(connection);

Program ID (verified)

Same address on Mainnet and Devnet:

cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG

Do not confuse with DLMM (LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo) or the DBC bonding curve (dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN).

Position model — NFT positions on a constant-product curve

A position is an NFT (supply-1 SPL token); the holder owns the position. Liquidity is fungible-equivalent (a proportional share of pool liquidity) — there is no tick/bin range. A DAMM v2 position is always "full range": it earns fees on every swap and never goes out of range.

Dynamic fees (volatility / time / market-cap schedulers + rate limiter): getBaseFeeParams, getDynamicFeeParams, getBaseFeeNumerator, getDynamicFeeNumerator, bpsToFeeNumerator / feeNumeratorToBps, and the fee-scheduler encoders/decoders (encodeFeeTimeSchedulerParams, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams + matching decoders).

Fetch positions + pool state

// Pool state (sqrt price, liquidity, fees):
const poolState = await cpAmm.fetchPoolState(poolAddress);

// All positions for a user (across DAMM v2 pools):
const positions = await cpAmm.getPositionsByUser(userPublicKey);

// Positions for a user in one pool:
const byPool = await cpAmm.getUserPositionByPool({ pool, user });

// Single position:
const pos = await cpAmm.fetchPositionState(positionNft);

// Pool fees (claimable LP fee):
const fees = await cpAmm.fetchPoolFees(poolAddress);

Other state getters: getAllPositions, getAllPositionsByPool, getMultiplePositions, fetchPoolStatesByTokenAMint, getAllPools, isPoolExist, isLockedPosition / isPermanentLockedPosition / canUnlockPosition.

Fees & rewards — claim

// Claim accrued LP fees for a position:
await cpAmm.claimPositionFee({ positionNft, payer, ... });   // claimPositionFee2 = newer variant
// Claim liquidity-mining rewards:
await cpAmm.claimReward({ positionNft, rewardIndex, ... });

Unclaimed-fee helper: getUnClaimLpFee(...). Rewards do not auto-compound — claim manually (same rule as DLMM).

Why range/rebalance don't apply (the math)

A constant-product position is the full-range case of impermanent-loss.md:

  • Capital efficiency λ = 1 → IL_v2(r) = 2·√r/(1+r) − 1 (the un-amplified v2 curve), not λ · IL_v2.
  • No out-of-range state → range-alerts.md has nothing to fire on.
  • No range to widen/move/withdraw → rebalance.md heuristics are N/A. "Rebalancing" a DAMM v2 position = withdraw + redeposit (close + open) — a gas-vs-fees call, not a range call.

Lifecycle coverage for DAMM v2

Step Applies? How
FETCH ✅ fetchPoolState, fetchPositionState, getPositionsByUser
MEASURE (fees) ✅ fetchPoolFees, getUnClaimLpFee; IL via IL_v2 (λ=1)
MEASURE (in-range) n/a always full-range
DECIDE rebalance limited withdraw+redeposit gas call, not a range decision
EXECUTE ✅ removeAllLiquidityAndClosePosition / createPositionAndAddLiquidity — simulate first (../rules/safe-rebalance.md)
MONITOR ✅ poll fetchPoolFees + fetchPoolState on a schedule (monitoring.md)

2026 notes

  • SDK @meteora-ag/cp-amm-sdk 1.4.4 (published 2026-04). API surface read from the SDK's own docs.md; exact param shapes per method — confirm in docs.md before relying on a specific field. The class name (CpAmm) and the functions above are taken verbatim from that documentation.
  • Position lifecycle extras: splitPosition / splitPosition2, mergePosition, lockPosition / permanentLockPosition, refreshVesting, closePosition.
  • Quote helpers: getQuote / getQuote2, getDepositQuote, getWithdrawQuote, getLiquidityDelta, getPriceImpact, getPriceFromSqrtPrice / getSqrtPriceFromPrice, getMaxAmountWithSlippage / getAmountWithSlippage.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at b89520b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
compatibility
claude-code, codex
Other metadata
metadata
{
  "orca-whirlpools": "@orca-so/whirlpools 8.x",
  "raydium-clmm": "raydium-sdk-v2 0.2.55",
  "meteora-dlmm": "@meteora-ag/dlmm 1.9.10",
  "meteora-damm-v2": "@meteora-ag/cp-amm-sdk 1.4.4",
  "verified": "2026-06-26"
}

README badge

README badge for yusizer/solana-position-manager-skill