- Topic:
position - Stream: Private (
wss://api.ekiden.fi/ws/private)
Authenticate
Use authentication flow described in the Connect page.Subscribe
Events
Messages arrive withop: "event", topic: "position", and data is an array of PositionResponse augmented with PnL fields.
Example:
initial_margin,initial_margin_mark,maintenance_margin,leverage, andliq_pricemay be null when not computable (e.g., zero size), though typical streaming updates include them.timestamp(seconds) is deprecated; prefertimestamp_ms.- Semantics:
initial_marginis entry-notional based IM requirement;initial_margin_markis mark-notional based IM requirement.marginis the actual collateral assigned to the position (quote units, scaled). In cross mode, it represents the portion of account equity allocated to this position for risk and liquidation.
Fields
| Field | Type | Notes |
|---|---|---|
| sid | string | Position identifier (vault address) |
| market_addr | string | Market address |
| user_addr | string | User address |
| size | integer | Signed base units (scaled) |
| price | integer | Entry price alias (scaled) |
| entry_price | integer | Same as price for clarity |
| margin | integer | Margin allocated to position (quote units, scaled) |
| funding_index | integer | Position funding index |
| epoch | integer | Internal epoch/version |
| is_cross | boolean | Margin mode |
| initial_margin | integer or null | Required initial margin (entry notional) |
| initial_margin_mark | integer or null | Required initial margin (mark notional) |
| maintenance_margin | integer or null | Required maintenance margin |
| leverage | integer or null | Entry notional / margin |
| mark_price | integer | Current mark price |
| seq | integer | Sequence of last update |
| side | string | buy or sell inferred from size |
| unrealized_pnl | integer | Signed PnL (scaled) |
| liq_price | integer or null | Estimated liquidation price |
| timestamp | integer | Deprecated seconds timestamp |
| timestamp_ms | integer | Milliseconds timestamp (preferred) |
PositionResponse.