Lighter icon

Lighter

Interact with Lighter (zkLighter) DEX API - High-performance perpetuals trading

Trading → Create Entry with Brackets

AI-generated

Summary

Creates a market entry with take-profit and stop-loss brackets in a single API call.

Inputs

  • tradingMarketIndex — Market index (0=ETH, 1=BTC, 2=SOL, etc.)
  • tradingSide — Order side
  • tradingSize — Order size in base asset
  • tradingSlippage — Maximum slippage tolerance percentage
  • tradingTP1Price — Take profit 1 trigger price (leave 0 to skip)
  • tradingTP1Percent — Percentage of position to close at TP1
  • tradingTP2Price — Take profit 2 trigger price (leave 0 to skip)
  • tradingTP2Percent — Percentage of position to close at TP2
  • tradingTP3Price — Take profit 3 trigger price (leave 0 to skip)
  • tradingTP3Percent — Percentage of position to close at TP3
  • tradingSLPrice — Stop loss trigger price (leave 0 to skip)

Output shape

JSON response from the Lighter trading backend containing order confirmation details

Returned as a paired item with the original input index; errors may be returned as JSON if continueOnFail is enabled.

Examples

Example 1: Create a long entry with TP1 at 10% and SL at 5%

tradingMarketIndex=0, tradingSide=buy, tradingSize=0.1, tradingTP1Price=0, tradingTP1Percent=10, tradingSLPrice=0.95*entryPrice (not directly set, use SL price param)

Links

Discussion