Brine's Docupaper
AboutTrade
  • ABOUT
    • ๐Ÿ“’Brine Docupaper
    • ๐Ÿช™Tokenomics
  • ๐Ÿ—ž๏ธBrine Bytes
    • ๐ŸงตOctober Edition
  • 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
        • List trades
      • ๐Ÿ”Account
        • Login
        • 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
  • FOR USERS
    • ๐Ÿ“’User Docuguide
      • ๐Ÿ’ปWeb App
        • Sign up through Metamask
        • Sign up through Wallet Connect
        • Place a Market Order Trade
        • Place a Limit Order Trade
        • Refer Brine to a Friend
        • Deposit with Metamask
        • Withdraw to Metamask
  • LEGAL
    • โ€ผ๏ธ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.

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 login section of the documentation.

URL

wss://api.brine.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
  }
}
PreviousWeb-socket streamNextPublic websocket connection

Last updated 1 year ago

Was this helpful?

๐Ÿ”Œ
๐ŸŒ
๐Ÿ—๏ธ