Skip to content

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

Terminal window
polygolem data positions --user 0x...
polygolem data closed-positions --user 0x...
polygolem data trades --user 0x... --limit 20
polygolem data activity --user 0x... --limit 20
polygolem data holders --token-id <token-id> --limit 20
polygolem data value --user 0x...
polygolem data markets-traded --user 0x...
polygolem data open-interest --token-id <token-id>
polygolem data leaderboard --limit 20
polygolem 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 methodREST pathAuthNotes
HealthGET /PublicReachability check
CurrentPositions, CurrentPositionsWithLimitGET /positions?user=...&limit=...PublicOpen positions for a wallet
ClosedPositions, ClosedPositionsWithLimitGET /closed-positions?user=...&limit=...PublicClosed positions and realized PnL
TradesGET /trades?user=...&limit=...PublicPublic trades for a wallet
ActivityGET /activity?user=...&limit=...PublicPublic activity stream
TopHoldersGET /holders?market=...&limit=...PublicTop holders grouped by market/token response shape
TotalValueGET /value?user=...PublicPortfolio value; polygolem accepts object or array response
MarketsTradedGET /traded?user=...PublicTotal markets traded
OpenInterestGET /oi?market=...PublicOpen interest for one market/token
LiveVolumeGET /live-volume?id=...PublicLive 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:

FieldUse
assetCTF token ID held by the wallet
conditionIdMarket condition used for redeem calldata
redeemableRedemption readiness signal
mergeableFuture merge-flow readiness signal
negativeRiskChooses NegRiskCtfCollateralAdapter instead of CtfCollateralAdapter
outcome, outcomeIndexHeld side and its index
oppositeOutcome, oppositeAssetOpposite side, useful for operator output
endDateResolution 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.