---
title: "Spot account summary"
description: "Get the total equity and spot balances of one spot sub-account."
---

| | |
|---|---|
| SDK | `client.spot_account_summary(...)` |
| HTTP | `POST https://trades.<domain>/full/v1/spot_account_summary`, or `/lite/v1/spot_account_summary` for [lite names](../../guides/environments.md#encoding-full-or-lite) (the SDKs' default) |
| WebSocket | method `v1/spot_account_summary` on `wss://trades.<domain>/ws/full`, or `/ws/lite` for lite names |
| Auth | Session required ([Authentication](../../guides/authentication.md)) |
| Retries | Read: the SDKs retry retryable errors ([rules](../../guides/errors-and-retries.md)) |
| Contract id | `account.spot_account_summary` (`RPCSpotAccountSummaryV1`) |

## Request

Body type `ApiSpotSubAccountSummaryRequest`. Fields the server fills are left out.

- `sub_account_id` · lite `sa` · string (uint64) · required — The sub-account ID to filter by

## Response

Body type `ApiSpotSubAccountSummaryResponse` (the same object is the JSON-RPC `result` over WebSocket).

- `result` · lite `r` · object SpotSubAccount · required — The spot sub-account summary
- `result.event_time` · lite `et` · string (int64 unix ns) · required — Time at which the event was emitted in unix nanoseconds
- `result.sub_account_id` · lite `sa` · string (uint64) · required — The sub-account ID this entry refers to
- `result.total_equity` · lite `te` · string · required — Total equity of the spot sub-account, denominated USD
- `result.spot_balances` · lite `sb` · object SpotBalance[] · required — The list of spot assets owned by this spot sub-account, and their balances
- `result.spot_balances[].currency` · lite `c` · string · required — The currency you hold a spot balance in
- `result.spot_balances[].balance` · lite `b` · string · required — This currency's balance in this sub-account.
- `result.spot_balances[].index_price` · lite `ip` · string · required — The index price of this currency. (reported in `USD`)
- `result.spot_balances[].entry_price` · lite `ep` · string · required — The entry price of this spot currency. (reported in `USD`)
- `result.spot_balances[].realized_pnl` · lite `rp` · string · required — The realized PnL of this spot currency. (reported in `USD`)
- `result.spot_balances[].unrealized_pnl` · lite `up` · string · required — The unrealized PnL of this spot currency. (reported in `USD`)
- `result.spot_balances[].available_to_transfer` · lite `at` · string · required — The available to transfer amount of this spot currency.
- `result.spot_balances[].borrowed_amount` · lite `ba` · string · optional — The amount borrowed in this currency, inclusive of accrued interest.
  Only reported by `account_summary`, and only for multi-asset-mode sub-accounts

## Errors

Errors come back as `{"code", "message", "status"}` (lite `{"c", "m", "s"}`) with the HTTP status. Codes this call can return, as code, name (HTTP status) ([all error codes](../errors.md)):

`1000` Unauthorized (401) · `1001` Forbidden (403) · `1002` InternalServer (500) · `1003` InvalidRequest (400) · `1006` RateLimit (429, retryable) · `1008` IPNotWhitelisted (401)

## Example

```python
import os

from grvt import Grvt

with Grvt(
    env=os.environ.get("GRVT_ENV", "testnet"),
    api_key=os.environ["GRVT_API_KEY"],
) as client:
    resp = client.spot_account_summary(
        sub_account_id=os.environ["GRVT_SUB_ACCOUNT_ID"],
    )
    print(resp)
```

Raw HTTP (set `GRVT_DOMAIN`, see [Environments](../../guides/environments.md); `GRVT_COOKIE` and `GRVT_ACCOUNT_ID` come from [login](../../guides/authentication.md)):

With full field names:

```sh
curl -sS "https://trades.$GRVT_DOMAIN/full/v1/spot_account_summary" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data @- <<EOF
{
  "sub_account_id": "$GRVT_SUB_ACCOUNT_ID"
}
EOF
```

With lite field names:

```sh
curl -sS "https://trades.$GRVT_DOMAIN/lite/v1/spot_account_summary" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data @- <<EOF
{
  "sa": "$GRVT_SUB_ACCOUNT_ID"
}
EOF
```
