ScaleTrade Trading Platform TCP API - MngGetExposureByGroup Method for Group Exposure
MngGetExposureByGroup¶
Description:
Returns current open market exposure for all accounts matched by group_mask, grouped by symbol.
All exposure values are normalized to USD. This method is intended for group-level risk views where the selected accounts may belong to groups with different account currencies.
Exposure is calculated from open BUY and SELL market positions only:
exposure = lots * contract_size * market_price
Market price is selected by side:
BUY: currentbidSELL: currentask
LP coverage is included from open positions on accounts in the coverage group. Coverage volume uses gw_volume when it is greater than 0; otherwise it falls back to the trade volume. Coverage rows are matched only by symbols present in the selected group exposure.
Access Control¶
🛡️ Access Level Required:
SESSION_MANAGER,SESSION_ADMIN,SESSION_DEALER
Endpoint¶
GET /trades/exposure/group/
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| group_mask | string | Yes | Account group mask used to select accounts, for example "real-*" or "*". |
Request Example¶
{
"group_mask": "real-*"
}
Response¶
The response contains:
group_mask: requested group maskaccounts: number of matched accountscurrency/account_currency: alwaysUSDstructure: array of column namesrows: array of exposure rows aligned withstructure- total exposure fields in USD
- total coverage fields in USD
For this method, main exposure fields and their _usd counterparts are both USD-normalized:
buy_exposure == buy_exposure_usd
sell_exposure == sell_exposure_usd
net_exposure == net_exposure_usd
gross_exposure == gross_exposure_usd
Structure Fields¶
| Field | Description |
|---|---|
| symbol | Symbol name |
| account_currency | Result currency, always USD |
| quote_currency | Symbol quote currency used as base exposure currency before conversion |
| orders | Number of open account market positions for this symbol |
| buy_volume | Group BUY volume in raw platform volume units |
| sell_volume | Group SELL volume in raw platform volume units |
| net_volume | buy_volume - sell_volume |
| buy_lots | Group BUY volume in lots |
| sell_lots | Group SELL volume in lots |
| net_lots | buy_lots - sell_lots |
| buy_price | Average BUY market price used for exposure |
| sell_price | Average SELL market price used for exposure |
| buy_exposure | BUY exposure in USD |
| sell_exposure | SELL exposure in USD |
| net_exposure | buy_exposure - sell_exposure in USD |
| gross_exposure | buy_exposure + sell_exposure in USD |
| buy_exposure_usd | BUY exposure in USD |
| sell_exposure_usd | SELL exposure in USD |
| net_exposure_usd | buy_exposure_usd - sell_exposure_usd |
| gross_exposure_usd | buy_exposure_usd + sell_exposure_usd |
| coverage_orders | Number of open LP coverage positions for this symbol |
| coverage_buy_volume | LP coverage BUY volume, using gw_volume when available |
| coverage_sell_volume | LP coverage SELL volume, using gw_volume when available |
| coverage_net_volume | coverage_buy_volume - coverage_sell_volume |
| coverage_buy_lots | LP coverage BUY volume in lots |
| coverage_sell_lots | LP coverage SELL volume in lots |
| coverage_net_lots | coverage_buy_lots - coverage_sell_lots |
| coverage_buy_price | Average LP coverage BUY market price |
| coverage_sell_price | Average LP coverage SELL market price |
| coverage_buy_exposure | LP coverage BUY exposure in USD |
| coverage_sell_exposure | LP coverage SELL exposure in USD |
| coverage_net_exposure | coverage_buy_exposure - coverage_sell_exposure in USD |
| coverage_gross_exposure | coverage_buy_exposure + coverage_sell_exposure in USD |
| coverage_buy_exposure_usd | LP coverage BUY exposure in USD |
| coverage_sell_exposure_usd | LP coverage SELL exposure in USD |
| coverage_net_exposure_usd | coverage_buy_exposure_usd - coverage_sell_exposure_usd |
| coverage_gross_exposure_usd | coverage_buy_exposure_usd + coverage_sell_exposure_usd |
Example Response¶
{
"login": 0,
"group_mask": "real-*",
"accounts": 42,
"currency": "USD",
"account_currency": "USD",
"structure": [
"symbol",
"account_currency",
"quote_currency",
"orders",
"buy_volume",
"sell_volume",
"net_volume",
"buy_lots",
"sell_lots",
"net_lots",
"buy_price",
"sell_price",
"buy_exposure",
"sell_exposure",
"net_exposure",
"gross_exposure",
"buy_exposure_usd",
"sell_exposure_usd",
"net_exposure_usd",
"gross_exposure_usd",
"coverage_orders",
"coverage_buy_volume",
"coverage_sell_volume",
"coverage_net_volume",
"coverage_buy_lots",
"coverage_sell_lots",
"coverage_net_lots",
"coverage_buy_price",
"coverage_sell_price",
"coverage_buy_exposure",
"coverage_sell_exposure",
"coverage_net_exposure",
"coverage_gross_exposure",
"coverage_buy_exposure_usd",
"coverage_sell_exposure_usd",
"coverage_net_exposure_usd",
"coverage_gross_exposure_usd"
],
"rows": [
[
"EURUSD",
"USD",
"USD",
18,
12000,
8000,
4000,
120.0,
80.0,
40.0,
1.1012,
1.1014,
13214400.0,
8811200.0,
4403200.0,
22025600.0,
13214400.0,
8811200.0,
4403200.0,
22025600.0,
4,
0,
4000,
-4000,
0.0,
40.0,
-40.0,
0.0,
1.1014,
0.0,
4405600.0,
-4405600.0,
4405600.0,
0.0,
4405600.0,
-4405600.0,
4405600.0
]
],
"count": 1,
"total_buy_exposure": 13214400.0,
"total_sell_exposure": 8811200.0,
"total_net_exposure": 4403200.0,
"total_gross_exposure": 22025600.0,
"total_buy_exposure_usd": 13214400.0,
"total_sell_exposure_usd": 8811200.0,
"total_net_exposure_usd": 4403200.0,
"total_gross_exposure_usd": 22025600.0,
"total_coverage_buy_exposure": 0.0,
"total_coverage_sell_exposure": 4405600.0,
"total_coverage_net_exposure": -4405600.0,
"total_coverage_gross_exposure": 4405600.0,
"total_coverage_buy_exposure_usd": 0.0,
"total_coverage_sell_exposure_usd": 4405600.0,
"total_coverage_net_exposure_usd": -4405600.0,
"total_coverage_gross_exposure_usd": 4405600.0
}
Error Responses¶
Validation Error¶
{
"error": "INVALID_DATA",
"message": "group_mask is required"
}
Permission Error¶
{
"error": "PERMISSION_DENIED"
}