---
title: "Get historical \"Token God Mode\" (TGM) DEX trades (Beta)"
method: POST
path: "/api/v1beta1/tgm/historical-dex-trades"
tags: ["Token God Mode"]
---

# Get historical "Token God Mode" (TGM) DEX trades (Beta)

`POST /api/v1beta1/tgm/historical-dex-trades`

**Beta — subject to breaking changes.**

Access historical DEX trading transactions for a specific token with temporally-correct
trader labels. Labels are resolved at the trade date using label history tables to
avoid forward-looking bias.

**Key differences from `/tgm/dex-trades`:**
- Accepts an explicit `date_range` (no rolling default)
- Labels resolved at the trade date, not the current state
- No `token_address` / `traded_token_address` in the response
- No `only_smart_money` flag — use `filters.include_labels` instead

## Request body

- TGMHistoricalDexTradesRequest — Request model for the historical DEX trades endpoint. Returns individual DEX trades for a token with temporally-correct trader labels to prevent forward-looking bias. Uses label history tables instead of current-state label dictionaries.
  - `chain` 'base' | 'bnb' | 'ethereum' | 'solana', required — Chains supported for the TGM historical DEX trades endpoint.
  - `token_address` string, required — Token contract address
  - `date_range` DateRange, required — Date range model matching the API schema.
    - `from` string — Start date in ISO 8601 format (e.g., 2025-01-01T00:00:00Z or 2025-01-01)
    - `to` string — End date in ISO 8601 format (e.g., 2025-01-31T23:59:59Z or 2025-01-31)
  - `pagination` PaginationRequest — Pagination parameters for API requests.
    - `page` integer — Page number (1-based)
    - `per_page` integer — Number of records per page (max 1000)
  - `filters` TGMHistoricalDexTradesFilters — Filters for the historical DEX trades endpoint.
    - `action` 'BUY' | 'SELL' — TGM who bought/sold type.
    - `include_labels` HistoricalLabelType[] — Include only traders with these smart money labels
    - `value_usd` NumericRangeFilter — Filter for numeric values (floats) with optional min/max bounds. Use for prices, volumes, ratios, and other decimal values. - Values between -10.5 and 100.75
      - `min` number — Minimum value (inclusive)
      - `max` number — Maximum value (inclusive)
    - `trader_address` string — Filter to a specific trader address
  - `order_by` SortOrderTGMHistoricalDexTradesSortField[] — Sort order. Defaults to block_timestamp DESC. Only the first element is used.
    - `field` 'block_timestamp' | 'estimated_value_usd' | 'token_amount' | 'estimated_swap_price_usd', required — Sortable fields for historical DEX trades endpoint.
    - `direction` 'ASC' | 'DESC', required — Enum for sort directions.
  - `apply_blacklist_filter` boolean — When True, exclude blacklisted addresses from the results. Defaults to True.

## Response `200`

Historical TGM DEX trades data

- TGMHistoricalDexTradesResponse — Response model for the historical DEX trades endpoint.
  - `data` TGMHistoricalDexTrade[], required — List of historical DEX trade records
    - `block_timestamp` string, required — Block timestamp of the trade
    - `transaction_hash` string, required — Transaction hash
    - `trader_address` string, required — Trader address
    - `trader_address_label` string — Temporally-correct label of the trader as of the trade date
    - `action` 'BUY' | 'SELL', required — TGM who bought/sold type.
    - `token_name` string, required — Symbol of the queried token
    - `token_amount` number, required — Amount of the queried token traded
    - `traded_token_name` string, required — Symbol of the counter token
    - `traded_token_amount` number, required — Amount of the counter token traded
    - `estimated_swap_price_usd` number, required — Estimated per-token price in USD at trade time
    - `estimated_value_usd` number, required — Estimated trade value in USD
  - `pagination` PaginationInfo, required — Pagination information for API responses.
    - `page` integer — Current page number
    - `per_page` integer — Number of records per page
    - `is_last_page` boolean — Whether this is the last page

## Other responses

- `400` — Bad Request - Invalid request parameters or malformed request
- `401` — Authentication error - No API key found in request
- `402` — Payment Required - This endpoint supports pay-per-request via x402 and MPP. x402 responses advertise payment options in `Payment-Required`; MPP responses advertise a fresh `WWW-Authenticate: Payment ...` challenge. Successful MPP responses may include `Payment-Receipt`.
- `403` — Forbidden - User does not have required subscription tier or has exceeded credit limit
- `404` — Not Found - The requested resource was not found
- `422` — Validation error - Invalid request parameters
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.net/nansen/apis/nansen-api.md) · [All operations](https://skmtc.net/nansen/apis/nansen-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nansen/nansen-api/revisions/02a4d2e7d827/schema)
