Bingex.Swap.DetailedOrderInfo (Bingex v0.1.7)

Represents detailed order information for a swap contract in BingX.

This module provides a structured representation of an order's full details, including execution status, fees, profit/loss, and associated risk management parameters.

Summary

Functions

Complete order information.

Types

t()

@type t() :: %Bingex.Swap.DetailedOrderInfo{
  average_price: float(),
  client_order_id: binary(),
  executed_quantity: float(),
  executed_quote_amount: float(),
  fee: float(),
  leverage: non_neg_integer(),
  only_one_position?: boolean(),
  order_id: binary(),
  order_type: binary(),
  original_quantity: float(),
  position_id: binary(),
  position_side: Bingex.Order.position_side(),
  price: float(),
  profit: float(),
  reduce_only?: boolean(),
  side: Bingex.Order.side(),
  status: Bingex.Order.status(),
  stop_guaranteed?: boolean(),
  stop_loss: any(),
  stop_loss_entrust_price: float(),
  stop_price: float(),
  symbol: binary(),
  take_profit: any(),
  take_profit_entrust_price: float(),
  timestamp: non_neg_integer(),
  trigger_order_id: binary(),
  type: Bingex.Order.type(),
  update_time: non_neg_integer(),
  working_type: Bingex.Order.working_type()
}

Functions

decode(data)

@spec decode(map()) :: {:ok, t()} | :error

Complete order information.

Fields:

  • order_id (binary): Unique identifier for the order.
  • symbol (binary): Trading pair symbol (e.g., "BTC-USDT").
  • side (Order.side()): Buy/Sell direction of the order.
  • position_side (Order.position_side()): Position type (e.g., long, short).
  • status (Order.status()): Current status of the order (e.g., filled, canceled).
  • stop_price (float): Stop price for conditional orders.
  • price (float): Price at which the order was placed.
  • type (Order.type()): Order type (e.g., market, limit).
  • client_order_id (binary): Custom client-provided order ID.
  • trigger_order_id (binary | nil): ID of the trigger order (if applicable).

  • working_type (Order.working_type()): Price type used for stop orders.
  • leverage (integer): Leverage level applied to the order.
  • fee (float): Trading fee incurred.
  • executed_quote_amount (float): Total executed quote asset amount.
  • executed_quantity (float): Total executed base asset quantity.
  • only_one_position? (boolean): Whether the order allows only one position.
  • order_type (binary): Additional classification of the order type.
  • original_quantity (float): Initial order quantity.
  • average_price (float): Average execution price of the order.
  • position_id (binary | nil): Associated position ID.

  • profit (float): Realized profit from the order.
  • reduce_only? (boolean): Whether the order reduces an existing position.
  • stop_loss (map | nil): Stop-loss details (if applicable).

  • stop_loss_entrust_price (float): Price at which stop-loss is triggered.
  • take_profit (map | nil): Take-profit details (if applicable).

  • take_profit_entrust_price (float): Price at which take-profit is triggered.
  • stop_guaranteed? (boolean): Whether stop-loss is guaranteed.
  • timestamp (non_neg_integer): Order creation timestamp.
  • update_time (non_neg_integer): Last update timestamp.