investfly.models.portfolio.Portfolio

Portfolio state exposed to SDK clients and strategy callbacks.

class Portfolio:

Current balances, positions, pending orders, and completed trades.

Attributes:
  • portfolioId: Stable Investfly identifier for the portfolio.
  • broker: Broker connected to the portfolio.
  • balances: Current account balances.
  • openPositions: Positions currently held by the portfolio.
  • pendingOrders: Orders that have not reached a terminal state.
  • completedTrades: Filled trades recorded for the portfolio.

Return the matching open position, or None when it is not held.