Skip to main content
Buy or sell an outcome against collateral — quote live, then swap. Always size with client.pool(outcomeToken).quoteTrade, then submit with .swap. Use prices / MarketSummary for mid prices in the UI — not for trade sizing.

Prerequisites

  • Seeded market (seedStatus() === 'seeded')
  • Collateral (buy) or outcome tokens (sell)
  • Outcome token from summary.wrappedTokens[index] (real outcomes only)

Steps

1. Get the pool

2. Quote exact-in

If withinRange is false, size the swap to quote.amountIn (or maxAmountIn), not the original request.

3. Swap

Tip

Buys are collateral → outcome; sells are the reverse. Don’t drive trade buttons from prices — those can be indexer-stale. Always quoteTrade right before swap. Vanilla client.pool(token) works the same without useVoiz.