diff --git a/cryptostore.py b/cryptostore.py index e32bdf7..465120e 100644 --- a/cryptostore.py +++ b/cryptostore.py @@ -16,6 +16,8 @@ from cryptofeed.backends.postgres import BookPostgres, TradePostgres, TickerPostgres, FundingPostgres, CandlesPostgres, OpenInterestPostgres, LiquidationsPostgres from cryptofeed.backends.socket import BookSocket, TradeSocket, TickerSocket, FundingSocket, CandlesSocket, OpenInterestSocket, LiquidationsSocket from cryptofeed.backends.influxdb import BookInflux, TradeInflux, TickerInflux, FundingInflux, CandlesInflux, OpenInterestInflux, LiquidationsInflux +from cryptofeed.backends.quest import BookQuest, TradeQuest, TickerQuest, FundingQuest, CandlesQuest, OpenInterestQuest, LiquidationsQuest + async def tty(obj, receipt_ts): # For debugging purposes @@ -105,7 +107,7 @@ def load_config() -> Feed: OPEN_INTEREST: OpenInterestSocket(host, **kwargs), LIQUIDATIONS: LiquidationsSocket(host, **kwargs) } - elif backend in ('INFLUX'): + elif backend == 'INFLUX': args = (host, org, bucket, token) cbs = { L2_BOOK: BookInflux(*args, snapshot_interval=snap_interval, snapshots_only=snap_only), @@ -116,6 +118,17 @@ def load_config() -> Feed: OPEN_INTEREST: OpenInterestInflux(*args), LIQUIDATIONS: LiquidationsInflux(*args) } + elif backend == 'QUEST': + kwargs = {'host': host, 'port': port if port else 9009} + cbs = { + L2_BOOK: BookQuest(**kwargs), + TRADES: TradeQuest(**kwargs), + TICKER: TickerQuest(**kwargs), + FUNDING: FundingQuest(**kwargs), + CANDLES: CandlesQuest(**kwargs), + OPEN_INTEREST: OpenInterestQuest(**kwargs), + LIQUIDATIONS: LiquidationsQuest(**kwargs) + } elif backend == 'TTY': cbs = { L2_BOOK: tty, diff --git a/docs/overview.md b/docs/overview.md index cabd53c..7e88acb 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -11,6 +11,7 @@ Cryptostore utilizes the supported backends of cryptofeed to store data from exc * UDP - `UDP` * UDS - `UDS` * InfluxDB - `INFLUX` +* QuestDB - `QUEST` Cryptostore runs in a docker container, and expects configuration to be provided to it via environment variables. The env vars it utilizes (not all are required for all configurations) are: @@ -21,7 +22,7 @@ Cryptostore runs in a docker container, and expects configuration to be provided * BACKEND - Backend to be used, see list of supported backends above. * SNAPSHOT_ONLY - Valid for orderbook channel only, specifies that only complete books should be stored. Default is False. * SNAPSHOT_INTERVAL - Specifies how often snapshot is stored in terms of number of delta updates between snapshots. Default is 1000. -* HOST - Host for backend. Defaults to localhost. TCP, UDP and UDS require the protocol to be prepended to the host/url. E.g. `tcp://127.0.0.1`, `uds://udsfile.tmp`, etc. +* HOST - Host for backend. Defaults to localhost. TCP, UDP and UDS require the protocol to be prepended to the host/url. E.g. `tcp://127.0.0.1`, `uds://udsfile.tmp`, etc. * PORT - Port for service. Defaults to backend default. * CANDLE_INTERVAL - Used for candles. Default is 1m. * DATABASE - Specify the database for MongoDB or Postgres