Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.us/llms.txt
Use this file to discover all available pages before exploring further.
The Portfolio resource provides access to your trading positions and activity history.
Methods
| Method | Endpoint | Description |
|---|
positions(params?) | GET /v1/portfolio/positions | Get trading positions |
activities(params?) | GET /v1/portfolio/activities | Get activity history |
positions
Get your current trading positions. Returns a map of market slug to position data.
positions = client.portfolio.positions()
for slug, pos in positions["positions"].items():
meta = pos["marketMetadata"]
print(f"{meta['title']}")
print(f" Net Position: {pos['netPosition']}")
print(f" Cost: ${pos['cost']['value']}")
print(f" Cash Value: ${pos['cashValue']['value']}")
Parameters
| Parameter | Type | Description |
|---|
cursor | str | Pagination cursor |
limit | int | Maximum results |
Position Fields
| Field | Type | Description |
|---|
netPosition | str | Net quantity (positive = long, negative = short) |
qtyBought | str | Total quantity bought |
qtySold | str | Total quantity sold |
cost | Amount | Total cost basis |
realized | Amount | Realized profit/loss |
cashValue | Amount | Current unrealized value |
qtyAvailable | str | Quantity available to trade |
expired | bool | Whether position has expired |
marketMetadata | object | Market information |
activities
Get your trading activity history including trades, settlements, deposits, and withdrawals.
activities = client.portfolio.activities({"limit": 20})
for act in activities["activities"]:
print(f"{act['type']}: {act.get('trade', act.get('accountBalanceChange', {}))}")
Parameters
| Parameter | Type | Description |
|---|
limit | int | Maximum results |
cursor | str | Pagination cursor |
types | list[str] | Filter by activity types |
marketSlug | str | Filter by market |
sortOrder | str | SORT_ORDER_DESCENDING (default) or SORT_ORDER_ASCENDING |
Activity Types
| Type | Nested Field | Description |
|---|
ACTIVITY_TYPE_TRADE | trade | Trade execution |
ACTIVITY_TYPE_POSITION_RESOLUTION | positionResolution | Market settlement |
ACTIVITY_TYPE_ACCOUNT_DEPOSIT | accountBalanceChange | Deposit |
ACTIVITY_TYPE_ACCOUNT_WITHDRAWAL | accountBalanceChange | Withdrawal |
Trade Fields
| Field | Type | Description |
|---|
id | str | Trade ID |
marketSlug | str | Market slug |
price | Amount | Trade price |
qty | str | Trade quantity |
isAggressor | bool | True if taker |
realizedPnl | Amount | Realized P&L |
For real-time position updates, use the WebSocket with SUBSCRIPTION_TYPE_POSITION instead of polling.