Cryptoq
stores market data from cryptofeed to kdb+
Install / Use
/learn @AlgoTrader5/CryptoqREADME
cryptoq
stores streaming trade and quote data from cryptofeed to kdb+
Requirements:
- python>=3.6
- 32-bit or 64-bit version of kdb+ https://kx.com/connect-with-us/download/
- qpython (python library to interact with q)
- pyzmq
- cryptofeed (stream cryptocurrency market data)
- ccxt (reference data)
Getting Started
Configure the conf/subscriptions.yaml config file with exchange as key and list of products as value. You can use the pre-existing file out of the box. example:
coinbase:
- BTC-USD
- LTC-USD
kraken:
- BTC-USD
- LTC-USD
Or you can use the config ui (still in development):
start_config_ui.bat
<p align="center">
<img src="img/config_ui.PNG">
</p>
In the command prompt, first start q instance specifiying port and load.q file. This file will loads table schemas and functions to the q session.
q.exe q/load.q -p 5002
To see all table names loaded into q session:
q)tables[]
`quotes`refdata`trades
To see all functions loaded into q session:
q)\f
`getCandlestick`getLastTrade`getSymList`jjoin`out`syncmd
In command prompt, change to cryptoq directory and run bin/cryptoq.py script with arguments.
python -m bin.cryptoq --q-port 5002 --kdb-port 5555 --gui-port 5556 --depth 1 --config conf\subscriptions.yaml
or if using Windows:
start_md.bat
In the q window or qpad, you can see trades and quotes data:
q)trades
utc_datetime exch_datetime exch sym side amount price tradeid
---------------------------------------------------------------------------------------------------------------
2019.07.17D22:03:28.561529000 2019.07.17D17:03:24.427000000 COINBASE EOS-USD sell 42.8 3.956 396979
2019.07.17D22:03:28.760387000 2019.07.17D17:03:24.641000000 COINBASE ETH-USD buy 5 215.52 50223672
2019.07.17D22:03:28.762372000 2019.07.17D17:03:24.641000000 COINBASE ETH-USD buy 15.61874 215.53 50223673
2019.07.17D22:03:29.105701000 2019.07.17D17:03:24.987000000 COINBASE ETH-USD buy 5 215.52 50223674
2019.07.17D22:03:29.196769000 2019.07.17D17:03:25.760000000 COINBASE DAI-USDC sell 6.03765 0.992532 147320
2019.07.17D22:03:29.279228000 2019.07.17D17:03:25.152000000 COINBASE BTC-USD sell 0.01056728 9860 70194746
2019.07.17D22:03:30.065150000 2019.07.17D17:03:25.939000000 COINBASE BTC-USD buy 0.05440595 9864.39 70194747
2019.07.17D22:03:30.524360000 2019.07.17D17:03:26.405000000 COINBASE XRP-USD buy 67 0.315 2431849
2019.07.17D22:03:30.704920000 2019.07.17D17:03:26.580000000 COINBASE LTC-BTC sell 1.1969 0.009416 6068676
2019.07.17D22:03:31.379680000 2019.07.17D17:03:27.259000000 COINBASE DAI-USDC sell 22.06721 0.992532 147321
2019.07.17D22:03:32.061706000 2019.07.17D17:03:27.921000000 COINBASE LINK-USD buy 38.8 2.4657 581567
<p align="center">
<img src="img/kdb_quote_table.PNG">
</p>Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
84.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
341.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
