Prediction Markets
Browse prediction markets, query the user's positions and orders, and trade outcome tokens.
A prediction market asks a yes/no (or multi-outcome) question that will resolve at some point in the future. Each outcome is represented by an ERC-1155 outcome token. Buying an outcome token is betting on that outcome; if the market resolves in your favor, the token can be redeemed for payout.
Commands are grouped into three categories: market/category queries, position/order queries, and trade commands (quote, place-order, cancel, redeem).
prediction category list
List available prediction market categories (e.g. crypto, sports, politics).
Syntax
baw prediction category list --jsonExample
baw prediction category list --jsonprediction market list
List prediction markets, optionally filtered by category and sorted.
Syntax
baw prediction market list [--l1Category <category>] [--l2Category <category>] [--sortBy <sort>] [--orderBy <order>] [--offset <offset>] [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--l1Category |
No | — | L1 category filter (e.g. crypto, sports). From prediction category list. |
--l2Category |
No | — | L2 subcategory filter |
--sortBy |
No | — | RECOMMENDED, VOLUME, PARTICIPANTS, CREATED_TIME, END_DATE |
--orderBy |
No | DESC |
ASC or DESC |
--offset |
No | 0 |
Pagination offset |
--limit |
No | 20 |
Page size, max 100 |
Example
baw prediction market list --json
baw prediction market list --l1Category crypto --limit 5 --json
baw prediction market list --sortBy VOLUME --orderBy DESC --jsonprediction market detail
Get the full detail of a single prediction market by its topic ID.
Syntax
baw prediction market detail --marketTopicId <id> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketTopicId |
Yes | — | Market topic ID |
Example
baw prediction market detail --marketTopicId 123456 --jsonprediction market search
Search prediction markets by keyword.
Syntax
baw prediction market search --query <query> [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--query |
Yes | — | Search keyword, max 200 chars |
--limit |
No | 10 |
Max results, max 50 |
Example
baw prediction market search --query "Bitcoin" --json
baw prediction market search --query "FIFA World Cup" --limit 5 --jsonprediction market order-book
Get the order book for a specific outcome token.
Syntax
baw prediction market order-book --marketId <id> --tokenId <tokenId> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketId |
Yes | — | Market ID |
--tokenId |
Yes | — | Outcome token ID |
Example
baw prediction market order-book --marketId 789 --tokenId 123456789 --jsonprediction market last-trade-price
Get the last trade price for a market.
This is a historical fill price, not a live market quote — it can be stale if there have been no recent trades, and it does not reflect the current best bid/ask.
Syntax
baw prediction market last-trade-price --marketId <id> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketId |
Yes | — | Market ID |
Example
baw prediction market last-trade-price --marketId 789 --jsonprediction position list
List the user's active and past prediction positions with PnL summary.
Syntax
baw prediction position list [--tab <tab>] [--offset <offset>] [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--tab |
No | ONGOING |
Filter: ONGOING, ENDED, PENDING_CLAIM |
--offset |
No | 0 |
Pagination offset |
--limit |
No | 20 |
Page size, max 100 |
PENDING_CLAIM surfaces winning positions that have not yet been redeemed — use prediction trade redeem to claim them.
Example
baw prediction position list --json
baw prediction position list --tab PENDING_CLAIM --jsonprediction position token
Look up a single position by its ERC-1155 outcome token ID.
Syntax
baw prediction position token --tokenId <tokenId> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--tokenId |
Yes | — | ERC-1155 outcome token ID |
Example
baw prediction position token --tokenId 123456789 --jsonprediction position settled-history
List the user's settled (finalized) prediction positions, with optional win/lose filtering.
Syntax
baw prediction position settled-history [--l1Category <category>] [--filter <filter>] [--offset <offset>] [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--l1Category |
No | — | L1 category filter (e.g. crypto, sports) |
--filter |
No | all |
all, win, lose |
--offset |
No | 0 |
Pagination offset |
--limit |
No | 20 |
Page size, max 100 |
Example
baw prediction position settled-history --json
baw prediction position settled-history --filter win --json
baw prediction position settled-history --filter lose --jsonprediction position pnl
Query detailed PnL records for the user's prediction positions.
Syntax
baw prediction position pnl [--tokenId <tokenId>] [--l1Category <category>] [--offset <offset>] [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--tokenId |
No | — | Filter by a specific token ID |
--l1Category |
No | — | L1 category filter: crypto, sports, all |
--offset |
No | 0 |
Pagination offset |
--limit |
No | 20 |
Page size, max 100 |
Example
baw prediction position pnl --json
baw prediction position pnl --l1Category crypto --json
baw prediction position pnl --tokenId abc123 --jsonprediction position portfolio
Get a portfolio-level summary of the user's active prediction positions, including unrealized PnL.
Syntax
baw prediction position portfolio --jsonExample
baw prediction position portfolio --jsonprediction order history
List the user's historical prediction orders across all statuses.
Syntax
baw prediction order history [--status <status>] [--l1Category <category>] [--orderType <type>] [--offset <offset>] [--limit <limit>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--status |
No | — | PENDING, SUBMITTED, FILLED, PARTIALLY_FILLED, CANCELLED, FAILED, EXPIRED |
--l1Category |
No | — | L1 category filter |
--orderType |
No | — | MARKET or LIMIT |
--offset |
No | 0 |
Pagination offset |
--limit |
No | 20 |
Page size, max 100 |
Example
baw prediction order history --json
baw prediction order history --status FILLED --limit 10 --json
baw prediction order history --orderType LIMIT --jsonOrder Status
| Status | Description |
|---|---|
PENDING |
Order created but not yet submitted to vendor |
SUBMITTED |
Order submitted to vendor, awaiting execution |
FILLED |
Order fully filled |
PARTIALLY_FILLED |
Order partially filled |
CANCELLED |
Order cancelled by user or system |
FAILED |
Order failed to execute |
EXPIRED |
Expired due to market ends |
Trading Flow
Prediction trading is a two-step flow:
- Quote — call
prediction trade quoteto get aquoteIdand the expected cost / payout. - Confirm with the user — show them the quote (price, amount, expected payout) and require an explicit "yes" before proceeding. Remind them to DYOR.
- Place — call
prediction trade place-orderwith thequoteIdfrom step 1.
Quotes expire; if placement fails because the quote is stale, fetch a new quote and try again.
prediction trade quote
Get a trade quote for an outcome token. Returns a quoteId that must be passed to place-order within the quote's validity window.
Syntax
baw prediction trade quote --binanceChainId <binanceChainId> --tokenId <tokenId> --marketTopicId <marketTopicId> --side <side> --amount <amount> --orderType <type> [--slippageBps <bps>] [--priceLimit <price>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--binanceChainId |
Yes | — | Binance chain ID |
--tokenId |
Yes | — | ERC-1155 outcome token ID |
--side |
Yes | — | BUY or SELL |
--amount |
Yes | — | Trade amount, human-readable. Unit depends on --side: USDT for BUY, shares for SELL. |
--marketTopicId |
Yes | — | Market topic ID. If --slippageBps is omitted, the market's default slippage is fetched via this ID. |
--orderType |
Yes | — | MARKET or LIMIT |
--slippageBps |
No | market default | Slippage in basis points (e.g. 1200 = 12%) |
--priceLimit |
For LIMIT only | — | Limit price in USDT — required when --orderType LIMIT |
Example
# Market BUY quote
baw prediction trade quote --binanceChainId 56 --tokenId abc123 --marketTopicId 123 --side BUY --amount 1 --orderType MARKET --json
{
"success": true,
"data": {
"quoteId": "1234567890",
"tokenId": "abc123",
"side": "BUY",
"amountIn": "1",
"amountOut": "1.021983640081799586",
"averagePrice": 0.978,
"lastPrice": 0.978,
"priceImpact": 0,
"feeAmount": "0.000460018149807002",
"minReceive": "0.919831382438179829",
"expireAt": "2026-05-21T17:30:29+08:00",
"chainId": "56",
"orderType": "MARKET",
"slippageBps": 1000,
"marketTitle": "No change"
}
}Note on units — amountIn, amountOut, feeAmount, and minReceive swap units with --side:
| Field | BUY |
SELL |
|---|---|---|
amountIn |
USDT spent | shares sold |
amountOut |
shares received | USDT received |
feeAmount |
shares (provider service fee) | USDT (provider service fee) |
minReceive |
shares (worst-case fill) | USDT (worst-case proceeds) |
prediction trade place-order
Place an order using a quoteId obtained from prediction trade quote. This is a state-changing command — confirm with the user first, unless the user explicitly asks to skip confirmation.
Syntax
baw prediction trade place-order --quoteId <quoteId> --slippageBps <bps> [--orderType <type>] [--priceLimit <price>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--quoteId |
Yes | — | Quote ID returned from prediction trade quote |
--slippageBps |
Yes | — | Slippage in basis points (from quote response slippageBps field) |
--orderType |
No | MARKET |
MARKET or LIMIT |
--priceLimit |
For LIMIT only | — | Limit price in USDT — required for LIMIT orders |
Example
baw prediction trade place-order --quoteId quote_abc123 --slippageBps 1000 --json
baw prediction trade place-order --quoteId quote_abc123 --slippageBps 1000 --orderType LIMIT --priceLimit 0.6 --jsonImportant: placing an order does not mean it is filled
A successful response means the order has been submitted. For MARKET orders, fills usually happen quickly; LIMIT orders rest on the book until the trigger price is reached. After placement, tell the user:
- The order has been submitted.
- They can check its status with
prediction order history. - They should verify execution before assuming the trade is complete.
prediction trade cancel
Cancel one or more open prediction orders.
Syntax
baw prediction trade cancel --orderIds <ids> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--orderIds |
Yes | — | Comma-separated list of order IDs |
Example
baw prediction trade cancel --orderIds order_123,order_456 --jsonprediction trade redeem
Redeem (claim) the payout from winning prediction positions once their markets have resolved. Use prediction position list with --tab PENDING_CLAIM to find token IDs that are redeemable.
Syntax
baw prediction trade redeem --tokenIds <ids> [--binanceChainId <binanceChainId>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--tokenIds |
Yes | — | Comma-separated list of winning token IDs |
--binanceChainId |
No | — | Binance chain ID filter |
Example
baw prediction trade redeem --tokenIds token_123,token_456 --json
baw prediction trade redeem --tokenIds token_123 --binanceChainId 56 --json