@moltbankhq/polymarket-mod
v0.1.2
Published
Polymarket Capability. Provides cap.polymarket.markets (read) and cap.moltbank.polymarket (Moltbank-orchestrated trade flows: create-order / cancel-order / withdraw-to-safe). Composes Polymarket CLOB protocol calls with the Moltbank backend MCP (status, b
Readme
Polymarket Mod
Polymarket prediction-market Capability. Read-side surfaces market data (Gamma API + CLOB v2); trade-side runs Moltbank-orchestrated multi-step flows (status check → wallet registration → budget bootstrap → on-chain approvals → POL gas funding → pUSD wrap → CLOB order placement → audit recording) plus withdraw-to-safe bridge flow.
See SKILL.md for the full capability surface and required Moltbank MCP tools.
Auth model
This mod never holds wallet keys. All EVM signing delegates to
the host's cap.signer.evm (per architecture spec §10.1: only the
trusted core signs). The mod builds the order body or the on-chain
approval calldata, calls cap.signer.evm for the signature, and
submits the signed payload to the CLOB / a Polygon RPC.
Capabilities
cap.polymarket.markets— read-only market metadata + the caller's authenticated reads (markets / market / order-book / midpoint / get-order / get-orders / get-trades).cap.moltbank.polymarket— Moltbank-orchestrated trade flows (create-order,cancel-order,withdraw-to-safe).
The protocol-level handlers (raw CLOB order placement / cancel /
approve) are reachable only by the orchestrator pipeline through
the in-process router at src/orchestrator/cap-call.ts. They are
not exposed publicly — anything that mutates state flows through
the audit / budget / status pipeline backing
cap.moltbank.polymarket.
This package is the result of merging the former polymarket-mod
(protocol-level) and polymarket-orchestrator-mod (Moltbank-
flavored). Option A of the merge dropped cap.polymarket.orders
from the public surface; the protocol code lives on as internal
modules invoked by the orchestrator.
Configuration
Optional config at ~/.moltbank/mods/polymarket/config.json:
{
"clobBaseUrl": "https://clob-v2.polymarket.com",
"gammaBaseUrl": "https://gamma-api.polymarket.com",
"polygonRpcUrl": "https://polygon-bor-rpc.publicnode.com",
"defaultMarketLimit": 50,
"defaultWeeklyBudgetUsdc": 25,
"polGasFundingUsdc": 1
}Defaults apply when the file is absent.
Spec alignment
- §10.1 (only the trusted core signs): signer integration is via
cap.signer.evm, not direct private-key access. - §9 (riskLevel: trade): community installs of equivalent
third-party trade mods would require explicit
cap.budget.spendgrants + per-run estimate confirmation. This mod istier: officialso it doesn't need community-tier gates, but it still publishes per-run USDC estimates viamod estimate polymarket. - §6 (capability ids):
cap.polymarket.marketsandcap.moltbank.polymarketare this mod's two public capability ids.
