Buy and sell in a pool
How to quote and trade in a launched token's pool, why to keep slippage low, and what a trade makes public.
On this page
A trade, step by step#
- Quote. The wallet reads the pool state from the node and accepts it only if its root equals the market root in the newest header the wallet verified. It then computes the quote itself. A quote describes that exact pool state; it is not a price guarantee.
- Set slippage. You choose a tolerance in basis points (100 basis points is 1%). The wallet turns it into a minimum amount out. The default is 50 basis points (0.5%).
- Prove and submit. The wallet builds the proof on your computer. The intent lives for 8 blocks by default.
- Settlement. When the transaction is included, the ledger computes the trade against the pool and creates your output note. Your wallet opens the third envelope, checks the note against the public record, and credits it.
Slippage, and why to keep it low#
Slippage is how much worse than the quote you will accept. Your minimum amount out is public. The block producer sees every pool trade before it is included. If your trade is large compared to the pool, the producer can trade just before you and leave you exactly your minimum. Your loss is bounded by your tolerance, and the tolerance is the only protection. A tight tolerance and a short lifetime reduce what can be taken. They do not remove the producer's power over ordering.
A tight tolerance also makes your trade more likely to fail when another trade lands first. That costs you a proof's time, not funds.
You cannot withdraw a submitted trade#
A submitted intent stays admissible until its expiry height, unless one of its input notes is spent first. A refused intent is still watched until expiry; if the node includes it later, the wallet recognises it and credits the output.
If a trade is refused#
| Category | Meaning |
|---|---|
slippage | The pool moved beyond your tolerance |
expired | The intent expired or its window is out of range |
overflow | The amount is too large for the pool arithmetic |
asset | The wrong asset for this side of the pool |
amount | The amount is zero or too small to produce any output |
supply | More tokens than the pool can take back |
unknown-pool | No such pool |
rejected | Anything else |
Reserved notes are released when a trade is refused.
What a pool trade makes public#
Public: the pool, the side, the exact amount paid in, the minimum accepted out, the expiry height, the anchor root, a recipient binding, and at settlement the exact output amount and its note commitment. No address or account.
Two consequences the wallet shows next to the form:
- The output note's amount is public. Selling or swapping exactly that amount later links the two trades.
- A distinctive slippage setting is a behavioural fingerprint.