Skip to main content

Documentation Index

Fetch the complete documentation index at: https://polymarket-data.com/llms.txt

Use this file to discover all available pages before exploring further.

client.data.core.getTrades returns historical fills across markets. Combine filters to analyse liquidity, user behaviour, or market conditions.

Request

const trades = await client.data.core.getTrades(params);

Parameters

NameTypeRequiredDefaultNotes
limitnumber (0–10000)100Page size.
offsetnumber (0–10000)0Page offset.
takerOnlybooleantrueSet to false to include maker fills.
filterType"CASH" | "TOKENS"Must be provided with filterAmount.
filterAmountnumber (≥ 0)Minimum cash/tokens threshold.
marketstring[]Condition IDs (mutually exclusive with eventId).
eventIdnumber[]Event IDs (mutually exclusive with market).
userstring (address)Filter by participant.
side"BUY" | "SELL"Filter by trade direction.
⚠️ Provide both filterType and filterAmount or neither. Mixing them triggers a validation error. Likewise, market and eventId cannot be combined.

Response

type Trade = {
  proxyWallet: string;
  side: "BUY" | "SELL";
  asset: string;
  conditionId: string;
  size: number;
  price: number;
  timestamp: number;
  title: string;
  slug: string;
  icon: string;
  eventSlug: string;
  outcome: string;
  outcomeIndex: number;
  name: string;
  pseudonym: string;
  bio: string;
  profileImage: string;
  profileImageOptimized: string;
  transactionHash: string;
};

Usage example

const trades = await client.data.core.getTrades({
  user: "0x56687bf447db6ffa42ffe2204a05edaa20f55839",
  side: "BUY",
  limit: 20,
});

const averagePrice =
  trades.reduce((total, trade) => total + trade.price, 0) / Math.max(trades.length, 1);

Failure modes

  • Missing paired filters → validation error referencing both fields.
  • Conflicting market/eventId → validation error.
  • HTTP failure → HttpError with parsed body.
  • Network failure → Error("Network error: …") with original cause.