Complete portfolio snapshot with balance, positions, and aggregate P&L.
GET /v1/account/portfolio
curl -H "X-API-Key: $API_KEY" \ https://api.polysimulator.com/v1/account/portfolio
{ "balance": { "balance": "993.50", "currency": "USD", "unrealized_pnl": "-6.50", "total_value": "1000.50", "starting_balance": "1000.00" }, "positions": [ { "id": 1, "market_id": "0x1a2b3c...", "outcome": "Yes", "quantity": "10.0", "avg_entry_price": "0.65", "current_price": "0.70", "market_value": "7.00", "unrealized_pnl": "0.50", "status": "OPEN" } ], "total_trades": 5, "win_rate": "60.0%" }
balance
positions
total_trades
win_rate
portfolio = requests.get( f"{BASE}/v1/account/portfolio", headers=headers, ).json() cash = Decimal(portfolio["balance"]["balance"]) total = Decimal(portfolio["balance"]["total_value"]) positions = portfolio["positions"] print(f"Cash: ${cash} | Total: ${total} | Positions: {len(positions)}") if portfolio["win_rate"]: print(f"Win rate: {portfolio['win_rate']}") # Check if over-allocated if total > 0: cash_pct = cash / total * 100 if cash_pct < 20: print("Warning: Low cash — consider reducing positions")
Was this page helpful?