AArtery
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

ArteryUpstream
GET /v1/polymarket/marketsgamma-api.polymarket.com/markets
GET /v1/polymarket/markets/:conditionIdGamma /markets/:id
GET /v1/polymarket/eventsGamma /events
GET /v1/polymarket/search?q=Gamma /public-search

Cloudflare WAF

Warning

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 Module
  • DELETE /v1/polymarket/orders/:id — cancel
  • POST /v1/polymarket/positions/redeem — redeem settled markets
  • POST /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:

ModeHow it worksUse when
rpc_polling (default)Worker polls Polygon RPC for new OrderFilled logs every ~3sDefault; works with any Polygon RPC. Latency: 3–10s
moralis_streamsMoralis pushes logs to a webhook within ~1s of the blockProduction; 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.*:

SettingRequiredDescription
api_keyyesMoralis API key (secret)
webhook_secretyesMoralis-generated shared secret for HMAC-SHA256 verification (secret)
webhook_urlyesPublicly reachable URL of POST /v1/internal/polymarket/streams-webhook
stream_idautoPopulated 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

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.

Edit this page on GitHubLast updated
Polymarket · Artery API Docs