Public Swap
A standard signed token swap settles directly between a trader's SPL accounts and the pool's public LP vaults.
A Public Swap is the ordinary CPMM path. The trader signs the transaction, debits an input token account, receives output into the other token account and is visible as a transaction signer. The pool and reserve movements are public as well.
Trader token account → LP input vault → LP output vault → Trader token account
public public public publicWhat the program checks
The instruction identifies a pool, direction, amount_in and caller-specified min_amount_out. Core reads both LP vault balances, computes the fee-adjusted integer output, checks the minimum and the LP-claim reserve floor, then executes checked SPL Token transfers. The pool's swap nonce increments after settlement.
The trader's public key is the trader signer account, not a value inferred from a relayer. The transaction's token accounts and the trader identity are therefore directly associated in the instruction.
Public data
| Visible on-chain | Why |
|---|---|
| Trader signer and token accounts | They sign and authorize the token transfers. |
| Pool, input/output mint and direction | They are explicit in the instruction and accounts. |
| Input amount and minimum output | They are instruction arguments. |
| Output, reserve changes and fee-vault changes | They result from public token transfers. |
Public Swap does not use a shielded note or a proof. For the shielded alternative, see Private Swap; for the exact math, see CPMM.