All projects
AMM Solana

CPMM

A Constant Product Market Maker with a full swap + liquidity UI.

Year
2025
Role
Solo — on-chain program & front-end
RustAnchorTypeScriptNext.js

Overview

A constant-product (x·y=k) AMM on Solana. The on-chain swap and pool program is written in Rust/Anchor and paired with a TypeScript client and a Next.js front-end for swapping tokens and providing liquidity.

The challenge

Before tackling concentrated liquidity, I wanted to build the simpler constant-product model end to end — to nail the on-chain swap/pool mechanics, LP accounting and the wallet-connected trading flow on Solana.

What I built

  • An on-chain constant-product swap and pool program in Rust/Anchor.
  • Liquidity provision and removal with LP token accounting.
  • A TypeScript client and a Next.js UI for swapping tokens and managing pools.

Outcome

A working CPMM deployed and live — and the conceptual foundation for the CLMM that followed.

More work