bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 666 forks source link

Fix persisting Kraken trades in QuestDB #1039

Closed carloe closed 1 month ago

carloe commented 1 month ago

This PR fixes an issue (#1038) where inserting Kraken trades into QuestDB would always fail silently.

When TradeQuest persists a Trade it tried to use Trade.id for for the db id field. But the old Kraken websocket does not return trade id's, which means TradeQuest attempts to insert every record with id None. But the QuestDB server will silently ignore any record that have that has it's id set to None.

Since in quest id is not a required field in qdb (actually not sure if this is specific to qdb, or more generally true for the InfluxDB line protocol), this pr only adds the id peoperty to the request if it's not None.

Description of code - what bug does this fix / what feature does this add?