Currently Coinbase Pro isn’t on our roadmap because we aren’t able to reuse the data for tutorials based on their licensing. Instead, we currently use Twelve Data to source our stock and crypto data through their websocket API and we will be providing an example of that process soon as a tutorial on our documentation website.
That said, TimescaleDB is PostgreSQL. Any tutorial you find about using Asyncpg to save data from a websocket into Postgres will work with TimescaleDB. The only difference is that your time-series tables should be created as Hypertables. Assuming you’re using the Coinbase API to pull in trade/tick data, we have a tutorial that was just released which will provide a great foundation for some schema ideas and how to use Continuous Aggregates and compression.
Also, if you come up with a sample and want to start a PR to our docs (or post a link to a Github example here), please feel free to contribute that back too!
Thank you for your message. Yes, I have no problem working with any Websocket api’s.
The examples in your online tutorials are typically for one time data ingestion. For example: downloading data in csv and then uploading in a hyper table.
I am comfortable with creating hyper tables and pushing the data using psycopg2 etc. but I believe we can further performance gain if we use asyncpg instead of the normal ways of creating/destroying connections when connecting to postgres.
I’ve used bare aiohttp as a server but not the websockets module. That said, migrating a streaming aiohttp server from psycopg2 to asyncpg let me cut my kubernetes pod count by around 75% and reduce frontend latency. The binary copy_records_to_table is very good, especially with large batch sizes.
It does and there’s some great stuff to think about there.
For now, we’re going to start with the script we have which uses psycopg2 so that we can make the resource available ASAP for users to start getting data.
However, asyncpg looks really interesting and we’ve already discussed how we can provide some good examples and (maybe) even do some comparisions. We’ll update this thread with any relevant content that we publish over the next few months!