{ market, outcomeIndex }. Invalid is not tradable. Display mids live on market.prices(). quoteTrade is for the button.
You need a seeded market, collateral (buy) or shares (sell), and summary.wrappedTokens[index] for a named outcome.
swap sides: buy = collateral → outcome; sell = the reverse. May return a capped size when the request cannot fill (withinRange: false). If it capped you, swap quote.amountIn, not the original number.
Quote again right before you send — mids from the indexer can be stale.