On this page
Polymarket
Artery exposes all five Polymarket hosts as a single namespace. Every
endpoint returns the upstream JSON shape unmodified, wrapped in { native, meta }.
Endpoints
| Artery | Upstream |
|---|---|
GET /v1/polymarket/markets | gamma-api.polymarket.com/markets |
GET /v1/polymarket/markets/:conditionId | Gamma /markets/:id |
GET /v1/polymarket/events | Gamma /events |
GET /v1/polymarket/search?q= | Gamma /public-search |
Cloudflare WAF
Polymarket fronts every host with Cloudflare. Calling clob.polymarket.com with curl or default
axios UA returns 403 Forbidden. Artery's @artery/transport package automatically injects a
Chrome 131 User-Agent + Origin / Referer so all requests pass.
If you bypass Artery and call Polymarket directly, replicate this header
set or you will hit 403 on /auth/api-key.
Planned additions
POST /v1/polymarket/orders— place CLOB order via Safe ModuleDELETE /v1/polymarket/orders/:id— cancelPOST /v1/polymarket/positions/redeem— redeem settled marketsPOST /v1/polymarket/delegation/initiate— Safe Module setup flow
These are scaffolded but require a Polygon Amoy testnet wallet for
end-to-end validation. See Linear QF-10297 for the full spec.
Trade-feed transport
The per-event and per-org trade channels documented in
Streaming reference are populated from on-chain
OrderFilled events on Polymarket's V2 exchanges (CTF_EXCHANGE +
NEG_RISK_EXCHANGE). Artery supports two transports for ingesting them,
switched via the art.polymarket.live_feed_mode system setting:
| Mode | How it works | Use when |
|---|---|---|
rpc_polling (default) | Worker polls Polygon RPC for new OrderFilled logs every ~3s | Default; works with any Polygon RPC. Latency: 3–10s |
moralis_streams | Moralis pushes logs to a webhook within ~1s of the block | Production; needs Moralis API key + a publicly reachable webhook URL |
Switching is hot — flip the setting and the new transport starts within
one cron tick (≤ 30s) without restart. Both modes feed the same
PolymarketTradeListener.onFills() persistence path, so consumers of
the Redis stream channels see no difference beyond reduced latency.
Moralis Streams mode
When live_feed_mode = moralis_streams, Artery maintains a single
Moralis Stream (per-deployment) that watches the two V2 exchange
contracts and filters server-side to the union of all customer-bound
wallets. The address list is synced incrementally as wallets are bound
or unbound, capped at 100 addresses per upstream call.
Configuration lives under art.polymarket.moralis_streams.*:
| Setting | Required | Description |
|---|---|---|
api_key | yes | Moralis API key (secret) |
webhook_secret | yes | Moralis-generated shared secret for HMAC-SHA256 verification (secret) |
webhook_url | yes | Publicly reachable URL of POST /v1/internal/polymarket/streams-webhook |
stream_id | auto | Populated on first start; manual edits trigger a re-resolve |
Operator surface lives at /streams in the internal admin — current
mode, configured-vs-unset checklist, upstream stream status (address
count + drift vs local mirror), last webhook timestamp, plus
Re-sync addresses (idempotent) and Recreate stream (destructive)
actions. The webhook handler verifies HMAC-SHA256 over the raw body
and accepts both signing-input forms Moralis has documented (body
and body+secret).
Terms-of-service note
Polymarket's Developer Agreement forbids redistribution of order book and market data except as explicitly permitted. Artery's pass-through model — your client provides Polymarket credentials per request — keeps you within those bounds. Ask Polymarket BD before exposing data through Artery as a public product.