altangent / ccxws

WebSocket client for 38 cryptocurrency exchanges
MIT License
619 stars 187 forks source link

Gemini appears to use incorrect sequenceId #240

Closed evan-coygo closed 3 years ago

evan-coygo commented 3 years ago

Gemini is using the eventId property as the sequenceId but it looks like it should be using socket_sequence instead.

The docs say

socket_sequence : integer : zero-indexed monotonic increasing sequence number attached to each message sent - if there is a gap in this sequence, you have missed a message. See Sequence Numbers for more information.

I subscribed to l2 updates and logged the eventId and socket_sequence to demonstrate.

{ socket_sequence: 0, eventId: 18670485960 }
{ socket_sequence: 1, eventId: 18670486399 }
{ socket_sequence: 2, eventId: 18670486521 }
{ socket_sequence: 3, eventId: 18670486564 }
{ socket_sequence: 4, eventId: 18670486602 }
{ socket_sequence: 5, eventId: 18670486643 }
{ socket_sequence: 6, eventId: 18670486657 }
{ socket_sequence: 7, eventId: 18670486669 }
{ socket_sequence: 8, eventId: 18670486755 }
{ socket_sequence: 9, eventId: 18670486845 }

If the purpose of sequenceId is for detecting lost/incorrect order book data as it is for most other exchanges I think socket_sequence should be used here