Docs
La Recherche⌘ K
  • Accueil
  • À propos de The Graph
  • Réseaux pris en charge
  • Contrats du Protocole
  • 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.

                  Paramètres de requête

                  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.

                        user
                        string

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

                          input_token
                          string

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

                            output_token
                            string

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

                              protocol
                              string

                              Protocol name

                              • Accepted values: justswap, sunswap, sunpump
                              start_time
                              string

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

                              • Default value: 2015-01-01
                              end_time
                              string

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

                              • Default value: 2050-01-01
                              start_block
                              integer

                              Filter by block number

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

                              Filter by block number

                              • Default value: 9999999999
                              • 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&user=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&input_token=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t&output_token=TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR&start_time=2015-01-01&end_time=2050-01-01&start_block=0&end_block=9999999999&limit=10&page=1' \3  --header 'Authorization: Bearer {token}'

                              1{2  "data": [3    {4      "block_num": 77233509,5      "datetime": "2025-11-05 16:55:03",6      "timestamp": 1762361703,7      "transaction_id": "e74815245a8f1321ce5ede99cde8e021f75bf8e3d4f94cd8949d283eb56fee63",8      "transaction_index": 0,9      "log_index": 1,10      "log_ordinal": 662,11      "log_address": "TFGDbUyP8xez44C76fin3bn3Ss6jugoUwJ",12      "log_topic0": "d78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",13      "protocol": "sunswap",14      "factory": "TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY",15      "pool": "TFGDbUyP8xez44C76fin3bn3Ss6jugoUwJ",16      "user": "TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR",17      "input_amount": "170000000",18      "input_value": 170,19      "input_token": {20        "address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",21        "symbol": "USDT",22        "name": "Tether USD",23        "decimals": 624      },25      "output_amount": "590270510",26      "output_value": 590.27051,27      "output_token": {28        "address": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR",29        "symbol": "WTRX",30        "name": "Wrapped TRX",31        "decimals": 632      },33      "network": "tron"34    }35  ]36}
                              The GraphStatusTestnetActifs de la MarqueForumSécuritéPolitique de confidentialitéConditions d'utilisation