The following order types are supported by Drift: market orders, limit orders, and conditional/advanced orders.

Market Orders

A market order is an order to buy or sell an asset at the current market price. When placing a market order, traders have the option to specify a maximum slippage tolerance, which sets an upper bound for the price at which the order will be filled. This effectively functions as a combination of a market order and a limit order.

For example, if the mark price of SOL-PERP is $100.00 and a trader wants to go long, they can set a maximum slippage tolerance of 0.1%. This means that the worst price at which the trader can fill their order is $100.10. If the quoted price exceeds the limit price (including the slippage tolerance) for makers, the order will not be completed.

During this 5-second auction, market makers can participate in filling the trader's orders. Once the JIT auction ends, orders will be completed as long as the price is within the slippage tolerance limit. If no market maker participates in the JIT auction, the remaining order will be filled using Drift's DAMM (Decentralized Automated Market Maker).

*It's important to note that executing a market order does not guarantee that the order will be completed at the current mark price. The mark price may change before the JIT auction is complete.

The fee paid depends on whether the order is a taker order or maker order. 

See Trading Fees and Advanced Orders FAQ for more information.

Limit Orders

Limit orders are orders to buy or sell a specific asset at a predetermined price. Traders can specify the limit price at which they want their order to be filled.

On Drift, limit orders are executed when the mark price of an asset reaches or crosses the trigger/limit price. These orders take against the DAMM and are executed by a decentralized network of keepers (Keeper Network) and are executed 'best-effort' by the network with special economic incentives designed to mimic the typical execution order seen in a Centralised Limit Order Book (CLOB).

For taker orders, the trader's resulting entry price is guaranteed to be equal to or better than the specified limit price. If the "Post" order flag is set, the order will be filled at the specified limit price with a variable rebate (see Fees & Rebates). This rebate is derived from the surplus liquidity of taker fills, after accounting for the filler reward (which is capped at 5bps).

Conditional Orders (Advanced)

Stop Market Order

A stop market order is a type of order that is used to close the position of a specific asset if its mark price reaches a specified trigger price.

To use a stop market order, a trader specifies a trigger price. If the mark price of the asset reaches this trigger price and is executed by a keeper, a market order to sell the asset will be automatically placed. This allows traders to automatically sell their asset at a predetermined price, helping to limit their potential losses or to protect profits.

Stop Limit Order

A stop limit order is a type of order that is triggered when the mark price of a specific asset reaches a predetermined trigger price. When this occurs, a limit order is placed at the specified limit price. This limit order may be filled immediately or may remain open until the specified limit price is reached and executed by a decentralized keeper.

To use a stop limit order, a trader specifies both a trigger price and a limit price. When the mark price of the asset reaches the trigger price and a keeper executes the order, a limit order is placed at the specified limit price.

Stop limit orders also serve as a maximum slippage tolerance for the stop order.

Take Profit Market Order

A take-profit order is a type of order that is used to automatically close the position of a specific asset when its mark price reaches a predetermined trigger price. When the trigger price is reached and the order is executed by a keeper and the position is closed at the current market price.

To use a take-profit order, a trader specifies a trigger price. If the mark price of the asset reaches this trigger price, a market order to sell the asset is automatically placed. This allows traderes to secure profits by selling an asset when it reaches a certain price.

Take-Profit Limit Order

A take-profit limit order is a type of order that is triggered when the mark price of a specific asset reaches a predetermined trigger price. When this occurs, a limit order is placed at the specified limit price. This limit order may be filled immediately or may remain open until the specified limit price is reached and executed by a decentralized keeper.

To use a take profit limit order, a trader specifies both a trigger price and a limit price. When the mark price of the asset reaches the trigger price and the order is executed by a keeper, a limit order is placed at the specified limit price.

Take-profit limit orders also serve as a maximum slippage tolerance for the stop order.

If Trigger Price < Limit Price: order begins to be filled once the price is below the trigger price.

If Limit Price < Trigger Price: order begins to be filled once the price is below the limit price.

One limitation of the protocol is that it can only detect when the trigger price has been reached if the order has already been partially filled or can be partially filled. This means that certain order configurations cannot be placed.

TriggerIsAbove | DirectionIsLong | LimitPrice

------------------------------------------------

True           | True            | Must be above trigger

True           | False           | Ok

False          | True            | Ok        

False          | False           | Must be below trigger

Example: 

If the trigger price is >$140 and a long is placed with a limit price = $135, it is not possible for the order to detect that the trigger price of $140 was hit before you attempt to long when the price falls $5.

In the other scenario, if the trigger price is < $140 and a long is placed with a limit price of $135, you will know that $140 (AND $135) must have been hit since you were partially filled.

Additionally, if the trigger price is <$140 and a long is placed with a limit price of $141, the order will get filled up to $141 once it crosses $140. 

Order Flags

In addition to specifying execution parameters, orders can also include flags that provide additional instructions. The protocol allows for the use of three additional order flags:

  • Reduce-only: This flag ensures that the order will never increase or reverse the current position (for example, going from long to short or short to long).
  • Post-only: This flag ensures that the order is a maker order that can provide liquidity to the pool for a reduced exchange fee (0%). Without this flag, orders that do not execute immediately are not considered post-only.
  • Immediate or cancel (IOC): This flag specifies that an order should be placed and potentially partially filled. Any remainder that is not filled immediately is then canceled.

Trade On Drift‍

You can deposit the digital assets you purchased and swapped to use as collateral on Drift and start trading, earning yield, and borrowing.

For more on Drift, head over to the Learn hub.

discord
Try Drift Now
Try Drift Now