Skip to main content
client.data.core.getPositions surfaces the holdings for a single wallet. Results include token sizes, average price, cash/percent PnL, redeem/merge flags, and market metadata.

Request

const positions = await client.data.core.getPositions(params);

Parameters

NameTypeRequiredDefaultNotes
userstring (0x + 40 hex)Wallet or proxy address.
marketstring[]Condition IDs (0x + 64 hex). Mutually exclusive with eventId.
eventIdnumber[]Event IDs. Mutually exclusive with market.
sizeThresholdnumber1Minimum token size to display.
redeemablebooleanfalseRestrict results to redeemable positions.
mergeablebooleanfalseRestrict results to mergeable positions.
limitnumber (0–500)100Page size.
offsetnumber (0–10000)0Page offset.
sortByenum"TOKENS"CURRENT, INITIAL, TOKENS, CASHPNL, PERCENTPNL, TITLE, RESOLVING, PRICE, AVGPRICE.
sortDirectionenum"DESC"ASC or DESC.
titlestring (≤ 100 chars)Case-insensitive title filter.
⚠️ Mutually exclusive filters — Provide either market or eventId, not both. The SDK throws a validation error highlighting both fields if used together.

Response

type Position = {
  proxyWallet: string;
  asset: string;
  conditionId: string;
  size: number;
  avgPrice: number;
  initialValue: number;
  currentValue: number;
  cashPnl: number;
  percentPnl: number;
  totalBought: number;
  realizedPnl: number;
  percentRealizedPnl: number;
  curPrice: number;
  redeemable: boolean;
  mergeable: boolean;
  title: string;
  slug: string;
  icon: string;
  eventSlug: string;
  outcome: string;
  outcomeIndex: number;
  oppositeOutcome: string;
  oppositeAsset: string;
  endDate: string;
  negativeRisk: boolean;
};
Unexpected fields are preserved via passthrough() so you can adopt new attributes without waiting for a release.

Usage example

const positions = await client.data.core.getPositions({
  user: "0x56687bf447db6ffa42ffe2204a05edaa20f55839",
  limit: 25,
  sortBy: "CASHPNL",
});

positions.forEach((position) => {
  console.log(`${position.title}: ${position.cashPnl.toFixed(2)} USDC`);
});

Failure modes

  • Missing user → validation error.
  • Conflicting filters → validation error naming both market and eventId.
  • HTTP failure → HttpError with status, statusText, and body.
  • Network failure → Error("Network error: …") with the original cause.