Placing a Limit order

Other than market orders, LogX also supports opening limit and TPSL orders. The core function responsible for creating an order is OrderManager.createOrders and it accepts:

  • collateralDelta: amount of collateral tokens

  • indexToken: address of the index token you want to create an order for

  • sizeDelta: size by which you want to increase or decrease your position via this order

  • collateralToken: address of the collateral token

  • isLong: weather this is an order for a long or short position.

  • isIncreaseOrder: true if this is an order to increase a position, and false for decreasing a position.

  • _executionFee

  • limitPrice

  • tpPrice

  • slPrice

  • maxOrder


  1. For opening, just Limit order (can be open or close) specify only the limitPrice as the price at which you want to trigger your order and leave tpPrice and slPrice as 0. _executionFee should be >= OrderManager.minExecutionFeeLimitOrder in this case.

  2. For placing Take Profit or Stop Loss order, specify tpPrice and slPrice and leave limitPrice as 0.

  3. Only take profit orders; limitPrice: 0, tpPrice: trigger price for order execution, slPrice 0

  4. Only stop loss order; limitPrice: 0, tpPrice: 0, slPrice: trigger price for order execution

IMPORTANT: An order can either be a limit order or a tpsl order.

Last updated