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. Pass scoped API-token credentials via hmac_credentials (as above), or use the root Client with the same credentials. A legacy LIMITLESS_API_KEY (X-API-Key) still works but is not recommended for new integrations.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:
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.