GokooSwap

The first automated market maker on ONX — constant-product liquidity, settled by a Nacre smart contract.

Devnet-3 · Test tokens only — TKA / TKB have no real-world value

Pool — TKA / TKB

RESERVE · TKA
—
RESERVE · TKB
—
Spot price: —
Product k: —
loading pool state…

Swap

TKA
— TKB
Price impact—
New reserves after swap—

The quote uses the contract's own formula with integer floor division — out = reserve_out × in / (reserve_in + in) — so what you see here is what the pool would settle on-chain, to the unit.

Add liquidity

TKA
TKB
New reserves—
Your share of pool after—
Pool ratio TKB per TKA—

On onx-isa-1 messages carry no value, so the reserves above are the pool's own ledger of the two test tokens. Custody between separate token contracts arrives with the onx-isa-2 proposals — GokooSwap's pricing core carries over unchanged.

How it settles

A swap is a signed ContractCall to the pool contract on ONX devnet-3. The contract recomputes the price from its own reserves — no oracle, no off-chain matching — using checked u64 arithmetic: an overflowing trade faults and bounces rather than wrapping. A swap can never decrease the product of the reserves.

GokooSwap is written in Nacre, ONX's contract language, and compiled by the Nacre compiler — extended for this pool with message fields and integer division, proven by execution tests and a full STF end-to-end run before it ever touched a chain.

Proof

ContractGokooSwap (Nacre, onx-isa-1)
Code root478ca14f…6eff3d
Static gas bound10,410
MessagesAddLiquidity · SwapAForB · SwapBForA
Gettersreserve_a · reserve_b

Source and compiler live in the ONX repository: git.on-x.live/amethyst/the-open-network-x (contracts/nacre/gokooswap.nacre).