Install
openclaw skills install polymarket-edgeTrade and analyse Polymarket prediction markets with a 5-minute BTC EMA crossover strategy. Browse markets, read order books, run signals, manage a live auto...
openclaw skills install polymarket-edgeA locally-running FastAPI skill that wraps the Polymarket Gamma + CLOB APIs with a built-in EMA(5/20) crossover strategy and SkillPay.me billing.
# Install dependencies
pip install -r requirements.txt
# Set required environment variables
export SKILL_BILLING_API_KEY=sk_your_skillpay_api_key_here
export SKILL_ID=polymarket-edge
# Start the skill server (port 8080)
python main.py
The interactive docs are available at http://localhost:8080/docs.
| Variable | Required | Description |
|---|---|---|
SKILL_BILLING_API_KEY | ✅ | From your skillpay.me dashboard |
SKILL_ID | ✅ | Your skill slug, e.g. polymarket-edge |
POLYMARKET_PRIVATE_KEY | optional | EVM private key for live order placement |
Every billed endpoint requires ?user_id=<id> in the query string.
If the user has no tokens the API returns HTTP 402 with a top_up_url.
GET /balance?user_id=alice → current token balance
GET /topup?user_id=alice&amount=10 → BNB Chain USDT payment link
1 USDT = 1 000 tokens · 1 call = 1 token · min top-up 8 USDT · SkillPay takes 5 %
?user_id=)GET /markets/search?q=bitcoin Search all Polymarket markets
GET /markets/btc List active BTC/Bitcoin markets
GET /market/{id} Single market details
GET /market/{token_id}/book Full order book (bids + asks)
GET /market/{token_id}/price Mid-price, spread, implied probability
GET /market/{token_id}/history 5-min OHLCV candles
POST /signal Run EMA crossover on top BTC markets
Returns BUY_YES / BUY_NO / HOLD / SKIP per market
GET /autotrader/status Is the auto-trader running?
POST /autotrader/start Start 5-min BTC cycle (background task)
POST /autotrader/stop Stop auto-trader
GET /autotrader/log Last 50 trade log entries
GET /portfolio?wallet=0x... Open positions + USD value for a wallet
BUY_YES; crosses below → BUY_NO?auto_trade=true on /autotrader/start (requires POLYMARKET_PRIVATE_KEY + py-clob-client)pip install py-clob-client
export POLYMARKET_PRIVATE_KEY=0x<your_burner_wallet>
# Then uncomment the py-clob-client block in polymarket_client.py
curl -X POST "http://localhost:8080/autotrader/start?user_id=alice&auto_trade=true"
⚠️ Use a burner wallet. Never commit your private key.