Skip to main content

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

FieldTypeRequiredDescription
tradingAccountIdstringNoFilter by trading account
venuestringNoFilter by venue
currencystringNoFilter by currency
limitintegerNoMaximum results (default: 100)
offsetintegerNoPagination offset

Result

Returns an array of portfolio objects.

Portfolio Object

FieldTypeDescription
tradingAccountIdstringTrading account identifier
venuestringExchange venue
positionsarrayOpen positions
balancesarrayAsset balances
summaryobjectPortfolio summary
updatedAtintegerLast update timestamp (ms)

Position Entry

FieldTypeDescription
positionIdstringPosition identifier
securitySymbolstringSecurity symbol
instrumentIdstringAssociated instrument
securityTypestringSecurity type
statusstringPosition status
quantitystringPosition quantity
entryPricestringEntry price
currentPricestringCurrent market price
unrealizedPnlstringUnrealized profit/loss
realizedPnlstringRealized profit/loss

Balance Entry

FieldTypeDescription
symbolstringAsset symbol
availablestringAvailable balance
lockedstringLocked in orders
totalstringTotal balance

Portfolio Summary

FieldTypeDescription
totalValuestringTotal portfolio value
unrealizedPnlstringTotal unrealized P&L
realizedPnlstringTotal 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
}
]
}