Skip to content

Build collateralized YES/NO pairs, quote exact partial redemptions, and disclose verifier and legacy allowance limits.

Use bb build prediction-market to create a binary market with YES (token 1) and NO (token 2). Every collateral base unit mints one unit of each position. The collection escrow holds deposits and pays consuming redemptions. Alias denoms make positions transferable and tradable on liquidity pools.

Create

bash
bb build prediction-market --verifier "$VERIFIER" --denom USDC \
  --name "Example market" --description "Define the event, evidence and resolver policy" \
  --image ipfs://image > market.json
bb check market.json
bb deploy market.json --browser
bb prediction-markets show "$COLLECTION_ID"

The canonical builder creates seven frozen approvals: mint pairs, transfer, redeem pairs, YES wins, NO wins, push YES and push NO. Use the builder for complete valid criteria rather than copying an abbreviated approval JSON fragment.

Redeem

RoutePositions consumedCollateral paid
PairOne YES and one NOOne base unit, paid once
YES winsOne YESOne base unit
NO winsOne NOOne base unit
PushTwo YES or two NOOne base unit per pair on that side

All CLI amounts are integer base units. For six-decimal collateral, 1000000 is one display coin. Fees are additional. Quote against current collection terms before proposing a transaction:

bash
bb prediction-markets quote "$COLLECTION_ID" --state yes-wins --yes-amount 250000 --yes-balance 1000000
bb prediction-markets redeem "$COLLECTION_ID" --creator "$HOLDER" --state yes-wins --yes-amount 250000 > redeem.json
bb deploy redeem.json --browser

New markets support repeated claims and redemption of positions acquired after an earlier claim. Each payout consumes positions. A winning claim leaves losing positions untouched. Pair deposits and pair redemptions remain available after resolution; the canonical recipe does not enforce a trading deadline.

For a push, omit an amount to select the maximum complete lots from a supplied balance. An explicit odd amount is rejected instead of rounded. Set one side to zero to skip it:

bash
bb prediction-markets quote "$COLLECTION_ID" --state push --yes-balance 5 --no-balance 3
bb prediction-markets redeem "$COLLECTION_ID" --creator "$HOLDER" --state push --yes-amount 4 --no-amount 0 > partial.json

The quote with balances 5 YES and 3 NO consumes 4 YES and 2 NO, pays 3 collateral base units and retains one raw unit of each. Complementary retained units can redeem as a pair; an unmatched odd unit cannot pay half a collateral base unit.

Quotes expose payout, legs, remaining, warnings and outcomeFinality. Each leg identifies the observed approval/version and its policy and eligibility. These values describe the proposed redemption; they do not replace simulation against fresh balances, votes, approval trackers and escrow liquidity.

Legacy Markets

Existing frozen one-shot approvals stay one-shot. A partial claim may consume the only permitted claim for that initiator, leaving later positions unable to use that settlement route. The UI discloses unknown allowance state when no tracker observation is supplied and blocks a known exhausted allowance. Unknown does not mean unused. Resettable trackers require the applicable epoch before a count can establish remaining eligibility.

Verifier Trust

bash
bb prediction-markets resolve "$COLLECTION_ID" --creator "$VERIFIER" --outcome yes > resolution.json
bb deploy resolution.json --browser

Voting challenges authorize settlement payouts. Independent challenges do not enforce an immutable, mutually exclusive terminal outcome. Frozen collection permissions do not freeze votes. The resolver must follow the published event policy; inconsistent decisions can undermine collateral solvency. Stronger finality requires a separate proven primitive or oracle design.

Interfaces

The creation form validates the wallet, verifier address, metadata and supported approval profile before enabling creation. The payment screen supports partial amounts, exact payouts, retained dust and legacy allowance warnings. Successful submissions refresh positions and collection state; a failed refresh requires reloading before another proposal.

Agents can use bb prediction-markets quote and redeem, or the equivalent MCP tools standard_prediction_markets_quote and standard_prediction_markets_redeem. Both return unsigned proposals; use bb deploy --browser for the human review and signing flow.

Edit this page on GitHub