POST
GetAccountSummary🔐 AuthGet account summary including equity, margin, and PnL.
Request
| Parameter | Type | Description |
|---|---|---|
addressoptional | Address |
Response
| Field | Type | Description |
|---|---|---|
address | Address | |
total_equity | Balance | Total account value |
available_balance | Balance | Withdrawable balance |
total_margin_used | Balance | Margin in positions |
total_unrealized_pnl | Balance | Sum of all positions' PnL |
total_realized_pnl | Balance | Today's realized PnL |
margin_ratio | int32 | Current margin ratio (basis points) |
leverage | int32 | Account leverage |
liquidation_risk | bool | True if close to liquidation |
Example
Request
import { RealmClient } from '@realm/sdk';const client = new RealmClient('https://api.realm.com');await client.connect(wallet);const response = await client.getAccountSummary({ /* params */ });console.log(response);
Response
{// Response fields}