# Nansen: Get Historical TGM DEX Trades

> Nansen: Get Historical TGM DEX Trades is a paid API for AI agents from api.nansen.ai, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-13).

Retrieves historical DEX trade data from Nansen's Token God Mode (TGM) flow intelligence layer for on-chain analytics.

## Facts

- Endpoint: GET https://api.nansen.ai/api/v1beta1/tgm/historical-dex-trades
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nansen-ec6507c3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eE5Xg2z9lNnlbqQW434mO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nansen-ec6507c3
```

Example prompt: Pull the historical DEX trades for token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum from Nansen's Token God Mode over the past 30 days so I can analyze the trading patterns.

## When to prefer this

Choose this endpoint when you need historical (not real-time) DEX trade records for a specific token and want Nansen's TGM-labeled intelligence — particularly useful for backtesting, trend analysis, or investigating past smart money activity on DEX platforms. Prefer over the real-time Smart Money DEX Trades endpoint when you need data beyond the last 24 hours.

## Known failure modes

- Invalid or unsupported token address returns 400 error
- Missing required parameters such as token or time range returns validation error
- Token with no DEX trade history returns empty result set
- Rate limiting or insufficient USDC balance triggers payment failure
- Unsupported chain or DEX filter returns 422 or empty response
- Service unavailability during beta period returns 503

## How this service works

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

## Output

A list of historical DEX trade records for the specified token, including trade timestamps, token pairs involved, trade volumes, wallet addresses of traders, transaction hashes, and DEX platform details — sourced from Nansen's TGM intelligence layer.

## Example request

```json
{
 "input": {
  "body": {
   "chain": "ethereum",
   "date_range": {
    "to": "2024-12-24",
    "from": "2024-11-24"
   },
   "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
   "apply_blacklist_filter": true
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "title": "TGMHistoricalDexTradesRequest",
 "required": [
  "chain",
  "token_address",
  "date_range"
 ],
 "properties": {
  "chain": {
   "enum": [
    "arbitrum",
    "avalanche",
    "base",
    "bnb",
    "ethereum",
    "hyperevm",
    "injective",
    "iotaevm",
    "linea",
    "mantle",
    "mantra",
    "monad",
    "near",
    "optimism",
    "plasma",
    "polygon",
    "ronin",
    "scroll",
    "sei",
    "solana",
    "sonic",
    "starknet",
    "sui",
    "ton",
    "tron"
   ],
   "type": "string",
   "title": "TGMChain",
   "description": "Chains supported in TGM (Token God Mode) endpoints."
  },
  "filters": {
   "anyOf": [
    {
     "type": "object",
     "title": "TGMHistoricalDexTradesFilters",
     "properties": {
      "action": {
       "anyOf": [
        {
         "enum": [
          "BUY",
          "SELL"
         ],
         "type": "string",
         "title": "TGMWhoBoughtSoldType",
         "description": "TGM who bought/sold type."
        }
       ],
       "examples": [
        "BUY"
       ],
       "description": "Filter by trade direction. Omit for all trades."
      },
      "value_usd": {
       "anyOf": [
        {
         "type": "object",
         "title": "NumericRangeFilter",
         "properties": {
          "max": {
           "anyOf": [
            {
             "type": "number"
            }
           ],
           "title": "Max",
           "examples": [
            50000,
            10000000,
            100
           ],
           "description": "Maximum value (inclusive)"
          },
          "min": {
           "anyOf": [
            {
             "type": "number"
            }
           ],
           "title": "Min",
           "examples": [
            1000,
            1000000,
            -50,
            0
           ],
           "description": "Minimum value (inclusive)"
          }
         },
         "description": "Filter for numeric values (floats) with optional min/max bounds.\nUse for prices, volumes, ratios, and other decimal values. - Values between -10.5 and 100.75"
        }
       ],
       "examples": [
        {
         "max": 100000,
         "min": 1000
        }
       ],
       "description": "Trade value range filter in USD"
      },
      "include_labels": {
       "anyOf": [
        {
         "type": "array",
         "items": {
          "enum": [
           "30D Smart Trader",
           "90D Smart Trader",
           "180D Smart Trader",
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "TGMHistoricalDexTradesResponse",
 "required": [
  "data",
  "pagination"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "TGMHistoricalDexTrade",
    "required": [
     "block_timestamp",
     "transaction_hash",
     "trader_address",
     "action",
     "token_name",
     "token_amount",
     "traded_token_name",
     "traded_token_amount",
     "estimated_swap_price_usd",
     "estimated_value_usd"
    ],
    "properties": {
     "action": {
      "enum": [
       "BUY",
       "SELL"
      ],
      "type": "string",
      "title": "TGMWhoBoughtSoldType",
      "description": "TGM who bought/sold type."
     },
     "token_name": {
      "type": "string",
      "title": "Token Name",
      "examples": [
       "PEPE"
      ],
      "description": "Symbol of the queried token"
     },
     "token_amount": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Token Amount",
      "examples": [
       1000000
      ],
      "description": "Amount of the queried token traded"
     },
     "trader_address": {
      "type": "string",
      "title": "Trader Address",
      "examples": [
       "0x28c6c06298d514db089934071355e5743bf21d60"
      ],
      "description": "Trader address"
     },
     "block_timestamp": {
      "type": "string",
      "title": "Block Timestamp",
      "examples": [
       "2025-06-01T12:00:00"
      ],
      "description": "Block timestamp of the trade"
     },
     "transaction_hash": {
      "type": "string",
      "title": "Transaction Hash",
      "examples": [
       "0x61adb6da30853c5988f0204dd9f6e4abbc878e02c34030a4f707cf4ec3124bcb"
      ],
      "description": "Transaction hash"
     },
     "traded_token_name": {
      "type": "string",
      "title": "Traded Token Name",
      "examples": [
       "WETH"
      ],
      "description": "Symbol of the counter token"
     },
     "estimated_value_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Estimated Value Usd",
      "examples": [
       12
      ],
      "description": "Estimated trade value in USD"
     },
     "traded_token_amount": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Traded Token Amount",
      "examples": [
       0.5
      ],
      "description": "Amount of the counter token traded"
     },
     "trader_address_label": {
      "anyOf": [
       {
       
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nansen-ec6507c3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.nansen.ai](https://www.zero.xyz/host/api.nansen.ai/llms.txt)
