Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

WSSfutures.kraken.com/ws/v1open_positions
This subscription feed publishes the open positions of the user account.

Request

event
string
required
subscribe or unsubscribe
feed
string
required
The requested subscription feed. Value: open_positions
api_key
string
required
The user API key.
original_challenge
string
required
The message that is received from a challenge request.
signed_challenge
string
required
The signed challenge message with user API secret.
{
  "event": "subscribe",
  "feed": "open_positions",
  "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
  "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
  "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}

Response Success

event
string
One of: subscribed, subscribed_failed, unsubscribed, unsubscribed_failedThe result.
feed
string
The requested subscription feed. Value: open_positions
api_key
string
The user API key.
original_challenge
string
The message that is received from a challenge request.
signed_challenge
string
The signed challenge message with user API secret.
{
  "event": "subscribed",
  "feed": "open_positions",
  "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
  "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
  "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}

Response Snapshot

feed
string
The subscribed feed.
account
string
The user account.
seq
positive integer
The subscription message sequence number.
timestamp
positive integer
The UTC time in milliseconds.
positions
list of structures
A list containing the user open positions.
{
  "feed": "open_positions",
  "account": "DemoUser",
  "positions": [
    {
      "instrument": "PF_XRPUSD",
      "balance": 500.0,
      "pnl": -239.6506683474764,
      "entry_price": 0.3985,
      "mark_price": 0.4925844,
      "index_price": 0.49756,
      "liquidation_threshold": 0.0,
      "effective_leverage": 0.17404676894304316,
      "return_on_equity": -2.3609636135508127,
      "initial_margin": 101.5054475943615,
      "initial_margin_with_orders": 101.5054475943615,
      "maintenance_margin": 50.75272379718075
    },
    {
      "instrument": "PF_XBTUSD",
      "balance": 0.04,
      "pnl": 119.56244985549435,
      "entry_price": 26911.75,
      "mark_price": 29900.81124638736,
      "index_price": 29900.47,
      "liquidation_threshold": 9572.804662403718,
      "effective_leverage": 0.31865408963748215,
      "return_on_equity": 5.553450159107747,
      "unrealized_funding": 0.0004114160669590132,
      "initial_margin": 21.529400000000003,
      "initial_margin_with_orders": 21.529400000000003,
      "maintenance_margin": 10.764700000000001,
      "pnl_currency": "USD"
    },
    {
      "instrument": "OF_ETHUSD_240101_1000_C",
      "balance": 0.04,
      "pnl": 119.56244985549435,
      "entry_price": 26911.75,
      "mark_price": 29900.81124638736,
      "index_price": 29900.47,
      "return_on_equity": 5.553450159107747,
      "iv": 0.3,
      "delta": 0.5,
      "gamma": 0.5,
      "vega": 0.5,
      "theta": 0.5,
      "rho": 0.5
    }
  ],
  "seq": 4,
  "timestamp": 1687383625330
}

Response Error

event
string
Value: error
message
string
One of: Invalid product id, Invalid feed, Json ErrorAn error message.
{
  "event": "error",
  "message": "Invalid product id"
}