TP/SL Orders

Take Profit (TP) and Stop Loss (SL) Orders are used to fully or partially close your position at a pre-defined price level, to either secure benefits or manage the potential risk of a trade.

How to place your TP/SL Orders

After opening a new position, a user can place TP/SL orders for that position by going to the TP/SL column in the Positions tab and opening the TP/SL modal.

When accessing the modal (shown in the screenshots below), users can set their TP and SL by either selecting the prices at which they want them to trigger or the percentage Gain/Loss they want for the trade. These orders are triggered based on the Oracle Price, and by default they will have a size equal to the entire position, so that it is fully closed at the moment of execution.

A user will also have the option to partially close the position when these orders are executed, by switching to the Partial Position option above the TP Trigger Price Box. This will enable users to place multiple TP/SL orders based on the size of the position they want to close at each price level. However, the total sum of all TP or SL orders won't be allowed to exceed the total size of the position.

Additionally, when a position is adjusted or partially closed, the remaining TP/SL orders will not be re-sized. Thus, TP/SL orders will follow the cancellation mechanisms outlined in TP/SL Order Cancellation Logic when a user either adjusts or partially closes their position.

Finally, after the TP/SL orders are placed they can be viewed and cancelled in the Open Orders tab. By default, these will appear as Take Profit Market and Stop Loss Market order types, and the corresponding trigger prices will be shown in the TP/SL column of the Positions tab (which was previously blank).

It is important to highlight that these orders cannot be edited, for this purpose a user will have to cancel the existing orders and place new ones through the TP/SL modal.

Don't forget to couple TP/SL orders with 1CT (One-Click Trading) to improve your trading experience further by making it easier to manage your positions much quicker!

Limit vs Market TP/SL Orders

TP and SL orders are executed as market orders by default. However, since there will be an offset between the Oracle Price and the Market Price available on the book when the TP/SL gets triggered, a user can also set them as Limit Orders. This will send the order to the book to guarantee the execution at a specified price. However, there remains the risk of the order not executing with this approach.

For example: If a Limit TP order for an ETH-PERP Long position gets triggered at an Oracle Price of 3400 USDC while the lowest ask (best sell price) on the book at that moment sits at 3410 USDC, the order will be sent to the book but not execute if the user sets a Limit TP Price above that lowest ask. Thus, if the price reverses, the order may never execute.

So if a user wants to guarantee the execution of the TP/SL order, they must use the default market execution. On the other hand, if a user wants the order to execute at a specified price, they can opt for the Limit TP/SL option.

TP/SL Order Cancellation Logic

As outlined above, TP/SL orders are not re-sized when the position is adjusted or partially closed, thus, in order to avoid inverting the direction of a trade when a partial TP or SL is executed, we have implemented cancellation logics for different scenarios:

Case 1: If a user performs any manual updates to their position via non-TP/SL orders (adjusting the position size, changing the leverage...), all TP and SL orders will be cancelled.

Case 2: If multiple TP/SL orders are placed and either a TP or SL is executed, the orders of the opposite type will be cancelled to ensure that the sum of the order sizes is equal to or less than the current position size. In this scenario, the order of cancellations will be the following:

  • Non-triggered orders are cancelled first. This means that if a Limit TP order is triggered (sent to the book) but doesn't execute because the price quickly reverses, and then a partial SL gets triggered and executes, then the non-triggered TP orders will be cancelled first.

  • Non-triggered Order Cancellations will be prioritized based on the prices furthest from the current Oracle Price.

This second scenario can be better illustrated with these examples:

Example 1: A user has an open Long position for ETH-PERP with a size of 1 and an entry price of 3400 USDC. They now set two TPs, TP1 = 3500 / TP2 = 3600 with sizes of 0.7 and 0.3 respectively, and two SLs, SL1 = 3300 / SL2 = 3200 with sizes of 0.5 and 0.5 respectively. If the first TP is executed and the position size is now 0.3, then the two SL orders will be cancelled.

Example 2: A user has an open Long position for ETH-PERP with a size of 1 and an entry price of 3400 USDC. They now set two TPs, TP1 = 3500 / TP2 = 3600 with sizes of 0.3 and 0.7 respectively, and two SLs, SL1 = 3300 / SL2 = 3200 with sizes of 0.5 and 0.5 respectively. If the first TP is executed and the position size is now 0.7, then only SL2 will be cancelled as it has the furthest price from the current Oracle Price and SL1 has a size lower than the current position size.

Example 3: A user has an open Long position for ETH-PERP with a size of 1 and an entry price of 3400 USDC. They now set three Limit TPs, TP1 = 3500 / TP2 = 3600 / TP3 = 3700 with sizes of 0.4, 0.4 and 0.2 respectively, and two SLs, SL1 = 3300 / SL2 = 3200 with sizes of 0.2 and 0.8 respectively. If the first TP is triggered but not executed, the TP Limit order will remain on the book and the position size will still be 1 ETH-PERP. Now, if the price reverses, reaches and executes SL1, the position size will now be 0.8 and only TP3 will get cancelled.

Last updated