Overview
ThePortfolioFetcher class retrieves your profile, open positions, and portfolio data from the Limitless Exchange API. It requires an authenticated HttpClient.
Setup
PortfolioFetcher requires an authenticated client. Configure LIMITLESS_API_KEY, pass api_key to HttpClient, or use HMAC credentials through the root Client for partner/backend flows.Current Profile
Useget_current_profile() to fetch the authenticated caller’s private profile via GET /profiles/me. This is the preferred helper when the client is already authenticated and you do not want to pass a wallet address.
get_profile(address) only when you need the address-based route:
get_current_profile() calls GET /profiles/me; get_profile(address) calls GET /profiles/:account. Both return raw API responses matching the private profile schema.Fetching Positions
Useget_positions() to retrieve all your open positions:
| Key | Type | Description |
|---|---|---|
clob | list[dict] | Positions on CLOB (order book) markets |
amm | list[dict] | Positions on AMM (automated market maker) markets |
accumulativePoints | dict | Accumulated points and rewards data |
Iterating CLOB Positions
Each entry in theclob list contains the market details and your position size:
Example response structure
Example response structure
The
PortfolioFetcher returns raw API responses without heavy parsing or transformation. Field names and types match the REST API directly. Refer to the API Reference for the complete response schema.