Bybit supports placing orders by order cost. Order cost is the total margin required to open a position. In the order zone, traders can click **Order by Cost** in the quantity column to switch, and then enter the custom amount they want to invest.

(On Desktop)

(On Mobile App)

Please note the following:

— Currently, only **USDT Perpetual Contracts** **hedging mode** are supported.

— Only applicable to Limit Order and Market Order.

— Order by Qty is the default mode. Please manually switch to Order by Cost if needed.

**Calculation**

The order cost entered by traders will be used to calculate the initial margin required, as well as the taker fees for opening and closing positions.

Based on the direction of your position — long or short — the formulas used to calculate the order cost of the Limit Order and Market Order will be different.

**Long Positions**

**Formula**

*Order Cost = Initial Margin +* *Fee to Open Position + Fee to Close Position*

*Initial Margin = (**Order Price × Order Quantity) / Leverage*

*Fee to Open Position = Order Quantity × Order Price × Taker Fee Rate*

*Fee to Close Position = Order Quantity × Bankruptcy Price × Taker Fee Rate*

*Bankruptcy Price for Long Position = Order Price × ( Leverage − 1) / Leverage*

**Example**

Trader A opens a long position of 1 BTC at 50,000 USDT with 10x leverage.

The order cost is calculated as follows:

- Initial Margin = (50,000 × 1 ) / 10 = 5,000 USDT
- Fee to Open Position = 1 × 50,000 × 0.06% = 30 USDT
- Fee to Close Position = 1 × 50,000 × (10 − 1) / 10 × 0.06% = 27 USDT

In this case, order cost = 5,000 + 30 + 27 = 5,057 USDT

Traders who place orders by order cost can calculate the corresponding order quantity according to the following calculation.

Revisiting Trader A’s case:

Order Quantity = Order Cost × Leverage / [Order Price × (0.0012 × Leverage + 0.9994)]

= 5,057× 10 / [50,000 × (0.0012 × 10 + 0.9994)]

= 1 BTC

**Short Positions**

**Formula**

*Order Cost = Initial Margin + **Fee to Open Position + Fee to Close Position*

*Initial Margin = (**Order Price × Order Quantity) / Leverage*

*Fee to Open Position = Order Quantity × Order Price × Taker Fee Rate*

*Fee to Close Position = Order Quantity × Bankruptcy Price × Taker Fee Rate*

*Bankruptcy Price for Short Position = Order Price × ( Leverage + 1) / Leverage*

**Example**

Trader B opens a short position of 1 BTC at 55,000 USDT with 10x leverage.

The order cost is calculated as follows:

- Initial Margin = (55,000 × 1) / 10 = 5,500 USDT
- Fee to Open Position = 1 × 55,000 × 0.06% = 33 USDT
- Fee to Close Position = 1 × 55,000 × (10 + 1) / 10 × 0.06% =36.30 USDT

In this case, order cost = 5,500 +33 + 36.30 = 5,569.30 USDT

Traders who place orders by order cost can calculate the corresponding order quantity according to the following calculation.

Revisiting Trader B’s case:

Order Quantity = Order Cost × Leverage / [Order Price × (0.0012 × Leverage + 1.0006)]

= 5,569.3 × 10 / [55,000 × (0.0012 × 10 + 1.0006)]

= 1 BTC

**Note: The following criteria must be met in order to place an order successfully. **

1) The Order cost ( Initial Margin + Two-Way Taker Fee ) required has to be smaller than or equal to the available balance

2) Under cross margin mode, in the event that there is opened position, (1.2 x maintenance margin (MM) of open position + unrealized loss of position) has to be smaller than or equal to the available balance.