---
title: "POST /trades/search"
method: POST
path: "/trades/search"
tags: ["Trades"]
---

# POST /trades/search

`POST /trades/search`

Trade history search supporting the same filters used by the GMX UI:
marketsDirections (per-tuple market+direction+collateral) and
orderEventCombinations (orderType+eventName+isDepositOrWithdraw+isTwap).

## Request body

- TradesSearchRequest
  - `cursor` string — Opaque pagination cursor returned by previous response.
  - `limit` number, double — Page size, 1..1000. Defaults to 100.
  - `showDebugValues` boolean — When false (default), excludes MarketIncrease/Decrease/Swap OrderCreated debug events.
  - `orderEventCombinations` OrderEventCombination[]
    - `isTwap` boolean
    - `isDepositOrWithdraw` boolean
    - `orderType` number, double
    - `eventName` string
  - `marketsDirections` MarketDirectionFilter[]
    - `collateralAddress` string
    - `direction` 'long' | 'short' | 'swap' | 'any', required
    - `marketAddress` string, required
  - `toTimestamp` number, double — Inclusive upper-bound timestamp filter. Accepts seconds or milliseconds.
  - `fromTimestamp` number, double — Inclusive lower-bound timestamp filter. Accepts seconds or milliseconds.
  - `forAllAccounts` boolean — When true, returns trades for all accounts.
  - `address` string — Trader address. Required unless `forAllAccounts` is true.

## Response `200`

Success

- TradesListResponse
  - `hasMore` boolean, required
  - `nextCursor` string, nullable, required
  - `trades` TradeResponse[], required
    - `reasonBytes` string
    - `reason` string
    - `numberOfParts` number, double
    - `twapGroupId` string
    - `srcChainId` number, double
    - `decreasePositionSwapType` string
    - `proportionalPendingImpactUsd` string
    - `collateralTotalCostAmount` string
    - `swapImpactUsd` string
    - `executionAmountOut` string
    - `totalImpactUsd` string
    - `liquidationFeeAmount` string
    - `swapFeeUsd` string
    - `fundingFeeAmount` string
    - `borrowingFeeAmount` string
    - `traderDiscountAmount` string
    - `positionFeeAmount` string
    - `priceImpactDiffUsd` string
    - `priceImpactUsd` string
    - `basePnlUsd` string
    - `pnlUsd` string
    - `minOutputAmount` string
    - `collateralTokenPriceMax` string
    - `collateralTokenPriceMin` string
    - `indexTokenPriceMax` string
    - `indexTokenPriceMin` string
    - `executionPrice` string
    - `triggerPrice` string
    - `acceptablePrice` string
    - `sizeDeltaInTokens` string
    - `sizeDeltaUsd` string
    - `isLong` boolean
    - `marketAddress` string
    - `shouldUnwrapNativeToken` boolean
    - `initialCollateralDeltaAmount` string, required
    - `initialCollateralTokenAddress` string, required
    - `swapPath` string[], required
    - `transactionHash` string, required
    - `timestamp` number, double, required
    - `orderKey` string, required
    - `orderType` number, double, required
    - `account` string, required
    - `eventName` string, required
    - `id` string, required

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/gmx/apis/gmx-io-gmx-public-api.md) · [All operations](https://skmtc.net/gmx/apis/gmx-io-gmx-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gmx/gmx-io-gmx-public-api/revisions/b3be06047493/schema)
