LogX Docs
  • LogX Aggregator
    • Trading Guide
      • Open Position - Market Order
      • Close Position - Market Order
      • Positions
      • Open Position - Limit Order
      • Close Position - Limit Order
      • Cancel Order
      • Orders
      • Open Position - TPSL Order
      • Close Position - TPSL Order
    • Functional Guide
      • Chains
      • Exchanges
      • Routing
      • Assets
      • Fees
    • Technical Guide
      • Architecture
      • Contracts
    • Protocol Details
      • Audits
      • APIs
      • Bug Bounty
  • LogX Perp Dex
    • Overview
    • Liquidity
      • Liquidity Providers
      • LLP Token
    • Chains and Pairs
    • Fee Structure
    • Incentives and Rewards
    • Contracts
      • Blast
    • Technical Overview
      • Open/Increase a market Position
      • Close/Decrease a Market position
      • Market Order Execution
      • Placing a Limit order
      • Limit and TPSL Order Execution
      • Liquidations
      • Adding/Removing Liquidity
      • Staking
  • Audit
Powered by GitBook
On this page
  1. LogX Perp Dex
  2. Technical Overview

Open/Increase a market Position

In order to create or increase a position:

  1. Approve the Order Manager Contract for the token and the amount you want to use as collateral in order to open a position.

  2. Call OrderManager.createIncreasePosition() with the following parameters:

  • _collateralToken: address of the collateral token

  • _indexToken: address of the token you want to long or short.

  • _amountIn: specifies the amount of collateral tokens.

  • _sizeDelta: USD value of the size you want to open a position.

  • _isLong: whether the position is long or short.

  • _acceptablePrice: price at which you want your position request to get executed.

  • takeProfitPrice: If you want to open a take profit while placing a market order, pass the TP price in this parameter; otherwise, leave it as 0.

  • stopLossPrice: Similar to takeProfitPrice, if you want to specify a stop loss for the position while placing a market order, pass the SL price in this parameter; otherwise, leave it as 0.

  • _executionFee

    • If placing a market order, this should be >= OrderManager.minExecutionFeeMarketOrder.

    • If placing a tp or sl order, _executionFee should be >= OrderManager.minExecutionFeeMarketOrder + OrderManager.minExecutionFeeLimitOrder

    • If placing a tp and sl order along with the market order, _executionFee >= minExecutionFeeMarketOrder + 2 * minExecutionFeeLimitOrder

  1. After this transaction, a request to create your position will be created, and a keeper will execute your request. Note that a request can either be executed or fail.

  2. If the position cannot be increased due to factors like the unfulfilled acceptable price, the request will be terminated, and the funds will be returned to the sender (msg.sender)

PreviousTechnical OverviewNextClose/Decrease a Market position

Last updated 1 year ago