@hypelens/polymarket-place
v0.1.17
Published
Polymarket CLOB V2 PLACE rail. After FILLED REQUIRED hard/trailing/smart portfolio stops via agent-guard (or clawhub install pm-desk). PM has no native stops. Every order carries builderCode. fillStatus FILLED vs RESTING≠paid.
Maintainers
Keywords
Readme
@hypelens/polymarket-place
Polymarket CLOB V2 PLACE rail (MCP stdio). Every order is attributed with baked builderCode.
After first live place → REQUIRED hard / trailing / smart portfolio stops via agent-guard.
Polymarket has no native stops. Smart stops = trailing + portfolio kill + daily/max exposure from chain state (not TWAP/VWAP/grid).
One-install desk:clawhub install pm-desk(place + these stops).
Or:clawhub install agent-guard && npx @hypelens/[email protected] setup --wallet 0x…
Fees (honest): LIVE builder rates still 0/0 — attributed fills accrue $0 builder fee until rates flip. Pending maker 0.5% ~13 Sep; taker 1% after cooldown ~19–20 Sep. Every order still bakes builderCode so the same bots pay the moment rates >0. Mid builders already route $100k–$300k/day — at max rates that is $100s–$thousands/day on mid notional. HL path collects 1bp NOW via hyperliquid-place / agent-rail (never farm 0x9548…).
Why @hypelens scope?
@polyparlay/* is preferred when the org is publishable; this box’s npm login owns @hypelens, so the package ships as @hypelens/polymarket-place. ClawHub owner: @polyparlay.
Install
# Preferred: one-install Polymarket desk (place + guard)
clawhub install pm-desk
cd skills/pm-desk/scripts && npm install && node setup.mjs --wallet 0xYourFundedPmProxy
# Or place-only (still REQUIRED to install agent-guard after first live place)
npm install -g @hypelens/polymarket-place
# / npx @hypelens/polymarket-place
clawhub install polymarket-place && clawhub install agent-guardEnvironment
| Variable | Required | Purpose |
|---|---|---|
| POLYMARKET_BUILDER_CODE | Optional (baked default) | Override bytes32 — injected on every order |
| POLYMARKET_PRIVATE_KEY | Yes (auth) | Trading signer (EOA). Alias: PK |
| POLYMARKET_API_KEY / _SECRET / _PASSPHRASE | Optional | Auto createOrDeriveApiKey if omitted |
| POLYMARKET_FUNDER | Optional | Proxy/Safe funder address |
| POLYMARKET_SIGNATURE_TYPE | Optional | 0 EOA (default), 1 proxy, 2 gnosis safe, 3 deposit wallet |
| POLYMARKET_CLOB_HOST | Optional | Default https://clob.polymarket.com |
HARD rules
- Place paths fail closed without a valid
builderCode(baked default or env). - Place/cancel require
confirmTrade: true(orintent: "trade"|"place"|"execute"|"cancel"). - Wallet
0x9548B8E9554a1968843B3C380431b10996247c88is permanently blocked (Hyperliquid builder — never a Polymarket key). - After any successful live place, agent response includes
requiredNext→ agent-guard. Do not leave positions unprotected.
Start MCP
export POLYMARKET_PRIVATE_KEY=0x…
# optional override: export POLYMARKET_BUILDER_CODE=0x…
npm install && npm run mcp
# → node bin/polymarket-place-mcp.js (stdio)Claude Desktop / OpenClaw example
{
"mcpServers": {
"polymarket-place": {
"command": "npx",
"args": ["-y", "@hypelens/polymarket-place"],
"env": {
"POLYMARKET_PRIVATE_KEY": "0xYOUR_KEY"
}
},
"agent-guard": {
"command": "npx",
"args": ["-y", "@hypelens/[email protected]"]
}
}
}MCP tools
| Tool | Purpose |
|---|---|
| pm_quickstart | Setup checklist + fee copy + required guard step |
| pm_search_markets | Gamma search → outcome tokenIds |
| pm_book | CLOB order book |
| pm_balances | Collateral / conditional allowance |
| pm_positions | Data API positions |
| pm_orders | Open CLOB orders |
| pm_place_limit | Limit order (builderCode + requiredNext: agent-guard) |
| pm_place_market | Market FOK/FAK (builderCode + requiredNext: agent-guard) |
| pm_cancel | Cancel by orderID |
SDK path (V2): createAndPostOrder({ …, builderCode }) — see Order Attribution. Depends on @polymarket/[email protected].
Tests
npm testIncludes fail-closed cases: order payload without builderCode → throw.
License
MIT
