Implement Kraken integration with REST and WebSocket clients, add market data handling, and enhance settings configuration

This commit is contained in:
2026-06-01 10:30:58 +02:00
parent 6211575db7
commit 7d3071463e
20 changed files with 977 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
from arbitrade.config.settings import Settings
from arbitrade.exchange.kraken_ws import KrakenWsClient
def test_parse_book_delta() -> None:
client = KrakenWsClient(Settings())
message = {
"channel": "book",
"symbol": "BTC/USD",
"data": [
{
"bids": [{"price": "100.0", "qty": "1.2"}],
"asks": [{"price": "100.5", "qty": "0.8"}],
"checksum": 123,
"timestamp": 1717232000000,
}
],
}
delta = client.parse_book_delta(message)
assert delta is not None
assert delta.symbol == "BTC/USD"
assert len(delta.bids) == 1
assert len(delta.asks) == 1
assert delta.checksum == 123