WebSocket API Update - Bitfinex blog
92
post-template-default,single,single-post,postid-92,single-format-standard,bridge-core-3.0.6,et_bloom,qode-page-transition-enabled,ajax_fade,page_not_loaded,,qode-title-hidden,qode_grid_1300,footer_responsive_adv,qode-content-sidebar-responsive,qode-child-theme-ver-1.0.0,qode-theme-ver-29.3,qode-theme-bridge,qode_header_in_grid,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

WebSocket API Update

On 2016/01/25 we will be making an update to the public WebSocket API to add the txid to the WebSocket stream (Please note that this change has been in effect for authenticated channels for about two months).

Currently the message we send for public trades are sent as soon as they match in th trading engine. At this time they do not have a tradeId included, since we want to broadcast the trade in less then 2ms.

We are splitting the public trade messages into two: a “te” message which mimics the current behavior, and a “tu” message which will be delayed by 1-2 seconds and include the tradeId. If the tradeId is important to you, use the “tu” message. If speed is important to you, listen to the “te” message. Or of course use both if you’d like.

Current:

Public Trades Snapshot

[  
  CHANNEL_ID,
  [  
    [  
      SEQ,
      TIMESTAMP,
      PRICE,
      AMOUNT
    ],
    [  
      "..."
    ]
  ]
]

Public Trades Updates

[
  CHANNEL_ID,
  SEQ,
  TIMESTAMP,
  PRICE,
  AMOUNT
]

New:

Public Trades Snapshot

[  
  CHANNEL_ID,
  [  
    [  
      SEQ or ID,
      TIMESTAMP,
      PRICE,
      AMOUNT
    ],
    [  
      "..."
    ]
  ]
]

Public Trades Updates

[
  CHANNEL_ID,
  "te",
  SEQ,
  TIMESTAMP,
  PRICE,
  AMOUNT
]

[
  CHANNEL_ID,
  "tu",
  SEQ,
  ID,
  TIMESTAMP,
  PRICE,
  AMOUNT
]
Tags: