2

Using the Bitfinex WebSocket API I am subscribing to trades.

The data I receive looks like this:

  chanId  msgType tradeID   Timestamp      Amount     Price
[ 139260, 'te', [ 73962571, 1507383025000, 97.628437, 0.503 ] ]
[ 139260, 'tu', [ 73962571, 1507383025000, 97.628437, 0.503 ] ]

te = Trade Execution

tu = Trade Execution Update

As stated by the Abbreviations Glossary

What I do not understand is that for the same tradeId I first get a te message and then a moment later a tu message. There is no difference in content of these messages, so what is the purpose of the tu message?

What is the difference between a Trade Execution and a Trade Execution Update?

1

The documentation of the authenticated side of the API from where these orders are created states the following:

After a te message you receive shortly a tu message that contains the real trade id (TRD_ID) and additional/updated fields.

These updated fields are for example fees that are charged afterwards.

Although from the public side of the API this real trade ID is already known and fees are irrelevant. Therefore, the data of the te-message is identical to the tu-message.

So, it seems tu-messages can be ignored.

+

Bitfinex now has it explained at their Bitfinex API module for Node.JS. https://github.com/bitfinexcom/bitfinex-api-node

How do te and tu messages differ?

A te packet is sent first to the client immediately after a trade has been matched & executed, followed by a tu message once it has completed processing. During times of high load, the tu message may be noticably delayed, and as such only the te message should be used for a realtime feed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.