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

# POST /trades/search

`POST /trades/search`

## Request

- Base URL: `https://arbitrum.gmxapi.io/v1`
- URL: `https://arbitrum.gmxapi.io/v1/trades/search`
- Auth: none required
- TypeScript: <https://skmtc.dev/gmx/apis/gmx-io-gmx-public-api/docs/trades/search/post.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/gmx/apis/gmx-io-gmx-public-api.md) - [All operations](https://skmtc.dev/gmx/apis/gmx-io-gmx-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gmx/apis/gmx-io-gmx-public-api/revisions/f140bd95ce1d?raw)
