# Trades

`GET /trades`

> Sample Response

```
{
  "message":[
    {...}, // see trade by ID response below
    {...}  // see trade by ID response below
  ],
  "page":1,
  "total_pages":45
}
```

This returns an array of all trades received by NDAXs where the requestor is the Platform, either party associated with the trade, or the account group where the trade was settled.

Optional query parameters include:

* `market_identifier_code` filters trades to ones on a specific market (SCXM for Seed Digital Commodities Market for example)
* `omit_market_identifier_code` filters out trades from one specific market
* `platform_code` filters trades to ones on a specific Platform on which the trade was executed
* `omit_platform_code` filters out trades from one specific Platform
* `trade_state` filters trades to ones in a specific trade\_state
* `settlement_state` filters trades to ones in a specific settlement\_state
* `party_code` filters trades to ones that include a party\_code in any of the parties
* `transaction_timestamp` filters trades based on a given timestamp in milliseconds `1593798130060` or nanoseconds `1593798130060000000` using the following next params for the following filter types:
  * `[gt]` greater than a given timestamp, e.g. `transaction_timestamp[gt]=1593798130060`
  * `[gte]` greater than or equal to a given timestamp, e.g. `transaction_timestamp[gte]=1593798130060`
  * `[e]` equal to a given timestamp, e.g. `transaction_timestamp[e]=1593798130060`
  * `[lt]` less than a given timestamp, e.g. `transaction_timestamp[lt]=1593798130060`
  * `[lte]` lower than or equal to a given timestamp, e.g. `transaction_timestamp[lte]=1593798130060`
  * combinations are also possible, e.g. to find a trades between `1593798130555` and `1593798130777` you can use the next combination `transaction_timestamp[gt]=1593798130555&transaction_timestamp[lt]=1593798130777`
* `page` for paginating through the trades
* `client_trade_id` filters trades based on the client\_trade\_id
* `reporting_party` filters trades based on the reporting\_party
* `settlement_schedule` filters trades based on the settlement\_schedule

#### `GET /trades/:trade_id` <a href="#get-trades-trade_id" id="get-trades-trade_id"></a>

A trade is a request to exchange assets on the NDAX exchange. When a trade is submitted, NDAX assigns it a unique identifier called the 'trade\_id'. This identifier is returned in the response from the trade submission endpoints, which are specific routes on the server used to initiate trades. The 'trade\_id' can be used to track the progress of the trade and retrieve information about it.

> Sample Response

```
{
  "message": {
    "trade_id": "9411a2d9-8964-47d0-8971-a52db2f65748",
    "client_trade_id": "fjfd9wekdwoc0sdkcs09w",
    "session_id": "20190801000000",
    "trade_state": "terminated",
    "market_identifier_code": "NDAX",
    "reporting_party": "00NDAX",
    "settlement_schedule": "ABCDEF",
    "symbol": "BTC/e₹",
    "trade_quantity": "4",
    "trade_price": "10000",
    "trade_type": "block",
    "physical_delivery": true,
    "comment": null,
    "last_update": 1565832456717,
    "transaction_timestamp": 1565731066447,
    "settlement_timestamp": 1565731965906,
    "accepted_timestamp": 1565731066768,
    "defaulted_timestamp": null,
    "settled_timestamp": 1565794980952,
    "contract_size": 1,
    "bank_fee": "1.00",
    "underlying": "BTC",
    "quoted_currency": "e₹",
    "trade_reporter": "user@NSE.com",
    "platform_code": "DNSE",
    "product_type": "spot",
    "parties_anonymous": false,
    "parties": [
      {
        "participant_code": "WKC2M0",
        "side": "buy",
        "asset": "BTC",
        "amount": "4",
        "liquidity_indicator": null,
        "execution_id": "ex_id1",
        "order_id": "foo",
        "desk_code": null,
        "trading_account_code": null,
        "obligations_outstanding_timestamp": null,
        "current_obligations_met_timestamp": null,
        "settlement_state": "settled",
        "client_order_id": null,
        "settling": true
      },
      {
        "participant_code": "NDAX",
        "side": "sell",
        "asset": "e₹",
        "amount": "40000",
        "liquidity_indicator": null,
        "execution_id": "ex_id2",
        "order_id": "foo",
        "desk_code": null,
        "trading_account_code": null,
        "obligations_outstanding_timestamp": null,
        "current_obligations_met_timestamp": null,
        "settlement_state": "settled",
        "client_order_id": null,
        "settling": true
      }
    ]
  }
}
```
