getBalances(params: WalletBalanceQuery)
getBalances(params: WalletBalanceQuery)
Description
Get Current Token Balance, Cost, and Performance data for one or more registered wallets, including Price, Balance, Value, Cost Basis, Realized PnL, and Unrealized PnL. Use this endpoint for real-time pricing and Live or Historical P&L reporting for tokens
- OpenPool API Endpoint:
GET:/wallet/balance/
Parameters
Name | Type | Description | Optional |
---|---|---|---|
params | WalletBalanceQuery | Query parameters | No |
interface WalletBalanceQuery {
cost_method?: "FIFO" | "LIFO" | "WAC";
currency?: "AVAX" | "ETH" | "MATIC" | "USD" | "XDAI";
period?: "1YR" | "3M" | "D" | "M" | "MAX" | "W" | "YTD";
wallet: string;
}
Response
[{
id?: string;
wallet?: string;
token: Token;
balance?: string;
price?: string;
value?: string;
average_cost?: string;
unrealized_pnl?: string;
total_realized_pnl?: string;
currency?: string;
cost_method: string;
basis: CurrentBasis[];
timestamp: string;
}]