---
name: agentic-market
description: Discover, quote, and build unsigned non-custodial on-chain prediction market transactions on Agentic Market (BSC V5.0) via MCP or REST.
---

# Agentic Market — Agent Execution Skill

Use this skill whenever the user asks to browse markets, analyze odds, estimate payouts, trade, or claim settled positions on **Agentic Market** (https://agenticmarket.fun).

## Canonical Endpoints

- **Protocol Manifest:** `GET https://api.agenticmarket.fun/llms.txt`
- **MCP Server (JSON-RPC 2.0):** `POST https://api.agenticmarket.fun/mcp`
- **OpenAPI 3.1 Schema:** `GET https://api.agenticmarket.fun/openapi.json`
- **Active Markets:** `GET https://api.agenticmarket.fun/api/v1/markets?status=active&engine=binary`
- **Market Detail & Rules:** `GET https://api.agenticmarket.fun/api/v1/markets/:marketId`
- **Fresh-RPC Quote:** `GET https://api.agenticmarket.fun/api/v1/markets/:marketId/quote`
- **Unsigned Trade Calldata:** `GET https://api.agenticmarket.fun/api/v1/markets/:marketId/build-tx`
- **Unsigned Approval Calldata:** `GET https://api.agenticmarket.fun/api/v1/build-approve-tx`
- **Unsigned Batch Claim Calldata:** `GET https://api.agenticmarket.fun/api/v1/build-redeem-batch-tx`
- **Real-Time SSE Stream:** `GET https://api.agenticmarket.fun/api/v1/stream?engine=binary`

## V5.0 Accounting & Protocol Rules

1. **6-Decimal Integer Strings:** All USDT collateral and share amounts are serialized as exact 6-decimal integer strings (`1000000` = `1.00 USDT`, `25000000` = `25.00 USDT`). Never use floating-point arithmetic for on-chain amounts.
2. **Minimum Trade Size:** `minTradeAmount` is `1000000` (`1.00 USDT`). Selling 100% of remaining shares (`fullExit = true`) is exempt from the minimum trade threshold.
3. **One-Time Direct Approval:** There is no Router contract. Grant `USDT.approve(BinaryEngine, limit)` once directly to `BinaryEngine`; `msg.sender` is unconditionally the trader.
4. **Unstoppable User Exits:** `AdapterRegistry` Agent ID verification runs strictly on `buy()`. `sell()`, `redeem()`, `redeemVoid()`, and `redeemBatch()` are permanently permissionless and never blocked.
5. **TWAP Void Settlement:** Canceled or voided markets settle using on-chain historical time-weighted average prices (TWAP) rather than last-second spot prices. Always disclose this to users before trading.
6. **Fresh-RPC Mandatory:** Never compute trade quotes or slippage bounds from cached indexer data; always call `get_quote` / `/quote` directly before building calldata.

## Safe Trading Workflow Checklist

1. **Discover:** Call `list_markets` (or `GET /api/v1/markets?status=active`) to find the target market.
2. **Inspect Rules:** Call `get_market` to verify the resolution source, cutoff timestamp, and structured JSON rules.
3. **Quote & Preflight:** Call `get_quote` with `action`, `side` (`0` or `1`), 6-decimal `amount`, and the user's `address`. Check `preflight.canExecute`, `preflight.engineAllowanceOk`, and `preflight.blockingReasons`.
4. **Approve (If Needed):** If `preflight.engineAllowanceOk === false`, call `build_approve_tx` and have the user sign the one-time `USDT.approve(BinaryEngine, limit)` in their wallet.
5. **Build Unsigned Trade:** Call `build_trade_tx` with explicit `slippageBps` (e.g., `100` = `1.0%`).
6. **Confirm & Hand Off:** Present a clear summary (market, side, USDT amount, estimated shares/payout, fee, slippage, expiry, destination contract) and hand the unsigned payload to the user's wallet for local simulation and signing. Never ask for private keys or seed phrases.
