Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

position

Channelpositionserver → client · type positionUpdates

React to individual position changes (opened, resized, closed).

Subscribe
{
  "method": "subscribe",
  "type": "positionUpdates",
  "subscription": {
    "type": "positionUpdates",
    "user": "0x0000000000000000000000000000000000000000"
  }
}
Try it
WS wss://rpc.txflow-testnet.xyz/ws
Subscription parameters
typestringrequired
"positionUpdates"
userEthAddressrequired

User to follow. Use the account address, not an agent's.

exchangeIdExchangeScopeoptional

Filter by an instrument's configured exchange_id. Same three-state semantics as the HTTP /info ExchangeScope: missing, null, or 0 -> Default (only instruments with no configured exchange_id); the string "all" (case-insensitive) -> All (no filter, every exchange); a positive integer n -> Exchange(n) (only that exchange_id).

oneOf · variant 1
null
oneOf · variant 2
integer
oneOf · variant 3
string
Server message
actionstring

Event that produced this update, e.g. `"Create"`.

channelstring
"position"
closedTimeinteger

Close time, milliseconds. 0 if still open.

createTimeinteger

Position open time, milliseconds.

entryPriceDecimalString

Decimal number encoded as a string to avoid floating-point precision loss.

instrumentIdinteger
leverageinteger
marginDecimalString

Decimal number encoded as a string to avoid floating-point precision loss.

marginModestring

Margin mode: `"Cross"` or `"Isolated"`.

modestring

Position mode: `"OneWay"` or `"Hedge"`.

positionSidestring

"Long" or "Short".

sizeDecimalString

Decimal number encoded as a string to avoid floating-point precision loss.

updateTimeinteger

Last update time, milliseconds.

userEthAddress

Ethereum-style account or token address, 0x-prefixed, 40 hex characters.

fundingSinceChangeDecimalStringnullable

Decimal number encoded as a string to avoid floating-point precision loss.

fundingSinceOpenDecimalStringnullable

Decimal number encoded as a string to avoid floating-point precision loss.

markPriceDecimalStringnullable

Decimal number encoded as a string to avoid floating-point precision loss.

Message example
{
  "channel": "position",
  "user": "0x0000000000000000000000000000000000000000",
  "instrumentId": 1,
  "mode": "OneWay",
  "marginMode": "Cross",
  "positionSide": "Long",
  "action": "Create",
  "createTime": 1791895804242,
  "updateTime": 1791895804242,
  "closedTime": 0,
  "size": "0.0010",
  "leverage": 10,
  "margin": "0.000000",
  "entryPrice": "83227.1",
  "markPrice": "83241.4"
}