Files
ritmex-bot/docs/binance/binance_derivatives/docs_derivatives_usds-margined-futures_user-data-streams_Event-Order-Update.md
DisneyandGitHub d6399b92aa Feat/support binance (#22)
* add docs

* Add Binance exchange support

- Updated the environment configuration to include Binance as a selectable exchange option.
- Enhanced the README documentation to reflect the addition of Binance.
- Implemented the Binance exchange adapter and integrated it into the existing exchange framework.
- Modified the basis arbitrage strategy to support Binance alongside existing exchanges.
- Added tests to ensure proper functionality and integration of Binance within the trading system.

* Enhance README with detailed Binance exchange configuration

- Added comprehensive instructions for setting up Binance as an exchange option.
- Included environment variable specifications for API keys, market types, and trading symbols.
- Provided examples for both perpetual and spot trading strategies.
- Clarified the use of WebSocket and REST for the Binance adapter.

* Enhance exchange support and testing framework

- Added a new test suite for exchange contracts to ensure consistency and functionality across supported exchanges.
- Refactored exchange ID handling to utilize a centralized list of supported exchanges, improving maintainability.
- Updated CLI argument parsing and help documentation to reflect the new exchange structure.
- Introduced utility functions for validating supported exchanges and their display names.
- Enhanced the BasisApp and strategy runner to leverage the new exchange validation logic.
- Added a new test command for running exchange-related tests.

* Refactor exchange contract tests and update CLI commands

- Removed the trailing supported exchanges set and simplified the logic for trailing stop support in the exchange contract tests.
- Updated the test command for exchange contracts to exclude unnecessary tests, streamlining the testing process.
- Enhanced test descriptions for clarity and improved understanding of the functionality being tested.
2026-02-27 11:37:44 +08:00

5.0 KiB
Raw Permalink Blame History

title, source, fetched_at
title source fetched_at
Event Order Update | Binance Open Platform https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update 2026-01-27T05:28:33.273Z

Event: Order Update

Event Description

When new order created, order status changed will push such event. event type is ORDER_TRADE_UPDATE.

Side

  • BUY
  • SELL

Order Type

  • LIMIT
  • MARKET
  • STOP
  • STOP_MARKET
  • TAKE_PROFIT
  • TAKE_PROFIT_MARKET
  • TRAILING_STOP_MARKET
  • LIQUIDATION

Execution Type

  • NEW
  • CANCELED
  • CALCULATED - Liquidation Execution
  • EXPIRED
  • TRADE
  • AMENDMENT - Order Modified

Order Status

  • NEW
  • PARTIALLY_FILLED
  • FILLED
  • CANCELED
  • EXPIRED
  • EXPIRED_IN_MATCH

Time in force

  • GTC
  • IOC
  • FOK
  • GTX

Working Type

  • MARK_PRICE
  • CONTRACT_PRICE

Liquidation and ADL:

  • If user gets liquidated due to insufficient margin balance:

    • c shows as "autoclose-XXX"X shows as "NEW"
  • If user has enough margin balance but gets ADL:

    • c shows as “adl_autoclose”,X shows as “NEW”

Expiry Reason

  • 0: None, the default value
  • 1: Order has expired to prevent users from inadvertently trading against themselves
  • 2: IOC order could not be filled completely, remaining quantity is canceled
  • 3: IOC order could not be filled completely to prevent users from inadvertently trading against themselves, remaining quantity is canceled
  • 4: Order has been canceled, as it's knocked out by another higher priority RO (market) order or reversed positions would be opened
  • 5: Order has expired when the account was liquidated
  • 6: Order has expired as GTE condition unsatisfied
  • 7: Order has been canceled as the symbol is delisted
  • 8: The initial order has expired after the stop order is triggered
  • 9: Market order could not be filled completely, remaining quantity is canceled

Event Name

ORDER_TRADE_UPDATE

Response Example

{  "e":"ORDER_TRADE_UPDATE",		   // Event Type  "E":1568879465651,			       // Event Time  "T":1568879465650,			       // Transaction Time  "o":{								    "s":"BTCUSDT",			         // Symbol    "c":"TEST",				           // Client Order Id      // special client order id:      // starts with "autoclose-": liquidation order      // "adl_autoclose": ADL auto close order      // "settlement_autoclose-": settlement order for delisting or delivery    "S":"SELL",					         // Side    "o":"TRAILING_STOP_MARKET",	 // Order Type    "f":"GTC",					         // Time in Force    "q":"0.001",				         // Original Quantity    "p":"0",					           // Original Price    "ap":"0",					           // Average Price    "sp":"7103.04",				       // Stop Price. Please ignore with TRAILING_STOP_MARKET order    "x":"NEW",					         // Execution Type    "X":"NEW",					         // Order Status    "i":8886774,				         // Order Id    "l":"0",					           // Order Last Filled Quantity    "z":"0",					           // Order Filled Accumulated Quantity    "L":"0",					           // Last Filled Price    "N":"USDT",            	     // Commission Asset    "n":"0",               	     // Commission    "T":1568879465650,			     // Order Trade Time    "t":0,			        	       // Trade Id    "b":"0",			    	         // Bids Notional    "a":"9.91",					         // Ask Notional    "m":false,					         // Is this trade the maker side?    "R":false,					         // Is this reduce only    "wt":"CONTRACT_PRICE", 		   // Stop Price Working Type    "ot":"TRAILING_STOP_MARKET", // Original Order Type    "ps":"LONG",					       // Position Side    "cp":false,						       // If Close-All, pushed with conditional order    "AP":"7476.89",				       // Activation Price, only puhed with TRAILING_STOP_MARKET order    "cr":"5.0",					         // Callback Rate, only puhed with TRAILING_STOP_MARKET order    "pP": false,                 // If price protection is turned on    "si": 0,                     // ignore    "ss": 0,                     // ignore    "rp":"0",	   					       // Realized Profit of the trade    "V":"EXPIRE_TAKER",          // STP mode    "pm":"OPPONENT",             // Price match mode    "gtd":0,                     // TIF GTD order auto cancel time    "er":"0"                     // Expiry Reason  }}