# The DEX liquidity added and removed in a transaction

[Open the transaction's liquidity events →](https://tracefast.xyz/defi/liquidity/by-tx/0x7730d7a24d8e69cc5f74b5ffded346d4dc735a9f3ad78703b6a24ecec6151c06)

Every liquidity event in the transaction, in log order — the pool, its protocol, the provider, whether liquidity was added or removed, and each token leg: the token with its declared symbol and decimals (verbatim, not verified), the raw amount and in token units, and its USD value with the price and how it was valued, as the source states them. An empty list means no liquidity event happened in the transaction. A transaction past the events' reach answers 422 rather than an empty list. Uniswap v4 liquidity events are not recorded.

```
GET https://tracefast.xyz/api/v1/chains/1/transactions/{hash}/liquidity-events
```

| Parameter | In | Type | Notes |
|---|---|---|---|
| `hash` | path | string | The transaction hash, `0x` + 64 hex, any case. |

**Access** — an [API key](/api/authentication) on the **Investigation** plan or higher ([plans](/api/authentication#plans)), or no key at all: pay per call with [x402](/api/x402) at the same path on `https://mpp.tracefast.xyz/api/v1`, at the price its `402` states. As a tool for AI agents: `get_transaction_liquidity_events` on the [MCP server](/api/mcp-server). **Stable** — see [stability](/api/conventions#stability).

`chains/1` is a literal: other chain ids answer `404 chain_not_supported`. An unknown query parameter is refused rather than ignored.

## Response

`200 application/json`, a transaction that added liquidity to the Uniswap v3 USDC/WETH pool. Lists in the example are cut to two entries.

```json
{
  "data": {
    "chainId": 1,
    "hash": "0x7730d7a24d8e69cc5f74b5ffded346d4dc735a9f3ad78703b6a24ecec6151c06",
    "events": [
      {
        "logIndex": 131,
        "pool": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
        "protocol": "uniswap",
        "protocolVersion": "v3",
        "provider": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
        "action": "add",
        "eventType": "mint",
        "pricedLegs": 2,
        "unpricedLegs": 0,
        "legs": [
          {
            "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "role": "underlying",
            "amountRaw": "138126992059",
            "amount": 138126.992059,
            "direction": "pool_in",
            "amountUsd": 138126.992059,
            "priceUsd": 1,
            "valuationStatus": "priced"
          },
          {
            "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "role": "underlying",
            "amountRaw": "0",
            "amount": 0,
            "direction": "zero",
            "amountUsd": 0,
            "priceUsd": 1796.2609021225487,
            "valuationStatus": "priced"
          }
        ]
      }
    ]
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1794918389768,
    "cached": false,
    "asOfBlock": 26434404,
    "docs": "https://docs.tracefast.xyz/api/transaction-liquidity-events"
  }
}
```

### `data`

| Field | Meaning |
|---|---|
| `chainId` | Chain id. `1` is Ethereum mainnet. |
| `events` | The transaction's liquidity events, in log order. |
| `hash` | The transaction hash, lowercase and `0x`-prefixed. |

### `data.events[]`

| Field | Meaning |
|---|---|
| `action` | `add` or `remove`. |
| `eventType` | The event as the pool names it, for example `mint`, `burn`, `add_liquidity`. |
| `legs` | The event's token legs. |
| `logIndex` | The event's index in the block. |
| `pool` | The pool, lowercase and `0x`-prefixed. |
| `pricedLegs` | The event's token legs that could be priced. |
| `protocol` | The pool's protocol, for example `uniswap` or `curve`. |
| `protocolVersion` | The protocol's version, for example `v3`. |
| `provider` | The liquidity provider the event names, where it names one. |
| `unpricedLegs` | The event's token legs that could not be priced. |

### `data.events[].legs[]`

| Field | Meaning |
|---|---|
| `amount` | `amountRaw` in whole token units (scaled by `decimals`) as a floating-point number — an approximation for display; `amountRaw` is exact. Absent when the decimals are unknown. |
| `amountRaw` | The amount in the token's smallest unit, as a signed decimal string: positive into the pool, negative out of it. The exact amount. |
| `amountUsd` | The leg's USD value, as a positive number. Absent when it could not be priced. |
| `decimals` | The decimals the token contract declares. Absent when unknown. |
| `direction` | Whether the leg went into the pool or out of it: `pool_in`, `pool_out`, `zero` or `unknown`. |
| `priceUsd` | The USD price of one whole token behind `amountUsd`. Absent when it could not be priced. |
| `role` | The token's role in the event, as the source states it. |
| `symbol` | The symbol the token contract declares — verbatim, not verified. Absent when unknown. Absent when longer than 64 characters — left out whole, never shortened. |
| `token` | The leg's token, lowercase and `0x`-prefixed. Absent when it could not be resolved. |
| `valuationStatus` | How the leg was valued, as the source states it: `priced` when it carries a USD value, otherwise why it does not. |

`meta` is the same envelope on every method — see [conventions](/api/conventions#meta).

## Errors

| Status | When |
|---|---|
| 400 | `bad_request`: a malformed hash (`tx_hash_invalid`), or a query parameter was given |
| 404 | `not_found`: no transaction with that hash; `chain_not_supported`, or an unknown path |
| 422 | `block_not_available`: the transaction is past the liquidity events' reach (`coverage_gap`, `details.maxAvailableBlock`), or transactions are temporarily unavailable around it; retry later |
| 503 | `service_unavailable`: the events' reach could not be read; retry with backoff; or `service_degraded`: who is calling could not be established right now; retry after `Retry-After`. |

Malformed input, unknown parameters and the key check's `401`/`403`/`429`/`503` are the same for every method — see [conventions](/api/conventions#errors) and [API keys](/api/authentication#when-a-key-is-refused).

## Related pages

* [One transaction](/api/transaction)
* [Transaction events](/api/transaction-events)
* [Why it reverted](/api/transaction-failures)
* [Execution trace](/api/trace)
* [All API methods](/api/methods) — every method on one page
* [Conventions](/api/conventions) — requests, responses, errors and pagination
