v1.175.0

nautechsystems/nautilus_traderv1.175.0Jun 17, 2023by github-actions[bot]

AI Summary

A major architectural shift integrating core Rust components (OrderBook, HTTP/WebSocket clients) and the Interactive Brokers adapter v2, alongside an upgrade to Pandas v2.

Key Highlights

  • Integrated core Rust `OrderBook` and `OrderBookDelta` data types.
  • Integrated Interactive Brokers adapter v2 into the platform.
  • Upgraded `pandas` to v2.
  • Defined public API for data and events by denesting namespaces.
  • Added core Rust `HttpClient` and `WebSocketClient` based on hyper and tokio.

Breaking Changes

  • Upgraded `pandas` to v2.
  • Removed `OrderBookSnapshot` and `OrderBookData` (redundant).
  • Renamed `Actor.handle_order_book_delta` to `handle_order_book_deltas`.
  • Renamed `inverse_as_quote` to `use_quote_for_inverse`.
  • Renamed core `LogMessage` to `LogEvent`.
  • Renamed `LogEvent.timestamp_ns` to `LogEvent.timestamp`.

New Features

  • Added `quote_quantity` parameter to determine order quantity denomination.
  • Added `trigger_instrument_id` parameter for triggering emulated orders.
  • Added `use_random_ids` to `add_venue(...)` method.
  • Added `ExecEngineConfig.filter_unclaimed_external_orders` option.
  • Changed `BinanceHttpClient` to use new core HTTP client.

Full Release Notes

# NautilusTrader 1.175.0 Beta

Released on 16th June 2023 (UTC).

The Betfair adapter is broken for this release pending integration with the new Rust order book.
We recommend you do not upgrade to this version if you're using the Betfair adapter.

### Enhancements
- Integrated Interactive Brokers adapter v2 into platform, thanks @rsmb7z
- Integrated core Rust `OrderBook` into platform
- Integrated core Rust `OrderBookDelta` data type
- Added core Rust `HttpClient` based on `hyper`, thanks @twitu
- Added core Rust `WebSocketClient` based on `tokio-tungstenite`, thanks @twitu
- Added core Rust `SocketClient` based on `tokio` `TcpStream`, thanks @twitu
- Added `quote_quantity` parameter to determine if order quantity is denominated in quote currency
- Added `trigger_instrument_id` parameter to trigger emulated orders from alternative instrument prices
- Added `use_random_ids` to `add_venue(...)` method, controls whether venue order, position and trade IDs will be random UUID4s (no change to current behaviour)
- Added `ExecEngineConfig.filter_unclaimed_external_orders` options, if unclaimed order events with an `EXTERNAL` strategy ID should be filtered/dropped
- Changed `BinanceHttpClient` to use new core HTTP client
- Defined public API for data, can now import directly from `nautilus_trader.model.data` (denest namespace)
- Defined public API for events, can now import directly from `nautilus_trader.model.events` (denest namespace)

### Breaking changes
- Upgraded `pandas` to v2
- Removed `OrderBookSnapshot` (redundant as can be represented as an initial CLEAR followed by deltas)
- Removed `OrderBookData` (redundant)
- Renamed `Actor.handle_order_book_delta` to `handle_order_book_deltas` (to more clearly reflect the `OrderBookDeltas` data type)
- Renamed `Actor.on_order_book_delta` to `on_order_book_deltas` (to more clearly reflect the `OrderBookDeltas` data type)
- Renamed `inverse_as_quote` to `use_quote_for_inverse` (ambiguous name, only applicable for notional calcs on inverse instruments)
- Changed `Data` contract (custom data), [see docs](https://docs.nautilustrader.io/develop/concepts/advanced/data.html)
- Renamed core `LogMessage` to `LogEvent` to more clearly distinguish between the `message` field and the event struct itself (aligns with [vector](https://vector.dev/docs/about/under-the-hood/architecture/data-model/log/) language)
- Renamed core `LogEvent.timestamp_ns` to `LogEvent.timestamp` (affects field name for JSON format)
- Renamed core `LogEvent.msg` to `LogEvent.message` (affects field name for JSON format)

### Fixes
- Updated `BinanceAccountType` enum members and associated docs
- Fixed `BinanceCommonExecutionClient` iteration of `OrderList` orders
- Fixed heartbeats for `BinanceWebSocketClient` (new Rust client now responds with `pong` frames)
- Fixed Binance adapter typing for `orderId`, `fromId`, `startTime` and `endTime` (all are ints), thanks for reporting @davidsblom
- Fixed `Currency` equality to be based on the `code` field (avoiding equality issues over FFI), thanks for reporting @Otlk
- Fixed `BinanceInstrumentProvider` parsing of initial and maintenance margin values