Perpetual order types on dYdX Chain

Perpetual order types on dYdX Chain

Roselynn Chang avatar
Written by Roselynn Chang
Updated over a week ago

Update as of January 29, 2024: As part of the default settings of the v4 open source software (”dYdX Chain”), conditional orders now trigger either via oracle price (current) or via last trade price if the price is within X% change of the oracle price. Where X =

  • 0.1% for BTC, ETH

  • 0.25% for mid-cap markets

  • 0.4% for low cap markets

---

As part of the default settings of the v4 open source software (”dYdX Chain”), dYdX Chain supports 6 different order types:

  • Market Order

  • Limit Order

  • Stop Market Order

  • Stop Limit Order

  • Take Profit Market Order

  • Take Profit Limit Order

Market Order

A Market Order is an order to buy or sell a given asset and will execute immediately at the best price dependent on the liquidity on the other side of the order book. By default, the front end submits market orders as Fill-or-Kill orders, meaning the order will only be filled if the entire amount can be matched. Partial matches are not filled with this order type and will not execute. Market orders are also used to close positions. For closing positions, the order is submitted as an Immediate-or-Cancel, meaning the order will fill immediately (matched against the other side of the order book) and any part that isn’t filled will be canceled. To place a Market Order, traders can:

  1. Select Market in the trade box

  2. Select Buy or Sell

  3. Enter an Amount to trade or drag the Leverage Slider to the desired position leverage

Amount - this is the amount to buy or sell. This is the amount a trader’s position will increase or decrease by when the order is filled, not the trader’s resulting position amount.

Leverage — Leverage controls how much of a trader’s position is borrowed. The higher the leverage is, the smaller the trader’s margin deposit is and the more funds are borrowed to open a position. Borrowing more funds is riskier, amplifying both a trader’s gains and losses, while also giving positions a riskier liquidation price.

Limit Order

A Limit Order is an order to buy or sell a given asset at a specified (or better) price. A limit order to buy will only execute at the limit price or lower, and a limit order to sell will only execute at the limit price or higher. To place a Limit Order, traders can:

  1. Select Limit in the trade box

  2. Select Buy or Sell

  3. Enter an Amount - this is the total trade size

  4. Enter a Limit Price - this sets the maximum or minimum price at which a trader is willing to buy or sell, this order can only be filled at the specific limit order or better.

Limit orders have a default Good Til Date of 28 days which can be changed.

Advanced Limit Order Options

As part of the default settings of the v4 open source software, traders can also use advanced options such as Good-Til-Date, Fill Or Kill, Immediate or Cancel, or Post-Only. When selecting a limit order, traders can expand the Advanced section to reveal the following Time in Force and Execution policies:

  • Good Til Date: This order will be placed on the order book and automatically expires at the specified date.

  • Fill-or-Kill: This order will only fill if the entire amount can be matched. Partial matches are not filled with this order type and will not execute.

  • Immediate-or-Cancel: This order will fill immediately (matched against the other side of the order book) and any part that isn’t filled will be canceled.

  • Post-Only: This order is either placed in the order book or cancelled if any part of the order matches an existing order. The Post-Only option guarantees that the trader will will pay the maker fee and not the taker fee.

Stop Market Order

A Stop Market Order protects against losses by closing a trader’s position once the oracle price crosses the trigger price. Once the Oracle Price touches the trigger price, a market order will automatically be placed to market buy/sell the order amount. Stop market orders can be used to limit losses on a trader’s positions by automatically closing them when the price falls below (for longs) or rises above (for shorts) the trigger price.

Once triggered, the resulting market order will be immediately filled at the best price on the books.

To place a Stop Market Order:

  1. Select Stop Market under the Stop dropdown menu

  2. Select Buy or Sell

  3. Enter an Amount - this is the total trade size

  4. Enter the desired Trigger Price - the order will trigger when the Oracle Price reaches this amount

Advanced Stop Order Options

As part of the default settings of the v4 open source software, traders can edit the Good Til Time under the Advanced section in the trade box.

Max slippage is 5% for BTC/ETH and 10% for all other markets.

Traders may have multiple stop orders open for a given position.

Stop Limit Order

A Stop Limit Order will execute only when the oracle price crosses a specified Trigger Price. Once the Oracle Price touches the stop price, a limit order will automatically be placed to limit buy/sell a trader’s order amount. Stop limit orders can be used to limit losses on a trader’s positions by automatically closing them when the price falls below (for longs) or rises above (for shorts) the trigger price.

Once triggered, the resulting limit order may either be immediately filled or may rest on the orderbook at the limit price. The limit price operates exactly the same as for normal limit orders.

To place a Stop Limit Order:

  1. Select Stop Limit under the Stop dropdown menu

  2. Select Buy or Sell

  3. Enter an Amount - this is the total trade size

  4. Enter the desired Trigger Price - the order will trigger when the Oracle Price reaches this amount

  5. Enter the desired Limit Price - this will be the limit price of the limit order that is placed once the stop order triggers

Advanced Stop Order Options

As part of the default settings of the v4 open source software, traders can edit the Good Til Time under the Advanced section in the trade box.

Traders may have multiple stop orders open for a given position.

Take Profit Market Order

Take Profit Market orders allow traders to set targets and protect profits on positions by specifying a price at which to close an open position for profit. Take profit market orders lock in profits by closing a trader’s position once the oracle price crosses the trigger price.

For a long position, a trader places a stop above the current market price. For a short position, a trader places the stop below the current market price. Stop limit orders can be used to limit losses on a trader’s positions by automatically closing them when the price falls below (for longs) or rises above (for shorts) the trigger price.

To place a Take Profit Market Order:

  1. Select Take Profit Market under the Stop dropdown menu

  2. Select Buy or Sell

  3. Enter an Amount - this is the total trade size

  4. Enter the desired Trigger Price

Advanced Stop Order Options

As part of the default settings of the v4 open source software, traders can edit the Good Til Time under the Advanced section in the trade box.

The default max slippage is 5% for BTC/ETH and 10% for all other markets.

Take Profit Limit Order

Take Profit Limit orders allow traders to set targets and protect profits on positions by specifying a price at which to close an open position for profit. Take profit limit orders enable profit taking like take profit market orders, but with the versatility and control of a limit order.

For a long position, a trader places a take profit limit above the current market price. For a short position, a trader places the trigger below the current market price. If the Oracle Price rises/drops to take-profit point, the T/P order changes from 'Untriggered' -> 'Open', and then behaves as a traditional limit order. Take-profit orders are best used by short-term traders interested in managing their risk. This is because they can get out of a trade as soon as their planned profit target is reached and not risk a possible future downturn in the market.

To place a Take Profit Limit Order:

  1. Select Take Profit Limit under the Stop dropdown menu

  2. Select Buy or Sell

  3. Enter an Amount - this is the total trade size

  4. Enter the desired Trigger Price

  5. Enter the desired Limit Price

Advanced Stop Order Options

As part of the default settings of the v4 open source software, traders can edit the Good Til Time under the Advanced section in the trade box.

Traders can also add options like Default (Good-Til-Date), Fill-Or-Kill, Immediate-Or-Cancel, or Post-Only.

  • Default (Good Til Date) - This order will be placed on the order book and automatically expires at the specified date. This option is not available for stop / take profit market orders.

  • Fill-or-Kill - This order will only complete if the entire amount can be matched. Partial matches are not filled with this order type and will not execute.

  • Immediate-or-Cancel - This order will fill immediately (matched against the other side of the order book) and any part that isn’t filled will be canceled.

  • Post-Only - This order is either placed in the order book or cancelled if any part of the order matches an existing order. The Post-Only option guarantees that the trader will will pay the maker fee and not the taker fee.

Disclaimer and Terms

This document may provide information with respect to the default settings of dYdX Trading Inc. (”dYdX”) v4 software, or non-mandatory guidelines and suggestions that may help with using v4 software. dYdX does not deploy or run v4 software for public use, or operate or control any dYdX Chain infrastructure. dYdX is not responsible for any actions taken by other third parties who use v4 software. dYdX services and products are not available to persons or entities who reside in, are located in, are incorporated in, or have registered offices in the United States or Canada, or Restricted Persons (as defined in the dYdX Terms of Use). The content provided herein does not constitute, and should not be considered, or relied upon as, financial advice, legal advice, tax advice, investment advice or advice of any other nature, and you agree that you are responsible to conduct independent research, perform due diligence and engage a professional advisor prior to taking any financial, tax, legal or investment action related to the foregoing content. The information contained herein, and any use of v4 software, are subject to the v4 Terms of Use.

Did this answer your question?