API Reference

This endpoint establises a json rpc websocket connection with your client

Staging: wss://stream.staging.rysk.finance/
Prod: wss://stream.rysk.finance/

You can then subscribe/unsubscribe to events by sending requests with SUBSCRIBE or UNSUBSCRIBE method and any of the following event types:

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: [List of event types]
}
  

Aggregated Trades

An aggregate trade (aggTrade) represents one or more individual trades. Trades that fill at the same time, from the same taker order.

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: ["{productSymbol}@aggTrade"]
}

Example

{
  "id": "ethperp@aggTrade",
  "success": true,
  "result": {
    "trades": [
      {
        "productId": 1002,
        "takerId": "0x6604a08da565081fe9a51e716abd6cb511aaead03c8ef83a58ce635bd35bb6f35c8c4d351583ba250f856b08508a807f7884b5ad49be9f53312bd07e5c0ba6b41b",
        "takerAccount": "0x6099167AdEdeFd0e69da87a803E8085590da774E",
        "takerSubaccount": 1,
        "makerId": "0x6604a08da565081fe9a51e716abd6cb511aaead03c8ef83a58ce635bd35bb6f35c8c4d351583ba250f856b08508a807f7884b5ad49be9f53312bd07e5c0ba6b41b",
        "makerAccount": "0x6099167AdEdeFd0e69da87a803E8085590da774E",
        "makerSubaccount": 1,
        "price": "123000000000000000000",
        "quantity": "13000000000000000",
        "takerIsBuyer": true,
        "cumFunding": null,
        "timestamp": 1715844840429,
      }
    ],
    "taker": "0x6099167AdEdeFd0e69da87a803E8085590da774E",
    "makers": [
      "0x5e9870d10831a79106af60a947a076851b05ccd9"
    ]
  }
}

Single Trades

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: ["{productSymbol}@trade"]
}

Example

{
  "id": "ethperp@trade",
  "success": true,
  "result": {
    "productId": 1002,
    "takerId": "0x6604a08da565081fe9a51e716abd6cb511aaead03c8ef83a58ce635bd35bb6f35c8c4d351583ba250f856b08508a807f7884b5ad49be9f53312bd07e5c0ba6b41b",
    "takerAccount": "0x6099167AdEdeFd0e69da87a803E8085590da774E",
    "takerSubaccount": 1,
    "makerId": "0x6604a08da565081fe9a51e716abd6cb511aaead03c8ef83a58ce635bd35bb6f35c8c4d351583ba250f856b08508a807f7884b5ad49be9f53312bd07e5c0ba6b41b",
    "makerAccount": "0x6099167AdEdeFd0e69da87a803E8085590da774E",
    "makerSubaccount": 1,
    "price": "123000000000000000000",
    "quantity": "120000000000000000",
    "takerIsBuyer": true,
    "cumFunding": "123000000000000000000",
    "timestamp": 1715844840429,
  }
}

Klines/candlesticks

The Kline/Candlestick Stream push updates to the current klines/candlestick every second.

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: ["{productSymbol}@klines_{1m|5m|15m|30m|1h|2h|4h|8h|1d|3d|1w}"]
}

Partial Book Depth Streams

Pushed every second, top {limit} bids and asks.

Valid values for limit are 5, 10, or 20.

Prices are rounded by 1e{granularity}.

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: ["{productSymbol}@depth{limit}_{granularity}"]
}

Example

{
  "id": "ethperp@depth10_16",
  "success": true,
  "result": {
    "bids": [
      [
        "4002600000000000000000",
        "10000000000000000",
        "10000000000000000"
      ],
      [
        "3999500000000000000000",
        "20000000000000000",
        "30000000000000000"
      ],
      [
        "3995500000000000000000",
        "20000000000000000",
        "50000000000000000"
      ],
      [
        "3990300000000000000000",
        "30000000000000000",
        "80000000000000000"
      ],
      [
        "3988200000000000000000",
        "20000000000000000",
        "100000000000000000"
      ],
      [
        "3987700000000000000000",
        "190000000000000000",
        "290000000000000000"
      ],
      [
        "3987600000000000000000",
        "170000000000000000",
        "460000000000000000"
      ],
      [
        "3987500000000000000000",
        "80000000000000000",
        "540000000000000000"
      ],
      [
        "3987400000000000000000",
        "240000000000000000",
        "780000000000000000"
      ],
      [
        "3987300000000000000000",
        "140000000000000000",
        "920000000000000000"
      ]
    ],
    "asks": [
      [
        "4004200000000000000000",
        "10000000000000000",
        "10000000000000000"
      ],
      [
        "4004900000000000000000",
        "10000000000000000",
        "20000000000000000"
      ],
      [
        "4005000000000000000000",
        "40000000000000000",
        "60000000000000000"
      ],
      [
        "4006700000000000000000",
        "10000000000000000",
        "70000000000000000"
      ],
      [
        "4007100000000000000000",
        "10000000000000000",
        "80000000000000000"
      ],
      [
        "4009700000000000000000",
        "10000000000000000",
        "90000000000000000"
      ],
      [
        "4010000000000000000000",
        "60000000000000000",
        "150000000000000000"
      ],
      [
        "4010200000000000000000",
        "140000000000000000",
        "290000000000000000"
      ],
      [
        "4010400000000000000000",
        "50000000000000000",
        "340000000000000000"
      ],
      [
        "4010500000000000000000",
        "60000000000000000",
        "400000000000000000"
      ]
    ],
    "timestamp": 1715844840429,
  }
}

24hr Mini-Ticker Price Change Statistics

24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Pushed out every 5s.

{
  jsonrpc: "2.0",
  id:     "some random id",
  method: "SUBSCRIBE" | "UNSUBSCRIBE",
  params: ["{productSymbol}@ticker"]
}

Example

{
  "id": "ethperp@ticker",
  "success": true,
  "result": {
    "productId": 1002,
    "productSymbol": "ethperp",
    "oraclePrice": "3978088750186933554423",
    "markPrice": "3999407724665514174215",
    "priceChange": "4013000000000000000000",
    "priceChangePercent": "1000000000000000000", // e18 based
    "volume": "133790000000000000000",
    "low": "0",
    "high": "4013000000000000000000",
    "fundingRateHourly": "82395299287459700",
    "fundingRateYearly": "722277193553871730200",
    "openInterest": "0",
    "nextFundingTime": 0
  }
}