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

  • If the new order decreases the absolute sum of open positions and open order sizes, then the Order Cost is set to 0.

  • If the new order increases the absolute sum of open positions and open order sizes without reversing it, then the Order Cost = Initial Margin Rate * Abs (New Order Size * New Order Price) + Open Loss.

  • If the new order reverses the absolute sum of open positions and open order sizes without decreasing it, then the Order Cost = Initial Margin Rate * Abs (New Order Size *New Order Price + Open Position Size * Mark price + Order Size 1 * Order Price 1 + … Order Size N * Order Price N) + Open Loss.

In the equations above:

  • Open Loss = Abs(min(0, Order Size*(Mark Price - Entry Price)))

  • 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