Skip to content

token-swap: say "minor units" in PoolConfig, align devnet program ID - #206

Merged
mikemaccana merged 1 commit into
mainfrom
claude/token-swap-minor-units-program-id
Nov 5, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/token-swap-minor-units-program-id

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

What

1. "minor units" in PoolConfig. The admin_fees_owed_a / admin_fees_owed_b doc comments said "in base units". The solana-finance plugin style (skills/solana/SKILL.md) uses "minor units" instead. Fixed in all three variants:

  • finance/token-swap/anchor-v1/programs/token-swap/src/state/pool_config.rs
  • finance/token-swap/anchor/programs/token-swap/src/state/pool_config.rs
  • finance/token-swap/quasar/src/state.rs

2. Program ID. Anchor.toml [programs.devnet] swap_example was AsGVFxWqEn8icRBFQApxJe68x3r9zvfSbmiEzYFATGYn, which no program declares. It is now GahM6PrXesrBkHiGJ5no4EskLNnVBCaSwVKbM4UtzyK6, the declare_id! that the anchor-v1, anchor and quasar programs all already use. Fixed in both anchor-v1/Anchor.toml and anchor/Anchor.toml.

I checked every other finance program's Anchor.toml against its declare_id!: betting-market, escrow, fundraiser, lending, managed-fund, options, order-book, perpetual-futures, prop-amm, token-fundraiser and vault-strategy all agree. token-swap was the only mismatch.

Testing

In finance/token-swap/anchor-v1, I followed the anchor-v1.yml steps with Solana 3.1.8, Anchor CLI 1.2.1 and surfpool 1.7.0:

  • anchor keys sync, anchor build: OK
  • anchor test: OK, 28 passed, 0 failed (tests/test_swap.rs)

The anchor/ and quasar/ variants were not built locally. Their changes there are doc comments and Anchor.toml only, so CI will cover them.

Follow-up

The PoolConfig excerpt in quiknode-labs/docs#3676 (guides/solana-development/finance/solana-amm-program/index.mdx) needs updating to match after this merges.


Generated by Claude Code

- PoolConfig's admin_fees_owed_a/b doc comments said "base units"; reword
  to "minor units" in the anchor-v1, anchor and quasar variants.
- Anchor.toml [programs.devnet] held AsGVFx..., which matched nothing;
  set it to GahM6P..., the declare_id! all three variants already use.
  token-swap was the only finance program with this mismatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZHin66a6gYXbTBsFu1HTS
@mikemaccana
mikemaccana merged commit 86ae9b8 into main Nov 5, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants