Skip to content

Makabeez/position-manager-skill

Repository files navigation

CLMM Position Manager

CLMM Position Manager Skill

The position-lifecycle + risk layer the Solana AI Kit is missing. IL accounting · range-exit probability · rebalance expected-value · delta-neutral hedging — across Orca Whirlpools, Raydium CLMM, and Meteora DLMM.

License Solana Claude Code Skill

An addon for solana-ai-kit. It extends solana-dev-skill (core) and references sendai (DeFi calls) — it does not re-implement swaps or pool integration. It adds the one thing no skill in the ecosystem covers: managing a concentrated-liquidity position after you've opened it.

Why

Every skill in the kit helps you open an LP position. None helps you survive one.

A CLMM position silently bleeds when divergence loss outruns fees, and "am I in range right now?" is the wrong question — by the time you're out, you've already stopped earning. Builders and funds running LPs on Orca / Raydium / Meteora reach for spreadsheets and one-off scripts because there is no shared, quantitatively serious tool for the position lifecycle.

This skill is that tool. It is not an alerting wrapper. It computes:

  • Range-exit probability over a horizon (first-passage-time of the price process through the band), not just a binary in/out flag — so you act before you exit.
  • Real net P&L: impermanent loss decomposed against fee accrual, with a feeCoverage ratio that exposes the "looks fine, actually losing money" position.
  • Rebalance only when it pays: an expected-value gate (gas + crystallized IL + swap cost vs expected incremental fee capture) that refuses to churn.
  • Delta-neutral hedging: the perp short on Drift that strips the position's directional exposure, turning an LP into a fees + funding carry trade. No other position-manager skill does this.

Architecture

                 ┌──────────────────────────────────────────────────────────┐
                 │              position-manager-skill (addon)               │
                 │                                                           │
   one struct    │   skill/SKILL.md  ── routes ──▶  clmm-positions.md        │
   for 3 venues  │                                  range-monitoring.md  ◀── first-passage / OU
                 │                                  impermanent-loss.md  ◀── IL vs fees
                 │                                  rebalancing.md       ◀── EV gate
                 │                                  delta-neutral-hedge.md◀── Drift perp short
                 │                          │                                │
                 │                          ▼ references (does not vendor)   │
                 │   solana-dev-skill (core)   ·   sendai (DeFi calls)       │
                 └──────────────────────────────────────────────────────────┘
       Orca Whirlpools  ·  Raydium CLMM  ·  Meteora DLMM   ──normalized──▶  one math layer

What's included

File Role
skill/SKILL.md Router / entry point (progressive, token-efficient loading)
skill/clmm-positions.md Unified NormalizedPosition model across all 3 venues
skill/range-monitoring.md In-range + range-exit probability (BM first-passage, OU upgrade)
skill/impermanent-loss.md IL vs fee accrual, feeCoverage, net P&L
skill/rebalancing.md Rebalance expected-value gate + range-width choice
skill/delta-neutral-hedge.md Perp hedge sizing, gamma re-hedge, carry P&L
skill/resources.md 2026 SDK matrix + math references
agents/position-manager.md Opus lifecycle agent
commands/ /check-positions, /rebalance-plan, /hedge-plan
rules/ Path-scoped code constraints (lazy-load on CLMM file patterns)

Stack (2026)

Protocol Package Model
Orca Whirlpools @orca-so/whirlpools v8 + @orca-so/whirlpools-core v3 tick-range CLMM (Kit / web3.js v2)
Raydium CLMM @raydium-io/raydium-sdk-v2 tick-range CLMM
Meteora DLMM @meteora-ag/dlmm v1.9.x discrete bins
Drift (hedge) @drift-labs/sdk (protocol-v2) perp short for delta-neutralization

Install

# Standard (defaults: ~/.claude/skills/)
git clone https://github.com/Makabeez/position-manager-skill
cd position-manager-skill
./install.sh           # or: ./install.sh -y   (non-interactive)

# Custom (choose personal / project / custom path)
./install-custom.sh

Inside solana-ai-kit, solana-dev-skill and sendai are already present as ext/ submodules. Standalone, install those for full protocol calls.

Usage

"Check all my LP positions and tell me which ones are bleeding"      -> /check-positions
"What's the probability my SOL/USDC Orca position exits range today?"-> range-monitoring
"Is my Meteora DLMM position actually profitable after IL?"          -> impermanent-loss
"Should I rebalance, or is it just churn?"                           -> /rebalance-plan
"Hedge my SOL exposure so this LP is delta-neutral"                  -> /hedge-plan

The skill recommends; it never signs. Every output shows its inputs (sigma, horizon, fees, gas) so you can sanity-check before acting.

Contributing

git checkout -b feat/<scope>-<description>-DD-MM-YYYY

Keep modules ~one screen. Math venue-agnostic, SDK calls venue-specific. No auto-execute paths.

License

MIT — see LICENSE.


Built for the Solana AI Kit · MIT · ready to submodule as ext/position-manager

About

CLMM position-lifecycle + risk skill for the Solana AI Kit — IL, range-exit probability, rebalance EV, delta-neutral hedging across Orca/Raydium/Meteora + Drift

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages