> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daya.co/llms.txt
> Use this file to discover all available pages before exploring further.

# List Trades

> List trade history for the authenticated user

## Overview

Retrieve a list of executed trades for the authenticated user. Trades represent individual fills against orders.

## Authentication

<ParamField header="X-Api-Key" type="string" required>
  Your API key with Read or Trade scope

  ```
  X-Api-Key: daya_sk_YOUR_API_KEY
  ```
</ParamField>

## Query Parameters

<ParamField query="symbol" type="string">
  Filter by trading pair symbol

  **Example:** `USDT-NGN`
</ParamField>

<ParamField query="order_id" type="string">
  Filter by order ID

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of trades to return

  **Default:** `50`

  **Range:** `1` to `100`
</ParamField>

<ParamField query="offset" type="integer">
  Number of trades to skip for pagination

  **Default:** `0`
</ParamField>

## Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.pro.daya.co/public/v1/trades?symbol=USDT-NGN&limit=20' \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.pro.daya.co/public/v1/trades?symbol=USDT-NGN&limit=20',
    {
      headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
    }
  );

  const data = await response.json();
  console.log('Trade history:', data.data);
  ```

  ```python Python theme={null}
  import requests

  headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}

  response = requests.get(
      'https://api.pro.daya.co/public/v1/trades',
      headers=headers,
      params={'symbol': 'USDT-NGN', 'limit': 20}
  )

  trades = response.json()
  print(f"Trade history: {trades['data']}")
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      req, _ := http.NewRequest("GET", "https://api.pro.daya.co/public/v1/trades?symbol=USDT-NGN&limit=20", nil)
      req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Println("Trade history:", result["data"])
  }
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string" required>
  Human-readable response message
</ResponseField>

<ResponseField name="data" type="array" required>
  Array of trade objects

  <Expandable title="trade properties">
    <ResponseField name="id" type="string">
      Unique trade identifier (UUID)
    </ResponseField>

    <ResponseField name="symbol" type="string">
      Trading pair symbol
    </ResponseField>

    <ResponseField name="side" type="string">
      Trade side relative to the authenticated user (`"buy"` or `"sell"`)
    </ResponseField>

    <ResponseField name="order_id" type="string">
      The authenticated user's order identifier (UUID)
    </ResponseField>

    <ResponseField name="price" type="string">
      Execution price
    </ResponseField>

    <ResponseField name="quantity" type="string">
      Trade quantity in base asset
    </ResponseField>

    <ResponseField name="total_value" type="string">
      Trade value in quote asset (price x quantity)
    </ResponseField>

    <ResponseField name="fee" type="string">
      Fee charged to the authenticated user for this trade
    </ResponseField>

    <ResponseField name="is_maker" type="boolean">
      Whether the authenticated user was the maker (resting order) in this trade
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 trade execution timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp of the response
</ResponseField>

### Success Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Trades retrieved successfully",
    "data": [
      {
        "id": "660e8400-e29b-41d4-a716-446655440000",
        "symbol": "USD-NGN",
        "side": "buy",
        "order_id": "550e8400-e29b-41d4-a716-446655440000",
        "price": "1545.50",
        "quantity": "100.00000000",
        "total_value": "154550.00",
        "fee": "0.15455000",
        "is_maker": false,
        "created_at": "2024-01-15T10:35:01Z"
      },
      {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "symbol": "USD-NGN",
        "side": "sell",
        "order_id": "550e8400-e29b-41d4-a716-446655440001",
        "price": "1548.00",
        "quantity": "50.00000000",
        "total_value": "77400.00",
        "fee": "0.05000000",
        "is_maker": true,
        "created_at": "2024-01-15T10:20:15Z"
      }
    ],
    "timestamp": "2024-01-15T10:35:01Z"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "message": "Unauthorized",
    "error": {
      "code": "API_KEY_INVALID",
      "message": "The provided API key is invalid"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```

  ```json 400 Bad Request - Invalid order_id theme={null}
  {
    "success": false,
    "message": "Validation error",
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid order_id format"
    },
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>

## Rate Limits

* **100 requests per minute** per API key

## Next Steps

<CardGroup cols={2}>
  <Card title="List Orders" icon="list" href="/pro/api-reference/list-orders">
    View your orders
  </Card>

  <Card title="Place Order" icon="arrow-right-arrow-left" href="/pro/api-reference/place-order">
    Place a new order
  </Card>
</CardGroup>
