Implement Kraken integration with REST and WebSocket clients, add market data handling, and enhance settings configuration
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user