.agents/skills/binance-agentic-wallet/references/prediction.md
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 listList available prediction market categories (e.g. crypto, sports, politics).
baw prediction category list --json
baw prediction category list --json
prediction market listList prediction markets, optionally filtered by category and sorted.
baw prediction market list [--l1Category <category>] [--l2Category <category>] [--sortBy <sort>] [--orderBy <order>] [--offset <offset>] [--limit <limit>] --json
| 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 |
baw prediction market list --json
baw prediction market list --l1Category crypto --limit 5 --json
baw prediction market list --sortBy VOLUME --orderBy DESC --json
prediction market detailGet the full detail of a single prediction market by its topic ID.
baw prediction market detail --marketTopicId <id> --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketTopicId | Yes | — | Market topic ID |
baw prediction market detail --marketTopicId 123456 --json
prediction market searchSearch prediction markets by keyword.
baw prediction market search --query <query> [--limit <limit>] --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--query | Yes | — | Search keyword, max 200 chars |
--limit | No | 10 | Max results, max 50 |
baw prediction market search --query "Bitcoin" --json
baw prediction market search --query "FIFA World Cup" --limit 5 --json
prediction market order-bookGet the order book for a specific outcome token.
baw prediction market order-book --marketId <id> --tokenId <tokenId> --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketId | Yes | — | Market ID |
--tokenId | Yes | — | Outcome token ID |
baw prediction market order-book --marketId 789 --tokenId 123456789 --json
prediction market last-trade-priceGet 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.
baw prediction market last-trade-price --marketId <id> --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--marketId | Yes | — | Market ID |
baw prediction market last-trade-price --marketId 789 --json
prediction position listList the user's active and past prediction positions with PnL summary.
baw prediction position list [--tab <tab>] [--offset <offset>] [--limit <limit>] --json
| 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.
baw prediction position list --json
baw prediction position list --tab PENDING_CLAIM --json
prediction position tokenLook up a single position by its ERC-1155 outcome token ID.
baw prediction position token --tokenId <tokenId> --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--tokenId | Yes | — | ERC-1155 outcome token ID |
baw prediction position token --tokenId 123456789 --json
prediction position settled-historyList the user's settled (finalized) prediction positions, with optional win/lose filtering.
baw prediction position settled-history [--l1Category <category>] [--filter <filter>] [--offset <offset>] [--limit <limit>] --json
| 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 |
baw prediction position settled-history --json
baw prediction position settled-history --filter win --json
baw prediction position settled-history --filter lose --json
prediction position pnlQuery detailed PnL records for the user's prediction positions.
baw prediction position pnl [--tokenId <tokenId>] [--l1Category <category>] [--offset <offset>] [--limit <limit>] --json
| 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 |
baw prediction position pnl --json
baw prediction position pnl --l1Category crypto --json
baw prediction position pnl --tokenId abc123 --json
prediction position portfolioGet a portfolio-level summary of the user's active prediction positions, including unrealized PnL.
baw prediction position portfolio --json
baw prediction position portfolio --json
prediction order historyList the user's historical prediction orders across all statuses.
baw prediction order history [--status <status>] [--l1Category <category>] [--orderType <type>] [--offset <offset>] [--limit <limit>] --json
| 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 |
baw prediction order history --json
baw prediction order history --status FILLED --limit 10 --json
baw prediction order history --orderType LIMIT --json
| 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 |
Prediction trading is a two-step flow:
prediction trade quote to get a quoteId and the expected cost / payout.prediction trade place-order with the quoteId from step 1.Quotes expire; if placement fails because the quote is stale, fetch a new quote and try again.
prediction trade quoteGet a trade quote for an outcome token. Returns a quoteId that must be passed to place-order within the quote's validity window.
baw prediction trade quote --binanceChainId <binanceChainId> --tokenId <tokenId> --marketTopicId <marketTopicId> --side <side> --amount <amount> --orderType <type> [--slippageBps <bps>] [--priceLimit <price>] --json
| 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 |
# 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-orderPlace an order using a quoteId obtained from prediction trade quote. This is a state-changing command — always confirm with the user first.
baw prediction trade place-order --quoteId <quoteId> --slippageBps <bps> [--orderType <type>] [--priceLimit <price>] --json
| 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 |
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 --json
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:
prediction order history.prediction trade cancelCancel one or more open prediction orders.
baw prediction trade cancel --orderIds <ids> --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--orderIds | Yes | — | Comma-separated list of order IDs |
baw prediction trade cancel --orderIds order_123,order_456 --json
prediction trade redeemRedeem (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.
baw prediction trade redeem --tokenIds <ids> [--binanceChainId <binanceChainId>] --json
| Parameter | Required | Default | Description |
|---|---|---|---|
--tokenIds | Yes | — | Comma-separated list of winning token IDs |
--binanceChainId | No | — | Binance chain ID filter |
baw prediction trade redeem --tokenIds token_123,token_456 --json
baw prediction trade redeem --tokenIds token_123 --binanceChainId 56 --json