Loading...
Loading...
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.
npx skill4agent add aibtcdev/skills stacks-marketSP3N5CN0PE7YRRP29X7K9XG22BT861BRS5BN8HFFA.market-factory-v18-biasbuy-yes-autobuy-no-autosell-yes-autosell-no-autobun run wallet/wallet.ts unlockbun run stacks-market/stacks-market.ts <subcommand> [options]bun run stacks-market/stacks-market.ts list-markets [--limit <n>] [--status <status>] [--category <cat>] [--featured]--limit--statusactiveendedresolved--categoryCryptoPolitics--featured{
"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
}
]
}bun run stacks-market/stacks-market.ts search-markets --query <keyword> [--limit <n>]--query--limit{
"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
}
]
}bun run stacks-market/stacks-market.ts get-market --market-id <mongoId>--market-id_id699c573ea7bb5ad25fee68a0{
"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": []
}
}bun run stacks-market/stacks-market.ts quote-buy --market-id <id> --side <yes|no> --amount <shares>--market-id1771853629839--sideyesno--amount5{
"network": "mainnet",
"quote": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"totalCostUstx": 5250000,
"totalCostStx": "5.25",
"fees": {
"protocolUstx": 125000,
"lpUstx": 75000
}
}
}bun run stacks-market/stacks-market.ts quote-sell --market-id <id> --side <yes|no> --amount <shares>--market-id--sideyesno--amount{
"network": "mainnet",
"quote": {
"marketId": "1771853629839",
"side": "yes",
"shares": 5,
"totalProceedsUstx": 4750000,
"totalProceedsStx": "4.75",
"fees": {
"protocolUstx": 125000,
"lpUstx": 75000
}
}
}buy-yes-autobun run stacks-market/stacks-market.ts buy-yes --market-id <id> --amount <shares> --max-cost <ustx>--market-id--amount--max-costquote-buy{
"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-autobun run stacks-market/stacks-market.ts buy-no --market-id <id> --amount <shares> --max-cost <ustx>--market-id--amount--max-cost{
"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-autobun run stacks-market/stacks-market.ts sell-yes --market-id <id> --amount <shares> --min-proceeds <ustx>--market-id--amount--min-proceedsquote-sell{
"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-autobun run stacks-market/stacks-market.ts sell-no --market-id <id> --amount <shares> --min-proceeds <ustx>--market-id--amount--min-proceeds{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"trade": {
"marketId": "1771853629839",
"side": "no",
"shares": 5,
"minProceedsUstx": 4500000
}
}bun run stacks-market/stacks-market.ts redeem --market-id <id>--market-id{
"success": true,
"txid": "abc123...",
"network": "mainnet",
"explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet",
"marketId": "1771853629839"
}bun run stacks-market/stacks-market.ts get-position --market-id <id> [--address <stacksAddress>]--market-id--address{
"network": "mainnet",
"address": "SP2...",
"marketId": "1771853629839",
"position": {
"yesShares": 5,
"noShares": 0
}
}bun run wallet/wallet.ts unlockquote-buyquote-sell1771853629839_idget-market_id699c573ea7bb5ad25fee68a0marketIdPostConditionMode.AllowisActivetrueendDateisResolved