> For the complete documentation index, see [llms.txt](https://docs.kaiko.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaiko.com/rest-api/data-feeds/level-1-and-level-2-data/level-1-tick-level/dex-trades.md).

# DEX trades

## What is this endpoint for?

Tick-level data is the most granular level of trading data and contains every single trade that occurs on decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade, the user address, the blockchain, the pool address, and the transaction hash related to the trade.\
\
Read our DEX trade data methodology [here](https://25446524.fs1.hubspotusercontent-eu1.net/hubfs/25446524/Case%20Studies%20%2B%20Data%20Gudies/DEX%20Methodology.pdf).&#x20;

### Endpoint

{% code overflow="wrap" %}

```http
https://{region}.market-api.kaiko.io/v3/data/trades.v1/dexs/{blockchain}/{asset_address}
```

{% endcode %}

### Path Parameters

<table><thead><tr><th width="203">Parameter</th><th>Required?</th><th>Description</th></tr></thead><tbody><tr><td><code>region</code></td><td>Yes</td><td>Choose between <code>eu</code> and <code>us</code>.</td></tr><tr><td><code>blockchain</code></td><td>Yes</td><td>Blockchain name.</td></tr><tr><td><code>asset_address</code></td><td>Yes</td><td>Asset address on the specified blockchain.</td></tr></tbody></table>

### Query Parameters

<table><thead><tr><th width="231">Parameter</th><th width="109">Required</th><th width="379">Description</th></tr></thead><tbody><tr><td><code>start_time</code></td><td>No</td><td>Starting time in ISO 8601 (inclusive). <br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>end_time</code></td><td>No</td><td>Ending time in ISO 8601 (exclusive). <br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>page_size</code></td><td>No</td><td>See <a data-mention href="/pages/mP3amLsYqKTsrRBoblxX">/pages/mP3amLsYqKTsrRBoblxX</a><br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>continuation_token</code></td><td>No</td><td>See <a data-mention href="/pages/mP3amLsYqKTsrRBoblxX">/pages/mP3amLsYqKTsrRBoblxX</a></td></tr><tr><td><code>sort</code></td><td>No</td><td>Return the data in ascending (asc) or descending (desc) order. Default desc.</td></tr></tbody></table>

### Fields

| Field              | Description                                                                                                      |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `timestamp`        | The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in nanoseconds)            |
| `trade_id`         | Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves. |
| `price`            | Price displayed in quote currency.                                                                               |
| `token1_address`   |                                                                                                                  |
| `token2_address`   |                                                                                                                  |
| `amount`           | Quantity of asset bought or sold (can be in base\_asset, quote\_asset or the number of contracts).               |
| `taker_side_sell`  | See ["taker\_side\_sell" Explained](/rest-api/general/getting-started/api-output/taker_side_sell-explained.md)   |
| `blockchain`       | The blockchain on which the trade happened.                                                                      |
| `transaction_hash` | Transaction hash.                                                                                                |
| `log_index`        | The log index of the event (in base 10).                                                                         |
| `pool_address`     | The address of the pool in which the trade happened.                                                             |
| `user_address`     | Trader address (beneficiary).                                                                                    |
| `block_number`     | The block number.                                                                                                |

### Request examples

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```url
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v3/data/trades.v1/dexs/ethereum/0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" %}

```python
##### 1. Import dependencies #####
import requests
import pandas as pd

##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "ethereum" 
asset_address = "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee"

# ---- Optional parameters ---- #
sort = "desc"
page_size = "100"
start_time= "2025-01-01T00:00:00Z"
end_time= "2025-01-01T00:03:00Z"

# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"

##### 3. Get the data #####
# ---- Function to run an API call ---- # 
# Get the data in a dataframe --------- # 

def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
    headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
    
    url = f'https://us.market-api.kaiko.io/v3/data/trades.v1/dexs/{blockchain}/{asset_address}'
    params = {
        "start_time": start_time,
        "end_time": end_time,
        "sort": sort,
        "page_size": page_size
    }

    try:
        res = requests.get(url, headers=headers, params=params)
        res.raise_for_status() 
        data = res.json()
        if 'data' not in data:
            print("No data returned.")
            return pd.DataFrame() 
        df = pd.DataFrame(data['data'])

        # Handle pagination with continuation token
        while 'next_url' in data:
            next_url = data['next_url']
            if next_url is None:
                break
            res = requests.get(next_url, headers=headers)
            res.raise_for_status()
            data = res.json()
            if 'data' in data:
                df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
        return df

    except requests.exceptions.RequestException as e:
        print(f"API request error: {e}")
        return pd.DataFrame() 

# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size))
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Response example

```json
{
    "query":
    {
        "start_time": "2010-01-01T00:00:00.000Z",
        "page_size": 100,
        "exchange": "*",
        "instrument_class": "*",
        "instrument": "*",
        "sort": "desc",
        "data_version": "v1",
        "commodity": "dex_trades",
        "request_time": "2026-06-18T17:48:43.355Z",
        "start_timestamp": 1262304000000,
        "live": "True"
    },
    "time": "2026-06-18T17:48:43.355Z",
    "timestamp": 1781804923355,
    "access":
    {
        "access_range":
        {
            "start_timestamp": 1073001600000,
            "end_timestamp": 1861830000000
        },
        "data_range":
        {
            "start_timestamp": "None",
            "end_timestamp": 1861830000000
        }
    },
    "data":
    [
        {
            "timestamp": 1781804435000,
            "trade_id": "ethereum-u4-0x373d4a1b17f68ef3e7a35fa7069301d8dd0491b1345a3e2c1987449c894a3d43-0x19b-0x7b2df9aa55101bb4251bb0a3d48ca08deedf3eefc39899d9fea1192e751b5bcf",
            "price": "0.9115886885456722",
            "token1_address": "0x0000000000000000000000000000000000000000",
            "token2_address": "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee",
            "amount": "0.05",
            "taker_side_sell": "False",
            "blockchain": "ethereum",
            "transaction_hash": "0x373d4a1b17f68ef3e7a35fa7069301d8dd0491b1345a3e2c1987449c894a3d43",
            "log_index": 411,
            "pool_address": "0x8fab936c814e050b67f4ff50c73bd35561f0c7e8855c7f6aaa38f6762d3520f2",
            "user_address": "0xba8d1c4fce49bcc8aa5146bccdeaf8d032697613",
            "block_number": 25346002
        },
        /* MORE ROWS */
    ],
    "result": "success",
    "continuation_token": "xxx",
    "next_url": "https://eu.market-api.kaiko.io/v3/data/trades.v1/dexs/ethereum/0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee?continuation_token=xxx"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kaiko.com/rest-api/data-feeds/level-1-and-level-2-data/level-1-tick-level/dex-trades.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
