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

Public websocket connection

Get real-time trades, orderbook and kline data.

Make use of this public web-socket connection in order to get real-time trades, orderbook and K-line data. Please note that this is a Private 🔒 route which means it needs to be authorised by the account initiating this request.

URL

wss://api.tanx.fi/public

Subscribe

{
  "event": "subscribe",
  "streams": ["btcusdc.trades", "btcusdc.ob-inc", "btcusdc.kline-5m"]
}

Unsubscribe

{
  "event": "unsubscribe",
  "streams": ["btcusdc.trades", "btcusdc.ob-inc", "btcusdc.kline-5m"]
}

Available Streams

1. Trade streams - <symbol>.trades

Response

{
  "btcusdc.trades": {
    "trades": [
      {
        "amount": "0.001",
        "date": 1659023778,
        "price": "23935.01",
        "taker_type": "buy",
        "tid": 448639
      }
    ]
  }
}

  
 

2. Orderbook streams - <symbol>.ob-inc

Response for ask

{
  "btcusdc.ob-inc": {
    "asks": ["23707.65", "0.034"],
    "sequence": 393494
  }
} 

Response for bid

{
  "btcusdc.ob-inc": {
    "bids": ["23728.62", ""],
    "sequence": 393575
  }
}

3. Kline/Candlestick streams - <symbol>.kline-<period>

Period options - 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 3d, 1w

Response

{
  "btcusdc.kline-5m": [1659024300, 23935.01, 23935.01, 23935.01, 23935.01, 0]
}

Note : Kline payload item as array of numbers

Example: [1660634520, 0.0839, 0.0921, 0.0781, 0.0845, 0.5895]

  1. Timestamp.

  2. Open price.

  3. Max price.

  4. Min price.

  5. Last price.

  6. Period volume

PreviousPrivate web-socket connectionNextInternal Transfer

Last updated 1 year ago

Was this helpful?

🔌
🌏
👥