timestamp stringdate 2024-12-18 04:19:09 2024-12-18 05:11:42 | pair stringclasses 9 values | price float64 0.38 104k | volume float64 431 9.31M | bid float64 0.38 104k | ask float64 0.38 104k | low float64 0.38 104k | high float64 0.4 106k | vwap float64 0.39 105k | trades int64 232 11.7k |
|---|---|---|---|---|---|---|---|---|---|
2024-12-18 04:19:09 | XXBTZUSD | 104,328.1 | 431.453939 | 104,320.7 | 104,320.8 | 104,200 | 106,489.3 | 105,162.17747 | 9,104 |
2024-12-18 04:19:09 | XETHZUSD | 3,843.46 | 2,900.404485 | 3,843.45 | 3,843.46 | 3,837.79 | 3,903.21 | 3,866.28364 | 3,295 |
2024-12-18 04:19:10 | XXRPZUSD | 2.50856 | 5,905,364.953693 | 2.50923 | 2.50924 | 2.5 | 2.59 | 2.547249 | 9,183 |
2024-12-18 04:19:10 | ADAUSD | 1.02769 | 3,168,867.957715 | 1.027803 | 1.0281 | 1.025045 | 1.060144 | 1.039812 | 2,646 |
2024-12-18 04:19:10 | XDGUSD | 0.388737 | 6,650,920.218939 | 0.388737 | 0.388738 | 0.387804 | 0.396055 | 0.391117 | 2,641 |
2024-12-18 04:19:10 | SOLUSD | 217.51 | 41,076.836375 | 217.51 | 217.52 | 216.54 | 225.89 | 220.97821 | 6,878 |
2024-12-18 04:19:10 | DOTUSD | 8.3215 | 93,347.599736 | 8.3196 | 8.3197 | 8.2858 | 8.5382 | 8.42541 | 1,802 |
2024-12-18 04:19:11 | MATICUSD | 0.5541 | 285,800.34673 | 0.5539 | 0.5546 | 0.5514 | 0.5674 | 0.561338 | 232 |
2024-12-18 04:19:11 | LTCUSD | 123.48 | 8,509.420538 | 123.44 | 123.51 | 122.93 | 129.04 | 126.37899 | 3,101 |
2024-12-18 04:19:13 | XXBTZUSD | 104,340 | 431.463524 | 104,350 | 104,350.1 | 104,200 | 106,489.3 | 105,162.15903 | 9,116 |
2024-12-18 04:19:13 | XETHZUSD | 3,844.47 | 2,902.416085 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26852 | 3,298 |
2024-12-18 04:19:13 | XXRPZUSD | 2.5095 | 5,905,370.463769 | 2.50949 | 2.5095 | 2.5 | 2.59 | 2.547249 | 9,185 |
2024-12-18 04:19:13 | ADAUSD | 1.0281 | 3,168,981.440442 | 1.028615 | 1.0287 | 1.025045 | 1.060144 | 1.039811 | 2,648 |
2024-12-18 04:19:14 | XDGUSD | 0.388738 | 6,650,934.131329 | 0.388837 | 0.388837 | 0.387804 | 0.396055 | 0.391117 | 2,642 |
2024-12-18 04:19:14 | SOLUSD | 217.6 | 41,084.523852 | 217.6 | 217.61 | 216.54 | 225.89 | 220.97756 | 6,885 |
2024-12-18 04:19:14 | DOTUSD | 8.3229 | 93,356.571594 | 8.3243 | 8.3244 | 8.2858 | 8.5382 | 8.4254 | 1,804 |
2024-12-18 04:19:14 | MATICUSD | 0.5541 | 285,800.34673 | 0.554 | 0.5546 | 0.5514 | 0.5674 | 0.561338 | 232 |
2024-12-18 04:19:14 | LTCUSD | 123.48 | 8,509.420538 | 123.5 | 123.54 | 122.93 | 129.04 | 126.37899 | 3,101 |
2024-12-18 04:19:16 | XXBTZUSD | 104,340 | 431.463524 | 104,350 | 104,350.1 | 104,200 | 106,489.3 | 105,162.15903 | 9,116 |
2024-12-18 04:19:17 | XETHZUSD | 3,844.47 | 2,902.416085 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26852 | 3,298 |
2024-12-18 04:19:17 | XXRPZUSD | 2.51101 | 5,905,399.487536 | 2.51167 | 2.51168 | 2.5 | 2.59 | 2.547249 | 9,190 |
2024-12-18 04:19:17 | ADAUSD | 1.02919 | 3,169,208.218272 | 1.029453 | 1.02969 | 1.025045 | 1.060144 | 1.03981 | 2,652 |
2024-12-18 04:19:17 | XDGUSD | 0.388872 | 6,667,433.049122 | 0.388939 | 0.388939 | 0.387804 | 0.396055 | 0.391112 | 2,656 |
2024-12-18 04:19:17 | SOLUSD | 217.68 | 41,085.653002 | 217.68 | 217.69 | 216.54 | 225.89 | 220.97747 | 6,891 |
2024-12-18 04:19:18 | DOTUSD | 8.3256 | 93,363.638576 | 8.3336 | 8.3387 | 8.2858 | 8.5382 | 8.42539 | 1,806 |
2024-12-18 04:19:18 | MATICUSD | 0.5544 | 292,649.629743 | 0.5544 | 0.5553 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:18 | LTCUSD | 123.61 | 8,521.900303 | 123.63 | 123.64 | 122.93 | 129.04 | 126.37494 | 3,108 |
2024-12-18 04:19:20 | XXBTZUSD | 104,380 | 431.470225 | 104,379.9 | 104,380 | 104,200 | 106,489.3 | 105,162.14671 | 9,124 |
2024-12-18 04:19:20 | XETHZUSD | 3,844.47 | 2,902.416085 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26852 | 3,298 |
2024-12-18 04:19:20 | XXRPZUSD | 2.51365 | 5,907,075.534306 | 2.51319 | 2.51353 | 2.5 | 2.59 | 2.547239 | 9,197 |
2024-12-18 04:19:21 | ADAUSD | 1.02969 | 3,169,321.524526 | 1.029899 | 1.03 | 1.025045 | 1.060144 | 1.03981 | 2,654 |
2024-12-18 04:19:21 | XDGUSD | 0.389021 | 6,667,763.838601 | 0.38904 | 0.38904 | 0.387804 | 0.396055 | 0.391112 | 2,660 |
2024-12-18 04:19:21 | SOLUSD | 217.72 | 41,085.867986 | 217.81 | 217.82 | 216.54 | 225.89 | 220.97746 | 6,893 |
2024-12-18 04:19:21 | DOTUSD | 8.3256 | 93,363.638576 | 8.337 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,806 |
2024-12-18 04:19:21 | MATICUSD | 0.5544 | 292,649.629743 | 0.5546 | 0.5549 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:21 | LTCUSD | 123.61 | 8,521.900303 | 123.63 | 123.64 | 122.93 | 129.04 | 126.37494 | 3,108 |
2024-12-18 04:19:24 | XXBTZUSD | 104,380 | 431.472562 | 104,383.4 | 104,383.5 | 104,200 | 106,489.3 | 105,162.14247 | 9,125 |
2024-12-18 04:19:24 | XETHZUSD | 3,844.48 | 2,902.420585 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26848 | 3,299 |
2024-12-18 04:19:24 | XXRPZUSD | 2.51427 | 5,940,517.968261 | 2.51309 | 2.51344 | 2.5 | 2.59 | 2.547053 | 9,215 |
2024-12-18 04:19:24 | ADAUSD | 1.02969 | 3,169,321.524526 | 1.029802 | 1.03 | 1.025045 | 1.060144 | 1.03981 | 2,654 |
2024-12-18 04:19:24 | XDGUSD | 0.38904 | 6,667,829.270503 | 0.389065 | 0.389065 | 0.387804 | 0.396055 | 0.391112 | 2,661 |
2024-12-18 04:19:25 | SOLUSD | 217.81 | 41,124.967986 | 217.78 | 217.82 | 216.54 | 225.89 | 220.97444 | 6,896 |
2024-12-18 04:19:25 | DOTUSD | 8.3256 | 93,363.638576 | 8.3374 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,806 |
2024-12-18 04:19:25 | MATICUSD | 0.5544 | 292,649.629743 | 0.5546 | 0.5553 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:25 | LTCUSD | 123.61 | 8,521.900303 | 123.63 | 123.64 | 122.93 | 129.04 | 126.37494 | 3,108 |
2024-12-18 04:19:27 | XXBTZUSD | 104,380 | 431.472562 | 104,383.4 | 104,383.5 | 104,200 | 106,489.3 | 105,162.14247 | 9,125 |
2024-12-18 04:19:27 | XETHZUSD | 3,844.48 | 2,902.420585 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26848 | 3,299 |
2024-12-18 04:19:28 | XXRPZUSD | 2.51337 | 5,940,537.34965 | 2.51403 | 2.51404 | 2.5 | 2.59 | 2.547052 | 9,217 |
2024-12-18 04:19:28 | ADAUSD | 1.03 | 3,173,863.386546 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039796 | 2,657 |
2024-12-18 04:19:28 | XDGUSD | 0.38904 | 6,667,829.270503 | 0.389065 | 0.389065 | 0.387804 | 0.396055 | 0.391112 | 2,661 |
2024-12-18 04:19:28 | SOLUSD | 217.8 | 41,124.990336 | 217.78 | 217.79 | 216.54 | 225.89 | 220.97444 | 6,897 |
2024-12-18 04:19:28 | DOTUSD | 8.3256 | 93,363.638576 | 8.3387 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,806 |
2024-12-18 04:19:29 | MATICUSD | 0.5544 | 292,649.629743 | 0.5546 | 0.5551 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:29 | LTCUSD | 123.72 | 8,522.690369 | 123.73 | 123.77 | 122.93 | 129.04 | 126.37469 | 3,112 |
2024-12-18 04:19:31 | XXBTZUSD | 104,380 | 431.472562 | 104,383.4 | 104,383.5 | 104,200 | 106,489.3 | 105,162.14247 | 9,125 |
2024-12-18 04:19:31 | XETHZUSD | 3,844.48 | 2,902.420585 | 3,844.47 | 3,844.48 | 3,837.79 | 3,903.21 | 3,866.26848 | 3,299 |
2024-12-18 04:19:31 | XXRPZUSD | 2.51337 | 5,940,537.34965 | 2.51391 | 2.51402 | 2.5 | 2.59 | 2.547052 | 9,217 |
2024-12-18 04:19:31 | ADAUSD | 1.03 | 3,174,725.034868 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039793 | 2,658 |
2024-12-18 04:19:31 | XDGUSD | 0.38904 | 6,667,829.270503 | 0.389065 | 0.389065 | 0.387804 | 0.396055 | 0.391112 | 2,661 |
2024-12-18 04:19:32 | SOLUSD | 217.8 | 41,124.990336 | 217.76 | 217.79 | 216.54 | 225.89 | 220.97444 | 6,897 |
2024-12-18 04:19:32 | DOTUSD | 8.3387 | 93,364.638576 | 8.3387 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,807 |
2024-12-18 04:19:32 | MATICUSD | 0.5544 | 292,649.629743 | 0.5545 | 0.5552 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:32 | LTCUSD | 123.72 | 8,522.690369 | 123.67 | 123.73 | 122.93 | 129.04 | 126.37469 | 3,112 |
2024-12-18 04:19:34 | XXBTZUSD | 104,383.4 | 431.472971 | 104,383.4 | 104,383.5 | 104,200 | 106,489.3 | 105,162.14173 | 9,126 |
2024-12-18 04:19:34 | XETHZUSD | 3,845.12 | 2,902.423815 | 3,845.7 | 3,845.71 | 3,837.79 | 3,903.21 | 3,866.26846 | 3,301 |
2024-12-18 04:19:34 | XXRPZUSD | 2.51337 | 5,940,537.34965 | 2.51403 | 2.51404 | 2.5 | 2.59 | 2.547052 | 9,217 |
2024-12-18 04:19:35 | ADAUSD | 1.03 | 3,179,315.518019 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039779 | 2,661 |
2024-12-18 04:19:35 | XDGUSD | 0.38904 | 6,667,829.270503 | 0.389065 | 0.389065 | 0.387804 | 0.396055 | 0.391112 | 2,661 |
2024-12-18 04:19:35 | SOLUSD | 217.8 | 41,124.990336 | 217.8 | 217.82 | 216.54 | 225.89 | 220.97444 | 6,897 |
2024-12-18 04:19:35 | DOTUSD | 8.3387 | 93,364.638576 | 8.3387 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,807 |
2024-12-18 04:19:35 | MATICUSD | 0.5544 | 292,649.629743 | 0.5547 | 0.5551 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:35 | LTCUSD | 123.72 | 8,522.690369 | 123.68 | 123.75 | 122.93 | 129.04 | 126.37469 | 3,112 |
2024-12-18 04:19:37 | XXBTZUSD | 104,383.5 | 431.475106 | 104,383.4 | 104,383.5 | 104,200 | 106,489.3 | 105,162.13788 | 9,130 |
2024-12-18 04:19:37 | XETHZUSD | 3,845.12 | 2,902.423815 | 3,845.7 | 3,845.71 | 3,837.79 | 3,903.21 | 3,866.26846 | 3,301 |
2024-12-18 04:19:38 | XXRPZUSD | 2.51445 | 5,940,595.28429 | 2.51444 | 2.51445 | 2.5 | 2.59 | 2.547052 | 9,220 |
2024-12-18 04:19:38 | ADAUSD | 1.03 | 3,184,185.153131 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039764 | 2,664 |
2024-12-18 04:19:38 | XDGUSD | 0.38904 | 6,667,829.270503 | 0.389065 | 0.389065 | 0.387804 | 0.396055 | 0.391112 | 2,661 |
2024-12-18 04:19:38 | SOLUSD | 217.8 | 41,124.990336 | 217.79 | 217.81 | 216.54 | 225.89 | 220.97444 | 6,897 |
2024-12-18 04:19:38 | DOTUSD | 8.3387 | 93,364.638576 | 8.3387 | 8.3388 | 8.2858 | 8.5382 | 8.42539 | 1,807 |
2024-12-18 04:19:38 | MATICUSD | 0.5544 | 292,649.629743 | 0.5547 | 0.5552 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:39 | LTCUSD | 123.77 | 8,523.176257 | 123.73 | 123.78 | 122.93 | 129.04 | 126.37454 | 3,115 |
2024-12-18 04:19:41 | XXBTZUSD | 104,394.6 | 431.495106 | 104,394.5 | 104,394.6 | 104,200 | 106,489.3 | 105,162.10231 | 9,134 |
2024-12-18 04:19:41 | XETHZUSD | 3,847.03 | 2,904.079992 | 3,847.02 | 3,847.03 | 3,837.79 | 3,903.21 | 3,866.25676 | 3,317 |
2024-12-18 04:19:41 | XXRPZUSD | 2.51507 | 5,940,625.17904 | 2.51506 | 2.51507 | 2.5 | 2.59 | 2.547052 | 9,222 |
2024-12-18 04:19:41 | ADAUSD | 1.03 | 3,213,119.14288 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039676 | 2,681 |
2024-12-18 04:19:42 | XDGUSD | 0.389065 | 6,671,347.707316 | 0.389221 | 0.389221 | 0.387804 | 0.396055 | 0.39111 | 2,664 |
2024-12-18 04:19:42 | SOLUSD | 217.82 | 41,125.082159 | 217.81 | 217.82 | 216.54 | 225.89 | 220.97444 | 6,898 |
2024-12-18 04:19:42 | DOTUSD | 8.3444 | 93,393.801566 | 8.345 | 8.3451 | 8.2858 | 8.5382 | 8.42536 | 1,817 |
2024-12-18 04:19:42 | MATICUSD | 0.5544 | 292,649.629743 | 0.5545 | 0.5555 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:42 | LTCUSD | 123.77 | 8,523.176257 | 123.77 | 123.78 | 122.93 | 129.04 | 126.37454 | 3,115 |
2024-12-18 04:19:44 | XXBTZUSD | 104,394.5 | 431.613036 | 104,394.5 | 104,394.6 | 104,200 | 106,489.3 | 105,161.89257 | 9,136 |
2024-12-18 04:19:44 | XETHZUSD | 3,847.03 | 2,904.079992 | 3,847.02 | 3,847.03 | 3,837.79 | 3,903.21 | 3,866.25676 | 3,317 |
2024-12-18 04:19:45 | XXRPZUSD | 2.51506 | 5,941,339.657109 | 2.51506 | 2.51507 | 2.5 | 2.59 | 2.547048 | 9,223 |
2024-12-18 04:19:45 | ADAUSD | 1.03 | 3,224,837.675967 | 1.029999 | 1.03 | 1.025045 | 1.060144 | 1.039641 | 2,686 |
2024-12-18 04:19:45 | XDGUSD | 0.389231 | 6,671,457.624919 | 0.389245 | 0.389245 | 0.387804 | 0.396055 | 0.39111 | 2,666 |
2024-12-18 04:19:45 | SOLUSD | 217.82 | 41,125.105116 | 217.81 | 217.82 | 216.54 | 225.89 | 220.97443 | 6,899 |
2024-12-18 04:19:45 | DOTUSD | 8.3451 | 93,396.48635 | 8.3475 | 8.3513 | 8.2858 | 8.5382 | 8.42536 | 1,818 |
2024-12-18 04:19:45 | MATICUSD | 0.5544 | 292,649.629743 | 0.5547 | 0.5555 | 0.5514 | 0.5674 | 0.561177 | 234 |
2024-12-18 04:19:45 | LTCUSD | 123.77 | 8,523.176257 | 123.77 | 123.78 | 122.93 | 129.04 | 126.37454 | 3,115 |
2024-12-18 04:19:47 | XXBTZUSD | 104,394.5 | 431.613249 | 104,394.5 | 104,394.6 | 104,200 | 106,489.3 | 105,161.89219 | 9,137 |
π Kraken Trading Data Collection
Overview
High-frequency cryptocurrency market data from Kraken exchange - perfect for algorithmic trading, time-series forecasting, and market microstructure analysis.
This dataset includes real-time price, volume, and order book data for 9 major cryptocurrency trading pairs, collected via WebSocket streaming and REST API polling.
π Included Trading Pairs
| Pair | Asset | Base Currency | Typical Daily Volume |
|---|---|---|---|
XXBTZUSD |
Bitcoin | USD | $500M - $2B |
XETHZUSD |
Ethereum | USD | $200M - $800M |
XXRPZUSD |
Ripple (XRP) | USD | $50M - $200M |
ADAUSD |
Cardano | USD | $30M - $150M |
DOGEUSD |
Dogecoin | USD | $40M - $300M |
BNBUSD |
Binance Coin | USD | $20M - $100M |
SOLUSD |
Solana | USD | $100M - $400M |
DOTUSD |
Polkadot | USD | $15M - $80M |
MATICUSD |
Polygon | USD | $20M - $100M |
LTCUSD |
Litecoin | USD | $30M - $150M |
π― Use Cases
1. Algorithmic Trading
- Backtesting strategies - Test mean reversion, momentum, arbitrage
- Order book analysis - Study bid-ask spreads, depth, liquidity
- Market making - Identify optimal quote placement
- High-frequency trading - Sub-second price movements
2. Time-Series Forecasting
- Price prediction - LSTM, Transformer, ARIMA models
- Volatility modeling - GARCH, stochastic volatility
- Regime detection - Bull/bear market classification
- Anomaly detection - Flash crashes, wash trading, manipulation
3. Market Microstructure Research
- Bid-ask spread dynamics - How does liquidity evolve?
- Order flow imbalance - Predict short-term price movements
- Trade execution analysis - Optimal execution strategies (TWAP, VWAP)
- Cross-exchange arbitrage - Price discrepancies with Binance, Coinbase
4. Risk Management
- Value at Risk (VaR) - Estimate portfolio risk
- Correlation analysis - How do crypto assets move together?
- Drawdown modeling - Maximum loss scenarios
- Liquidity risk - Can you exit positions without slippage?
π Dataset Structure
kraken-trading-data/
βββ trades/ # Individual trade executions
β βββ XXBTZUSD_trades_2024-01.csv
β βββ XETHZUSD_trades_2024-01.csv
β βββ ...
βββ ohlcv/ # OHLCV candlestick data (1min, 5min, 1h, 1d)
β βββ XXBTZUSD_1min.csv
β βββ XXBTZUSD_5min.csv
β βββ ...
βββ orderbook/ # Limit order book snapshots
β βββ XXBTZUSD_orderbook_2024-01.csv
β βββ ...
βββ metadata.json # Collection timestamps, pair info
βββ README.md
Data Fields
Trades (trades/)
| Field | Type | Description |
|---|---|---|
timestamp |
int64 | Unix timestamp (milliseconds) |
price |
float64 | Execution price (USD) |
volume |
float64 | Trade volume (asset units) |
side |
str | buy or sell (taker side) |
trade_id |
str | Unique trade identifier |
OHLCV (ohlcv/)
| Field | Type | Description |
|---|---|---|
timestamp |
int64 | Candle open time (Unix ms) |
open |
float64 | Opening price |
high |
float64 | Highest price in period |
low |
float64 | Lowest price in period |
close |
float64 | Closing price |
volume |
float64 | Total volume traded |
trade_count |
int32 | Number of trades |
Order Book (orderbook/)
| Field | Type | Description |
|---|---|---|
timestamp |
int64 | Snapshot time (Unix ms) |
side |
str | bid or ask |
price |
float64 | Limit order price |
volume |
float64 | Volume available at price level |
cumulative_volume |
float64 | Cumulative depth |
π Quick Start
Load the Dataset
from datasets import load_dataset
dataset = load_dataset("GotThatData/kraken-trading-data")
Example: Load Bitcoin Trades
import pandas as pd
# Load Bitcoin trades for January 2024
df = pd.read_csv("hf://datasets/GotThatData/kraken-trading-data/trades/XXBTZUSD_trades_2024-01.csv")
# Convert timestamp to datetime
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
# Set as index
df = df.set_index('timestamp')
# Display first rows
print(df.head())
Output:
price volume side trade_id
timestamp
2024-01-01 00:00:01.234 42150.5 0.025000 buy 1704067201234-1
2024-01-01 00:00:01.567 42149.8 0.100000 sell 1704067201567-2
...
Example: Resample to 1-Hour OHLCV
# Resample trades to hourly candles
ohlcv = df.resample('1H').agg({
'price': ['first', 'max', 'min', 'last'],
'volume': 'sum',
'trade_id': 'count'
})
# Flatten column names
ohlcv.columns = ['open', 'high', 'low', 'close', 'volume', 'trade_count']
print(ohlcv.head())
Example: Calculate Moving Average Crossover
import matplotlib.pyplot as plt
# Load 1-minute OHLCV
df = pd.read_csv("hf://datasets/GotThatData/kraken-trading-data/ohlcv/XXBTZUSD_1min.csv")
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
df = df.set_index('timestamp')
# Calculate moving averages
df['MA_20'] = df['close'].rolling(window=20).mean()
df['MA_50'] = df['close'].rolling(window=50).mean()
# Plot
plt.figure(figsize=(14, 7))
plt.plot(df['close'], label='BTC Price', alpha=0.5)
plt.plot(df['MA_20'], label='20-period MA')
plt.plot(df['MA_50'], label='50-period MA')
plt.legend()
plt.title('Bitcoin Price with Moving Averages')
plt.show()
Example: Order Book Visualization
import seaborn as sns
# Load order book snapshot
ob = pd.read_csv("hf://datasets/GotThatData/kraken-trading-data/orderbook/XXBTZUSD_orderbook_2024-01.csv")
# Filter for a specific timestamp
snapshot = ob[ob['timestamp'] == ob['timestamp'].iloc[0]]
# Separate bids and asks
bids = snapshot[snapshot['side'] == 'bid'].sort_values('price', ascending=False)
asks = snapshot[snapshot['side'] == 'ask'].sort_values('price')
# Plot depth chart
plt.figure(figsize=(12, 6))
plt.step(bids['price'], bids['cumulative_volume'], where='pre', label='Bids', color='green')
plt.step(asks['price'], asks['cumulative_volume'], where='post', label='Asks', color='red')
plt.xlabel('Price (USD)')
plt.ylabel('Cumulative Volume (BTC)')
plt.title('BTC/USD Order Book Depth')
plt.legend()
plt.show()
π Sample Analysis: Predict Next-Hour Price Movement
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
# Load hourly OHLCV
df = pd.read_csv("hf://datasets/GotThatData/kraken-trading-data/ohlcv/XXBTZUSD_1h.csv")
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
df = df.set_index('timestamp')
# Feature engineering
df['returns'] = df['close'].pct_change()
df['volatility'] = df['returns'].rolling(window=24).std()
df['volume_ma'] = df['volume'].rolling(window=24).mean()
# Target: 1 if price goes up next hour, 0 otherwise
df['target'] = (df['close'].shift(-1) > df['close']).astype(int)
# Drop NaNs
df = df.dropna()
# Features and target
features = ['open', 'high', 'low', 'close', 'volume', 'returns', 'volatility', 'volume_ma']
X = df[features]
y = df['target']
# Split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, shuffle=False)
# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
# Evaluate
accuracy = model.score(X_test, y_test)
print(f"Accuracy: {accuracy:.2%}")
π¬ Research Applications
Published Papers Using This Dataset
(Open a PR to add your work!)
Potential Research Questions
- Can transformers outperform LSTMs for crypto price prediction?
- How does order book imbalance predict short-term price movements?
- What's the optimal rebalancing frequency for a crypto portfolio?
- Do Twitter sentiment signals correlate with price volatility?
- Can you detect wash trading or market manipulation in the data?
π Citation
If you use this dataset in your research, please cite:
@dataset{daugherty2024kraken,
author = {Bryan Daugherty},
title = {Kraken Trading Data Collection},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/GotThatData/kraken-trading-data}
}
π Related Resources
- Kraken API Docs: https://docs.kraken.com/rest/
- ccxt Library: https://github.com/ccxt/ccxt - Unified crypto exchange API
- TA-Lib: https://ta-lib.org/ - Technical analysis library
βοΈ Data Collection Methodology
Data was collected using:
- Kraken WebSocket API - Real-time trade stream (sub-second latency)
- Kraken REST API - Order book snapshots (every 10 seconds)
- ccxt Library - Normalized OHLCV data (1min, 5min, 1h, 1d intervals)
Collection Period: January 2024 - December 2024 (ongoing updates)
Update Frequency: Daily (new data added at 00:00 UTC)
π License
MIT License - free for academic and commercial use.
Disclaimer: This data is for research and educational purposes only. Past performance does not guarantee future results. Cryptocurrency trading involves significant risk.
π Acknowledgments
- Kraken Exchange - For providing free, high-quality market data APIs
- ccxt Community - For building robust exchange integration tools
- Hugging Face - For hosting and serving this dataset
π Known Issues & Future Work
- Missing Data: Some gaps during exchange maintenance windows (< 0.1% of total data)
- Timezone: All timestamps are UTC
- Delisting: BNBUSD was delisted in June 2024 (data ends June 30)
Roadmap:
- Add L2 order book data (full depth, not just top 20 levels)
- Include funding rate data for perpetual futures
- Add cross-exchange arbitrage opportunities dataset
- Create Gradio Space for interactive data exploration
π¬ Feedback & Contributions
Found a bug? Want to request additional pairs or features?
- Discussions: Open a discussion
- Contact: YourFriends@smartledger.solutions
"In trading, the only constant is change. Adapt or fade away." β Paul Tudor Jones
- Downloads last month
- 1,629