query.portfolio.list
List portfolios.
Method
query.portfolio.list
Description
Returns portfolios (balances and positions) across trading accounts. Filter by trading account, venue, or currency.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
tradingAccountId | string | No | Filter by trading account |
venue | string | No | Filter by venue |
currency | string | No | Filter by currency |
limit | integer | No | Maximum results (default: 100) |
offset | integer | No | Pagination offset |
Result
Returns an array of portfolio objects.
Portfolio Object
| Field | Type | Description |
|---|---|---|
tradingAccountId | string | Trading account identifier |
venue | string | Exchange venue |
positions | array | Open positions |
balances | array | Asset balances |
summary | object | Portfolio summary |
updatedAt | integer | Last update timestamp (ms) |
Position Entry
| Field | Type | Description |
|---|---|---|
positionId | string | Position identifier |
securitySymbol | string | Security symbol |
instrumentId | string | Associated instrument |
securityType | string | Security type |
status | string | Position status |
quantity | string | Position quantity |
entryPrice | string | Entry price |
currentPrice | string | Current market price |
unrealizedPnl | string | Unrealized profit/loss |
realizedPnl | string | Realized profit/loss |
Balance Entry
| Field | Type | Description |
|---|---|---|
symbol | string | Asset symbol |
available | string | Available balance |
locked | string | Locked in orders |
total | string | Total balance |
Portfolio Summary
| Field | Type | Description |
|---|---|---|
totalValue | string | Total portfolio value |
unrealizedPnl | string | Total unrealized P&L |
realizedPnl | string | Total realized P&L |
Usage
# List all portfolios
result = await client.rpc("query.portfolio.list", {})
# List portfolio for specific account
result = await client.rpc("query.portfolio.list", {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000"
})
Example Response
{
"data": [
{
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"venue": "BINANCE",
"positions": [
{
"positionId": "pos-001",
"securitySymbol": "BTC",
"instrumentId": "BINANCE:BTC/USDT",
"securityType": "CRYPTO",
"status": "OPEN",
"quantity": "1.5",
"entryPrice": "45000.00",
"currentPrice": "50000.00",
"unrealizedPnl": "7500.00"
}
],
"balances": [
{"symbol": "BTC", "available": "1.5", "locked": "0", "total": "1.5"},
{"symbol": "USDT", "available": "10000.00", "locked": "5000.00", "total": "15000.00"}
],
"summary": {
"totalValue": "90000.00",
"unrealizedPnl": "7500.00",
"realizedPnl": "2500.00"
},
"updatedAt": 1703052635110
}
]
}