POST
GetPortfolioMargin🔐 AuthGet portfolio margin details and risk metrics.
Request
| Parameter | Type | Description |
|---|---|---|
addressoptional | Address |
Response
| Field | Type | Description |
|---|---|---|
address | Address | Collateral |
total_collateral | Balance | |
assets | CollateralAsset[] | Margin |
total_initial_margin | Balance | |
total_maintenance_margin | Balance | |
available_margin | Balance | PnL |
total_unrealized_pnl | Balance | |
total_realized_pnl | Balance | Risk metrics |
margin_ratio | int32 | Basis points (5000 = 50%) |
account_health | int32 | 0-10000 (10000 = healthy) |
is_liquidatable | bool | |
margin_call_warning | bool | Positions |
position_count | uint32 | |
positions | Position[] | |
last_update | Timestamp |
Example
Request
import { RealmClient } from '@realm/sdk';const client = new RealmClient('https://api.realm.com');await client.connect(wallet);const response = await client.getPortfolioMargin({ /* params */ });console.log(response);
Response
{// Response fields}