Websocket Connection

Important Note:

For all the Websocket endpoints below, pass your profile address.

To track your transactions on-chain (e.g., via Aptos Explorer or Aptos Scan), you must use your profile address, as all on-chain trades are executed using this profile address.

To obtain your profile address, use the /getProfileAddress endpoint and provide your wallet address as the userAddress parameter.

How to Fetch the Profile Address:

Example endpoint: https://perps-tradeapi.kanalabs.io/getProfileAddress?userAddress=0xd01e3a233632a41463bd6d289e99e69e1b50815c7afff710e1c992659a8722f3 Example code: https://docs.kanalabs.io/perpetual-futures/kana-perps/api-docs/kana-perps-typescript-rest-api#id-20.-get-profile-address

How to subscribe websocketURL:

Testnet WebSocket URL

wss://perpetuals-indexer-ws-develop.kanalabs.io/ws/

Mainnet WebSocket URL

wss://perpetuals-indexer-ws.kana.trade/ws/

Connect websocket with URL

  • order_history

{
  "topic": "order_history",
  "address": "{{user_address}}"
}
  • deposit_withdraw_history

  • trade_history

  • positions

  • open_orders

  • orderbook

  • recent_trades

  • live_funding_rate

  • live_order_history (It will update only latest single data)

  • live_trade_history (It will update only latest single data)

  • best_price

send message like and subscribe to websocket

Last updated