stacks-market
Prediction market trading on stacksmarket.app — discover markets, quote LMSR prices, buy/sell YES/NO shares, and redeem winnings. Uses the market-factory-v18-bias contract on Stacks mainnet. Write operations require an unlocked wallet with STX.
What this skill does
# Stacks Market Skill
Trade prediction markets on [stacksmarket.app](https://www.stacksmarket.app) via the on-chain contract `SP3N5CN0PE7YRRP29X7K9XG22BT861BRS5BN8HFFA.market-factory-v18-bias`.
- **Market Discovery** — List and search prediction markets via REST API with filters for status, category, and featured flag.
- **Price Quoting** — Get real-time LMSR prices for YES/NO shares via on-chain read-only calls before committing funds.
- **Trading** — Buy YES or NO shares with slippage protection (`buy-yes-auto`, `buy-no-auto`). Sell with minimum proceeds guard (`sell-yes-auto`, `sell-no-auto`).
- **Redemption** — Redeem winning shares after market resolution (1 share = 1 STX for winners).
- **Position Tracking** — Check your YES and NO share balances in any market.
All operations are **mainnet-only**. Write operations (buy-yes, buy-no, sell-yes, sell-no, redeem) require an unlocked wallet (use `bun run wallet/wallet.ts unlock` first).
## Usage
```
bun run stacks-market/stacks-market.ts <subcommand> [options]
```
## Subcommands
### list-markets
List prediction markets from stacksmarket.app. Returns markets sorted by most recent activity.
```
bun run stacks-market/stacks-market.ts list-markets [--limit <n>] [--status <status>] [--category <cat>] [--featured]
```
Options:
- `--limit` (optional) — Number of markets to return (default: 20)
- `--status` (optional) — Filter by status: `active` | `ended` | `resolved`
- `--category` (optional) — Filter by category (e.g., `Crypto`, `Politics`)
- `--featured` (optional) — Show only featured markets
Output:
```json
{
"network": "mainnet",
"marketCount": 5,
"markets": [
{
"_id": "699c573ea7bb5ad25fee68a0",
"marketId": "1771853629839",
"title": "Will BTC close above $100k by end of Q1?",
"category": "Crypto",
"isActive": true,
"isResolved": false,
"endDate": "2026-03-31T23:59:00.000Z",
"totalVolume": 5000000000,
"totalTrades": 42
}
]
}
```
### search-markets
Search prediction markets by keyword. Searches titles and descriptions.
```
bun run stacks-market/stacks-market.ts search-markets --query <keyword> [--limit <n>]
```
Options:
- `--query` (required) — Search keyword
- `--limit` (optional) — Maximum results (default: 10)
Output:
```json
{
"network": "mainnet",
"query": "bitcoin",
"resultCount": 3,
"markets": [
{
"_id": "699c573ea7bb5ad25fee68a0",
"marketId": "1771853629839",
"title": "Will BTC close above $100k by end of Q1?",
"isActive": true,
"isResolved": false
}
]
}
```
### get-market
Get full details for a single prediction market including trade history and order book.
```
bun run stacks-market/stacks-market.ts get-market --market-id <mongoId>
```
Options:
- `--market-id` (required) — MongoDB `_id` of the market (e.g., `699c573ea7bb5ad25fee68a0`)
Output:
```json
{
"network": "mainnet",
"market": {
"_id": "699c573ea7bb5ad25fee68a0",
"marketId": "1771853629839",
"title": "Will BTC close above $100k by end of Q1?",
"description": "Resolution source: CoinGecko closing price...",
"category": "Crypto",
"options": [
{ "text": "Yes", "impliedProbability": 52, "totalVolume": 3000000000 },
{ "text": "No", "impliedProbability": 48, "totalVolume": 2000000000 }
],
"isActive": true,
"isResolved": false,
"winningOption": null,
"endDate": "2026-03-31T23:59:00.000Z",
"totalVolume": 5000000000,
"totalTrades": 42,
"tradeHistory": []
}
}
```
### quote-buy
Get a price quote for buying YES or NO shares. Always quote before buying to verify cost and slippage.
```
bun run stacks-market/stacks-market.ts quote-buy --market-id <id> --side <yes|no> --amount <shares>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp, e.g., `1771853629839`)
- `--side` (required) — `yes` or `no`
- `--amount` (required) — Number of shares to buy (integer, e.g., `5` for 5 shares)
Output:
```json
{
"network": "mainnet",
"quote": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"totalCostUstx": 5250000,
"totalCostStx": "5.25",
"fees": {
"protocolUstx": 125000,
"lpUstx": 75000
}
}
}
```
### quote-sell
Get a price quote for selling YES or NO shares. Always quote before selling to verify proceeds.
```
bun run stacks-market/stacks-market.ts quote-sell --market-id <id> --side <yes|no> --amount <shares>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp)
- `--side` (required) — `yes` or `no`
- `--amount` (required) — Number of shares to sell (integer)
Output:
```json
{
"network": "mainnet",
"quote": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"totalProceedsUstx": 4750000,
"totalProceedsStx": "4.75",
"fees": {
"protocolUstx": 125000,
"lpUstx": 75000
}
}
}
```
### buy-yes
Buy YES shares in a prediction market. Uses `buy-yes-auto` for slippage protection. Requires an unlocked wallet.
```
bun run stacks-market/stacks-market.ts buy-yes --market-id <id> --amount <shares> --max-cost <ustx>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp)
- `--amount` (required) — Number of YES shares to buy
- `--max-cost` (required) — Maximum total cost in uSTX (slippage protection). Get from `quote-buy` first.
Output:
```json
{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"trade": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"maxCostUstx": 5500000
}
}
```
### buy-no
Buy NO shares in a prediction market. Uses `buy-no-auto` for slippage protection. Requires an unlocked wallet.
```
bun run stacks-market/stacks-market.ts buy-no --market-id <id> --amount <shares> --max-cost <ustx>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp)
- `--amount` (required) — Number of NO shares to buy
- `--max-cost` (required) — Maximum total cost in uSTX (slippage protection)
Output:
```json
{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"trade": {
"marketId": "1771853629839",
"side": "no",
"shares": 5,
"maxCostUstx": 5500000
}
}
```
### sell-yes
Sell YES shares before market resolution. Uses `sell-yes-auto` with minimum proceeds guard. Requires an unlocked wallet.
```
bun run stacks-market/stacks-market.ts sell-yes --market-id <id> --amount <shares> --min-proceeds <ustx>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp)
- `--amount` (required) — Number of YES shares to sell
- `--min-proceeds` (required) — Minimum acceptable proceeds in uSTX (slippage protection). Get from `quote-sell` first.
Output:
```json
{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"trade": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"minProceedsUstx": 4500000
}
}
```
### sell-no
Sell NO shares before market resolution. Uses `sell-no-auto` with minimum proceeds guard. Requires an unlocked wallet.
```
bun run stacks-market/stacks-market.ts sell-no --market-id <id> --amount <shares> --min-proceeds <ustx>
```
Options:
- `--market-id` (required) — Market ID (epoch millisecond timestamp)
- `--amount` (required) — Number of NO shares to sell
- `--min-proceeds` (required) — Minimum acceptable proceeds in uSTX
Output:
```json
{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"trade": {
"marketId": "1771853629839",
"side": "no",
"shares": 5,
"minProceedsUstx": 4500000
}
}
```
### redeem
Redeem winning shares after market resolution. Winning shares pay 1 Related in Web3
xaut-trade
IncludedBuy or sell XAUT (Tether Gold) on Ethereum. Supports market orders (Uniswap V3) and limit orders (UniswapX). Wallet modes: Foundry keystore or WDK. Delegates non-XAUT intents to registered skills (e.g. Polymarket prediction markets, Hyperliquid trading). Triggers: buy XAUT, XAUT trade, swap USDT for XAUT, sell XAUT, swap XAUT for USDT, limit order, limit buy XAUT, limit sell XAUT, check limit order, cancel limit order, XAUT when, create wallet, setup wallet, polymarket, prediction market, bet on, odds on, hyperliquid, perp, perpetual, long, short, open long, open short, close position, leverage.
qfc-openclaw-skill
IncludedQFC blockchain interaction — wallet, faucet, chain queries, staking, epoch & finality, AI inference
gate-dex-trade
IncludedExecutes on-chain token swaps via Gate DEX. Use when user wants to swap, buy, sell, exchange, or convert tokens, or bridge cross-chain. Covers full swap flow: price quotes, transaction build, signing, and submission. Do NOT use for read-only data lookups or wallet account management.
hunch
IncludedDiscover, bet on, track, and settle Hunch prediction markets in natural language. Trigger when a user wants to bet, take a position, or get odds on a crypto outcome — token market-cap milestones and flips, launchpad races (Bankr vs pump.fun volume / #1-days / launches over a cap), token head-to-head outperformance, mcap strike-ladders, and up/down price rounds. Also trigger on "what can I bet on about $TOKEN", "odds on …", "take YES/NO on …", "show my Hunch bets", "did my market resolve". Settles in USDC on Base via x402 (≤ $10 / bet); every bet returns an on-chain proof.
opensea
IncludedQuery NFT data, trade on the Seaport marketplace, and swap ERC20 tokens across Ethereum, Base, Arbitrum, Optimism, Polygon, and more.
polymarket
IncludedTrade on Polymarket prediction markets (CLOB V2) from a Privy EOA wallet. Search markets, place/cancel orders, manage positions. No private key handling. Use when the user wants to bet on event outcomes (e.g. "buy YES at 0.65 on the ceasefire market", "what are my open positions", "close my Trump bet").