Immutable, permissionless constant-product AMM for Liquid.
anchor uses Simplicity contracts to enforce AMM rules directly on-chain. Pools are covenant-controlled UTXOs with no admin key, no upgrade path, and no off-chain coordinator.
Anyone can deploy a pool between two Liquid assets, provide liquidity, and earn swap fees proportional to their share of the pool.
anchor is early-stage experimental software.
This repository is public so the protocol and implementation can receive review. The codebase currently contains incomplete features, bugs, and breaking changes.
Do not use with real funds.
-
CLI reference — all commands and flags docs/cli.md
-
Protocol specification docs/spec.md
-
Current development roadmap docs/status-wip.md
-
Lessons learned while building anchor docs/lessons.md
-
Very early frontend concept docs/concept.html
Requirements:
- Go 1.21+
- Rust / cargo
- Elements / Liquid node
Clone the repository:
git clone https://github.com/0ceanslim/anchor
cd anchorInstall the patched Simplicity compiler:
make install-simcInstall the Go → SimplicityHL transpiler:
make install-simgoBuild the CLI:
make buildBinary will be created at:
bin/anchor
All commands support interactive wizard mode — run without flags and the CLI will prompt for everything it needs. Every command also works fully non-interactively via flags.
Set up your environment once:
export ANCHOR_RPC_URL=http://localhost:7041
export ANCHOR_RPC_USER=user
export ANCHOR_RPC_PASS=pass
export ANCHOR_NETWORK=testnet
export ANCHOR_ESPLORA_URL=http://localhost:3000| Command | Description |
|---|---|
check |
Validate RPC, Esplora, compiler, and pool config |
compile |
Compile Simplicity contracts (developer tool) |
find-pools |
Discover pools by asset pair or pool ID |
pool-info |
Query live pool reserves and price |
create-pool |
Deploy a new AMM pool |
swap |
Swap between pool assets |
add-liquidity |
Deposit assets and receive LP tokens |
remove-liquidity |
Burn LP tokens and withdraw reserves |
# Find a pool by its LP asset ID
./anchor find-pools --pool-id <lp-asset-hex>
# Query pool reserves
./anchor pool-info --pool-id <lp-asset-hex>
# Interactive swap (prompts for everything)
./anchor swap
# Non-interactive swap
./anchor swap --pool-id <lp-asset-hex> --in-asset asset0 --amount 10000 --broadcastFull flag reference: docs/cli.md
cmd/anchor/ CLI entrypoint
pkg/ Core implementation
contracts/ Canonical contract logic (Go → SimplicityHL)
build/ Generated contract files
tests/ Integration tests
docs/ Protocol documentation and notes
MIT License
© 2025–2026 0ceanslim