13min

Perpetual Order Types

Market Orders

A Market Order is an order to buy or sell a given asset immediately at the current Market Price.

  • For a market order, users can pass slippage tolerance (custom, .1%,.5%,1%, inf)
    • this slippage tolerance translates to a limit price versus the current market price
    • if the order cannot be filled completely up to this limit price, the order is not executed and cancelled
  • confirmation module can show advanced market impact information

Executing a Market Order does not mean the order will execute at exactly the price displayed. The Market Price of an asset may change before the Market Order is executed.

All Drift orders are currently taker orders and share the same fee structure See Fees & Liquidations and Orders FAQ for more information

Limit Orders

Drift Protocol plans to support a number of queued orders types.

These orders take against the dAMM and are executed once conditions are met by a decentralised network of keepers. These orders 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).

Limit:

A Limit Order is an order to buy or sell a given asset at a specified or better price.

Users specify a Limit Price they wish to be filled at. The order will partially fill up to this Limit Price every time a keeper executes this order. The user's resulting Entry Price is guranteed to be equal or better than the Limit Price specified.

Advanced Orders

Stop Market:

A Stop Market Order is an order to close the position of a given asset if its Mark Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.

User specifies a Trigger Price, once (or if) the mark price of the asset reaches the specified Trigger Price and a keeper executes it, a Market Order to sell the asset will be executed.

Stop Limit:

A Stop Limit Order will only execute where the Mark Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed. Once triggered, the resulting Limit Order may be immediately filled or may rest until the specified Limit Price is reached and executed by a decentralised keeper.

User specifies a Trigger Price and a Limit Price, once (or if) the mark price of the asset reaches the specified Trigger Price and a keeper executes it, a Limit Order will be placed at the specified Limit Price.

Stop Limit Orders also serve as a max slippage tolerance for the Stop Order.

Curent Position

Order Type

Trade Direction

Trigger Condition

Reduce Only

Long

Stop (Market If Touch)

Buy

Below

False

Long

Stop

Sell

Below

True/False

Short

Stop

Buy

Above

True/False

Short

Stop (Market If Touch)

Sell

Above

False

๏ปฟ

Take Profit:

A Take Profit Order is an order to close the position of a given asset if its Mark Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.

User specifies a Trigger Price, once (or if) the mark price of the asset reaches the specified Trigger Price and a keeper executes it, a Market Order to sell the asset will be executed.

Take Profit Limit:

A Take Profit Limit Order will only execute where the Mark Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed. Once triggered, the resulting Limit Order may be immediately filled or may rest until the specified Limit Price is reached and executed by a decentralised keeper.

User specifies a Trigger Price and a Limit Price, once (or if) the mark price of the asset reaches the specified Trigger Price and a keeper executes it, a Limit Order will be placed at the specified Limit Price.

Take Profit Limit Orders also serve as a max slippage tolerance for the Stop Order.

Current Position

Order Type

Trade Direction

Trigger Condition

Reduce Only

Long

Take Profit (Market If Touch)

Buy

Above

False

Long

Take Profit

Sell

Above

True/False

Short

Take Profit

Buy

Below

True/False

Short

Take Profit (Market If Touch)

Sell

Below

False

If Trigger Price < Limit Price: order starts getting filled once price is below trigger

If Limit Price < Trigger Price: orders starts getting filled once price is below limit

One limitation is the only way the protocol can detect that a trigger price has beenย hitย is if the order has already been or can be partially filled. This doesn't allow some order configurations to 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 Trigger Price is >$140 and a Long is placed with a Limit Price = $135, theres no way the order can know that $140 was hit before you try to long when the price falls $5. In the other scenario, if Trigger Price is < $140 and a Long is placed with a Limit Price = $135, we will know that $140 (AND $135) must have been hit since you got partially filled a little bit

Additionally, if the Trigger Price is <$140 and a Long is placed with a Limit Price = $141, both the order will get filled up to $141 once it crosses $140.ย 

Order Flags:

Reduce Only: Enforces that order will never increases or flips the current position.

Future Order Flags (๐Ÿšง)

Immediate or cancel (IOC): An order is placed and potentially partially filled. The remainder that is not filled immediately is then cancelled. Post Only: These maker orders that can be filled if they price improve over the dAMM for a taker order. Aim to provide users with lower fee for utilising this order type.

๏ปฟ

๏ปฟ

๏ปฟ

Updated 04 Mar 2022
Did this page help you?
Yes
No