Files
ritmex-bot/docs/grvt/schemas/ws_positions_feed_data_v1.md
T

3.3 KiB

!!! info "WSPositionsFeedDataV1" |Name
Lite|Type|Required
Default| Description | |-|-|-|-| |stream
s |string|True|Stream name| |selector
s1 |string|True|Primary selector| |sequence_number
sn |string|True|A sequence number used to determine message order within a stream.
- If useGlobalSequenceNumber is false, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- If useGlobalSequenceNumber is true, this returns the global sequence number, which uniquely identifies messages across the cluster.
- A single cluster payload can be multiplexed into multiple stream payloads.
- To distinguish each stream payload, a dedupCounter is included.
- The returned sequence number is computed as: cluster_sequence_number * 10^5 + dedupCounter.| |feed
f |Positions|True|A Position being created or updated matching the request filter| ??? info "Positions" |Name
Lite|Type|Required
Default| Description | |-|-|-|-| |event_time
et |string|True|Time at which the event was emitted in unix nanoseconds| |sub_account_id
sa |string|True|The sub account ID that participated in the trade| |instrument
i |string|True|The instrument being represented| |size
s |string|True|The size of the position, expressed in base asset decimal units. Negative for short positions| |notional
n |string|True|The notional value of the position, negative for short assets, expressed in quote asset decimal units| |entry_price
ep |string|True|The entry price of the position, expressed in 9 decimals
Whenever increasing the size of a position, the entry price is updated to the new average entry price
new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size)| |exit_price
ep1 |string|True|The exit price of the position, expressed in 9 decimals
Whenever decreasing the size of a position, the exit price is updated to the new average exit price
new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size)| |mark_price
mp |string|True|The mark price of the position, expressed in 9 decimals| |unrealized_pnl
up |string|True|The unrealized PnL of the position, expressed in quote asset decimal units
unrealized_pnl = (mark_price - entry_price) * size| |realized_pnl
rp |string|True|The realized PnL of the position, expressed in quote asset decimal units
realized_pnl = (exit_price - entry_price) * exit_trade_size| |total_pnl
tp |string|True|The total PnL of the position, expressed in quote asset decimal units
total_pnl = realized_pnl + unrealized_pnl| |roi
r |string|True|The ROI of the position, expressed as a percentage
roi = (total_pnl / (entry_price * abs(size))) * 100^| |quote_index_price
qi |string|True|The index price of the quote currency. (reported in USD)| |est_liquidation_price
el |string|True|The estimated liquidation price| |leverage
l |string|True|The current leverage value for this position|