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

Reference for doppler-sol CPMM pools, positions, swaps, liquidity, protocol fee positions, oracle accounts, hooks, and PDA-based pool addressing.

Use this Skill: https://skilld.dev/gh/whetstoneresearch/doppler-skills/solana-cpmm

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

SKILL.md

≈40 tokens for metadata: the name and description. ≈663 when used: this file. ≈640 more on demand in 3 files.

Description uses 2.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈159 characters, or 2.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Consumer Source of Truth: Use the published @whetstone-research/doppler-sdk Solana helpers and generated IDLs for pool addresses, instructions, and account decoding.

Solana CPMM

When to use

  • You are inspecting or integrating post-migration constant-product pools.
  • You need pool, authority, position, protocol fee position, or oracle addresses.
  • You are debugging swaps, add/remove liquidity, fee accrual, protocol fees, or oracle behavior.

Mental model

CPMM is the Solana post-migration AMM destination. It is a constant-product pool with SPL vaults, internal LP positions, optional oracle state, optional external hooks, and a protocol fee position.

Do not assume Uniswap V2 LP-token mechanics. Liquidity is tracked in Position accounts, and fees accrue through per-position accounting.

Core workflow

  1. Derive the config and pool addresses with SDK helpers, preserving canonical mint ordering.
  2. Initialize a pool with token vaults owned by the pool authority PDA.
  3. Create user positions by (pool, owner, position_id).
  4. Add liquidity into a position and collect accrued fees through that position.
  5. Swap exact input amounts through swap_exact_in.
  6. If configured, update or consult oracle state.
  7. Reconcile protocol fee shares through the pool protocol fee position.

Quick facts

Item Detail
Program CPMM
Config PDA [b"config"]
Pool PDA [b"pool", token0_mint, token1_mint]
Mint ordering raw pubkey byte order
Vault authority PDA [b"authority", pool]
Position PDA [b"position", pool, owner, position_id_le_bytes]
Protocol fee owner PDA [b"protocol_fee_owner", pool]
Protocol fee position PDA [b"position", pool, protocol_fee_owner, 0]
Oracle PDA [b"oracle", pool]
Token support token-interface: SPL Token or Token-2022

Failure modes

  • Deriving a pool with unsorted mints.
  • Treating internal positions as transferable LP tokens.
  • Ignoring fees_unclaimed* when reconciling vault balances against reserves.
  • Forgetting the protocol fee position can hold shares.
  • Assuming oracle accounts are created automatically with pools.
  • Reusing removed routing or quote_to_numeraire assumptions; current CPMM no longer has route fields.

References

Related skills

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.

1 warning5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill is a technical reference for Solana CPMM (Constant Product Market Maker) protocols, providing documentation on PDA derivation, pool accounting, and oracle structures. It consists entirely of informational markdown files with no executable components or security risks detected.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 4f654fe. 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 6 months ago
metadata
{
  "author": "doppler",
  "version": "1.0"
}

README badge

README badge for whetstoneresearch/doppler-skills/solana-cpmm