PortfolioFetcher Setup
PortfolioFetcher provides access to your positions, trade history, and accumulated points. An API key is required.
All Positions
Fetch all positions across CLOB and AMM markets in a single call:Response Structure
CLOB Positions
Retrieve only your CLOB market positions:CLOB Position Structure
| Field | Description |
|---|---|
size | Number of shares held |
collateral | USDC value of collateral locked |
unrealizedPnl | Unrealized profit/loss in USDC based on current orderbook prices |
AMM Positions
Retrieve only your AMM market positions:Trade History
Fetch paginated trade history:Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-indexed) |
limit | number | 10 | Number of entries per page |
Combining Positions with Market Data
For a richer view, combine position data with live market information:Error Handling
Portfolio endpoints require a valid API key. If the key is missing or invalid, the SDK throws anApiError with status 401.