Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Token API
        • Hypergraph
          • AI Suite
            • Indexing
              • Graph Horizon
                • Resources
                  Token API > TVM DEX Endpoints

                  Swap Events

                  GET/v1/tvm/swaps

                  Returns DEX swap transactions from Tron protocols with token amounts and prices.

                  Query Parameters

                  ParameterDescriptionValue
                  network
                  string

                  The Graph Network ID for TVM networks https://thegraph.com/networks

                  • Accepted values: tron
                  Required
                  tron
                  transaction_id
                  string

                  Filter by transaction hash
                  Single value or array of values* (separate multiple values with ,)
                  *Plan restricted.

                    factory
                    string

                    Filter by address
                    Single value or array of values* (separate multiple values with ,)
                    *Plan restricted.

                      pool
                      string

                      Filter by pool address
                      Single value or array of values* (separate multiple values with ,)
                      *Plan restricted.

                        transaction_from
                        string

                        Filter by address
                        Single value or array of values* (separate multiple values with ,)
                        *Plan restricted.

                          user
                          string

                          Filter by address
                          Single value or array of values* (separate multiple values with ,)
                          *Plan restricted.

                            sender
                            string

                            Filter by address
                            Single value or array of values* (separate multiple values with ,)
                            *Plan restricted.

                              recipient
                              string

                              Filter by address
                              Single value or array of values* (separate multiple values with ,)
                              *Plan restricted.

                                input_contract
                                string

                                Filter by address
                                Single value or array of values* (separate multiple values with ,)
                                *Plan restricted.

                                  output_contract
                                  string

                                  Filter by address
                                  Single value or array of values* (separate multiple values with ,)
                                  *Plan restricted.

                                    protocol
                                    string

                                    Protocol name

                                    • Accepted values: uniswap_v1, uniswap_v2, uniswap_v3, uniswap_v4, sunpump
                                    null
                                    start_time
                                    string

                                    UNIX timestamp in seconds or date string (e.g. "2025-01-01T00:00:00Z", "2025-01-01", ...).

                                      end_time
                                      string

                                      UNIX timestamp in seconds or date string (e.g. "2025-01-01T00:00:00Z", "2025-01-01", ...).

                                        start_block
                                        integer

                                        Filter by block number

                                        • Minimum value: 0
                                        • Maximum value: 9007199254740991
                                        end_block
                                        integer

                                        Filter by block number

                                        • Minimum value: 0
                                        • Maximum value: 9007199254740991
                                        limit
                                        integer

                                        Number of items* returned in a single request.
                                        *Plan restricted.

                                        • Default value: 10
                                        • Minimum value: 1
                                        • Maximum value: 1000
                                        page
                                        integer

                                        Page number to fetch.
                                        Empty data array signifies end of results.

                                        • Default value: 1
                                        • Minimum value: 1
                                        • Maximum value: 767465558638

                                        Potential Responses

                                        StatusDescription
                                        200

                                        Successful Response

                                        400

                                        Client side error

                                        401

                                        Authentication failed

                                        403

                                        Forbidden

                                        404

                                        Not found

                                        500

                                        Server side error

                                        ⁠Edit on GitHub⁠

                                        Pool OHLCV DataHealth Check
                                        Test this endpoint

                                        1curl --request GET \2  --url 'https://token-api.thegraph.com/v1/tvm/swaps?network=tron&transaction_id=e74815245a8f1321ce5ede99cde8e021f75bf8e3d4f94cd8949d283eb56fee63&factory=TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY&pool=TFGDbUyP8xez44C76fin3bn3Ss6jugoUwJ&transaction_from=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&user=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&sender=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&recipient=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&input_contract=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t&output_contract=TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR&protocol=null&start_block=null&end_block=null&limit=10&page=1' \3  --header 'Authorization: Bearer {token}'

                                        1{2  "data": [3    {4      "block_num": 28320009,5      "datetime": "2021-03-10 04:43:33",6      "timestamp": 1615351413,7      "transaction_id": "0x3e0f39b48dae8c49d3f95bc6206a632af484059764487b0c7d3e3c97bb433130",8      "transaction_index": 10,9      "transaction_from": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",10      "log_ordinal": 0,11      "log_block_index": 0,12      "log_index": 0,13      "log_topic0": "d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",14      "factory": "TXk8rQSAvPvBBNtqSoY6nCfsXWCSSpTVQF",15      "pool": "TAqCH2kadHAugPEorFrpT7Kogqo2FckxWA",16      "user": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",17      "sender": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",18      "recipient": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",19      "input_token": {20        "address": "TGc9XV7skLENAHPj4afCpBS8JSHv6box9C",21        "symbol": "",22        "decimals": 023      },24      "output_token": {25        "address": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",26        "symbol": "TRX",27        "decimals": 628      },29      "input_amount": "20000000",30      "input_value": 20000000,31      "output_amount": "1258054968",32      "output_value": 1258.054968,33      "price": 0.0000629027484,34      "price_inv": 15897.556552552798,35      "protocol": "uniswap_v1",36      "summary": "Swap 20.00 million  for 1.26 thousand TRX on Uniswap V1",37      "network": "tron"38    }39  ]40}
                                        The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service