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

# Position

Receive real-time updates on your positions.

* Topic: `position`
* Stream: Private (`wss://api.ekiden.fi/ws/private`)

## Authenticate

Use authentication flow described in the [Connect](./connect) page.

## Subscribe

```json theme={null}
{ "op": "subscribe", "args": ["position"], "req_id": "202001" }
```

Ack:

```json theme={null}
{ "op": "subscribed", "args": ["position"], "req_id": "202001" }
```

## Events

Messages arrive with `op: "event"`, `topic: "position"`, and `data` is an array of `Position`.

Example:

```json theme={null}
{
	"op": "event",
	"topic": "position",
	"server_ts_ms": 1731541800000,
	"data": [
		{
			"risk_id": 1,
			"risk_limit_value": "100000000",
			"symbol": "BTC-USDC",
			"sub_account_address": "0xsubacct...",
			"side": "Sell",
			"size": "250",
			"avg_price": "100100",
			"position_value": "25025000",
			"margin_mode": "Cross",
			"position_balance": "50000",
			"position_status": "Normal",
			"leverage": "10",
			"mark_price": "100200",
			"liq_price": "100000",
			"bust_price": "95000",
			"position_im": "1200",
			"position_im_by_mp": "1210",
			"position_mm": "800",
			"position_mm_by_mp": "810",
			"unrealized_pnl": "-25",
			"unrealized_funding": "0",
			"realized_pnl_cur": "0",
			"realized_pnl_cum": "1000",
			"cum_funding": "-5",
			"adl_rank_indicator": "Zero",
			"is_reduce_only": false,
			"created_time": "1731541700000",
			"updated_time": "1731541800000",
			"seq": 999
		}
	]
}
```

Field notes:

* Numeric values are encoded as strings to preserve precision.
* Times (`created_time`, `updated_time`) are Unix milliseconds (encoded as strings).

### Fields

| Field                        | Type           | Notes                                        |
| ---------------------------- | -------------- | -------------------------------------------- |
| risk\_id                     | integer        | Risk tier ID                                 |
| risk\_limit\_value           | string         | Risk limit value                             |
| symbol                       | string         | Symbol name                                  |
| sub\_account\_address        | string         | Sub-account address                          |
| side                         | string         | `Buy` (long) or `Sell` (short)               |
| size                         | string         | Position size (always positive)              |
| avg\_price                   | string         | Average entry price                          |
| position\_value              | string         | Position value                               |
| margin\_mode                 | string         | `Cross` or `Isolated`                        |
| position\_balance            | string         | Position margin                              |
| position\_status             | string         | `Normal`, `Liq`, `Adl`                       |
| leverage                     | string         | Position leverage                            |
| mark\_price                  | string         | Mark price                                   |
| liq\_price                   | string         | Liquidation price                            |
| bust\_price                  | string         | Bankruptcy price                             |
| position\_im                 | string         | Initial margin                               |
| position\_im\_by\_mp         | string         | Initial margin (mark price)                  |
| position\_mm                 | string         | Maintenance margin                           |
| position\_mm\_by\_mp         | string         | Maintenance margin (mark price)              |
| take\_profit                 | string or null | Take profit price                            |
| stop\_loss                   | string or null | Stop loss price                              |
| trailing\_stop               | string or null | Trailing stop distance                       |
| unrealized\_pnl              | string         | Unrealized PnL (mark)                        |
| unrealized\_funding          | string         | Net unsettled funding PnL                    |
| realized\_pnl\_cur           | string         | Current realized PnL since position creation |
| realized\_pnl\_cum           | string         | Cumulative realized PnL                      |
| cum\_funding                 | string         | Net realized funding PnL                     |
| adl\_rank\_indicator         | string         | Auto-deleverage rank                         |
| is\_reduce\_only             | boolean        | Reduce-only flag                             |
| created\_time                | string         | Created time (ms)                            |
| updated\_time                | string         | Updated time (ms)                            |
| seq                          | integer        | Cross sequence                               |
| mmr\_sys\_update\_time       | string or null | System MM update time (ms)                   |
| leverage\_sys\_updated\_time | string or null | System leverage update time (ms)             |

See schema details in [AsyncAPI](../websockets/private): `Position`.
