Docs
Search⌘ K
  • Home
  • حول The Graph
  • الشبكات المدعومة
  • Protocol Contracts
  • Subgraphs
    • متعدد-السلاسل
      • 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

                  ParameterالوصفValue
                  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.

                        caller
                        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
                                  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

                                  Statusالوصف
                                  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&caller=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&sender=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&recipient=TXF1xDbVGdxFGbovmmmXvBGu8ZiE3Lq4mR&input_contract=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t&output_contract=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": 28320009,5      "datetime": "2021-03-10 04:43:33",6      "timestamp": 1615351413,7      "transaction_id": "0x3e0f39b48dae8c49d3f95bc6206a632af484059764487b0c7d3e3c97bb433130",8      "factory": "TXk8rQSAvPvBBNtqSoY6nCfsXWCSSpTVQF",9      "pool": "TAqCH2kadHAugPEorFrpT7Kogqo2FckxWA",10      "caller": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",11      "sender": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",12      "recipient": "TSLjVj4sL7uDWQXDbHyV3Kbgz1KL9jB78w",13      "input_token": {14        "address": "TGc9XV7skLENAHPj4afCpBS8JSHv6box9C",15        "symbol": "",16        "decimals": 017      },18      "output_token": {19        "address": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",20        "symbol": "TRX",21        "decimals": 622      },23      "input_amount": "20000000",24      "input_value": 20000000,25      "output_amount": "1258054968",26      "output_value": 1258.054968,27      "price": 0.0000629027484,28      "price_inv": 15897.556552552798,29      "protocol": "uniswap_v1",30      "summary": "Swap 20.00 million  for 1.26 thousand TRX on Uniswap V1",31      "network": "tron"32    }33  ]34}
                                  The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service