polymarket-clob-auth-trade
4
总安装量
4
周安装量
#54361
全站排名
安装命令
npx skills add https://github.com/lubluniky/polyclaude --skill polymarket-clob-auth-trade
Agent 安装分布
cline
4
gemini-cli
4
github-copilot
4
codex
4
kimi-cli
4
cursor
4
Skill 文档
Polymarket Trading & Authentication Pipeline
You are an AI agent implementing a trading bot (Rust) for Polymarket. Trading requires a two-level authentication flow. Follow this pipeline strictly.
Step 1: L1 Auth (Obtain API Keys)
- Create an EIP-712 signature using the wallet’s private key.
- EIP-712 Domain:
name="Polymarket CTF Exchange", version="1", chainId=137(must be Polygon). - Send headers
POLY_ADDRESS,POLY_SIGNATURE,POLY_TIMESTAMP,POLY_NONCEto generate/retrievePOLY_API_KEY,secret, andpassphrase.
Step 2: L2 Auth (HMAC-SHA256 for Trading)
Every POST/DELETE request to the CLOB (e.g. /order) requires an L2 signature.
- Algorithm: HMAC-SHA256 using your API
secret. - String to sign:
timestamp + method + path + body. - Pass the result in the
POLY_SIGNATUREheader along withPOLY_API_KEYandPOLY_PASSPHRASE.
Step 3: Order Construction & EIP-712 Signing
Build the Order struct.
CRITICAL TYPING RULES:
token_idobtained from Gamma API as a string ("217426...") must be cast toU256for the EIP-712 signature.signature_type: set0for EOA (standalone wallet),1for POLY_PROXY (Magic Link), or2for GNOSIS_SAFE.expiration:u64unix timestamp, or0for Good Till Cancelled.
Step 4: Place Order
- Send the signed order JSON via
POST https://clob.polymarket.com/order. - Attach the L2 HMAC headers from Step 2.