Data API
The Data API (https://data-api.polymarket.com) is read-only from
polygolem’s point of view. It does not require API keys for the current CLI
surface.
CLI
polygolem data positions --user 0x...polygolem data closed-positions --user 0x...polygolem data trades --user 0x... --limit 20polygolem data activity --user 0x... --limit 20polygolem data holders --token-id <token-id> --limit 20polygolem data value --user 0x...polygolem data markets-traded --user 0x...polygolem data open-interest --token-id <token-id>polygolem data leaderboard --limit 20polygolem data live-volume --limit <event-id>The current live-volume CLI flag is named --limit, but the SDK method and
upstream query use an event ID. Treat the flag value as the upstream id
parameter.
SDK
Use pkg/data when you only need Data API analytics. The public
pkg/universal facade exposes the same Data API methods when a caller already
uses one client for Gamma, CLOB, Data API, discovery, and streams. Both public
surfaces return DTOs from pkg/types.
import "github.com/TrebuchetDynamics/polygolem/pkg/data"
client := data.NewClient(data.Config{})positions, err := client.CurrentPositionsWithLimit(ctx, user, 20)leaders, err := client.TraderLeaderboard(ctx, 20)volume, err := client.LiveVolume(ctx, eventID)REST Mapping
| Polygolem method | REST path | Auth | Notes |
|---|---|---|---|
Health | GET / | Public | Reachability check |
CurrentPositions, CurrentPositionsWithLimit | GET /positions?user=...&limit=... | Public | Open positions for a wallet |
ClosedPositions, ClosedPositionsWithLimit | GET /closed-positions?user=...&limit=... | Public | Closed positions and realized PnL |
Trades | GET /trades?user=...&limit=... | Public | Public trades for a wallet |
Activity | GET /activity?user=...&limit=... | Public | Public activity stream |
TopHolders | GET /holders?market=...&limit=... | Public | Top holders grouped by market/token response shape |
TotalValue | GET /value?user=... | Public | Portfolio value; polygolem accepts object or array response |
MarketsTraded | GET /traded?user=... | Public | Total markets traded |
OpenInterest | GET /oi?market=... | Public | Open interest for one market/token |
LiveVolume | GET /live-volume?id=... | Public | Live volume for an event ID |
Rate Limits
The upstream Data API currently documents a general 1000 requests / 10s rate
limit. /positions, /closed-positions, and /trades each have a lower
200 requests / 10s limit. Health checks are lower again at 100 requests / 10s.
Position Fields For Settlement
GET /positions is the read-only source Polygolem uses to distinguish a
filled order from a redeemable winner. Current position rows include:
| Field | Use |
|---|---|
asset | CTF token ID held by the wallet |
conditionId | Market condition used for redeem calldata |
redeemable | Redemption readiness signal |
mergeable | Future merge-flow readiness signal |
negativeRisk | Chooses NegRiskCtfCollateralAdapter instead of CtfCollateralAdapter |
outcome, outcomeIndex | Held side and its index |
oppositeOutcome, oppositeAsset | Opposite side, useful for operator output |
endDate | Resolution window context |
There is no separate resolved boolean in the current schema. A settlement
worker should filter on redeemable=true and then route through the V2
collateral adapter that matches negativeRisk.