tanX Docupaper
AboutTrade
  • ABOUT
    • 📒tanX Docupaper
  • TECH
    • 👩‍💻Tech Docupaper
      • 🏨High level architecture
      • 🤔Starkware logic
      • 🌊Transactional flow
        • Off-chain accounts
        • The deposit flow
        • The withdrawal flow
        • The trade flow
        • The transfer flow
        • Full withdrawal
    • 🔌API Documentation
      • 😋Getting started
        • Test connectivity
      • 📈Market
        • 24hr Tickers Price
        • K-line/Candlestick data
        • Orderbook
        • Recent trades
      • ↔️Trading
        • Create order
        • Get order
        • List orders
        • Cancel order
        • Bulk Cancel
        • List trades
      • 🔐Account
        • Generating L2 Key Pairs
        • Login
        • Deposit
        • Withdrawal
        • Profile Information
        • Balance details
        • Profit and loss details
      • 🌏Web-socket stream
        • 🗝️Private web-socket connection
        • 👥Public websocket connection
      • ✨Internal Transfer
        • Create Internal Transfer
        • Get Internal Transfer
        • Check User Existence
        • List Internal Transfers
      • 🧪SDK Reference
        • NodeJS SDK
        • Python SDK
  • LEGAL
    • ‼️tanX Disclaimer
Powered by GitBook
On this page
  • URL
  • Subscribe
  • Unsubscribe
  • Available Streams

Was this helpful?

  1. TECH
  2. API Documentation
  3. Web-socket stream

Private web-socket connection

Get real-time info about your trades and orders.

PreviousWeb-socket streamNextPublic websocket connection

Last updated 1 year ago

Was this helpful?

Make use of this private web-socket connection to get real-time information about your personal trades and orders. Please note that this is a Private 🔒 route which means it needs to be authorised by the account initiating this request.

Note: You will need to include the JWT Auth token to request headers to access this endpoint. To get the JWT Auth Token, refer the section of the documentation.

URL

wss://api.tanx.fi/private?auth_header=<JWT Access Token>

Subscribe

{ "event": "subscribe", "streams": ["trade", "order"] }

Unsubscribe

{ "event": "unsubscribe", "streams": ["trade", "order"] }

Available Streams

1. Trade Streams [for trade updates]

Response

{
  "trade": {
    "amount": "0.001",
    "created_at": 1659024869,
    "id": 448640,
    "market": "btcusdc",
    "order_id": 8840859,
    "price": "23829.22",
    "side": "buy",
    "taker_type": "buy",
    "total": "23.82922"
  }
}

2. Order Streams [for order updates]

Response

{
  "order": {
    "at": 1659024868,
    "avg_price": "23829.22",
    "created_at": 1659024868,
    "executed_volume": "0.001",
    "id": 8840859,
    "kind": "bid",
    "market": "btcusdc",
    "ord_type": "limit",
    "origin_volume": "0.001",
    "price": "24000.0",
    "remaining_volume": "0.0",
    "side": "buy",
    "state": "done",
    "trades_count": 1,
    "updated_at": 1659024869
  }
}
🔌
🌏
🗝️
login