For the complete documentation index, see llms.txt. This page is also available as Markdown.

trades

Get trades for lighter accounts, including sub-accounts and public pools. auth is required for master accounts and sub accounts.

get
/api/v1/trades
Query parameters
market_idinteger · int16Optional

Public market identifier returned by orderBooks or events.

Default: 255
market_typestring · enumOptional

Market filter: perp, spot or bo; comma-separated values or all.

Default: allPossible values:
account_indexinteger · int64Optional

Account index to query.

Default: -1
order_indexinteger · int64Optional

Filter by the exchange-assigned order index; not a trade ID.

sort_bystring · enumRequired

Field to sort by.

Possible values:
sort_dirstring · enumOptional

Sort direction.

Default: descPossible values:
cursorstringOptional

Opaque pagination cursor returned by the previous response; pass it unchanged.

frominteger · int64Optional

Exclusive starting value in the selected sort_by field; timestamp uses Unix milliseconds. cursor takes precedence.

Default: -1
ask_filterinteger · int8Optional

Side filter: -1 = both sides, 0 = bids/buys, 1 = asks/sells.

Default: -1
rolestring · enumOptional

Select fills where the account was the maker or taker, or all fills.

Default: allPossible values:
typestring · enumOptional

Select one of the listed record types.

Default: allPossible values:
limitinteger · int64 · min: 1 · max: 100Required

Maximum number of records to return.

aggregatebooleanOptional

Include remaining fills for the last order on the page; requires account_index.

Default: false
skip_ask_order_idstringOptional

Skip fills belonging to this ask order ID (decimal string).

skip_bid_order_idstringOptional

Skip fills belonging to this bid order ID (decimal string).

integrator_account_indexinteger · int64Optional

Filter trades or statistics attributed to this integrator account index.

Default: -1
order_index_strstringOptional

takes precedence over order_index; for clients that cannot represent uint64 exactly

Header parameters
authorizationstringOptional

Auth token in the Authorization header.

Responses
200

A successful response.

application/json
codeinteger · int32RequiredExample: 200
messagestringOptional
next_cursorstringOptional
get/api/v1/trades
GET /api/v1/trades?sort_by=block_height&limit=1 HTTP/1.1
Host: mainnet.zklighter.elliot.ai
Accept: */*
{
  "code": 200,
  "message": "text",
  "next_cursor": "text",
  "trades": [
    {
      "trade_id": 145,
      "tx_hash": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
      "type": "trade",
      "market_id": 1,
      "size": "0.1",
      "price": "3024.66",
      "usd_amount": "3024.66",
      "ask_id": 145,
      "bid_id": 245,
      "ask_account_id": 1,
      "bid_account_id": 3,
      "is_maker_ask": true,
      "block_height": 45434,
      "timestamp": 1640995200,
      "taker_fee": 0,
      "taker_position_size_before": "0",
      "taker_entry_quote_before": "0",
      "taker_initial_margin_fraction_before": 0,
      "taker_position_sign_changed": true,
      "maker_fee": 0,
      "maker_position_size_before": "0",
      "maker_entry_quote_before": "0",
      "maker_initial_margin_fraction_before": 0,
      "maker_position_sign_changed": true,
      "transaction_time": 1771943742851429,
      "bid_account_pnl": "-0.022890",
      "ask_account_pnl": "1.989696",
      "ask_client_id": 145,
      "bid_client_id": 245,
      "ask_client_id_str": "145",
      "bid_client_id_str": "245",
      "ask_id_str": "145",
      "bid_id_str": "245",
      "trade_id_str": "145",
      "integrator_maker_fee": 50,
      "integrator_maker_fee_collector_index": 156,
      "integrator_taker_fee": 50,
      "integrator_taker_fee_collector_index": 156,
      "taker_allocated_margin_usdc_before": 1100000000000000,
      "taker_allocated_margin_usdc_after": 150000000000000,
      "maker_allocated_margin_usdc_before": 210000000000000,
      "maker_allocated_margin_usdc_after": 250000000000000,
      "bid_order_version": 1,
      "ask_order_version": 1,
      "market_symbol": "ETH",
      "market_kind": "perps"
    }
  ]
}

Last updated

Was this helpful?