probable-trader
v1.0.0
Published
CLI for trading prediction markets on Probable Markets (BSC)
Maintainers
Readme
Probable Markets Trading Skill
An OpenClaw Skill that wraps the Probable Markets prediction market on BNB Chain (BSC). Enables agents to onboard wallets, discover markets, view orderbooks, place/cancel orders, track positions, and generate audit reports.
Built on top of opinion_clob_sdk — the official Probable Markets / Opinion Labs Python SDK.
Features
- One-command onboarding — auto-generates API key via L1 EIP-712 auth
- Full trading lifecycle — place/cancel limit & market orders, split/merge/redeem
- Safety by default — dry-run mode,
--confirmrequired for all transactions, secret masking - Audit logging — every action logged to local SQLite
- Real-time streaming — WebSocket orderbook & execution report subscriptions
- Agent-native — all output as structured JSON (ActionResult envelope)
Quick Start
# 1. Install dependencies
pip install opinion_clob_sdk websockets httpx
# 2. Set your private key
export PROB_PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
export PROB_RPC_URL="https://bsc-dataseed.binance.org"
# 3. Register on probable.markets (connect wallet), then set proxy wallet
export PROB_MULTI_SIG_ADDR="0xYOUR_PROXY_WALLET"
# 4. Auto-generate API key
python3 scripts/prob.py onboard --confirm --json
# 5. Enable trading approvals (on-chain)
python3 scripts/prob.py setup --confirm --json
# 6. Start trading
python3 scripts/prob.py market list --status activated --json
python3 scripts/prob.py book <token_id> --json
python3 scripts/prob.py order place --market-id <M> --token-id <T> --side BUY --price 0.55 --amount 100 --confirm --jsonCLI Commands
prob.py config {show,init} # Configuration management
prob.py doctor # Health check
prob.py onboard [--confirm] # Generate API key (L1 auth)
prob.py setup [--confirm] # Enable trading (on-chain approvals)
prob.py market {list,get,search} # Market discovery
prob.py book <token_id> # Orderbook snapshot
prob.py price <token_id> # Latest price
prob.py history <token_id> # Price history
prob.py fee-rates <token_id> # Fee rates
prob.py order {place,get,list,cancel,cancel-all} # Order management
prob.py positions [--market-id M] # My positions
prob.py trades [--market-id M] # My trades
prob.py balance # My balances
prob.py split --market-id M --amount A [--confirm] # Split collateral
prob.py merge --market-id M --amount A [--confirm] # Merge tokens
prob.py redeem --market-id M [--confirm] # Redeem resolved
prob.py ws book <token_id> [--duration N] # Stream orderbook
prob.py ws user [--duration N] # Stream execution reports
prob.py report daily [--format json|markdown|both] # Trading reportGlobal flags: --json (JSON output), --confirm (execute), --dry-run (preview)
Project Structure
marketskill/
├── SKILL.md # OpenClaw skill definition
├── scripts/
│ ├── prob.py # CLI entry point
│ └── lib/
│ ├── config.py # Env var + config file loading
│ ├── client_wrapper.py # Wraps opinion_clob_sdk.Client
│ ├── onboard.py # L1 auth + API key generation
│ ├── safety.py # Dry-run, confirmation, secret masking
│ ├── db.py # SQLite audit log + cache
│ ├── ws_client.py # WebSocket client
│ └── report.py # Daily report generator
├── schemas/ # JSON schemas (config, order intent, output)
├── references/ # API, WebSocket, and onboarding docs
└── examples/ # Example interactionsSafety Model
| Feature | Behavior |
|---------|----------|
| Default mode | Dry-run — shows what would happen without executing |
| Transactions | Require --confirm flag (orders, cancel, split, merge, redeem, setup) |
| Secrets | Private keys and API secrets masked in all output |
| Audit | Every action logged to .probable/probable.db (SQLite) |
| Output | Standardized JSON envelope with success, error, request_id, timestamp |
Key Contracts (BSC Mainnet)
| Contract | Address |
|----------|---------|
| ConditionalTokens | 0xAD1a38cEc043e70E83a3eC30443dB285ED10D774 |
| MultiSend | 0x998739BFdAAdde7C933B942a68053933098f9EDa |
| FeeManager | 0xC9063Dc52dEEfb518E5b6634A6b8D624bc5d7c36 |
Requirements
- Python 3.10+
opinion_clob_sdk(v0.4.3+)websockets,httpx- BNB Chain wallet with BNB (gas) and USDT (trading)
License
MIT
