Order Cost

Order Placement

When a user places a new order, we check that the Available Balance for Trading is greater than or equal to the Order Cost, where:

  • Available Balance for Trading = Equity - Initial Margin for Open Positions and Orders

  • Order Cost for Buy Orders = max(Initial Margin Rate * New Order Price * (New Order Size + min(0, 2 * (Open Position Size + Triggered Order Size 1+ … + Triggered Order Size N))) - Open Loss, 0)

  • Order Cost for Sell Orders = max(-Initial Margin Rate * New Order Price * (New Order Size + max(0, 2 * (Open Position Size + Triggered Order Size 1+ … + Triggered Order Size N))) - Open Loss, 0)

In the equations above:

  • Open Loss for Buy Orders = min(max(New Order Size + min(0,Open Position Size + Triggered Order Size 1+ … + Triggered Order Size N),0) * (Mark Price - New Order Price), 0)

  • Open Loss for Sell Orders = min(min(New Order Size + max(0,Open Position Size + Triggered Order Size 1+ … + Triggered Order Size N),0) * (Mark Price - New Order Price), 0)

  • Position / Order Size is positive for Long and Negative for Short

Orders Cancellation

If the Available Balance for Trading becomes less than 0, all open orders except for reduce-only orders are canceled. Additionally, as long as the Available Balance is less than 0, the user can only place orders that reduce the size of existing positions.

Last updated