From 9789e10f4a952c19a2f807fb7955ecf5a0f585fa Mon Sep 17 00:00:00 2001 From: Chris Sellers Date: Sat, 6 Jan 2024 08:08:16 +1100 Subject: [PATCH] Add BinanceOrderStatus.EXPIRED_IN_MATCH --- RELEASES.md | 1 + nautilus_trader/adapters/binance/common/enums.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index f5481ee1b18f..ba5d0c4c3135 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -31,6 +31,7 @@ Released on TBD (UTC). - Fixed handling of configuration objects to work with `StreamingFeatherWriter` - Fixed `BinanceSpotInstrumentProvider` fee loading key error for partial instruments load, thanks for reporting @doublier1 - Added `BinanceErrorCode.SERVER_BUSY` (-1008). Also added to the retry error codes. +- Added `BinanceOrderStatus.EXPIRED_IN_MATCH` which is when an order was canceled by the exchange due self-trade prevention (STP), thanks for reporting @doublier1 --- diff --git a/nautilus_trader/adapters/binance/common/enums.py b/nautilus_trader/adapters/binance/common/enums.py index fb27228b8d13..509b1fdbc946 100644 --- a/nautilus_trader/adapters/binance/common/enums.py +++ b/nautilus_trader/adapters/binance/common/enums.py @@ -193,6 +193,7 @@ class BinanceOrderStatus(Enum): PENDING_CANCEL = "PENDING_CANCEL" REJECTED = "REJECTED" EXPIRED = "EXPIRED" + EXPIRED_IN_MATCH = "EXPIRED_IN_MATCH" NEW_INSURANCE = "NEW_INSURANCE" # Liquidation with Insurance Fund NEW_ADL = "NEW_ADL" # Counterparty Liquidation @@ -478,6 +479,7 @@ def __init__(self) -> None: BinanceOrderStatus.NEW_ADL: OrderStatus.FILLED, BinanceOrderStatus.NEW_INSURANCE: OrderStatus.FILLED, BinanceOrderStatus.EXPIRED: OrderStatus.EXPIRED, + BinanceOrderStatus.EXPIRED_IN_MATCH: OrderStatus.CANCELED, # Canceled due self-trade prevention (STP) } self.ext_to_int_order_side = {