QuoineFinancial / liquid-tap-python

MIT License
4 stars 2 forks source link

Subscribing to created events seems broken and LiquidTap docs likely wrong. #2

Open scherrey opened 4 years ago

scherrey commented 4 years ago

Am using liquid-tap-python to try to subscribe to executions_cash_btcusd events. The docs at https://developers.liquid.com/#public-channels claim I should be subscribing to "updated" events but logging shows that these events come across as "created" events. See the stderr log output: $ python tap.py > data/executions_cash_btcusd.json Connection: Connection opened Connection: ping to pusher Connection: Message - {"data":"{\"activity_timeout\":120,\"socket_id\":\"8544629409.4799544661\"}","event":"pusher:connection_established"} Connection: Sending event - {"event": "pusher:subscribe", "data": {"channel": "executions_cash_btcusd"}} Connection: Message - {"data":"","event":"pusher:pong"} Connection: pong from pusher Connection: Message - {"channel":"executions_cash_btcusd","data":{},"event":"pusher_internal:subscription_succeeded"} Connection: Message - {"channel":"executions_cash_btcusd","data":"{\"created_at\":1578762435,\"id\":248693094,\"price\":8113.295,\"quantity\":0.068,\"taker_side\":\"sell\"}","event":"created"} Connection: Message - {"channel":"executions_cash_btcusd","data":"{\"created_at\":1578762504,\"id\":248693385,\"price\":8113.2492,\"quantity\":0.728,\"taker_side\":\"buy\"}","event":"created"}

However, even though I change the bind to subscribe to 'created' events, my callback function is never called and so even though the log shows events are out there I cannot capture them.

Contrast this to the executions_cash_btcusd channel which does product 'updated' events and subscriptions to same are captured in my callback function. I've attached two versions of the source code to show the difference.

Also - is there any other documentation for what events and channels exist to subscribe to and what their behavior really means? It's difficult to completely understand what the difference is between the semantics of the channels.

executions_cash_btcusd.txt product_cash_btcusd_1.txt

scherrey commented 4 years ago

Update to this issue. After running executions_cash_btcusd for a while, I am getting some events but only a few. Also, I can't see anything about these events that are any different than the events that the library detects and shows in the logs but doesn't execute the callback for. Very strange.

Attached is executions_cash_btcusd.log.txt which shows an execution with a bunch of events logged, and executions_cash_btcusd.json.txt which shows the events that arrive at the callback function (far far fewer than the quantity logged). Strange.

executions_cash_btcusd.json.txt executions_cash_btcusd.log.txt