Reference

Position events+

Premium

Every fill in its position-lifecycle context, tagged with the position it belongs to and what it did to it (open, increase, decrease, close, liquidation). Search the history over REST, or stream fills live over WebSocket with the same fields (delivery is best-effort; the REST endpoints remain the durable source of truth). A position's own fill timeline is under Positions.

Position event stream

Premium
WSS
Stream fills as they land, each tagged with the position_id the REST surface exposes. The scope is the URL, so watching several scopes means opening several connections.
Headers
x-api-keystringrequired
API key sent in the WebSocket upgrade header; never accepted as a query parameter.
Query parameters
marketstring
Optionally filter the stream to a market symbol or protocol-native market variant, when available.
addressstring
Optionally filter the stream to an owner address; combining filters returns their intersection.
typestring
Deliver only these event types, comma-separated: open, increase, decrease, close, liquidation. Combines with market and address. Omit for all.
Connection limits
Concurrent connections per account
50
Response
101
{ data: PositionEvent }
Request
websocat
websocat -H 'x-api-key: ak_...' \
  'wss://api.perpdb.xyz/v1/stream/gmtrade/position-events?market=SOL'
Example
{
  "data": {
    "protocol": "gmtrade",
    "position_id": 4821937,
    "market": "SOL",
    "market_variant": "SOL/USD[WSOL-USDC]",
    "address": "7NfgSkEcRr3FBixjD5cJTmb4kAV8Y6DAxNvbLnk3S9pE",
    "side": "long",
    "type": "increase",
    "time": "2026-08-09T14:32:07.184Z",
    "size_delta_usd": 2500,
    "position_size_usd": 7500,
    "collateral_delta_usd": 500,
    "price": 168.42,
    "entry_price": 165.87,
    "pnl_delta_usd": 0,
    "fee_usd": 1.5,
    "borrowing_fee_usd": 0.22,
    "funding_fee_usd": 0.08,
    "liquidation_fee_usd": null,
    "fee_total_usd": 1.8,
    "trade_id": 918273,
    "tx": "3QzUyfWvYcJ8gV1kM5xTn9rBq2eL6hPdS4mKjNwEbAtCgRfXhZs7DqoJp8uWvYcLkM5xTn9rBq2eL6hPdS4mKjNw"
  }
}