Skip to content

alexbanda08/clmm-command-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clmm-command-center

One routed Claude Code / Codex skill to monitor, backtest, rebalance, and tax-track concentrated-liquidity LP across every major Solana DEX.

The problem

Concentrated-liquidity LPs juggle five disconnected tools: one dashboard per venue (Orca, Raydium, Meteora, Kamino), a spreadsheet for IL math, a Telegram bot for alerts, and a separate exporter at tax time. Studies of Uniswap-style CLMM repeatedly show a majority of LPs are net-unprofitable after impermanent loss versus simply holding. The core failure mode is late information: polling a position every 60s means you learn you went out-of-range minutes after fees stopped accruing, and you size rebalances on stale quotes. By the time you react, the range has moved.

What it does

  • Track every CLMM/DLMM position across Orca Whirlpools, Raydium CLMM, Meteora DLMM + DAMM v2, and Kamino vaults in one normalized LpPosition view (tick bounds, in-range flag, unclaimed fees, token amounts).
  • Alert in realtime via reconnecting Yellowstone gRPC / websocket subscriptions, firing the moment the current tick crosses a stored bound, instead of polling.
  • Backtest a range: IL-vs-HODL net P&L and fee-APR over historical price paths, plus the break-even range width where fees cover IL.
  • Route yield: compare fee APR for a pair across venues so you LP where the capital actually earns.
  • Rebalance safely: plan a close+reopen into a new range, always simulate first, and gate execution behind a typed human confirmation with slippage / exposure caps.
  • Tax-lot ledger: build cost-basis lots (FIFO / HIFO / SPECID) from add/remove/collect events as a record-keeping aid.

Prior art and how this differs

Single-venue liquidity skills/SDKs exist (Orca, Raydium, Meteora, Kamino each ship their own); agiprolabs/claude-trading-skills covers CLMM math educationally (lp-math, impermanent-loss); and hosted CLMM rebalancing bots are a crowded market. None give you live, multi-venue position management as one routed skill. This repo is the build-out of the official solanabr/position-manager-skill seed - an empty stub the bounty explicitly invites contributors to fill - so it is an honest level-up of that seed pattern, not a claim of novelty. The differentiators, in one routed package:

  1. Realtime gRPC/websocket out-of-range alerting that replaces polling.
  2. IL-vs-HODL + fee-APR backtesting with an explicit break-even width.
  3. Cross-DEX yield routing for a single pair.
  4. A simulate-first, human-confirm rebalance gate with hard caps and no bypass flag.

It is scaffolding and knowledge you run yourself - never a hosted or auto-running bot.

How it works

SKILL.md is a router, not a manual. On activation it loads source-precedence rules and a Task Routing Guide that maps each intent to exactly one leaf file (references/positions.md, streaming.md, backtesting.md, yield-routing.md, kamino-vaults.md, rebalancing.md, tax-lots.md). The agent opens one leaf per task - minimal context, maximal precision. All Anchor / program / IDL / transaction-signing / priority-fee plumbing is delegated to the sibling ../solana-dev core skill via references/delegation.md.

Install

# Claude Code plugin install
./install.sh            # copies skill + templates into ~/.claude/skills/clmm-command-center
# or, from inside Claude Code:
/plugin install clmm-command-center

For Codex, point your skills directory at this repo's skill/ folder. Templates under templates/ are importable TypeScript (@solana/kit / web3.js v2); adapters import venue SDKs lazily so the core compiles without every DEX SDK present.

Use cases

# 1. Watch positions in realtime
> Watch my LP positions and alert me the moment any one goes out of range.

# 2. Backtest a range
> Backtest a 5% SOL/USDC range on Orca over the last 90 days: IL vs HODL and fee APR.

# 3. Rebalance with confirmation
> My SOL/USDC position is out of range. Plan a recenter, simulate it, and ask me to confirm before sending.

Safety

Rebalances always simulate (rpc.simulateTransaction) before submit and never auto-execute. Fund-moving and signing transactions require an explicit typed human confirmation; slippage, max-notional, max-position, and daily-loss caps plus a kill-switch are mandatory; configs default to DRY_RUN=true and REQUIRE_CONFIRM=true. No flag defeats the confirm-gate.

Tax note

The tax-lot ledger is a record-keeping aid, not tax advice. Per-wallet cost-basis tracking became mandatory Jan 1 2025 (Rev. Proc. 2024-28); the new 2026 items are broker 1099-DA cost-basis reporting and the expiry of Notice 2025-7 spec-ID transitional relief. The taxability of LP add/remove is unsettled, so ambiguous lots are flagged for CPA review. Default method is FIFO (HIFO / SPECID supported).

Stack (last-verified 2026-06; run npm view <pkg> version to confirm latest)

@solana/kit ^6 (web3.js successor; npm major 6.x, lockstep with compat; v1 maintenance-only) - @solana/compat ^6 at v1-only SDK boundaries - @triton-one/yellowstone-grpc ^5 (Yellowstone gRPC streaming) - @orca-so/whirlpools ^8 (Kit) - @raydium-io/raydium-sdk-v2 0.2.53-alpha (pin exact) - @meteora-ag/dlmm ^1.9 + DAMM v2 - @kamino-finance/kliquidity-sdk ^13 (note kliquidity -> klend KaminoVault migration) - Anchor 1.0.2. See references/sdk-versions.md.

License

MIT (c) 2026 Alexandre Bandarra. See LICENSE.

About

CLMM/LP lifecycle command center skill for Solana (Claude Code / Codex): realtime out-of-range alerts, IL-vs-HODL backtest, simulate-first rebalance, tax-lot ledger. MIT.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors