Enumeration OrderType

Can be used as a convenience when specifying your orders to benefit from inline documentation and auto-complete.

See

Example

 const order = { type: OrderType.limit, ...rest }

Enumeration Members

market: "market"

A market order is an order to buy or sell a specified quantity of an asset at the best available current price.


Characteristics:

  • A market order requires specifying the quantity in base terms to be traded
  • For market buy orders:
    • The trade executes immediately for the specified quantity at the current best available sell price.
  • For market sell orders:
    • The trade executes immediately for the specified quantity at the current best available buy price.
  • Market orders prioritize speed of execution over price and are filled using the best available prices until the order quantity is met.
  • Since market orders are filled immediately, they always remove liquidity from the order book and are subject to taker fees.
  • Market orders do not enter the order book as they do not have a price specified and are executed at the current market rate.

See

request RestRequestOrderTypeMarket

The interface that provides the necessary request parameters to create a market order when calling the RestAuthenticatedClient.createOrder method.

limit: "limit"

A limit order is an order to buy or sell a specified quantity of an asset at a price that is equal to or more favorable than a given threshold.


Characteristics:

  • A limit order requires specifying the quantity to be traded (in base terms) and the limit price (in quote terms).
  • For limit buy orders:
    • The trade executes up to the specified quantity, provided the market price is at or below the provided limit price.
  • For limit sell orders:
    • The trade executes up to the specified quantity, provided the market price is at or above the limit price.
  • Limit orders that are priced to cross the existing spread execute immediately and remove liquidity from the order book
    • (i.e. buy orders priced above the current lowest sell price, or sell orders priced below the current highest buy price)
  • Any unfilled portion of a limit order enters the order book, adhering to the specified timeInForce constraints and the maker trade minimum requirements as detailed in IDEX API Documentation - Minimums.

See

stopLossMarket: "stopLossMarket"

A stop-loss market order is an order to buy or sell a specified quantity of an asset when its price moves past a particular point, ensuring a higher probability of achieving a predetermined entry or exit price, limiting the traders loss or locking in a profit. Once the stop price is reached, the stop-loss order becomes a market order.


Characteristics:

  • A stopLossMarket order requires specifying the following request parameters:
  • Activation:
    • The order is not active and will not execute until the market price reaches the specified trigger price.
  • Execution:
    • Once activated, it executes as a market order at the current best available price.
  • Purpose:
    • This type of order is used to limit losses or protect profits in a position.
  • stopLossMarket orders are subject to slippage in fast-moving market conditions.
  • These orders do not guarantee an execution at or near the trigger price.

See

stopLossLimit: "stopLossLimit"

A stopLossLimit order is an order to buy or sell a specified quantity of an asset at a specified limit price, only after the asset's price has reached a specified stop price.

  • When the stop price is reached, the stop-loss order becomes a limit order to buy or sell at the limit price or better.

Characteristics:

  • A stopLossLimit order requires specifying the following request parameters:
    • quantity to be traded (in base terms)
    • the stop triggerPrice (in quote terms) at which the order is triggered
    • and the limit price at which the order should execute.
    • triggerType (enum: TriggerType) which determines the price type for the provided triggerPrice
  • Activation:
    • The order is not active and will not execute until the market price reaches the specified trigger price.
  • Execution:
    • Once activated, it becomes a limit order that will only execute at the specified limit price or better.
  • Purpose:
    • This type of order is used to limit losses or protect profits in a position while providing control over the price at which the order fills.
  • Stop-loss limit orders provide precision in execution price but are not guaranteed to execute if the market does not reach the limit price.
  • These orders can help prevent slippage by setting a specific limit price at which the order can execute.

See

takeProfitMarket: "takeProfitMarket"

A takeProfitMarket order is an order to sell or buy a specified quantity of an asset when its price reaches a specified profit target, ensuring a profit can be realized. Once the take-profit price is reached, the take-profit order becomes a market order.


Characteristics:

  • A takeProfitMarket order requires specifying the following request parameters:
    • quantity to be traded (in base terms)
    • the take-profit triggerPrice (in quote terms) at which the order is triggered.
    • triggerType (enum: TriggerType) which determines the price type for the provided triggerPrice
  • Activation:
    • The order is not active and will not execute until the market price reaches the specified trigger price.
  • Execution:
    • Once activated, it executes as a market order at the current best available price.
  • Purpose:
    • This type of order is used to lock in profits when the asset's price reaches a level that satisfies the trader's profit target.
  • takeProfitMarket orders are subject to slippage in fast-moving market conditions.
  • These orders do not guarantee an execution at or near the trigger price.

See

takeProfitLimit: "takeProfitLimit"

A take-profit limit order is an order to sell or buy a specified quantity of an asset at a specified limit price, only after the asset's price has reached a specified profit target. When the take-profit price is reached, the take-profit order becomes a limit order to sell or buy at the limit price or better.


Characteristics:

  • A take-profit limit order requires specifying the quantity to be traded (in base terms), the take-profit triggerPrice (in quote terms) at which the order is triggered, and the limit price at which the order should execute.
  • Additionally, the triggerType must be specified, indicating the price type for the trigger price (e.g., "last" or "index").
  • Activation:
    • The order is not active and will not execute until the market price reaches the specified trigger price.
  • Execution:
    • Once activated, it becomes a limit order that will only execute at the specified limit price or better.
  • Purpose:
    • This type of order is used to lock in profits when the asset's price reaches a level that satisfies the trader's profit target, while providing control over the price at which the order fills.
  • Take-profit limit orders provide precision in execution price but are not guaranteed to execute if the market does not reach the limit price.
  • These orders can help prevent slippage by setting a specific limit price at which the order can execute.

See

trailingStopMarket: "trailingStopMarket"

A trailingStopMarket order is an order that allows you to sell or buy at the market price once your asset has moved unfavorably by a specified distance (the trailing amount) from its peak price achieved after order placement.

  • It's designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the favorable direction, but closes the trade if the price changes direction by a specified trailing amount.

Characteristics:

  • A trailingStopMarket order requires specifying the following request parameters:
    • quantity to be traded (in base terms)
    • the activation triggerPrice (in quote terms) at which the order is triggered.
    • triggerType (enum: TriggerType) which determines the price type for the provided triggerPrice
    • (Coming Soon: callbackRate%, conditionalOrderId for added flexibility options)
  • Activation:
    • The order is active immediately upon placement, but the trigger price is dynamic and trails the peak price by the specified trailing amount.
  • Execution:
    • If the asset's price moves unfavorably by the trailing amount from its peak price, the order becomes a market order and executes at the current best available price.
  • Purpose:
    • This type of order is used to secure profits while maintaining a position that could potentially benefit from further price movement.
  • trailingStopMarket orders are subject to slippage in fast-moving market conditions.
  • These orders do not guarantee an execution at or near the trigger price once activated.

See