Skip to main content

Overview

The PortfolioFetcher 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

Use get_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.
Use 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

Use get_positions() to retrieve all your open positions:
The response is a dictionary with the following top-level keys:

Iterating CLOB Positions

Each entry in the clob list contains the market details and your position size:
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.

Complete Example