Perpetual Protocol 🥨

Posted on Dec 30, 2022Read on Mirror.xyz

Advanced Order Types Now Supported

The most anticipated update to Perpetual Protocol has arrived: advanced order types!

With the introduction of the limit, stop limit and take limit order types, traders can now enjoy more advanced strategies and improved risk management.

What are Limit Orders?

A limit order differs from a market order, as you can specify the price level (known as the limit price) at which you want to buy or sell an asset.

Limit orders also come with expiry options on Perp v2 (ranging from five minutes to one week). You can also cancel them if market conditions change or your initial trade idea is invalidated.

Market orders prioritize time, limit orders prioritize price

Limit orders guarantee a certain execution price, however, they do not guarantee that your order will be filled. The upside is better execution and a more favorable entry, but the downside is that if the limit price is not reached, then the order may never be filled and you may miss out on a price movement.

Also, for such an order to be executed successfully, there needs to be sufficient liquidity at the specified limit price. If there’s insufficient liquidity to fill your position based on the quantity you plan on buying or selling, then the order may not be executed.

Each order type has its own benefits in different situations: if you expect a major move to occur imminently, then a market order is probably the better option. On the other hand, if you think there’s an underlying trend that might have some momentum left in it before eventually ending, then it’s better to use a limit order to try and catch a reversal.

Here’s an example to make the limit order concept clearer.

Limit Order Example

Let’s say the current index price of ETH-USD is $2,000.

You have reason to believe that there’s a high likelihood that the price trend will halt and the market will bounce upwards once ETH-USD tags the $1,500 level.

To prepare for this possibility, we can place a buy limit order around an important support level, say $1,500. You may also want to set several limit orders above and below this level to make sure you get filled. Let’s say you set a limit price to buy at $1,500.

Once the price crosses the limit price of $1,500, this triggers the order to buy and automatically opens a long position.

Reduce-Only Option

There’s also a reduce-only option for limit orders, which can be used whenever you just want to reduce the size of an open position and avoid risking opening another position unexpectedly. For example, if you are long ETH-USD, you can use a reduce-only order to sell to make sure it only partially or fully closes the existing long position.

How Advanced Orders Work on Perp v2

Limit orders can now be submitted through our UI, API, or smart contract.

To learn more about how advanced order types work on Perp v2, check out our help center article.

What is a Stop Limit?

Stop loss is an order to close the position at a specified price. As the name suggests, these types of orders are used to cut your losses. Once the index price reaches the trigger price set for the stop loss, a market order will close out the position at a pre-defined loss.

Trading is a long game where a large part of becoming profitable is a matter of managing losses so that you maintain and grow your capital. Since a stop loss is an example of a stop order, it guarantees execution, avoiding the risk of no fills or partially fills, differing from a limit order (which guarantees execution at a specific price or better).

The diagram above illustrates how stop losses can be used after entering a long or short position. If you’re using a trend following strategy, then usually stops are placed somewhere beneath the lower low of the market structure, as displayed above.

Stop losses are not solely for cutting losses, though, you can also use them to ensure that you always exit the trade with a profit.

For example, if you go long and the price keeps going up, then you can move your stop loss up further in step with the market. That way, if the market reverses, the stop loss will be in an area where the position will be profitable.

The same concept also applies to limit orders: you may be bullish on ETH for example waiting for it to hit a certain price level, so you submit a limit buy order at $1,500. But then some new information comes into play suddenly and changes the market sentiment, which causes the price of ETH to drop. To account for the changes in market conditions and get a better entry, cancel the existing limit order and submit a new one with a lower price.

Cutting Losses: Stop Loss Example

Let’s say you long 0.5 ETH at $2,000. You anticipate that the market will remain bullish as long as the $1,800 price area holds. To manage your risk and prevent the position from losing more than $110, you set a stop loss at $1,780.

For the scenario where the price falls below $1,780, you’ll have limited your losses and until it happens, you can rest easy, knowing that the maximum loss you’re comfortable with will only be $110.

However, now let’s say the price moves sharply higher from $2,000 to $2,400 after opening the long. You can now move the stop loss up to $2,000 to ensure that if the price dives back down, the stop loss acts like an airbag - it will save you from a negative PnL.

What is a Take Profit?

A take profit is an order to close the position at a specified price, enabling you to lock in the gains of a successful trade. Once the index price reaches the trigger price, a market order automatically closes out the position for a pre-defined profit level.

Locking in Gains: Take Profit Example

If you’ve entered a short for ETH-USD at $2,000 and you think $1,500 is an important support level, then you might set a take profit order just above $1,500 (say $1,525). Once the index price reaches $1,525 or crosses below this level, the take profit order will automatically close out the position with a market buy.

  • Better execution in times of high volatility: Limit orders can help traders to avoid unfavorable entries/exits due to highly volatile market conditions. Since market orders execute immediately at the best available price, and if the price is moving around rapidly, it’s more uncertain at which price you’ll actually get an entry.

    • Example: the price of ETH is fluctuating between $1,600 and $1,400 over a very short time, and let’s say you’re bullish. You could use a market order as the price nears $1,400 but ends up getting filled nearer $1,500 due to market conditions. When using a limit order, you can simply set a limit price = ~$1,400 to improve the entry.
  • Automate your trading: Instead of waiting for the best time to submit a market order, you can set and forget a limit order at the price you’re comfortable buying or selling at. That means you don’t have to worry about timing tops or bottoms in the market.** **

  • Improved risk management: A combination of stop loss and take profit orders helps to define your risk-reward ratio, ensuring that your positions will always be closed with a predetermined profit/loss.

What’s Next?

By introducing these new advanced order types, Perp v2 is getting ever closer to its goal of matching the functionalities of centralized venues that offer perpetual swaps

Next up on the roadmap are a new tokenomic model for PERP and then permissionless markets.

Links

Translations of this article are available in Español, Hindi (हिंदी), Mandarin (普通话), Swahili, and Thai (ไทย), thanks to the help of our Perpvangelists!