# All trades

## What is this endpoint for? <a href="#what-is-this-endpoint-for" id="what-is-this-endpoint-for"></a>

Tick-level data is the most granular level of trading data, and contains every single trade that occurs or centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEX’s specifically, we also provide additional information on the user address, the blockchain, the pool address and transaction hash related to the trade.

Learn about our methodologies for [DEX data](https://25446524.fs1.hubspotusercontent-eu1.net/hubfs/25446524/Case%20Studies%20%2B%20Data%20Gudies/DEX%20Methodology.pdf) and [Uniswap V3](https://25446524.fs1.hubspotusercontent-eu1.net/hubfs/25446524/Factsheets%20and%20Methodologies/Uniswap_V3_snapshot_Dec22.pdf).

## Endpoints

{% tabs %}
{% tab title="gRPC" %}

```url
gateway-v0-grpc.kaiko.ovh
```

{% endtab %}

{% tab title="http" %}

```url
gateway-v0-http.kaiko.ovh
```

{% endtab %}

{% tab title="API (testing)" %}

```url
https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1
```

{% endtab %}
{% endtabs %}

## Request parameters

<table><thead><tr><th width="184">Parameter</th><th width="387">Description</th><th>Examples</th></tr></thead><tbody><tr><td><code>instrumentCriteria</code></td><td><p>A <strong>nested object</strong> to configure following properties for your stream: </p><ul><li><code>exchange</code> (String) - The code(s) for the exchange(s)</li><li><code>instrument_class</code> (String) - The class(es) of the instrument(s) .</li><li><code>code (String) -</code> The Kaiko code for the instrument.</li></ul><p>Explore instruments, codes and exchanges in the <a href="https://instruments.kaiko.com/#/instruments">Instrument Explorer</a> or <a data-mention href="/spaces/ltAbhvgBfrAWlpUnC7ys/pages/ypeWZ4XSK6XHt2hrySeK">/spaces/ltAbhvgBfrAWlpUnC7ys/pages/ypeWZ4XSK6XHt2hrySeK</a>. </p></td><td><p><code>cbse</code></p><p></p><p><code>spot</code></p><p></p><p><code>btc-usd</code><br><br></p></td></tr><tr><td><code>commodities</code></td><td>Must always be <code>[pb_commodity.SMUC_TRADE]</code></td><td><code>[pb_commodity.SMUC_TRADE]</code></td></tr><tr><td><code>interval</code></td><td>For accessing 72h replay data only. See the replay code example.</td><td><code>start_time</code><br><br><code>end_time</code></td></tr></tbody></table>

{% hint style="info" %}
**Configuring a wildcard**

A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream.\
\
Use a `*` in place of the relevant `exchange`, `instrument`, or `class` parameter. <br>

For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

`exchange: *`\
`class: spot`\
`instrument: btc-usd`
{% endhint %}

## Response fields

<table><thead><tr><th width="213">Field</th><th width="537">Description</th></tr></thead><tbody><tr><td><code>additionalProperties</code></td><td>Additional properties, specific to the exchange.</td></tr><tr><td><code>amount</code></td><td>Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).</td></tr><tr><td><code>class</code></td><td>Instrument class, empty when not mapped.</td></tr><tr><td><code>code</code></td><td>Instrument code, empty when not mapped.</td></tr><tr><td><code>exchange</code></td><td>Instrument exchange code.</td></tr><tr><td><code>sequenceId</code></td><td>Sequence ID for event. Sortable in lexicographic order.</td></tr><tr><td><code>id</code></td><td>Trade ID, empty string when not present.</td></tr><tr><td><code>price</code></td><td>Price for the trade.</td></tr><tr><td><code>tsExchange</code></td><td>The timestamp provided by the exchange for the transaction.</td></tr><tr><td><code>tsCollection</code></td><td>The timestamp for when Kaiko received the trade from the exchange.</td></tr><tr><td><code>tsEvent</code></td><td>The timestamp the data became available in the Kaiko system.</td></tr><tr><td><code>side</code></td><td>- UNKNOWN: Unknown side (not specified).<br>- BUY: Buy side.<br>- SELL: Sell side.<br><br>See <a href="https://docs.kaiko.com/v/kaiko-rest-api/general/getting-started/api-output/taker_side_sell-explained">"taker_side_sell" Explained</a></td></tr></tbody></table>

## Request examples

{% tabs %}
{% tab title="Python" %}
{% @github-files/github-code-block url="<https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/market_update_request.py>" visible="false" %}
{% endtab %}

{% tab title="Python (Replay)" %}
**This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in `hours`, `seconds`, and `minutes`.** \
\
**Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.**

{% @github-files/github-code-block url="<https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/market_update_request_replay.py>" visible="false" %}
{% endtab %}

{% tab title="cURL" %}
**cURL requests are intended for testing purposes only.**

{% code overflow="wrap" %}

```url
curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"*\" }, \"commodities\": [\"SMUC_TRADE\"]}"
```

{% endcode %}
{% endtab %}

{% tab title="Other examples" %}
For more advanced users, you can access our full SDK [here](https://github.com/kaikodata/kaiko-sdk-examples/tree/master), where you'll find more coding languages, examples and guidance.
{% endtab %}
{% endtabs %}

## Response Example

```json
{
    "result": {
        "additionalProperties": {
            "sequence": "85453949096"
        },
        "amount": 0.31157787,
        "class": "spot",
        "code": "btc-usd",
        "exchange": "cbse",
        "sequenceId": "cqpo618mna6i5t62gp4g",
        "id": "677226346",
        "price": 56510,
        "side": "SELL",
        "tsExchange": {
            "value": "2024-08-07T14:21:57.046442Z"
        },
        "tsCollection": {
            "value": "2024-08-07T14:21:57.131157967Z"
        },
        "tsEvent": "2024-08-07T14:21:57.329633824Z"
    }
}
```


---

# Agent Instructions: 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:

```
GET https://docs.kaiko.com/stream/data-feeds/level-1-and-level-2-data/level-1-tick-level/all-trades.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
