{"uid":"cap_eE5Xg2z9lNnlbqQW434mO","slug":"nansen-ec6507c3","name":"Nansen: Get Historical TGM DEX Trades","description":"Get historical \"Token God Mode\" (TGM) DEX trades (Beta)","url":"https://api.nansen.ai/api/v1beta1/tgm/historical-dex-trades","method":"GET","headers":{},"bodySchema":{"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","Fund","Smart Trader","Smart Dex Trader","30D Smart Dex Trader","90D Smart Dex Trader","180D Smart Dex Trader","Public Figure","Exchange","Whale","BananaGun Bot User","Top Maestro Bot User","Top BananaGun Bot User","Maestro Bot User","Early MAGIC Miner","First Mover LP","First Mover Staking","Profitable LP","Smart HL Perps Trader"],"type":"string","title":"HistoricalLabelType","description":"Filter by entity label type. Includes legacy label classes (e.g. Smart Dex Trader) that appear in historical data."}}],"title":"Include Labels","examples":[["Whale","Smart Trader"]],"description":"Include only traders with these smart money labels"},"trader_address":{"anyOf":[{"type":"string"}],"title":"Trader Address","examples":["0x28c6c06298d514db089934071355e5743bf21d60"],"description":"Filter to a specific trader address"}},"description":"Filters for the historical DEX trades endpoint.","additionalProperties":false}],"description":"Optional filters applied server-side"},"order_by":{"anyOf":[{"type":"array","items":{"type":"object","title":"SortOrder[TGMHistoricalDexTradesSortField]","required":["field","direction"],"properties":{"field":{"enum":["block_timestamp","estimated_value_usd","token_amount","estimated_swap_price_usd"],"type":"string","title":"TGMHistoricalDexTradesSortField","description":"Sortable fields for historical DEX trades endpoint."},"direction":{"enum":["ASC","DESC"],"type":"string","title":"SortDirection","description":"Enum for sort directions."}}}}],"title":"Order By","description":"Sort order. Defaults to block_timestamp DESC. Only the first element is used."},"date_range":{"type":"object","title":"DateRange","properties":{"to":{"anyOf":[{"type":"string"}],"title":"To","examples":["2025-01-31T23:59:59Z"],"description":"End date in ISO 8601 format (e.g., 2025-01-31T23:59:59Z or 2025-01-31)"},"from":{"anyOf":[{"type":"string"}],"title":"From","examples":["2025-01-01T00:00:00Z"],"description":"Start date in ISO 8601 format (e.g., 2025-01-01T00:00:00Z or 2025-01-01)"}},"description":"Date range model matching the API schema."},"pagination":{"type":"object","title":"PaginationRequest","properties":{"page":{"type":"integer","title":"Page","default":1,"minimum":1,"description":"Page number (1-based)"},"per_page":{"type":"integer","title":"Per Page","default":10,"maximum":1000,"minimum":1,"description":"Number of records per page (max 1000)"}},"description":"Pagination parameters for API requests."},"token_address":{"type":"string","title":"Token Address","examples":["0x6982508145454ce325ddbe47a25d4ec3d2311933"],"description":"Token contract address"},"apply_blacklist_filter":{"type":"boolean","title":"Apply Blacklist Filter","default":true,"examples":[true],"description":"When True, exclude blacklisted addresses from the results. Defaults to True."}},"description":"Request model for the historical DEX trades endpoint.\n\nReturns individual DEX trades for a token with temporally-correct trader labels\nto prevent forward-looking bias. Uses label history tables instead of\ncurrent-state label dictionaries.","additionalProperties":false},"responseSchema":{"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":[{"type":"string"}],"title":"Trader Address Label","examples":["Smart Money"],"description":"Temporally-correct label of the trader as of the trade date"},"estimated_swap_price_usd":{"anyOf":[{"type":"number"}],"title":"Estimated Swap Price Usd","examples":[0.000012],"description":"Estimated per-token price in USD at trade time"}},"description":"Single historical DEX trade record.\n\nLabels are resolved at the trade date using temporal label tables to avoid\nforward-looking bias. Differs from TGMDexTrade: no token_address or\ntraded_token_address columns (not available in view output)."},"title":"Data","description":"List of historical DEX trade records"},"pagination":{"type":"object","title":"PaginationInfo","properties":{"page":{"type":"integer","title":"Page","default":1,"minimum":1,"description":"Current page number"},"per_page":{"type":"integer","title":"Per Page","default":10,"maximum":1000,"minimum":1,"description":"Number of records per page"},"is_last_page":{"type":"boolean","title":"Is Last Page","default":true,"description":"Whether this is the last page"}},"description":"Pagination information for API responses."}},"description":"Response model for the historical DEX trades endpoint."},"example":{"request":{"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"}},"response":{"data":[{"action":"BUY","token_name":"USDC","token_amount":1861.574942,"trader_address":"0x51e59b82d6d93b27886e0353b70bf55b21234594","block_timestamp":"2024-12-24T23:59:35","transaction_hash":"0x16e42da91cf5c82310a72df81b24cc32ab5e6c3d4f5cc81e5d6c4147269e6145","traded_token_name":"SPC","estimated_value_usd":1876.3824877214454,"traded_token_amount":35000,"trader_address_label":null,"estimated_swap_price_usd":1.0079543108296982},{"action":"SELL","token_name":"USDC","token_amount":975.693834,"trader_address":"0x52aa899454998be5b000ad077a46bbe360f4e497","block_timestamp":"2024-12-24T23:59:35","transaction_hash":"0x16e42da91cf5c82310a72df81b24cc32ab5e6c3d4f5cc81e5d6c4147269e6145","traded_token_name":"ETH","estimated_value_usd":953.5047296858382,"traded_token_amount":0.2793737877067258,"trader_address_label":null,"estimated_swap_price_usd":0.9772581279691045},{"action":"SELL","token_name":"USDC","token_amount":888.665245,"trader_address":"0xb874dd4d665dc22e7744ed38da743aee16dfd0d9","block_timestamp":"2024-12-24T23:59:35","transaction_hash":"0x16e42da91cf5c82310a72df81b24cc32ab5e6c3d4f5cc81e5d6c4147269e6145","traded_token_name":"AURA","estimated_value_usd":837.2942242988934,"traded_token_amount":2044.2972621900906,"trader_address_label":null,"estimated_swap_price_usd":0.9421930575206565},{"action":"BUY","token_name":"USDC","token_amount":1012.969103,"trader_address":"0xe7502678a9f7dbfeab2b42ff6f0b5dc40c870351","block_timestamp":"2024-12-24T23:59:35","transaction_hash":"0xb74b665d720e1df82ee8d9c3269725eeb8898b9307e9f8f046b246f7b2d00bfd","traded_token_name":"HOPPY","estimated_value_usd":1070.2438577144037,"traded_token_amount":11749503.028565075,"trader_address_label":null,"estimated_swap_price_usd":1.0565414626613776},{"action":"SELL","token_name":"USDC","token_amount":113.98043,"trader_address":"0x0d4c7c091d6721bf6c652a6162cef42946652262","block_timestamp":"2024-12-24T23:59:23","transaction_hash":"0x7d34cdc20d9ee2fa2157b4435fd3389c73900cbf701aab3b71355959792b73cc","traded_token_name":"ETH","estimated_value_usd":107.8478325218032,"traded_token_amount":0.03159906451382153,"trader_address_label":null,"estimated_swap_price_usd":0.9461960489340424},{"action":"BUY","token_name":"USDC","token_amount":9992.009634,"trader_address":"0x1cdd941f7efe4572345e2d71b8a7af01ba85b570","block_timestamp":"2024-12-24T23:59:11","transaction_hash":"0x22818bd51686b6fe7c628219e1a569ea064f6873e928564badf7168856647945","traded_token_name":"USDT","estimated_value_usd":9988.178967284512,"traded_token_amount":10000,"trader_address_label":null,"estimated_swap_price_usd":0.9996166269993922},{"action":"SELL","token_name":"USDC","token_amount":847.702749,"trader_address":"0x2e851c8ff842292bdeb574d34735a70ec70e4081","block_timestamp":"2024-12-24T23:59:11","transaction_hash":"0x8bd32782b8f95775868834378e7027c814219a287268f7df781f07479d3d75fe","traded_token_name":"ALT","estimated_value_usd":795.2388435975481,"traded_token_amount":6515.169452715593,"trader_address_label":null,"estimated_swap_price_usd":0.9381104927825922},{"action":"BUY","token_name":"USDC","token_amount":847.702749,"trader_address":"0xb02f39e382c90160eb816de5e0e428ac771d77b5","block_timestamp":"2024-12-24T23:59:11","transaction_hash":"0x8bd32782b8f95775868834378e7027c814219a287268f7df781f07479d3d75fe","traded_token_name":"USDT","estimated_value_usd":847.2764214120457,"traded_token_amount":848.279175,"trader_address_label":null,"estimated_swap_price_usd":0.9994970789130302},{"action":"BUY","token_name":"USDC","token_amount":82028.607307,"trader_address":"0x68d3a973e7272eb388022a5c6518d9b2a2e66fbf","block_timestamp":"2024-12-24T23:59:11","transaction_hash":"0x9dcdd7a2765253127e02a10076cbc02bcac70f7ed1c0b036a9b7c6ab0bfec4f5","traded_token_name":"WETH","estimated_value_usd":80190.72095040984,"traded_token_amount":23.49560837441114,"trader_address_label":null,"estimated_swap_price_usd":0.977594568322833},{"action":"BUY","token_name":"USDC","token_amount":105.70249,"trader_address":"0xa0dd866f0a0fef44ecc63b71bc906cb2c020288b","block_timestamp":"2024-12-24T23:58:59","transaction_hash":"0x680ed05d6897b44f28500b126ed6b67e8ceaf8c2c6a250674b1dbb319e5685e9","traded_token_name":"WETH","estimated_value_usd":103.06616802892964,"traded_token_amount":0.030198036530392464,"trader_address_label":null,"estimated_swap_price_usd":0.9750590362528796}],"pagination":{"page":1,"per_page":10,"is_last_page":false}}},"exampleRequest":{"chain":"ethereum","date_range":{"to":"2024-12-24","from":"2024-11-24"},"token_address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","apply_blacklist_filter":true},"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1yoc1mN57DQUO4O_6kkq6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Retrieves historical DEX trade data from Nansen's Token God Mode (TGM) flow intelligence layer for on-chain analytics.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Backtest smart money trading signals","prompt":"Pull all historical DEX trades for token 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 on Ethereum between January and March 2024, and flag any transactions from Nansen-labeled smart money wallets so I can backtest a trading signal based on their entry and exit points."},{"title":"Investigate past whale activity","prompt":"Go back and fetch the historical DEX swap history for token 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9 on Ethereum from six months ago and show me which large wallets were accumulating or dumping during that period — I want to see if whale moves preceded any major price swings."},{"title":"Analyze token launch trading patterns","prompt":"Retrieve the on-chain DEX trade history for token 0x6B175474E89094C44Da98b954EedeAC495271d0F on Ethereum from its first two weeks of trading so I can analyze early buyer behavior and see which labeled wallets got in at launch."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:49:47.648Z","isFirstParty":false}