trades
Get trades for lighter accounts, including sub-accounts and public pools. auth is required for master accounts and sub accounts.
Public market identifier returned by orderBooks or events.
255Market filter: perp, spot or bo; comma-separated values or all.
allPossible values: Account index to query.
-1Filter by the exchange-assigned order index; not a trade ID.
Field to sort by.
Sort direction.
descPossible values: Opaque pagination cursor returned by the previous response; pass it unchanged.
Exclusive starting value in the selected sort_by field; timestamp uses Unix milliseconds. cursor takes precedence.
-1Side filter: -1 = both sides, 0 = bids/buys, 1 = asks/sells.
-1Select fills where the account was the maker or taker, or all fills.
allPossible values: Select one of the listed record types.
allPossible values: Maximum number of records to return.
Include remaining fills for the last order on the page; requires account_index.
falseSkip fills belonging to this ask order ID (decimal string).
Skip fills belonging to this bid order ID (decimal string).
Filter trades or statistics attributed to this integrator account index.
-1takes precedence over order_index; for clients that cannot represent uint64 exactly
Auth token in the Authorization header.
A successful response.
200Bad request
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?