> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsidemax.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# shareGroupState: List Portfolio Share Group Definitions

> Fetch the definitions of portfolio share groups, including contract membership and settlement coin, used by PORTFOLIO margin mode accounts.

The `shareGroupState` query returns the definitions of share groups used by PORTFOLIO margin mode accounts. A share group defines a set of contracts that share a single margin pool, with a common settlement coin. Use this to understand which contracts are grouped together when calculating portfolio margin requirements, and to check whether a group is currently accepting new (non-reduce-only) orders.

## Request

```json theme={"system"}
{"type": "shareGroupState", "groupId": 0}
```

<ParamField body="type" type="string" required>
  Must be `"shareGroupState"`.
</ParamField>

<ParamField body="groupId" type="integer">
  Filter results by group ID. Use `0` or omit to return all share groups. Pass a positive integer to retrieve the definition for a single group.
</ParamField>

## Response

```json theme={"system"}
{
  "type": "shareGroupState",
  "groups": [
    {
      "groupId": 3,
      "settleCoinId": 1,
      "status": "Active",
      "contractIds": [10, 11]
    }
  ]
}
```

<ResponseField name="groupId" type="integer">
  Unique identifier for this share group. Reference this ID in portfolio margin operations.
</ResponseField>

<ResponseField name="settleCoinId" type="integer">
  The coin used for settlement and margin within this group. Cross-reference with the `coins` array in `configs` for the coin name and decimals.
</ResponseField>

<ResponseField name="status" type="string">
  Current status of the share group:

  * `"Active"` — the group is operating normally and accepts all order types.
  * `"Frozen"` — the group is suspended; only `reduceOnly` orders are accepted on contracts in this group.
</ResponseField>

<ResponseField name="contractIds" type="integer[]">
  Array of contract IDs that belong to this share group. All contracts in a group share the same margin pool and settlement coin.
</ResponseField>
