Open Positions
Inspect a wallet’s current outcome exposure and unrealized performance.- TypeScript
- Python
- API
Call
listPositions() on a PublicClient or SecureClient.Output: Position[]
Output: Position[]
firstEntryAt is the first acquisition time in Unix epoch milliseconds, or undefined when unrecorded. Acquisitions include buys, splits, mints, migrations, and incoming transfers.Filter Positions by Title
Narrow positions to markets whose titles contain a search term, ignoring case. This works across position statuses and when listing a market’s holders.- TypeScript
- Python
- API
Pass
title to listPositions() on the existing PublicClient or SecureClient:title accepts at most 200 Unicode characters. Empty or whitespace-only
input disables the filter. Other patterns are preserved unchanged; %
matches any sequence of characters and _ matches one character.
The paginator retains title on every page, including when resumed with
pages.from(nextCursor).Closed Positions
Review the positions a wallet has exited or that have resolved, including their realized performance.- TypeScript
- Python
- API
One method serves the whole position lifecycle: call
For a
listPositions()
with status: PositionStatus.Closed. Closed rows keep the same Position
shape with realized economics (currentSize is a ~0 residual and
realizedPnl carries the outcome); they default to sorting by realized
PnL.This example uses an existing PublicClient or SecureClient. If needed,
create a Public Client first.Output: Position[]
Output: Position[]
Position Example
user-anchored listing with status: PositionStatus.Closed,
PositionSortBy.Tokens, CurrentValue, Price, and UnrealizedPnl
rank by realized PnL, preserving the requested sortDirection. This
example therefore orders realized PnL descending. RealizedPnl,
TotalPnl, and Timestamp retain their semantics. Market-only CLOSED
listings do not use this fallback.Keep the original filters and sortBy when continuing with a cursor.
Do not rewrite it to RealizedPnl. An old residual-sort cursor can raise
RequestRejectedError with a message containing
positions order changed; restart pagination without cursor. The SDK
passes the rejection to the caller without restarting. Explicitly discard
that cursor and start again with the original request and no cursor.
Restarting can return rows you have already consumed.Sort Positions by Price
Rank a wallet’s holdings by current effective price to find its lowest- or highest-priced outcomes.- TypeScript
- Python
- API
Call
listPositions() on an existing PublicClient or SecureClient, using
the address from the open positions example.PositionSortBy.Price orders by currentPrice. Use SortDirection.Desc for
highest prices first. The paginator retains the selected sort on later pages.Activity History
Follow the timeline for a wallet across trades and other activity.- TypeScript
- Python
- API
Call You can narrow down the activity types using the For Parsed ordinary rows return
listActivity() on an existing PublicClient or SecureClient.
If needed, create a Public Client first.type field:TRADE, SPLIT, MERGE and REDEEM, check type first, then isCombo. A value of
true identifies Combo activity. false identifies ordinary market
activity. RedeemActivity is ClobRedeemActivity | ComboRedemptionActivity.
Combo rows carry a ComboConditionId in conditionId.
Combo splits, merges and redemptions have optional titles and no single
market or event URL slug.Combo outcome and outcomeIndex describe the Yes/No side of the aggregate
basket token, rather than a selected leg’s label. Unavailable labels or
indexes stay undefined. A known index of 0 is preserved. Automatic
redemption is also represented by ActivityType.REDEEM.This source-breaking 0.x API update adds Combo variants to
SplitActivity, MergeActivity and RedeemActivity. Code that previously accessed market URLs after
checking only type must also check !isCombo. For example, read ordinary
market URLs within the same activity iterator:isCombo: false. Manually constructed ordinary
split, merge and redemption values may omit it.Activity is a discriminated union. The type field identifies each
variant:Output: Activity[]
Output: Activity[]
Notifications
Notifications provide a short-lived record of unread events for the connected account. The CLOB retains them for 48 hours.Clients authenticated with Session
Keys receive only
notifications generated by those Session Keys.
List Notifications
- TypeScript
- Python
- API
Call
fetchNotifications() on a SecureClient:Output: Notification[]
Output: Notification[]
Drop Notifications
Mark notifications as read after processing them. Dropped notifications no longer appear when you list unread notifications.- TypeScript
- Python
- API
Call
dropNotifications() on a SecureClient with the notification IDs:Portfolio Value
Read the current portfolio value for a wallet.- TypeScript
- Python
- API
Call
fetchPortfolioValue() on a PublicClient or SecureClient. It
returns a single object: the wallet’s marked portfolio value in USDC,
rounded to four decimals.Output: PortfolioValue
Output: PortfolioValue
Wallet Stats
Read a wallet’s lifetime trading statistics.- TypeScript
- Python
- API
Call
fetchUserStats() on a PublicClient or SecureClient.tradedMarketCount counts distinct markets, not fills. stats is null
for an unknown user.Wallet PnL History
Track a wallet’s cumulative profit and loss over time.- TypeScript
- Python
- API
Call The default is one day sampled hourly.
fetchUserPnl() on a PublicClient or SecureClient.points are cumulative and ordered
oldest first. Nullable amounts mean unavailable, not zero.Wallet Trading Volume
Measure a wallet’s trading volume over a selected period.- TypeScript
- Python
- API
Call
fetchUserVolume() on a PublicClient or SecureClient.volume.volume is in shares, volume.volumeUsdc is in USD, and
volume.tradeCount counts fills. Window bounds expand to whole UTC days.