Enumeration TimeInForce

Time in force policies specify the behavior of a limit order upon execution.

See

Enumeration Members

Enumeration Members

gtc: "gtc"

Good Till Canceled (gtc)

  • The gtc time in force policy keeps a limit order open until it is either filled or manually canceled by the trader.
  • This is the default behavior for limit orders if the timeInForce parameter is not provided.

Characteristics:

  • Persistence: A gtc order remains active on the order book until it is executed or canceled.
  • Default Option: If you do not specify a time in force, gtc is assumed.

Example

import { TimeInForce, OrderType } from '@idexio/idex-sdk';

authenticatedClient.createOrder({
type: OrderType.limit,
timeInForce: TimeInForce.gtc,
// ... other limit order parameters
});

See

docs IDEX API Documentation: Time in Force Explained

gtx: "gtx"

Good Til Crossing (gtx)

  • The gtx time in force policy ensures that a limit order will only execute if it does not immediately match with an existing order.
  • This policy is used to guarantee that an order will only add liquidity to the market and not take liquidity away.
  • Applicable to all limit orders, gtx is particularly useful for traders who wish to avoid paying taker fees.

Characteristics:

  • Post-Only: A gtx order is rejected if it would immediately match with an existing order upon submission.
  • Liquidity Addition: Ensures the order contributes liquidity, qualifying it for potential maker fee rebates.

Example

import { TimeInForce, OrderType } from '@idexio/idex-sdk';

authenticatedClient.createOrder({
type: OrderType.limit,
timeInForce: TimeInForce.gtx,
// ... other limit order parameters
});

See

docs IDEX API Documentation: Time in Force Explained

ioc: "ioc"

Immediate Or Cancel (ioc)

  • An ioc time in force policy is used for limit orders that should be executed immediately.
  • Any portion of the order that cannot be filled right away is canceled, ensuring no part of the order remains on the order book.
  • This policy is ideal for traders who prioritize speed of execution over full order fulfillment.

Characteristics:

  • Immediate Execution: An ioc order attempts to fill immediately upon placement.
  • Partial Fulfillment: If the full order cannot be executed, the unfilled portion is immediately canceled.
  • No Resting Orders: ioc orders do not become resting orders on the book, preventing any residual market impact.

Example

import { TimeInForce, OrderType } from '@idexio/idex-sdk';

authenticatedClient.createOrder({
type: OrderType.limit,
timeInForce: TimeInForce.ioc,
// ... other limit order parameters
});

See

docs IDEX API Documentation: Time in Force Explained

fok: "fok"

Fill Or Kill (fok)

  • The fok time in force policy requires that a limit order be filled in its entirety immediately upon placement or not at all.
  • This policy is used by traders who need a guarantee that their order will be executed as a single transaction at a known price.
  • fok orders are particularly useful for large orders that could be subject to price slippage if executed in smaller increments.
  • fok orders must specify the SelfTradePrevention.cn (Cancel Newest) selfTradePrevention policy.

Characteristics:

  • All-or-Nothing: A fok order must be completely filled with a single transaction or it is entirely canceled.
  • Price Certainty: Ensures that the order will execute at a single price point, providing full cost transparency.
  • No Partial Fills: Eliminates the possibility of partial order execution, which can be critical for certain trading strategies.

Example

import { TimeInForce, OrderType } from '@idexio/idex-sdk';

authenticatedClient.createOrder({
type: OrderType.limit,
timeInForce: TimeInForce.fok,
// ... other limit order parameters
});

See