# Bitquery Docs — full text: Tron, Bitcoin, Cardano, Algorand and the remaining chain pages > 37 pages. All parts and the curated entry points: https://docs.bitquery.io/llms.txt ## Algorand API Documentation URL: https://docs.bitquery.io/docs/blockchain/Algorand/ Algorand API overview: query blocks, transactions, addresses, smart contracts and fund tracing on Algorand, with a quick start and links to each API page. # Algorand API Documentation ## Overview Bitquery's Algorand APIs let you query the chain through GraphQL — blocks, transactions, ALGO and ASA transfers, address balances, smart contract calls, parsed call arguments, and multi-hop fund flow. Replace the example addresses and asset IDs in any query with your own values to point them at real wallets and assets. If you get stuck or need a data point that isn't covered here, reach out on [Telegram](https://t.me/Bloxy_info). :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ### What you can do with the Algorand API - Pull blocks by proposer, height, or time window with protocol version, rewards, and timestamps. - Get transactions with fees, types, senders, groups, and daily or per-address counts. - Track ALGO and ASA transfers filtered by asset ID, sender, receiver, or date range. - Look up native ALGO balances, multi-address snapshots, and smart contract bytecode. - Count and filter smart contract calls by transaction type (`pay`, `acfg`, and others). - Read parsed argument names, types, and values from smart contract calls and events. - Trace ALGO and ASA flows across multiple hops with Coinpath. ### How the Algorand API differs from running your own node | Algorand node / indexer | Bitquery Algorand API | | --- | --- | | Raw chain state — you build the indexer | Pre-indexed and parsed: blocks, txs, transfers, app calls | | No historical analytics out of the box | History, joins, aggregations, USD conversion on transfers | | You decode transaction types and app args yourself | GraphQL response — pick the fields you need | | Best for submitting transactions and full validation | Best for analytics, dashboards, wallet UIs, and compliance work | ## Quick start This query returns the 5 most recent Algorand blocks with height, hash, reward, proposer, and timestamp. ```graphql { algorand(network: algorand) { blocks(options: {desc: "height", limit: 5}) { height hash reward proposer { address } timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } } } ``` ## API reference ### Core data - [Algorand Blocks API](/docs/blockchain/Algorand/algorand-blocks-api) — block lookups by proposer, height, or time, plus reward aggregates. - [Algorand Transactions API](/docs/blockchain/Algorand/algorand-transactions-api) — transaction details, daily counts, unique senders, and hash lookups. - [Algorand Transfers API](/docs/blockchain/Algorand/algorand-transfers-api) — ALGO and ASA transfer history with USD amounts. ### Addresses and contracts - [Algorand Address API](/docs/blockchain/Algorand/algorand-address-api) — ALGO balances, multi-address lookups, and smart contract bytecode. - [Algorand Smart Contract Calls API](/docs/blockchain/Algorand/algorand-smart-contract-calls-api) — app call counts, transaction-type filters, and new asset creation tracking. - [Algorand Arguments API](/docs/blockchain/Algorand/algorand-arguments-api) — parsed argument names, types, and values from calls and events. ### Fund tracing - [Algorand Coinpath API](/docs/blockchain/Algorand/algorand-coinpath-api) — multi-hop ALGO and ASA flow tracing for compliance and treasury work. ## More guides - [Data Coverage & Retention](/docs/graphql/data-coverage-retention/) — how far back this chain's data goes - [Common errors and what to do](/docs/start/errors/) - [Plans, Points & Limits](/docs/plans/how-billing-works/) - [First query in 5 minutes](/docs/start/first-query/) --- ## Algorand Address API URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-address-api/ Algorand address queries: get ALGO balances for one or many addresses, plus smart contract bytecode and source, with GraphQL examples you can run. # Algorand Address API The Address API gives you native ALGO balances for one or many accounts, plus smart contract details — bytecode and source — for application addresses. Use it for wallet dashboards, treasury monitoring, and inspecting on-chain program code without running your own indexer. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get ALGO balance for a single address Returns the native ALGO balance for one account. Replace the address with your target wallet or contract. ```graphql { algorand(network: algorand) { address( address: {is: "ADDRESS_HERE"} ) { address { address } balance } } } ``` Add a `date` filter to reconstruct balance context at a point in time, or use the `in` operator shown below for batch lookups. ## Get ALGO balances for multiple addresses Pull balances for several addresses in a single request. Handy for portfolio views and treasury snapshots. ```graphql { algorand(network: algorand) { address(address: {in: ["ADDRESS_ONE", "ADDRESS_TWO", "ADDRESS_THREE"]}) { address { address } balance } } } ``` ## Get smart contract bytecode and source Returns the bytecode and source of an Algorand application address. Add the `balance` field to the `smartContract` block if you also need the contract's ALGO holdings. ```graphql { algorand(network: algorand) { address(address: {is: "SMART_CONTRACT_ADDRESS"}) { smartContract { address { address } bytecode source } } } } ``` ## Related resources - [Algorand Transfers API](/docs/blockchain/Algorand/algorand-transfers-api) — ALGO and ASA transfer history per address - [Algorand Coinpath API](/docs/blockchain/Algorand/algorand-coinpath-api) — multi-hop fund flow tracing --- ## Algorand Arguments API URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-arguments-api/ Algorand smart contract arguments: list recent application call arguments and filter them by smart contract address, with GraphQL query examples. # Algorand Arguments API When Bitquery parses an Algorand smart contract call or event, the Arguments API exposes each argument's index, type, and value alongside transaction and block context. Use it to inspect app call payloads, filter calls by specific argument values, or build dashboards around on-chain program activity. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## List recent smart contract arguments Returns the 10 most recent parsed arguments across Algorand, with transaction hash, sender, transaction type, and block timestamp. Each row includes the argument index and decoded value. ```graphql { algorand(network: algorand) { arguments(options: {limit: 10, desc: "block.timestamp.iso8601"}) { argindex block { timestamp { iso8601 } } firstRound genesisId lastRound note transaction { hash } txSender { address annotation } txType value } } } ``` ## Filter arguments by smart contract address Narrow results to a specific application. You can also filter by `txType`, `txHash`, `argindex`, or `value` depending on what you're looking for. ```graphql { algorand(network: algorand) { arguments( smartContractAddress: {is: "2TUBOBZ7CP7EZXFOWULEG5HE6WJ34TT7SBZ5AMHGR222O7RZNBK3I4BUMY"} options: {limit: 10, desc: "block.timestamp.iso8601"} ) { argindex value txType transaction { hash } txSender { address } smartContract { address { address } } } } } ``` ## Related resources - [Algorand Smart Contract Calls API](/docs/blockchain/Algorand/algorand-smart-contract-calls-api) — call counts and transaction-type filters - [Algorand Transactions API](/docs/blockchain/Algorand/algorand-transactions-api) — full transaction details and hash lookups --- ## Algorand Blocks API - Query Blocks by Proposer URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-blocks-api/ Algorand blocks by proposer: list recent blocks proposed by an address and sum the block rewards a proposer earned, with ready-to-run GraphQL queries. # Algorand Blocks API The Blocks API returns block-level data on Algorand: height, hash, protocol version, proposer, seed, reward, and timestamp. Use it to drive explorer front-ends, monitor chain progression, track validator participation, or aggregate block rewards over time. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get recent blocks proposed by an address Returns the 10 most recent blocks proposed by a specific address after a given date, ordered by timestamp descending. Swap the `proposer` filter for a height or time window when you need a broader scan. ```graphql { algorand(network: algorand) { blocks( date: {after: "2023-08-05"} options: {desc: "timestamp.iso8601", limit: 10} proposer: {is: "PROPOSER_ADDRESS_HERE"} ) { currentProtocol hash height proposer { address } reward seed timestamp { iso8601 } } } } ``` Remove the `proposer` filter to query all blocks in the date range, or adjust `limit` and `date` for different windows. ## Sum block rewards earned by a proposer Aggregates total block rewards for a proposer address. Add a `date` filter to limit the time range, or swap `sum` for `average` to get mean reward per block. ```graphql { algorand(network: algorand) { blocks( proposer: {is: "PROPOSER_ADDRESS_HERE"} ) { reward(calculate: sum) } } } ``` ## Related resources - [Algorand Transactions API](/docs/blockchain/Algorand/algorand-transactions-api) — per-block transaction details and daily counts - [Algorand Address API](/docs/blockchain/Algorand/algorand-address-api) — proposer and wallet balances --- ## Algorand Coinpath API URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-coinpath-api/ Algorand Coinpath queries to trace outgoing fund flows from a sender and count coinpath transactions received by an address, with ready-to-run GraphQL examples. # Algorand Coinpath API Coinpath walks ALGO and ASA flows between Algorand addresses — forward to see where funds went, backward to see where they came from. The API returns senders, receivers, hop depth, amounts, currency metadata, and transaction details at each level. Common use cases: AML screening, treasury audits, exchange deposit tracing, and source-of-funds verification. :::tip Trace Algorand funds with AI — no queries needed Connect the [Bitquery MCP server](https://mcp.bitquery.io/) to Claude, Cursor, or ChatGPT and ask in plain English: _"Trace where ALGO from this address went, 3 hops deep, and show the largest receivers."_ The agent walks the fund flow for you. See [AI Investigations](https://bitquery.io/solutions/ai-investigations) and the [Tracing MCP guide](/docs/mcp/Tracing/overview). ::: :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Trace outgoing fund flows from a sender Returns the 10 most recent coinpath entries for transfers sent from a specific address after a given date. Swap `sender` for `receiver` to trace incoming flows instead. ```graphql { algorand(network: algorand) { coinpath( date: {after: "2023-08-05"} options: {desc: "block.timestamp.iso8601", limit: 10} sender: {is: "SENDER_ADDRESS_HERE"} ) { amount block { timestamp { iso8601 } } currency { address name } depth receiver { address } transaction { hash value } } } } ``` ## Count coinpath transactions received by an address Counts total coinpath entries received by an address after a given date. Add a `sender` filter to narrow by source, or replace `count` with `amount(calculate: sum)` to get total value moved. ```graphql { algorand(network: algorand) { coinpath( date: {after: "2023-08-01"} receiver: {is: "BWSNMG43TUYEOHE76J6KDWIY6MU4U6JFJYGAYCZA2RF5IS3XPO3P3G4FEI"} ) { count } } } ``` ## Related resources - [Algorand Transfers API](/docs/blockchain/Algorand/algorand-transfers-api) — raw ALGO and ASA transfer history - [Algorand Address API](/docs/blockchain/Algorand/algorand-address-api) — wallet balances and contract bytecode --- ## Algorand Smart Contract Calls API URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-smart-contract-calls-api/ Algorand smart contract calls: count calls per block and by transaction type, filter latest calls by type, and track newly created assets (acfg). # Algorand Smart Contract Calls API The Smart Contract Calls API returns parsed application call data on Algorand: transaction type, sender, smart contract address, block context, and call counts. Filter by `txType` to isolate payments (`pay`), asset configuration (`acfg`), or any other Algorand transaction type. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Count unique smart contract calls in the latest block Returns the count of unique smart contract calls in the most recent block after a given date. [Run query](https://ide.bitquery.io/Get-Count-of-Smart-Contract-Calls-in-Latest-Block_1) ```graphql { algorand(network: algorand) { smartContractCalls( date: {after: "2023-08-05"} options: {desc: "block.timestamp.iso8601", limit: 1} ) { block { timestamp { iso8601 } } count(uniq: calls) } } } ``` ## Track newly created assets (acfg transactions) Returns the 10 most recent asset configuration transactions — `acfg` stands for asset config. Each result includes the smart contract address, transaction hash, sender, and block timestamp. [Run query](https://ide.bitquery.io/Track-latest-assets-created-on-Algorand-network_1#) ```graphql { algorand(network: algorand) { smartContractCalls( options: {desc: "block.timestamp.iso8601", limit: 10} txType: {is: acfg} ) { block { timestamp { iso8601 } } smartContract { address { address } } transaction { hash } txSender { address } txType } } } ``` ## Count smart contract calls by transaction type since genesis Returns the total number of calls grouped by transaction type across Algorand mainnet history. [Run query](https://ide.bitquery.io/Count-of-each-trxn-type-called-till-now-on-Algorand-network#) ```graphql query MyQuery { algorand(network: algorand) { smartContractCalls(options: {desc: "count"}) { txType count } } } ``` ## Get latest smart contract calls filtered by type Returns the 10 most recent `pay` (payment) transactions with smart contract address, hash, sender, and block timestamp. Swap `pay` for any other `txType` value. ```graphql { algorand(network: algorand) { smartContractCalls( date: {after: "2023-08-05"} options: {desc: "block.timestamp.iso8601", limit: 10} txType: {is: pay} ) { block { timestamp { iso8601 } } smartContract { address { address } } transaction { hash } txSender { address } txType } } } ``` ## Video: tracking newly created tokens on Algorand ## Related resources - [Algorand Arguments API](/docs/blockchain/Algorand/algorand-arguments-api) — parsed argument names, types, and values - [Algorand Transactions API](/docs/blockchain/Algorand/algorand-transactions-api) — full transaction details and daily counts --- ## Algorand Transactions API URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-transactions-api/ Algorand transactions: latest and date-range transactions, daily counts, unique senders per day, counts sent from an address, and lookup by hash. # Algorand Transactions API The Transactions API returns transaction-level data on Algorand: block context, fees, types, senders, groups, and currency metadata. Use it for paginated transaction feeds, daily activity dashboards, sender analytics, and hash-based lookups. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get the latest Algorand transactions Returns the 10 most recent transactions after a given date with block height, timestamp, currency, fee, group, hash, sender, subtype, and type. ```graphql { algorand(network: algorand) { transactions( date: {after: "2023-08-05"} options: {desc: "block.timestamp.iso8601", limit: 10} ) { block { height timestamp { iso8601 } } currency { address name } fee group hash index sender { address } subtype type } } } ``` ## Get transactions in a date range Paginated query for all transactions in a specific window. [Run query](https://ide.bitquery.io/All-Transactions-on-Algorand#) ```graphql query MyQuery { algorand(network: algorand) { transactions( options: {desc: "block.height", limit: 10, offset: 0} date: {since: "2024-07-08", till: "2024-07-09"} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } currency { tokenType tokenId symbol name decimals address } fee firstRound poolerror note lastRound index hash group genesisId genesisHash subtype type sender { address annotation } } } } ``` ## Get daily transaction counts for recent days Returns the number of transactions per day over the last 10 days, ordered by date descending. [Run query](https://ide.bitquery.io/Daily-Transaction-Count-for-last-10-days#) ```graphql query MyQuery { algorand(network: algorand) { transactions(options: {desc: "date.date", limit: 10}) { date { date } count } } } ``` ## Count unique senders for a single day Counts distinct transaction senders on a specific date. [Run query](https://ide.bitquery.io/Daily-Unique-Txn-Senders-on-algorand#) ```graphql query MyQuery { algorand(network: algorand) { transactions(date: {is: "2024-07-08"}) { Unique_senders: count(uniq: senders) } } } ``` ## Count transactions sent from an address Returns the total number of transactions sent by a specific address. ```graphql { algorand(network: algorand) { transactions( txSender: {is: "ADDRESS_HERE"} ) { count } } } ``` ## Look up a transaction by hash Returns block context, currency, sender, subtype, and type for a single transaction hash. ```graphql { algorand(network: algorand) { transactions( txHash: {is: "TXN_HASH_HERE"} ) { block { height timestamp { iso8601 } } currency { address name } sender { address } subtype type } } } ``` ## Video: Algorand transaction data with Bitquery ## Related resources - [Algorand Transfers API](/docs/blockchain/Algorand/algorand-transfers-api) — ALGO and ASA transfer history - [Algorand Blocks API](/docs/blockchain/Algorand/algorand-blocks-api) — block-level context for each transaction --- ## Algorand Transfers API - Track ALGO & ASA Token Transfers URL: https://docs.bitquery.io/docs/blockchain/Algorand/algorand-transfers-api/ Algorand Transfers API - Track ALGO & ASA Token Transfers: monitor Algorand native and token transfers in real time with Bitquery GraphQL APIs. # Algorand Transfers API The Transfers API returns ALGO and ASA (Algorand Standard Asset) movements with amounts in native units and USD, sender and receiver addresses, block context, and transaction hashes. Filter by asset ID, date range, or address to build wallet history feeds, treasury monitors, and token analytics dashboards. :::info Endpoint Algorand GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get transfers for a specific asset in a date range Returns transfers for asset ID `31566704` between two dates, ordered by block height descending. Swap the `currency` filter for any ASA ID or ALGO. [Run query](https://ide.bitquery.io/All-the-transfers-of-an-asset-on-Algorand-Mainnet-in-a-specific-timeframe) ```graphql query MyQuery { algorand(network: algorand) { transfers( options: {desc: "block.height", limit: 10, offset: 0} currency: {is: 31566704} date: {since: "2024-07-01", till: "2024-07-09"} ) { amount amount_usd: amount(in: USD) currency { tokenType tokenId symbol name decimals address } receiver { address annotation } sender { address annotation } block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transferType transaction { hash } } } } ``` ## Get transfers to or from an address for a specific asset Uses the `any` filter to match transfers where the address appears as either sender or receiver. [Run query](https://ide.bitquery.io/traansfers-where-a-currency-is-sent-from-or-sent-to-a-particular-address) ```graphql query MyQuery { algorand(network: algorand) { transfers( date: {since: "2024-07-01", till: "2024-07-09"} currency: {is: 849191641} any: [ {sender: {in: ["OLP2LMN4NDMT6FKRFCMV5J7U3LTUFXKOHOMGWYBMIA675FSRVWT4C5HWVI"]}} {receiver: {in: ["OLP2LMN4NDMT6FKRFCMV5J7U3LTUFXKOHOMGWYBMIA675FSRVWT4C5HWVI"]}} ] ) { block { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } height } sender { address annotation } receiver { address annotation } currency { address symbol } amount amount_usd: amount(in: USD) transaction { hash } } } } ``` ## Video: Algorand transfer data with Bitquery ## Related resources - [Algorand Address API](/docs/blockchain/Algorand/algorand-address-api) — wallet balances and contract bytecode - [Algorand Coinpath API](/docs/blockchain/Algorand/algorand-coinpath-api) — multi-hop fund flow tracing --- ## Bitcoin API Documentation URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/ Bitcoin data: blocks, transactions, inputs and outputs, address balances, fees, Omni Layer USDT, Coinpath fund tracing and real-time feeds. # Bitcoin API Documentation ## Overview Bitquery's Bitcoin APIs cover the chain end-to-end through GraphQL — blocks, transactions, addresses, UTXO-level inputs and outputs, fees in BTC and USD, miner rewards, Omni Layer transactions (USDT-on-Bitcoin and other Omni tokens), and multi-hop fund flow tracing. Every query carries the historical USD value at the time of the transaction, which makes it easy to build wallet history feeds, tax / accounting tools, compliance dashboards, and mining analytics. If you need a data point that isn't covered here, reach out on [Telegram](https://t.me/Bloxy_info). :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. For real-time data, see the [Bitcoin Kafka stream](/docs/streams/protobuf/chains/Bitcoin-protobuf). ::: ### What you can do with the Bitcoin API - Pull blocks by height, hash, or time window with difficulty, size, and transaction counts. - Get transactions with input and output totals, fees in BTC and USD, and per-tx pagination. - Compute address balances from raw UTXOs — including balance at a historical block height. - List individual UTXOs received and spent by an address inside any date range. - Aggregate fees paid by an address or across the network for fee analytics. - Track miner activity, daily block rewards, and first-active timestamps for mining pools. - Query Omni Layer transactions and transfers (USDT on Bitcoin and other Omni tokens). - Trace inbound and outbound fund flows across multiple hops with Coinpath. ### How the Bitcoin API differs from running your own node | `bitcoind` / Bitcoin RPC | Bitquery Bitcoin API | | --- | --- | | Raw chain state — you build the indexer | Pre-indexed and parsed: blocks, txs, UTXOs, addresses, Omni Layer | | No historical analytics out of the box | History, joins, aggregations, USD conversion at trade time | | Re-scan the chain to compute balances | One query for current balance, balance at a height, or activity stats | | Best for submitting transactions and full validation | Best for analytics, dashboards, wallet UIs, compliance, and mining stats | ### Real-time Bitcoin data For live, low-latency Bitcoin data, use Bitquery's **[Bitcoin Kafka stream](/docs/streams/protobuf/chains/Bitcoin-protobuf)** (`btc.transactions.proto`). It delivers every block and transaction as soon as it lands on-chain, with full input/output detail, script and address parsing, and miner data. GraphQL subscriptions are not available for Bitcoin — Kafka is the real-time path. For polling or historical pulls, the GraphQL queries below work the same way you'd expect on any other Bitquery chain. ## Quick start This query returns the 5 most recent Bitcoin blocks with height, difficulty, transaction count, and timestamp. ```graphql { bitcoin(network: bitcoin) { blocks(options: {desc: "height", limit: 5}) { height difficulty transactionCount blockSizeBigInt timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } } } ``` ## API reference ### Core data - [Bitcoin Blocks API](/docs/blockchain/Bitcoin/bitcoin-blocks-api) — block lookups by height or time, difficulty, size, and transaction counts. - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — transaction-level data with fees, inputs/outputs totals, and pagination patterns. - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — UTXO-level data, historical BTC price, balance at a block height, and miner rewards. ### Addresses and balances - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — balances from UTXOs (current and at a height), `addressStats` aggregates, first/last-active. ### Fees - [Bitcoin Fee API](/docs/blockchain/Bitcoin/bitcoin-fee-api) — per-transaction and aggregate fee queries in BTC and USD. ### Omni Layer (USDT on Bitcoin) - [Bitcoin Omni Transactions & Transfers API](/docs/blockchain/Bitcoin/bitcoin-omni-transactions) — Omni transactions and per-address transfers for tokens like USDT-on-Bitcoin. ### Fund tracing - [Bitcoin Coinpath API](/docs/blockchain/Bitcoin/bitcoin-coinpath-api) — multi-hop fund flow tracing between Bitcoin addresses. ### Real-time - [Bitcoin Kafka stream](/docs/streams/protobuf/chains/Bitcoin-protobuf) — `btc.transactions.proto` topic for sub-block-time delivery. ## More guides - [Data Coverage & Retention](/docs/graphql/data-coverage-retention/) — how far back this chain's data goes - [Common errors and what to do](/docs/start/errors/) - [Plans, Points & Limits](/docs/plans/how-billing-works/) - [First query in 5 minutes](/docs/start/first-query/) --- ## Bitcoin Address API - Get BTC Balance URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-address-api/ Bitcoin address balance from UTXOs or addressStats, balance at a block height, multi-address totals, first and last activity, and inputs and outputs by date. # Bitcoin Address API Bitcoin doesn't store account balances on-chain — there is no `getBalance` call. The reliable way to get an address balance is to sum every UTXO the address received (outputs) and subtract every UTXO it has spent (inputs). Bitquery indexes that UTXO data and pairs every value with the BTC/USD price at the time of the transaction, so you can pull current balances, historical balances at a specific block, or full activity timelines in a single request. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get a Bitcoin address balance from UTXOs (recommended) Returns total BTC sent (inputs) and received (outputs) for an address, along with USD-equivalent values and first / last activity dates. Subtract `inputs.value` from `outputs.value` to get the current balance. ```graphql { bitcoin(network: bitcoin) { inputs( inputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } outputs( outputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } } } ``` ## Get a Bitcoin address balance via addressStats `addressStats` is a pre-aggregated view — fast, but it can lag the chain. Use it for quick lookups and dashboards; use the UTXO sum above when you need exact, up-to-the-block accuracy. [Run query](https://ide.bitquery.io/Bitcoin-balance_5). :::caution `addressStats` is pre-aggregated and may occasionally be out of date. For precise balance math, use the inputs / outputs query above. ::: ```graphql { bitcoin(network: bitcoin) { addressStats(address: {is: "bc1q6xra3s8c5c4vr8m5f9htkuc3neyn4zykv5seua"}) { address { balance inboundTransactions firstActive { time } address annotation outflows lastActive { time } uniqueSenders uniqueReceivers } } } } ``` ## Get a Bitcoin balance at a specific block height Need to know what a wallet held at a particular point in time? The `height` filter caps inputs and outputs at a given block number, which is exactly what you need for audits, tax reporting, and point-in-time portfolio snapshots. Balance at that height equals `outputs.value - inputs.value`. [Run query](https://ide.bitquery.io/bitcoin-balance-at-a-given-height). ```graphql { bitcoin(network: bitcoin) { inputs( inputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} height: {lteq: 944000} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } outputs( outputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} height: {lteq: 944000} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } } } ``` ## Aggregate balances for multiple Bitcoin addresses in one call Pass an array of addresses to `inputAddress` and `outputAddress` with `{in: [...]}` to get per-wallet totals in a single request. Useful for exchanges, custodians, and portfolio dashboards that monitor many wallets at once. [Run query](https://ide.bitquery.io/BTC-balance-API-for-multiple-addresses). ```graphql { bitcoin(network: bitcoin) { inputs( inputAddress: {in: ["bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq", "bc1p2gel5e7ny42epalps3vddqrwedqh8ca4v6fdjem3pa3930ltl90s2cfg6e"]} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) inputAddress { address } } outputs( outputAddress: {in: ["bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq", "bc1p2gel5e7ny42epalps3vddqrwedqh8ca4v6fdjem3pa3930ltl90s2cfg6e"]} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) outputAddress { address } } } } ``` ## Get a Bitcoin address's first and last active timestamps Quick way to find when a wallet first appeared on-chain and the last time it transacted. Useful for wallet age analysis, dormant-address screening, and compliance checks. :::caution `addressStats` is pre-aggregated and may occasionally be inaccurate. For precise timestamps, query inputs and outputs directly with `minimum(of: date)` and `maximum(of: date)`. ::: ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { addressStats(address: {is: "ADDRESS_HERE"}) { address { firstActive { year month dayOfMonth } lastActive { year month dayOfMonth } } } } } ``` Replace `ADDRESS_HERE` with the Bitcoin address you want to inspect. ## List inputs and outputs for an address over a date range Returns every UTXO an address spent or received inside a time window, with block height, timestamp, transaction hash, output index, BTC value, and USD-equivalent. Use it for transaction reports, payment reconciliation, and per-period wallet activity feeds. [Run query](https://ide.bitquery.io/Input-and-outputs-of-a-bitcoin-address). ```graphql { bitcoin(network: bitcoin) { outputs( date: {since: "2024-03-19", till: "2024-03-26"} outputAddress: {is: "bc1p2gel5e7ny42epalps3vddqrwedqh8ca4v6fdjem3pa3930ltl90s2cfg6e"} options: {desc: ["block.height", "outputIndex"], limit: 10, offset: 0} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } outputIndex outputDirection value value_usd: value(in: USD) } inputs( date: {since: "2024-03-19", till: "2024-03-26"} inputAddress: {is: "bc1p2gel5e7ny42epalps3vddqrwedqh8ca4v6fdjem3pa3930ltl90s2cfg6e"} options: {desc: ["block.height", "transaction.index"], limit: 10, offset: 0} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } outputTransaction { hash index } transaction { hash index } inputIndex value value_usd: value(in: USD) } } } ``` ## Related resources - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — more UTXO patterns, miner rewards, and historical BTC price - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — per-tx detail and pagination - [Bitcoin Coinpath API](/docs/blockchain/Bitcoin/bitcoin-coinpath-api) — multi-hop fund tracing --- ## Bitcoin Blocks API URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-blocks-api/ Bitcoin blocks: get the 10 most recent blocks and find the busiest Bitcoin blocks by transaction count, with GraphQL queries you can run in the IDE. # Bitcoin Blocks API The Blocks API returns block-level data on Bitcoin: height, difficulty, size, transaction count, and timestamp. Use it to drive explorer front-ends, monitor chain progression, or pull historical block context for mining and network analytics. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get the 10 most recent Bitcoin blocks Returns blocks ordered by height descending, with the timestamp formatted for display. Add a `date` filter to constrain the window. ```graphql query { bitcoin(network: bitcoin) { blocks(options: {desc: "height", limit: 10}, date: {after: "2023-10-10"}) { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } height difficulty transactionCount blockSizeBigInt } } } ``` Use `height: {is: N}` to look up a single block, or `height: {in: [N1, N2, ...]}` for several at once. The same query shape works on other UTXO networks supported here by swapping `network: bitcoin` for `litecoin`, `dogecoin`, and others. ## Find the busiest Bitcoin blocks by transaction count Sort blocks by `transactionCount` descending to surface the busiest blocks on-chain — useful for network congestion studies and block utilization analysis. ```graphql query { bitcoin(network: bitcoin) { blocks(options: {limit: 10, desc: "transactionCount"}) { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } difficulty maximum(of: transaction_count, get: transaction_count) transactionCount } } } ``` Swap the sort to `desc: "difficulty"` or `desc: "blockSizeBigInt"` for different angles. Add `date: {since: ..., till: ...}` to search inside a specific window, or use `average(of: transaction_count)` for average transactions per block. ## Related resources - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — per-block transaction details and fees - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — UTXO data and miner rewards - [Bitcoin Kafka stream](/docs/streams/protobuf/chains/Bitcoin-protobuf) — real-time block and transaction delivery --- ## Bitcoin Coinpath API - Trace BTC Fund Flows Across Addresses URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-coinpath-api/ Bitcoin fund tracing with Coinpath: follow outbound and inbound BTC flows from an address and verify a path between two specific addresses. # Bitcoin Coinpath API Coinpath walks Bitcoin fund flows between addresses — forward to see where funds went, backward to see where they came from. Use it for AML investigations, source-of-funds verification, exchange deposit tracing, and mapping transaction paths across wallets. ## Video Tutorial | Investigate Bitcoin Address Fund flow Visually | Bitquery Coinpath API :::tip Trace Bitcoin funds with AI — no queries needed Connect the [Bitquery MCP server](https://mcp.bitquery.io/) to Claude, Cursor, or ChatGPT and ask in plain English: _"Trace where BTC from bc1q... went over the last 30 days, 3 hops deep, and flag any exchange deposits."_ The agent walks the fund flow for you. See [AI Investigations](https://bitquery.io/solutions/ai-investigations) and the [Tracing MCP guide](/docs/mcp/Tracing/overview). ::: :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Trace outbound fund flow from a Bitcoin address Returns direct recipients of an address with USD amounts, block heights, and transaction hashes. The `seed` option controls the starting point for repeated runs when you want consistent samples. [Run query](https://ide.bitquery.io/Destination-of-Funds-from-a-Specific-Address-on-Bitcoin). ```graphql { bitcoin(network: bitcoin) { coinpath( initialAddress: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} date: {after: "2023-10-10"} options: {limit: 10, asc: "block.height", seed: 10} ) { amount(in: USD) block { height } sender { address } receiver { address } transaction { hash } currency { name address } } } } ``` For multi-hop tracing, add `depth: {lteq: N}` (typically 3–5; deeper for forensic work). Switch direction with `options: {direction: inbound}` to walk backward instead. ## Track all incoming fund paths to a Bitcoin address Use the `receiver` filter to see who sent BTC to a specific wallet. Returns sender addresses, USD amounts, and transaction hashes — the standard "who funded this wallet?" query. ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { coinpath( date: {after: "2023-10-10"} options: {limit: 10, desc: "block.height"} receiver: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} ) { amount(in: USD) block { height } sender { address } receiver { address } transaction { hash } } } } ``` Swap `receiver` for `sender` to trace outflows instead, or add `initialAddress` to find paths between two specific addresses. ## Verify a path between two specific Bitcoin addresses Combine `initialAddress` and `receiver` to check whether BTC moved from address A to address B — useful for chain-of-custody verification and direct flow auditing. ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { coinpath( date: {after: "2023-10-10"} options: {limit: 10, desc: "block.height"} receiver: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} initialAddress: {is: "bc1pu349c0fvmqnv5s0aj3aracrsvn696hzhuyyukn6r5c9h03y88plql53h5h"} ) { amount(in: USD) block { height } sender { address } receiver { address } transaction { hash } } } } ``` Raise `limit` for more rows and add `depth: {lteq: N}` to follow multi-hop paths between the two addresses. ## Related resources - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — balances and activity stats - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — UTXO-level inflows and outflows - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — per-tx detail --- ## Bitcoin Fee API URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-fee-api/ Bitcoin Fee API: analyze Bitcoin transaction fees and costs with Bitquery GraphQL queries and streams. Great for bots, dashboards, and alerts. # Bitcoin Fee API Query Bitcoin transaction fees at the per-transaction level or aggregated across an address or time window — in BTC and USD. Use it for fee estimation, wallet expense tracking, and historical fee trend analysis. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## List Bitcoin transactions with per-tx fees in BTC and USD Pulls transactions for a specific address on a given day with per-transaction fee amounts (BTC and USD), input/output values, and counts. [Run query](https://ide.bitquery.io/bitcoin-trxn-fees-for-a-account_2). ```graphql query MyQuery { bitcoin(network: bitcoin) { transactions( options: {limit: 10, desc: ["block.height"]} date: {is: "2025-05-08"} inputAddress: {is: "bc1qrtjvr4d8qtstw5334mspp7rmrzl55uj3dcwj09"} ) { block { timestamp { iso8601 } height } feeValue feeInUSD: feeValue(in: USD) feeValueDecimal hash index inputValue inputCountBigInt inputCount outputValueDecimal outputValue outputCountBigInt outputCount inputValueDecimal } } } ``` Drop the `inputAddress` filter to see fees across all transactions, add `date: {since: ..., till: ...}` for a window, or sort by `feeValue` to surface the highest-fee transactions first. ## Sum total Bitcoin fees paid by an address on a single day Aggregate total fees paid by an address with `feeValue(calculate: sum)` in both BTC and USD. [Run query](https://ide.bitquery.io/Get-Total-fees-paid-by-an-account-on-Bitcoin-network). ```graphql query MyQuery { bitcoin(network: bitcoin) { transactions( date: {is: "2025-05-08"} inputAddress: {is: "bc1qrtjvr4d8qtstw5334mspp7rmrzl55uj3dcwj09"} ) { total_fees_in_usd: feeValue(calculate: sum, in: USD) total_fees: feeValue(calculate: sum) } } } ``` Change `date` to a range for multi-day totals, drop `inputAddress` for a network-wide aggregate, or add `feeValue(calculate: average)` for average fee per transaction. ## Video tutorial: getting Bitcoin transaction fee data ## Related resources - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — full transaction query patterns - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — address balances and activity - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — UTXO-level detail --- ## Bitcoin Inputs Outputs URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-inputs-outputs/ Bitcoin inputs and outputs: BTC price on a date, balance at a block height, UTXO inputs and outputs for an address, daily miner rewards and miner activity. # Bitcoin Inputs and Outputs API Bitcoin runs on an unspent-transaction-output (UTXO) model — every transaction consumes previous outputs (inputs) and creates new ones (outputs). These APIs give you direct access to that UTXO data with BTC and USD values, block context, transaction hashes, and per-address filtering. They're the foundation for balance reconstruction, miner reward tracking, historical price lookups, and detailed wallet activity feeds. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get the BTC price on a given date Pulls the BTC/USD price implied by any output on a given date — Bitquery stores the spot value at the time of each transaction, so you can derive a historical price by dividing USD value by BTC value. [Run query](https://ide.bitquery.io/btc-price-in-2016). ```graphql query MyQuery { bitcoin { outputs(date: {is: "2016-01-01"}) { value usd: value(in: USD) expression(get: "usd/value") } } } ``` ## Get a Bitcoin balance at a specific block height Sum outputs and subtract inputs with a `height: {lteq: N}` cap to get the wallet's balance at a specific point on-chain. Useful for audits, tax snapshots, and point-in-time portfolio reporting. [Run query](https://ide.bitquery.io/bitcoin-balance-on-a-given-block-height). ```graphql { bitcoin(network: bitcoin) { inputs( height: {lteq: 919195} inputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } outputs( height: {lteq: 919195} outputAddress: {is: "bc1ppu6akjngyvpxwz0w38n4evcygwh08tjtmcc0dx6ft2zzgkxtd97stwehcq"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } } } ``` ## List UTXO inputs and outputs for an address inside a block range Returns spent and received UTXOs for a specific address between two block heights, with date, transaction hash, block height, address annotation, and value. [Run query](https://ide.bitquery.io/bitcoin-inputs-and-outputs-for-address). ```graphql { bitcoin(network: bitcoin) { spendvolumes: inputs( inputAddress: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} height: {between: [822372, 822376]} ) { date { date } any(of: amount) block { height } transaction { hash } inputAddress { annotation address } value } recievevolumes: outputs( height: {between: [822372, 822376]} outputAddress: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} ) { date { date } any(of: amount) transaction { hash } block { height } outputAddress { annotation address } value } } } ``` The same shape works with `date: {since: ..., till: ...}` instead of `height: {between: [...]}` when you want to filter by time rather than block range. ## Get daily miner block rewards on Bitcoin Mining rewards live in coinbase outputs (the first transaction in every block, `txIndex: 0`) with `outputDirection: mining`. This query returns daily reward totals per miner address along with the number of unique blocks they mined — the standard view for tracking mining pool activity and reward distribution. [Run query](https://ide.bitquery.io/bitcoin-miners-rewards). ```graphql query ($network: BitcoinNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) { bitcoin(network: $network) { outputs( options: {asc: "date.date"} date: {since: $from, till: $till} txIndex: {is: 0} outputDirection: {is: mining} outputScriptType: {notIn: ["nulldata", "nonstandard"]} ) { address: outputAddress { address annotation } date { date(format: $dateFormat) } reward: value count(uniq: blocks) } } } ``` ## Count miner activity in a time window Pulls the activity count per miner address inside a date range. Drop or extend the date window to size the cohort however you need. [Run query](https://ide.bitquery.io/get-miners-activity-in-a-specific-timeframe). ```graphql query MyQuery { bitcoin(network: bitcoin) { outputs( outputDirection: {is: mining} date: {since: "2025-01-01", till: "2025-01-10"} outputScriptType: {notIn: ["nulldata", "nonstandard"]} ) { outputAddress { address } count } } } ``` ## Find a miner's first mining activity For a specific set of miner addresses, this query returns the first block each one mined. Useful for cohort analysis, miner onboarding studies, or building "first seen" timelines. [Run query](https://ide.bitquery.io/get-miners-first-activity). ```graphql query MyQuery { bitcoin(network: bitcoin) { outputs( outputDirection: {is: mining} options: {asc: "block.timestamp.iso8601", limitBy: {each: "outputAddress.address", limit: 1}} outputAddress: {in: ["1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6", "1KGG9kvV5zXiqyQAMfY32sGt9eFLMmgpgX"]} outputScriptType: {notIn: ["nulldata", "nonstandard"]} ) { outputAddress { address } block { timestamp { iso8601 } } } } } ``` ## Video tutorial: daily miner rewards ## Related resources - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — balances and activity stats per address - [Bitcoin Coinpath API](/docs/blockchain/Bitcoin/bitcoin-coinpath-api) — multi-hop fund flow tracing - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — transaction-level totals and fees - [Bitcoin Kafka stream](/docs/streams/protobuf/chains/Bitcoin-protobuf) — real-time UTXO delivery --- ## Bitcoin Omni Transactions URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-omni-transactions/ Bitcoin Omni Layer data: query the latest Omni transactions on Bitcoin and list Omni transfers for a specific address, with GraphQL examples to run in the IDE. # Bitcoin Omni Layer API The Omni Layer is a protocol built on top of Bitcoin for issuing and trading custom tokens — most famously the original Bitcoin-issued USDT. These APIs return Omni-specific transaction and transfer data so you can track issuance, redemptions, and per-address Omni token activity directly on the Bitcoin chain. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get the latest Omni transactions on Bitcoin Returns the 10 most recent Omni Layer transactions with block height, timestamp, fee in USD, transaction hash, and sender address — ordered by block height descending. ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { omniTransactions( options: {desc: "block.height", limit: 10} date: {after: "2023-11-20"} ) { block { height } blockHash date { date } feeValue(in: USD) hash index txSender } } } ``` Filter by sender with `txSender: {is: "..."}`, narrow with a different `date` window, or add `limit` / `offset` for pagination. ## List Omni transfers for a specific address Returns every Omni token transfer originating from a given Bitcoin address — block hash, sender (`transferFrom`), and receiver (`transferTo`). Replace `ADDRESS_HERE` with the wallet you want to inspect. ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { omniTransfers(options: {desc: "block.height"}, txSender: {is: "ADDRESS_HERE"}) { block { height } blockHash transferFrom transferTo } } } ``` Filter incoming transfers with `transferTo: {is: "..."}` instead, add a `date` window to scope a period, or extend the query with currency / amount fields to identify which Omni token moved. ## Related resources - [Bitcoin Transactions API](/docs/blockchain/Bitcoin/bitcoin-transactions-api) — base-layer Bitcoin transactions - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — address balances and activity - [Bitcoin Coinpath API](/docs/blockchain/Bitcoin/bitcoin-coinpath-api) — multi-hop BTC fund tracing --- ## Bitcoin Transactions API URL: https://docs.bitquery.io/docs/blockchain/Bitcoin/bitcoin-transactions-api/ Bitcoin transactions: latest transactions with fees and transfer values, daily transaction count and average fee, and transactions sent from an address. # Bitcoin Transactions API The Transactions API returns transaction-level data on Bitcoin: input and output totals in BTC and USD, fees, input/output counts, block context, and per-address transaction history. Use it for paginated transaction feeds, daily activity dashboards, fee trend analysis, and wallet history widgets. :::info Endpoint Bitcoin GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get the latest Bitcoin transactions with fees and transfer values A reusable query that takes `limit`, `offset`, and a date range as variables. Returns input value (BTC and USD), output count, input count, fees (BTC and USD), and block context — the standard shape for paginated transaction feeds. ```graphql query ($network: BitcoinNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) { bitcoin(network: $network) { transactions( options: {desc: ["block.height", "index"], limit: $limit, offset: $offset} time: {since: $from, till: $till} ) { block { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } height } inputValue input_value_usd: inputValue(in: USD) outputCount inputCount index hash feeValue fee_value_usd: feeValue(in: USD) } } } ``` Adjust `limit` and `offset` for pagination, narrow with `inputAddress` or `outputAddress` for a single wallet, or add `hash: {is: "..."}` for a single-transaction lookup. ## Daily Bitcoin transaction count and average fee Aggregate transactions by day to track network throughput and fee trends over time. Returns one row per day with the total transaction count, total fees, and average fee per transaction. ```graphql query ($network: BitcoinNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) { bitcoin(network: $network) { transactions(options: {asc: "date.date"}, date: {since: $from, till: $till}) { date: date { date(format: $dateFormat) } count: countBigInt feeValue avgFee: feeValue(calculate: average) } } } ``` Use `feeValue(calculate: median)` for median fees, or add `count(uniq: addresses)` to get daily active address counts alongside the fee stats. ## List Bitcoin transactions sent from a specific address Returns every transaction where a given address appears on the input side — the standard query for an outbound wallet history. ```graphql query ($network: BitcoinNetwork!) { bitcoin(network: $network) { transactions( options: {desc: ["block.height"]} inputAddress: {is: "bc1p4kufll9uhnpkgzuc65slcxd2qaw2hl9xecket3h8yyu4awglcsqslqaztd"} ) { block { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } height } inputValue hash feeValue outputValue } } } ``` Swap `inputAddress` for `outputAddress` to see received transactions instead. Add `date` for a window, `limit` / `offset` for pagination, and `inputValue(in: USD)` / `outputValue(in: USD)` for USD-equivalent amounts. ## Related resources - [Bitcoin Blocks API](/docs/blockchain/Bitcoin/bitcoin-blocks-api) — block-level lookups and stats - [Bitcoin Inputs and Outputs API](/docs/blockchain/Bitcoin/bitcoin-inputs-outputs) — UTXO-level transaction detail - [Bitcoin Fee API](/docs/blockchain/Bitcoin/bitcoin-fee-api) — focused fee queries and aggregates - [Bitcoin Address API](/docs/blockchain/Bitcoin/bitcoin-address-api) — wallet balances and activity stats --- ## Blockchain Data APIs Overview URL: https://docs.bitquery.io/docs/blockchain/introduction/ Explore Bitquery multi-chain blockchain APIs for trades, transfers, balances, NFTs, mempool data, and real-time streams. # Blockchain Data APIs Bitquery provides real-time and historical access to data across **40+ blockchains** including Bitcoin, Ethereum, Solana, BSC, Arbitrum, Base, Polygon, Tron and Arc. Thousands of developers use the APIs for DeFi apps, trading tools, analytics dashboards and blockchain infrastructure. ## Why Choose Bitquery's Blockchain Data APIs? Unlike traditional blockchain RPC providers that offer raw node data, Bitquery provides **pre-indexed, enriched, and analytics-ready** blockchain data through multiple interfaces: - **Real-time Streaming**: Live data via GraphQL subscriptions, gRPC and Kafka streams - **Pre-computed Analytics**: Real-time OHLC with 1-second aggregation, moving averages, volume metrics, and more - **Cross-chain Aggregation**: Unified view of tokens and currencies across chains - **High Performance**: Sub-second response times for complex queries - **Developer-Friendly**: GraphQL interface with comprehensive documentation ## Supported Blockchains **[Supported blockchains & networks (V1, V2, Kafka, gRPC, ClickHouse, cloud) →](/docs/blockchain/supported-chains/)** — See a single matrix of which chains are covered per interface (GraphQL versions, Kafka, CoreCast, ClickHouse warehouse, Parquet/datashares). Bitquery provides comprehensive blockchain data across **40+ blockchains** through two active API versions: ### **V2 APIs** Our V2 API version with enhanced features and real-time streaming: **EVM-Compatible Chains:** - **[Ethereum](/docs/blockchain/Ethereum/)** - **[BSC (Binance Smart Chain)](/docs/blockchain/BSC/)** - **[Arbitrum](/docs/blockchain/Arbitrum/)** - **[Base](/docs/blockchain/Base/)** - **[Polygon](/docs/blockchain/Matic/)** - **[Optimism](/docs/blockchain/Optimism/)** - **[opBNB](/docs/blockchain/supported-chains/)** (IDE / limited docs) - **[Robinhood](/docs/blockchain/robinhood/)** - **[Arc Blockchain API](https://bitquery.io/blockchains/arc-blockchain-api)** (Circle Arc; live queries and WebSocket streams) - **[Arc Testnet](/docs/blockchain/arc-testnet/)** (Circle Arc, testnet; realtime dataset only) **Non-EVM Chains:** - **[Solana](/docs/blockchain/Solana/)** - **[Tron](/docs/blockchain/Tron/)** - **[TON](/docs/blockchain/supported-chains/)** (limited support) - **[Bitcoin](/docs/blockchain/Bitcoin/)** - **[Cardano](/docs/blockchain/Cardano/)** ### **V1 APIs** Our comprehensive V1 API supporting 40+ blockchains with historical data: **Supported Blockchains:** Bitcoin, Ethereum, Solana, BSC, Polygon, Bitcoin Cash, Litecoin, Bitcoin SV, Dash, Zcash, Avalanche, Klaytn, Celo, Moonbeam, Fantom, Cronos, Cosmos, Hedera, Flow, EOS, Ripple (XRP), Stellar, Algorand, Cardano, Filecoin, and more. **Documentation:** - **[Supported chains by interface](/docs/blockchain/supported-chains/)** — Coverage matrix: V1/V2, Kafka, gRPC, ClickHouse, cloud - **[V2 Documentation](/docs/intro/)** - Latest APIs with real-time streaming - **[V1 Documentation](https://docs.bitquery.io/v1/)** - Comprehensive APIs with 40+ blockchain support ## Bitquery's Core Blockchain Data Capabilities **Popular APIs:** [Arc Blockchain API](https://bitquery.io/blockchains/arc-blockchain-api) · [Solana API](/docs/blockchain/Solana/) (DEX trades, Pump.fun, Raydium) · [Polymarket API](/docs/examples/polymarket-api/) · [BSC API](/docs/blockchain/BSC/) · [Base API](/docs/blockchain/Base/) · [DEX API](/docs/blockchain/Ethereum/dextrades/dex-api) · [Crypto Price API](/docs/trading/crypto-price-api/) ### **Crypto Price API - Real-Time Multi-Chain Price Data** Bitquery's dedicated **[Crypto Price API](/docs/trading/crypto-price-api/)** provides real-time, aggregated cryptocurrency price data with ultra-low latency across multiple blockchains. This specialized API is designed specifically for trading applications, DeFi protocols, and financial analytics. **Key Features:** - **Real-time Streaming**: 1-second granularity via GraphQL subscriptions and Kafka streams - **Pre-aggregated Data**: OHLC, SMA, WMA, EMA, and mean prices calculated automatically - **Multi-chain Support**: Ethereum, Solana, BSC, Arbitrum, Base, Optimism, Polygon, and more - **Clean Data**: Automatic filtering of low-quality trades and outliers - **Cross-chain Aggregation**: Unified view of token prices across multiple ecosystems - **Three Data Cubes**: Tokens (chain-specific), Currencies (cross-chain), and Pairs (market-specific) - **TradingView Integration**: Ready-to-chart SDK for real-time price feeds **Available Endpoints:** - **Streaming Endpoint**: Real-time data via WebSocket subscriptions - **Kafka Topic**: `trading.prices` for high-volume streaming applications ### **Trading & DeFi Data** - **DEX Trades**: Real-time and historical trading data across all major DEXs - **Price Data**: Real-time OHLC, moving averages, volume metrics with 1-second aggregation that updates consistently as trades come in - **Liquidity Events**: Pool creation, liquidity additions/removals - **Cross-chain Arbitrage**: Price differences across chains and DEXs ### **Token & Balance Data** - **Token Transfers**: ERC-20, ERC-721, ERC-1155, SPL, TRC-20 transfers - **Balance Updates**: Real-time wallet balance changes - **Token Holders**: Distribution analysis and holder tracking - **Token Supply**: Circulating supply, total supply, and burn events ### **Smart Contract Data** - **Contract Events**: Decoded smart contract events and logs - **Contract Calls**: Detailed contract interaction data - **Contract Creation**: New contract deployments - **Gas Analytics**: Fee analysis and optimization insights ### **Block & Transaction Data** - **Block Information**: Headers, timestamps, gas usage, miner data - **Transaction Details**: Complete transaction data with receipts - **Mempool Monitoring**: Pending transactions and fee estimation - **Network Statistics**: Block production, network health metrics ### **NFT Data** - **NFT Transfers**: Ownership changes and marketplace trades - **Collection Analytics**: Floor prices, volume, holder distributions - **Metadata**: Token attributes, images, and rarity information - **Marketplace Integration**: OpenSea, LooksRare, and other platforms ### **Stablecoin APIs - Specialized Payment Infrastructure** Bitquery provides dedicated **[Stablecoin APIs](/docs/category/stablecoin-apis/)** for comprehensive stablecoin data across multiple blockchains, designed specifically for payment applications, compliance, and financial analytics. **Key Features:** - **Real-time Price Monitoring**: Track stablecoin [price deviations](/docs/stablecoin-APIs/stablecoin-price-api/) and arbitrage opportunities - **Payment Detection**: Instant identification of incoming [stablecoin transfers](/docs/stablecoin-APIs/stablecoin-payments-api/) - **Multi-chain Support**: USDT, USDC, DAI, and other stablecoins across all supported chains - **Compliance Tools**: AML/KYC support with transaction monitoring - **Cross-chain Analytics**: Unified view of stablecoin movements across ecosystems **Available APIs:** - **[Stablecoin Price API](/docs/stablecoin-APIs/stablecoin-price-api/)** - Real-time price tracking and deviation monitoring - **[Stablecoin Payments API](/docs/stablecoin-APIs/stablecoin-payments-api/)** - Payment detection and compliance tools - **[Stablecoin Trades API](/docs/stablecoin-APIs/stablecoin-trades-api/)** - Trading data and volume analytics - **USDT API** - Specialized Tether data across all chains ### **Mempool Monitoring - Pre-Confirmation Data** Access real-time data from the mempool before transactions are confirmed, enabling advanced trading strategies and MEV detection. **Key Features:** - **Pre-confirmation Visibility**: See transactions before they're included in blocks - **MEV Detection**: Identify arbitrage opportunities and sandwich attacks - **Fee Estimation**: Real-time gas price recommendations and market analysis - **Transaction Simulation**: Test transaction success before broadcasting - **Cross-chain Mempool**: Monitor pending transactions across multiple chains **Available Endpoints:** - **Ethereum Mempool**: Real-time pending transactions and events - **BSC Mempool**: High-speed mempool monitoring for Binance Smart Chain - **Tron Mempool**: TRX network pending transaction tracking - **Kafka Mempool Streams**: Ultra-low latency mempool data via Protocol Buffers **Learn More:** [Mempool Subscriptions](/docs/subscriptions/mempool-subscriptions/) ### **Advanced Features & Enterprise Capabilities** **Backfilling & Historical Data Recovery:** - **Gap-free Data**: Automatic backfilling of missing data during connection interruptions - **Historical Recovery**: Retrieve data from any point in blockchain history - **One application, both views**: Combine historical and real-time data in a single app **Connection Management:** - **Silent Disconnect/Reconnect**: Automatic connection recovery for production applications - **Connection Pooling**: Efficient resource management for high-volume applications - **Load Balancing**: Automatic traffic distribution across multiple endpoints **Advanced Analytics:** - **Custom Aggregations**: Build sophisticated analytics with custom time windows and metrics - **Cross-chain Analytics**: Unified analytics across multiple blockchain ecosystems **Learn More:** [Advanced Features](/docs/subscriptions/backfilling-subscription/) ## Developer Interfaces ### **GraphQL API** Our primary interface for querying blockchain data with powerful filtering, aggregation, and real-time capabilities. The GraphQL API provides a flexible, type-safe way to query exactly the data you need. **Key Features:** - **Type-safe queries** with comprehensive schema documentation - **Powerful filtering** with complex where clauses and nested conditions - **Aggregation support** for time-series data and statistical analysis - **Join capabilities** across different data types (transactions, events, transfers) - **Pagination** with cursor-based and offset-based options - **Field selection** - request only the data you need to optimize performance **Endpoints:** - **V2 Primary Endpoint**: `https://streaming.bitquery.io/graphql` - **V1 Endpoint**: `https://graphql.bitquery.io/` (for comprehensive blockchain support) ```graphql { EVM(network: eth) { DEXTrades( where: { Block: {Time: {after: "2024-01-01"}} Trade: {Amount: {gt: "1000"}} } limit: {count: 10} orderBy: {descending: Block_Time} ) { Block { Time Number } Transaction { Hash From To } Trade { Amount Price BuyAmount SellAmount } Protocol { Name Type } Currency { Symbol Name } } } } ``` **Advanced Query Features:** - **Nested filtering**: Filter by multiple criteria across related entities - **Time-based queries**: Query by specific time ranges, intervals, or relative periods - **Cross-chain queries**: Query data across multiple blockchains in a single request - **Expression support**: Use mathematical expressions and calculations in queries - **Custom aggregations**: Group and aggregate data by any field or time interval ### **Real-time Subscriptions (WebSocket)** Convert any query to a live stream by changing `query` to `subscription`. Our WebSocket implementation provides real-time blockchain data with sub-second latency. **Learn More:** [WebSocket Subscriptions](/docs/subscriptions/websockets/) **WebSocket Features:** - **Protocol Support**: Both `graphql-ws` and `subscriptions-transport-ws` protocols - **Automatic Reconnection**: Built-in reconnection logic with exponential backoff - **Connection Management**: Handle multiple subscriptions on a single connection - **Error Handling**: Comprehensive error reporting and recovery mechanisms - **Authentication**: Secure token-based authentication for WebSocket connections **Trigger Options:** - **`trigger_on: head`**: Receive data as soon as new blocks are mined - **`trigger_on: block`**: Trigger on specific block conditions - **Custom triggers**: Set up triggers based on specific data conditions **WebSocket Endpoint**: `wss://streaming.bitquery.io/graphql` ```graphql subscription { EVM(network: eth, trigger_on: head) { DEXTrades( where: { Trade: {Amount: {gt: "10000"}} Protocol: {Name: {in: ["Uniswap", "SushiSwap"]}} } ) { Block { Time Number } Transaction { Hash From To } Trade { Amount Price BuyAmount SellAmount } Protocol { Name Type } Currency { Symbol Name } } } } ``` **WebSocket Connection Example (JavaScript):** ```javascript const client = createClient({ url: 'wss://streaming.bitquery.io/graphql', connectionParams: { Authorization: 'Bearer YOUR_ACCESS_TOKEN', }, }); const unsubscribe = client.subscribe( { query: ` subscription { EVM(network: eth, trigger_on: head) { DEXTrades { Block { Time } Trade { Amount } Protocol { Name } } } } `, }, { next: (data) => console.log('Received:', data), error: (err) => console.error('Error:', err), complete: () => console.log('Subscription completed'), } ); ``` **Use Cases:** - **Real-time trading bots**: Monitor live DEX trades and price movements - **Portfolio tracking**: Track wallet balance changes in real-time - **MEV detection**: Monitor mempool for arbitrage opportunities - **DeFi monitoring**: Track liquidity events and protocol interactions - **Alert systems**: Set up notifications for specific blockchain events ### **Kafka Streaming** High-throughput streaming for enterprise applications with pre-parsed Protocol Buffers. Our Kafka infrastructure provides enterprise-grade data streaming with guaranteed delivery and horizontal scalability. **Learn More:** [Kafka Streaming Concepts](/docs/streams/kafka-streaming-concepts/) **Kafka Infrastructure:** - **Broker**: `streaming.bitquery.io:9092` - **Protocol**: Apache Kafka with Protocol Buffers serialization - **Latency**: Sub-second data delivery with guaranteed ordering - **Reliability**: Built-in replication, failover, and data retention policies - **Scalability**: Auto-scaling consumer groups and partition management **Available Topics by Blockchain:** **Ethereum Topics:** - `eth.dextrades.proto` - DEX trading data across all Ethereum DEXs - `eth.transactions.proto` - Complete transaction data with receipts - `eth.tokens.proto` - Token transfers and balance updates - `eth.blocks.proto` - Block headers and metadata - `eth.events.proto` - Smart contract events and logs - `eth.calls.proto` - Smart contract function calls **Solana Topics:** - `solana.dextrades.proto` - DEX trading data (Raydium, Orca, Jupiter, etc.) - `solana.transactions.proto` - Transaction data with instruction details - `solana.tokens.proto` - SPL token transfers and balance updates - `solana.instructions.proto` - Individual instruction data - `solana.blocks.proto` - Block data and slot information **BSC Topics:** - `bsc.dextrades.proto` - PancakeSwap and other BSC DEX data - `bsc.transactions.proto` - BSC transaction data - `bsc.tokens.proto` - BEP-20 token transfers **Other Chains:** - `arbitrum.dextrades.proto`, `base.dextrades.proto`, `polygon.dextrades.proto` - `tron.dextrades.proto`, `tron.transactions.proto` **Kafka Consumer Example (Python):** ```python from kafka import KafkaConsumer # Initialize consumer consumer = KafkaConsumer( 'eth.dextrades.proto', bootstrap_servers=['streaming.bitquery.io:9092'], security_protocol='SASL_SSL', sasl_mechanism='PLAIN', sasl_plain_username='YOUR_USERNAME', sasl_plain_password='YOUR_PASSWORD', value_deserializer=lambda m: bitquery_pb2.DEXTrade().ParseFromString(m) ) # Consume messages for message in consumer: trade = message.value print(f"Trade: {trade.amount} {trade.currency.symbol} on {trade.protocol.name}") print(f"Price: ${trade.price_usd}") print(f"Block: {trade.block.number}") ``` **Kafka Features:** - **Schema Evolution**: Backward and forward compatible Protocol Buffer schemas - **Consumer Groups**: Scale horizontally with multiple consumers - **Offset Management**: Automatic and manual offset management options - **Dead Letter Queues**: Handle failed message processing - **Monitoring**: Comprehensive metrics and alerting - **Data Retention**: Configurable retention policies (7 days to 1 year) **Enterprise Features:** - **Dedicated Clusters**: Isolated Kafka clusters for high-volume customers - **Custom Topics**: Create custom topics for specific data requirements - **Priority Support**: Dedicated support for Kafka infrastructure issues - **SLA Guarantees**: 99.9% uptime with performance SLAs - **Silent Disconnect/Reconnect**: Automatic connection management for production applications ### **Cloud Data Storage & Data Export** Raw and processed data available in cloud storage for machine learning, deep analysis, and data export capabilities. **Cloud Storage Features:** - **AWS S3 Integration**: Direct access to optimized data formats - **Historical Data**: Complete blockchain history since genesis - **Multiple Formats**: JSON, Parquet, Protocol Buffers, and CSV - **Partitioned Data**: Optimized for time-based and blockchain-based queries - **Compression**: Efficient storage with gzip and snappy compression **Data Export Capabilities:** **1. Bulk Data Export** - **Time Range Exports**: Export data for specific date ranges - **Blockchain Selection**: Choose specific blockchains or all chains - **Data Type Filtering**: Export specific data types (trades, transfers, events) - **Format Options**: JSON, CSV, Parquet, or Protocol Buffers - **Compression**: Optional compression for large exports **Data Formats Available:** **JSON Format:** A human-readable, nested format ideal for development, debugging, and small to medium datasets. **Parquet Format:** A columnar, highly compressed format optimized for analytics and fast queries, perfect for data science and machine learning. **CSV Format:** A simple tabular format compatible with spreadsheets and BI tools, suitable for reporting and visualization. **Protocol Buffers:** A compact binary format with schema evolution, offering minimal storage and fast serialization for high-performance applications. **Use Cases for Data Export:** - **Machine Learning**: Train models on historical blockchain data - **Business Intelligence**: Create dashboards and reports - **Compliance**: Generate audit reports and regulatory filings - **Research**: Academic research and blockchain analysis - **Backup**: Create local backups of critical data - **Migration**: Move data to other systems or databases ## Getting Started ### 1. **Create Your Account** - Visit [Bitquery IDE](https://ide.bitquery.io/) to get started - **Free trial**: 7 days and 1,000 API points, on real-time data only, no credit card required - Access to real-time data and streaming ### 2. **Generate API Key** - Navigate to [Applications](https://account.bitquery.io/user/api_v2/applications) - Create an application and generate your access token - Use OAuth2 for secure, programmatic access ### 3. **Run Your First Query** - Try our [starter queries](/docs/start/starter-queries/) for common use cases - Use the IDE's autocomplete (Ctrl+Space) for query building - Convert queries to subscriptions for real-time data ### 4. **Explore Blockchain-Specific APIs** - **[Ethereum APIs](/docs/blockchain/Ethereum/)** - Complete EVM ecosystem data - **[Solana APIs](/docs/blockchain/Solana/)** - High-speed blockchain analytics - **[BSC APIs](/docs/blockchain/BSC/)** - Binance Smart Chain data - **[Trading APIs](/docs/category/trading-apis/)** - Real-time price and trading data ## Use Cases & Applications ### **DeFi Applications** - **DEX Aggregators**: Best [price discovery](/docs/schema/evm/dextrades/) across multiple DEXs - **Yield Farming**: Track liquidity positions and rewards - **Lending Protocols**: Monitor collateral ratios and liquidations - **Cross-chain Bridges**: Track asset movements between chains ### **Trading & Analytics** - **Trading Bots**: Real-time price feeds with 1-second aggregation and market data via [Crypto Price API](/docs/trading/crypto-price-api/) - **Portfolio Trackers**: Multi-chain wallet monitoring - **Market Analytics**: Volume, liquidity, and price analysis - **Arbitrage Detection**: Cross-chain and cross-DEX opportunities - **Charting Applications**: TradingView integration with real-time OHLC data ### **Enterprise Solutions** - **Compliance Tools**: Transaction monitoring and reporting - **Risk Management**: Real-time exposure tracking - **Business Intelligence**: Custom dashboards and KPIs - **Audit & Forensics**: Complete transaction history analysis - **MEV Detection**: Identify arbitrage opportunities and sandwich attacks - **Stablecoin Payments**: Real-time payment detection and compliance monitoring ### **Consumer Applications** - **Wallet Apps**: Balance tracking and transaction history - **NFT Marketplaces**: Collection analytics and trading data - **Block Explorers**: Enhanced blockchain data presentation - **Gaming**: In-game asset tracking and trading - **Payment Apps**: Real-time stablecoin payment processing - **MEV Tools**: Advanced trading strategies and arbitrage detection ## Data Quality & Reliability ### **Data Processing Pipeline** 1. **Real-time Ingestion**: Direct from blockchain nodes 2. **Quality Filtering**: Automatic removal of low-quality trades and outliers 3. **Enrichment**: USD values, protocol identification, and metadata 4. **Aggregation**: Pre-computed metrics and time-series data 5. **Distribution**: Multiple interfaces for different use cases ### **Enterprise-Grade Infrastructure** - **99.9% Uptime SLA**: Redundant systems with automatic failover - **Enterprise Support**: Dedicated support with guaranteed response times - **Scalable Architecture**: Auto-scaling infrastructure that grows with your needs - **Data Retention**: Complete historical data archive for comprehensive analysis ## Support & Community ### **Documentation & Resources** - **[Complete API Documentation](/docs/intro/)** - Comprehensive guides for all features - **[Code Examples](/docs/category/how-to-guides/)** - Real-world implementation examples - **[Video Tutorials](/docs/blockchain/Ethereum/)** - Step-by-step guides - **[Postman Collection](https://www.postman.com/interstellar-eclipse-270749/workspace/bitquery)** - Ready-to-use API examples ### **Community Support** - **[Telegram](https://t.me/Bloxy_info)** - Quick questions and community help - **[Community Forum](https://community.bitquery.io/)** - Feature requests and technical discussions - **[Support Desk](https://support.bitquery.io/)** - Technical issues and data problems ### **Learning Resources** - **[Learning Path](/docs/start/learning-path/)** - Structured learning from beginner to advanced - **[Starter Queries](/docs/start/starter-queries/)** - Pre-built queries for common use cases - **[GraphQL Guide](/docs/category/building-queries/)** - Complete GraphQL reference - **[Integration Examples](/docs/category/how-to-guides/)** - Real-world application examples ## Next Steps Ready to start building with blockchain data? Here's your path forward: 1. **[Create Your Account](https://ide.bitquery.io/)** - Get instant access to our platform 2. **[Run Your First Query](/docs/start/first-query/)** - Learn the basics in 5 minutes 3. **[Explore Blockchain APIs](/docs/blockchain/supported-chains/)** - Dive into specific blockchain data 4. **[Build Real-time Applications](/docs/category/graphql-subscriptions/)** - Set up live data streams 5. **[Join Our Community](https://t.me/Bloxy_info)** - Get help and share your projects --- **Start building the future of blockchain applications today with Bitquery's comprehensive multi-chain data platform.** --- ## Cardano API Documentation URL: https://docs.bitquery.io/docs/blockchain/Cardano/ Cardano API overview: query blocks, transactions, addresses and staking, native tokens, stablecoins and fund tracing on Cardano, with a quick start guide. # Cardano API Documentation ## Overview Bitquery's Cardano APIs let you query the chain through GraphQL — blocks, transactions, addresses, native tokens, UTXO-level inputs and outputs, staking, and multi-hop fund flow. Replace the example addresses and token IDs in any query with your own values to point them at real wallets and assets. If you get stuck or need a data point that isn't covered here, reach out on [Telegram](https://t.me/Bloxy_info). :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ### What you can do with the Cardano API - Look up blocks by height, hash, or time window — including epoch, slot, slot leader, and VRF key. - Pull transactions with input/output totals, fees in ADA and USD, mint count, and withdrawals. - Get address balances across ADA and every native token a wallet holds, plus staking and rewards. - Walk UTXO-level inputs and outputs to reconstruct exact balances or build transaction feeds. - Track mints and burns of any native token (NFTs, fungibles, stablecoins like DJED). - Trace ADA flows inbound and outbound across multiple hops with Coinpath. ### How the Cardano API differs from running your own node | `cardano-node` / RPC | Bitquery Cardano API | | --- | --- | | Raw chain state — you build the indexer | Pre-indexed and parsed: blocks, txs, UTXOs, native tokens, staking | | No historical analytics out of the box | History, joins, aggregations, USD conversion | | You stream and decode CBOR yourself | GraphQL response — pick the fields you need | | Best for submitting transactions and full validation | Best for analytics, dashboards, wallet UIs, and compliance work | ## Quick start This query returns the 5 most recent Cardano blocks with hash, height, transaction count, and timestamp. ```graphql { cardano(network: cardano) { blocks(options: {desc: "height", limit: 5}) { height blockHash transactionCount timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } } } ``` ## API reference ### Core data - [Cardano Blocks API](/docs/blockchain/Cardano/blocks) — block lookups by height or time, epoch/slot context, slot-leader metadata. - [Cardano Transactions API](/docs/blockchain/Cardano/transactions) — transaction details, fees in ADA and USD, mint counts, daily counts. - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — UTXO-level data for balance reconstruction and transfer feeds. ### Addresses and staking - [Cardano Address API](/docs/blockchain/Cardano/address) — per-asset balances, staking snapshot, and the `addressStats` aggregate cube. ### Native tokens - [Cardano Mints API](/docs/blockchain/Cardano/mints) — native-token mint and burn events, including NFT drops and fungible issuance. ### Stablecoins - [Djed Stablecoin API](/docs/blockchain/Cardano/djed) — DJED mints, burns, transfers, and wallet-level balance examples. ### Fund tracing - [Cardano Coinpath API](/docs/blockchain/Cardano/coinpath) — multi-hop inbound and outbound ADA flow tracing for compliance and treasury work. ## More guides - [Data Coverage & Retention](/docs/graphql/data-coverage-retention/) — how far back this chain's data goes - [Common errors and what to do](/docs/start/errors/) - [Plans, Points & Limits](/docs/plans/how-billing-works/) - [First query in 5 minutes](/docs/start/first-query/) --- ## Cardano Address API URL: https://docs.bitquery.io/docs/blockchain/Cardano/address/ Cardano address data: get wallet balances and staking info, plus address activity stats from addressStats, with GraphQL queries you can run in the IDE. # Cardano Address API The Address API gives you everything tied to a Cardano wallet: ADA balance, balances for every native token the wallet holds, and the staking snapshot (controlled stake, rewards available, rewards withdrawn). For quick activity profiling you can also use the `addressStats` cube, which returns pre-aggregated inflow, outflow, counterparty, and first/last-active metrics. :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get Cardano wallet balances and staking info This query returns ADA plus every native token a Cardano address holds, with the wallet's full staking context — total controlled stake, the staked amount with and without rewards, rewards currently available, and how much has already been withdrawn. Useful for portfolio dashboards, wallet UIs, and staking analytics. Swap the example address with the wallet you want to inspect. Stake addresses (`stake1...`) work in the same filter. ```graphql { cardano(network: cardano) { address( address: {is: "addr1v9m34968vfwya2dydafkaq48ag9pzerznwjf0ewu4jj5vfsvgmyhk"} ) { address { address annotation } balance { value currency { name symbol decimals address tokenId tokenType } } staking { controlledTotalStake stakedAmount stakedAmountWithRewards rewardsAmount rewardsAvailable withdrawnAmount address { address annotation } } } } } ``` If you only want the ADA balance, filter the response client-side where `currency.symbol == "ADA"`. Drop the `staking` block when stake context isn't needed. ## Get Cardano address activity stats (addressStats) `addressStats` is a pre-aggregated view of a wallet's lifetime activity — total inflows and outflows, inbound and outbound transaction counts, unique senders and receivers, unique active days, current balance, and the first / last active timestamps. It's the fastest way to profile an address for compliance checks, exchange screening, or analytics dashboards. :::caution `addressStats` is pre-aggregated and can lag the chain slightly. For exact, up-to-the-block balance math, sum `outputs` and subtract `inputs` from the [Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs). ::: ```graphql { cardano(network: cardano) { addressStats( address: {is: "addr1v9m34968vfwya2dydafkaq48ag9pzerznwjf0ewu4jj5vfsvgmyhk"} ) { address { address annotation balance inflows outflows inboundTransactions outboundTransactions uniqueSenders uniqueReceivers uniqueDaysWithTransfers firstActive { time } lastActive { time } } } } } ``` Pair this with the `address(...)` query above when you want fast aggregate metrics and per-asset balances in one round trip, or run it against a list of exchange / DAO / protocol addresses to compare them side-by-side. ## Related resources - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — UTXO-level balance reconstruction - [Cardano Transactions API](/docs/blockchain/Cardano/transactions) — transaction-level data with fees - [Cardano Coinpath API](/docs/blockchain/Cardano/coinpath) — multi-hop ADA flow tracing --- ## Cardano Blocks API - Query Blocks by Height, Slot & Epoch URL: https://docs.bitquery.io/docs/blockchain/Cardano/blocks/ Cardano blocks by height, slot and epoch: look up a single block by height or list recent Cardano blocks in a time window with GraphQL query examples. # Cardano Blocks API The Blocks API exposes everything you'd expect from a Cardano block: height, hash, size, protocol version, epoch and slot context, slot-leader metadata, VRF key, transaction count, and timestamp. Use it to power explorer front-ends, monitor chain progression, or pull historical block context for downstream analytics. :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Look up a Cardano block by height Fetch a single block by its height. The response carries the block hash, size and protocol version, epoch and slot context, operational certificate, slot-leader description and hash, VRF key, transaction count, and the production timestamp. ```graphql query { cardano(network: cardano) { blocks(height: {is: 9612373}) { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } blockHash blockSize blockVersion transactionCount epoch opCert slot slotInEpoch slotLeaderDescription slotLeaderHash vrfKey height } } } ``` To look up by hash instead, swap `height` for `blockHash: {is: "..."}`. To pull several blocks in one request, pass an array with `height: {in: [...]}`. ## List recent Cardano blocks in a time window Get the 10 most recent blocks produced between two timestamps. Handy for explorer recent-block widgets, throughput dashboards, and watching slot leaders across an epoch. ```graphql { cardano(network: cardano) { blocks( options: {desc: "height", limit: 10, offset: 0} time: {since: "2023-11-30T06:10:00Z", till: "2023-11-30T06:17:00Z"} ) { height blockHash blockSize transactionCount epoch slot slotInEpoch timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } } } ``` Sort ascending with `asc: "height"` to walk the chain forward, and widen the `time` window for longer scans. ## Related resources - [Cardano Transactions API](/docs/blockchain/Cardano/transactions) — per-block transaction details and fees - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — UTXO data tied to each transaction --- ## Cardano Coinpath API - Trace ADA Flows Across Multiple Hops URL: https://docs.bitquery.io/docs/blockchain/Cardano/coinpath/ Cardano Coinpath: trace inbound and outbound ADA flows for an address across multiple hops, including a deeper outbound trace, with GraphQL examples. # Cardano Coinpath API Coinpath walks ADA flows between Cardano addresses across multiple hops — forward to see where funds went, backward to see where they came from. Because Cardano uses an eUTXO model, the API stitches chains of UTXOs together and returns senders, receivers, hop depth, amounts, and transaction counts at each level. Common use cases: AML / compliance screening, DAO treasury audits, exchange deposit tracing, and source-of-funds verification. :::tip Trace Cardano funds with AI — no queries needed Connect the [Bitquery MCP server](https://mcp.bitquery.io/) to Claude, Cursor, or ChatGPT and ask in plain English: _"Trace where ADA from addr1... came from and where it went, 2 hops each way."_ The agent walks the fund flow for you. See [AI Investigations](https://bitquery.io/solutions/ai-investigations) and the [Tracing MCP guide](/docs/mcp/Tracing/overview). ::: :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Trace inbound and outbound ADA flows for an address This query runs both directions in one request. The `inbound` block walks backward from the initial address to find fund sources; the `outbound` block walks forward to find destinations. Each side is capped at 2 hops with up to 2 paths per hop — a good starting point before widening for deeper investigations. ```graphql { cardano(network: cardano) { inbound: coinpath( currency: {is: "ADA"} initialAddress: {is: "addr1q8hq60cyqg68aqfzs9geq084yj0tvvpm7rnckn6gsf3ahyrwak0antyvs6lyd7ymqg2zp6q8999vsdadmpm70x93f8msd7uwux"} depth: {lteq: 2} options: {direction: inbound, asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 2}} date: {since: "2023-11-30", till: "2023-12-18"} ) { sender { address annotation } receiver { address annotation } amount depth count } outbound: coinpath( currency: {is: "ADA"} initialAddress: {is: "addr1q8hq60cyqg68aqfzs9geq084yj0tvvpm7rnckn6gsf3ahyrwak0antyvs6lyd7ymqg2zp6q8999vsdadmpm70x93f8msd7uwux"} depth: {lteq: 2} options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 2}} date: {since: "2023-11-30", till: "2023-12-18"} ) { sender { address annotation } receiver { address annotation } amount depth count } } } ``` Raise `depth: {lteq: N}` (typically 3–5) for broader tracing, increase `limitBy.limit` for more paths per hop, and widen the `date` window. Keep only the block you need if a single direction is enough. ## Deeper outbound ADA trace Walk forward from an address up to 3 hops deep with 5 paths per hop — a compact view that covers more ground than the 2-hop example above. Returns `amount`, `depth`, and `count` per hop, which is enough for most DAO treasury audits and fraud investigations. ```graphql { cardano(network: cardano) { coinpath( currency: {is: "ADA"} initialAddress: {is: "addr1q8hq60cyqg68aqfzs9geq084yj0tvvpm7rnckn6gsf3ahyrwak0antyvs6lyd7ymqg2zp6q8999vsdadmpm70x93f8msd7uwux"} depth: {lteq: 3} options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 5}} date: {since: "2023-01-01", till: "2023-12-31"} ) { sender { address annotation } receiver { address annotation } amount depth count } } } ``` For forensic work, depths of 5–7 are common. Add `direction: inbound` to `options` to flip the trace. If you're running the same query repeatedly in parallel and want to bypass intermediate-stage caching, set `options: {seed: 110, ...}` with any random integer. ## Related resources - [Cardano Address API](/docs/blockchain/Cardano/address) — wallet balances, staking, and `addressStats` - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — UTXO-level inflows and outflows --- ## Cardano Djed Stablecoin API URL: https://docs.bitquery.io/docs/blockchain/Cardano/djed/ Djed stablecoin on Cardano: recent DJED mints and burns, wallet DJED and ADA balances, network-wide movements, and DJED sent or received by an address. # Djed Stablecoin API [Djed](https://djed.xyz) is an overcollateralized, USD-pegged stablecoin on Cardano, issued by COTI and designed in collaboration with Input Output Global. It trades under the ticker **DJED** (asset name `DjedMicroUSD`) and is backed by ADA reserves. Every issuance is an on-chain **mint** of the DJED native token, and every redemption is a **burn** — which means Djed's full lifecycle maps cleanly onto Bitquery's existing Cardano primitives: - Mint and burn activity → [Cardano Mints API](/docs/blockchain/Cardano/mints) - Holder balances → [Cardano Address API](/docs/blockchain/Cardano/address) - Movements between wallets → [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) You can verify the on-chain asset on Cardanoscan: [DjedMicroUSD token page](https://cardanoscan.io/token/8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344). :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## How to filter for DJED in Bitquery Bitquery's `currency: {is: "..."}` filter on Cardano matches native tokens by their **`tokenId`** — the [CIP-14 asset fingerprint](https://cips.cardano.org/cip/CIP-0014). For DJED, that value is: ```graphql currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} ``` The asset name / symbol (`DjedMicroUSD`) and the `currency.address` field are **not** usable as filter values — Bitquery returns `currency.address` as `"-"` for Cardano native tokens. Always filter by the `tokenId` fingerprint above. ## Recent DJED mint and burn events Pulls the 25 most recent DJED mint events, filtered server-side. A positive `value` is a mint (DJED issued against ADA collateral), a negative `value` is a burn (redemption). Useful for tracking Djed supply changes, correlating large mints with ADA price moves, or driving an issuance dashboard. ```graphql { cardano(network: cardano) { mints( currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} options: {limit: 25, desc: "block.height"} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } value transaction { hash index } currency { name symbol tokenId tokenType decimals } } } } ``` Sort with `desc: "value"` to surface the largest single mints and burns. Tighten the `date` filter or raise `limit` for deeper history. ## Wallet's DJED and ADA balances Returns every asset a Cardano address holds, plus stake and rewards context. The `balance` block lists one entry per currency, so ADA and every native token in the wallet — including DJED — come back in the same response. On the client, match `currency.tokenId == "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"` to pull out just the DJED position. Good for portfolio tracking of Djed holders, wallet-level risk analytics, or balance widgets in Djed-aware wallet UIs. ```graphql { cardano(network: cardano) { address( address: {is: "addr1q8de89fu0j09gze96nf8mfrcz056tw8nz35lqkr46zn52j9cvtjm8enawhyjjkcf6eves2cwz4c8y9tvhjuzpvmu4rwstxfht5"} ) { address { address annotation } balance { value currency { name symbol decimals tokenId tokenType } } staking { controlledTotalStake stakedAmount stakedAmountWithRewards rewardsAmount rewardsAvailable withdrawnAmount address { address annotation } } } } } ``` Drop the `staking` block when you don't need stake context, or pair this with `addressStats` (see the [Cardano Address API](/docs/blockchain/Cardano/address)) to combine per-asset balances with aggregate activity metrics in a single request. ## Recent DJED movements network-wide Lists the 10 most recent DJED movements across the chain. In the eUTXO model, `inputs` are UTXOs being spent (DJED "sent") and `outputs` are UTXOs being created (DJED "received"). Each row carries block height and timestamp, transaction hash, counterparty address, UTXO index, raw DJED `value`, and USD-equivalent `value_usd`. Good for live activity feeds, recent-transfers widgets, or auditing large DJED transactions. ```graphql { cardano(network: cardano) { inputs( currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} options: {desc: "block.height", limit: 10} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } inputAddress { address annotation } inputIndex value value_usd: value(in: USD) currency { name symbol tokenId } } outputs( currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} options: {desc: "block.height", limit: 10} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } outputAddress { address annotation } outputIndex outputDirection value value_usd: value(in: USD) currency { name symbol tokenId } } } } ``` Replace the `options` block with aggregates (`count`, `value(calculate: sum)`, `value(in: USD, calculate: sum)`) when you want totals instead of a row-level list. ## DJED received by a specific address Lists the 20 most recent DJED-bearing UTXOs received by an address, with block context, transaction hash, output index, DJED `value`, and USD equivalent. "Received" in eUTXO terms means the address appears as the `outputAddress` on a UTXO that contains DJED. Useful for merchant payment ingestion, on-chain invoicing, and exchange deposit monitoring. ```graphql { cardano(network: cardano) { outputs( currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} outputAddress: {is: "addr1q8de89fu0j09gze96nf8mfrcz056tw8nz35lqkr46zn52j9cvtjm8enawhyjjkcf6eves2cwz4c8y9tvhjuzpvmu4rwstxfht5"} options: {desc: "block.height", limit: 20} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } outputIndex outputDirection value value_usd: value(in: USD) currency { name symbol tokenId } } } } ``` Pass `outputAddress: {in: [...]}` with a list of addresses to aggregate receipts across several wallets. Replace `options` with aggregates to get totals received instead of per-UTXO rows. ## DJED sent by a specific address Same idea as above, in reverse. Lists the 20 most recent DJED-bearing UTXOs spent by an address — i.e. UTXOs where the address appears as `inputAddress` and the UTXO is being consumed. Useful for outflow tracking, spend-side accounting, and tax reporting. ```graphql { cardano(network: cardano) { inputs( currency: {is: "asset15f3ymkjafxxeunv5gtdl54g5qs8ty9k84tq94x"} inputAddress: {is: "addr1q8de89fu0j09gze96nf8mfrcz056tw8nz35lqkr46zn52j9cvtjm8enawhyjjkcf6eves2cwz4c8y9tvhjuzpvmu4rwstxfht5"} options: {desc: "block.height", limit: 20} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } inputIndex value value_usd: value(in: USD) currency { name symbol tokenId } } } } ``` Combine this with the "received" query above to reconstruct a wallet's complete DJED ledger — net DJED held equals the sum of received `value` minus the sum of sent `value`. ## Related resources - [Cardano Mints API](/docs/blockchain/Cardano/mints) — generic mint and burn query patterns - [Cardano Address API](/docs/blockchain/Cardano/address) — wallet balances and the `addressStats` cube - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — full UTXO query reference - [Cardano Coinpath API](/docs/blockchain/Cardano/coinpath) — multi-hop fund tracing - [Djed official site](https://djed.xyz) - [Djed launch announcement on COTI Medium](https://medium.com/cotinetwork/a-new-era-for-stablecoins-begins-djed-is-live-on-mainnet-55971971f2a8) --- ## Cardano Inputs and Outputs API URL: https://docs.bitquery.io/docs/blockchain/Cardano/inputs-outputs/ Cardano UTXO inputs and outputs: compute an address balance from UTXOs, list outputs received by an address, and read the parsed datum of a transaction UTXO. # Cardano Inputs and Outputs API Cardano runs on an **eUTXO** model — there are no account balances stored on-chain. To get an address's balance or activity you walk its inputs (UTXOs being spent) and outputs (UTXOs being received). These APIs return that UTXO-level data with transaction hash, output index, ADA and USD values, and block timestamps. :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Compute a Cardano address balance from UTXOs In the eUTXO model, an address balance is simply `sum(outputs received) - sum(inputs spent)`. This query pulls both sides in one request, with total counts, ADA values, USD values, and the first / last active dates. ```graphql { cardano(network: cardano) { inputs( currency: {is: "ADA"} inputAddress: {is: "addr1v9m34968vfwya2dydafkaq48ag9pzerznwjf0ewu4jj5vfsvgmyhk"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } outputs( currency: {is: "ADA"} outputAddress: {is: "addr1v9m34968vfwya2dydafkaq48ag9pzerznwjf0ewu4jj5vfsvgmyhk"} ) { count value value_usd: value(in: USD) min_date: minimum(of: date) max_date: maximum(of: date) } } } ``` Add `date: {since: ..., till: ...}` to scope a window, pass `inputAddress: {in: [...]}` / `outputAddress: {in: [...]}` to aggregate across multiple wallets in one call, or drop the `currency: {is: "ADA"}` filter to include native tokens alongside ADA. For the aggregate shortcut (with pre-computed inflows, outflows, counterparty counts, etc.) see the [`addressStats` query](/docs/blockchain/Cardano/address#get-cardano-address-activity-stats-addressstats). ## List UTXO outputs received by a Cardano address Return individual UTXOs received by an address inside a date window. Each row carries block height and timestamp, transaction hash, output index, output direction, and ADA / USD value. Use it for transaction reports, wallet activity feeds, or merchant payment ingestion. ```graphql { cardano(network: cardano) { outputs( currency: {is: "ADA"} date: {since: "2022-10-19", till: "2022-10-26T23:59:59"} outputAddress: {is: "addr1qxz3ve4caaywwg6q82ax9l5xknyc7juvwwsw20cpugyz5gv9zent3m6guu35qw46vtlgddxf3a9ccuaqu5lsrcsg9gss69fhxw"} options: {desc: ["block.height", "outputIndex"], limit: 10, offset: 0} ) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } transaction { hash } outputIndex outputDirection value value_usd: value(in: USD) currency { symbol } } } } ``` Swap `outputs` for `inputs` (and `outputAddress` for `inputAddress`) to see UTXOs the wallet has spent. Remove the `currency` filter entirely to include every asset type — native tokens included. ## Get the parsed datum of a Cardano transaction UTXO Cardano UTXOs can carry inline `datum` — script-readable data attached to an output, used by Plutus smart contracts. This query returns all outputs for a given transaction hash and exposes the parsed datum inside `currency.properties` (in YAML-like format), so you don't have to decode CBOR yourself. ```graphql query ($network: CardanoNetwork!, $hash: String!, $limit: Int!, $offset: Int!) { cardano(network: $network) { outputs( txHash: {is: $hash} options: {asc: "outputIndex", limit: $limit, offset: $offset} ) { outputIndex address: outputAddress { address annotation } value value_usd: value(in: USD) currency { symbol tokenType tokenId properties name decimals address } outputDirection date { date } transaction { hash } valueDecimal } } } ``` Variables: ```json { "limit": 10, "offset": 0, "network": "cardano", "hash": "6c83cf62225ecdf0cbb57e11718a8ec079f490b7f05d97f5a6d2214fb00be182" } ``` The `properties` field on the currency object contains the parsed datum: ``` "properties": "---\nassetName: 494e4459\nfingerprint: asset1u8caujpkc0km4vlwxnd8f954lxphrc8l55ef3j\npolicyId: 533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0\n", ``` ## Related resources - [Cardano Address API](/docs/blockchain/Cardano/address) — balances, staking, and the `addressStats` aggregate cube - [Cardano Coinpath API](/docs/blockchain/Cardano/coinpath) — multi-hop ADA flow tracing across addresses - [Cardano Transactions API](/docs/blockchain/Cardano/transactions) — transaction-level totals and fees --- ## Cardano Mints API - Track Native Token Mints URL: https://docs.bitquery.io/docs/blockchain/Cardano/mints/ Cardano native token mints: get recent mint and burn events and aggregate Cardano token mints by month, with GraphQL queries you can run. # Cardano Mints API Cardano doesn't mint tokens through smart contracts the way EVM chains do. Every native token — fungible or NFT — is issued under a **minting policy**, and every mint or burn shows up on-chain as a single event tied to that policy. The Mints API exposes those events with amounts, transaction hash, block context, and the full asset metadata. Use it to track NFT collection drops, fungible-token issuance, stablecoin supply changes, or any kind of on-chain supply movement. :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get recent Cardano mint and burn events Pull the 10 most recent mint events across every minting policy on a given date. The `value` field is signed: positive numbers are mints, negative numbers are burns. Each result includes block height and timestamp, transaction hash and index, and full currency metadata — including the policy-based `address`, asset name, symbol, `tokenId` (CIP-14 fingerprint), `tokenType`, and decimals. ```graphql { cardano(network: cardano) { mints(options: {limit: 10, desc: "block.height"}, date: {is: "2026-05-01"}) { block { height timestamp { time(format: "%Y-%m-%d %H:%M:%S") } } value transaction { hash index } currency { address name symbol tokenId tokenType decimals } } } } ``` To find the largest single mints, sort by `desc: "value"`. To filter by a specific policy or asset, add `currency: {is: ""}` — see the [DJED examples](/docs/blockchain/Cardano/djed) for the pattern. On Cardano, the policy ID is the first 56 hex characters of `currency.address`; the remainder is the hex-encoded asset name. ## Aggregate Cardano mints by month Get monthly mint counts by pulling `mintCount` from the `transactions` cube. Returns one row per month with the total mint count, input and output values, and fees — a compact view for tracking issuance trends across quarters or years. ```graphql { cardano(network: cardano) { transactions( options: {desc: "date.month", limit: 12} date: {since: "2023-01-01", till: "2023-12-31"} ) { date { month startOfInterval(unit: month) } mintCount(calculate: sum) inputValue input_value_usd: inputValue(in: USD) outputCount inputCount feeValue fee_value_usd: feeValue(in: USD) } } } ``` Change `startOfInterval(unit: month)` to `week` or `day` for finer buckets. To drill from a monthly total down to the individual mint events, combine this query with the one above. ## Related resources - [Djed Stablecoin API](/docs/blockchain/Cardano/djed) — currency-filtered mint and burn examples on a real asset - [Cardano Transactions API](/docs/blockchain/Cardano/transactions) — full transaction context for mint events --- ## Cardano Transactions API - Fees, Inputs, Outputs & Mints URL: https://docs.bitquery.io/docs/blockchain/Cardano/transactions/ Cardano transactions: query transactions for a specific date with fees, inputs and outputs, and count daily Cardano transactions over time. # Cardano Transactions API The Transactions API returns transaction-level data on Cardano: input and output totals, fees in ADA and USD, mint counts, withdrawals, and block context. Use it for daily reporting, fee analysis, spotting outlier transactions, and building activity dashboards. :::info Endpoint Cardano GraphQL queries are served at `https://graphql.bitquery.io`. ::: ## Get Cardano transactions for a specific date Pull 10 transactions from a single day with full economic context — input value in ADA and USD, fee value in ADA and USD, mint count, withdrawal totals, output value, and input/output counts. ```graphql { cardano(network: cardano) { transactions(options: {limit: 10}, date: {is: "2023-11-29"}) { block { timestamp { time(format: "%Y-%m-%d %H:%M:%S") } height } hash index inputValue input_value_usd: inputValue(in: USD) outputValue inputCount outputCount feeValue fee_value_usd: feeValue(in: USD) mintCount withdrawalValue withdrawalCount } } } ``` Switch `date: {is: ...}` to `date: {since: ..., till: ...}` for a range, sort with `options: {desc: ["block.height", "index"], limit: 10}` to pull the latest, or add `feeValue: {gt: ...}` to surface high-fee transactions only. ## Count daily Cardano transactions Aggregate the total transaction count per day for the last 10 days. Useful for activity dashboards, throughput monitoring, and spotting unusual spikes. ```graphql { cardano(network: cardano) { transactions(options: {desc: "date.date", limit: 10}) { date { date } count } } } ``` Use `startOfInterval(unit: day, interval: 10)` for coarser buckets, raise `limit` for more days, or add a `date: {since: ..., till: ...}` window. ## Related resources - [Cardano Blocks API](/docs/blockchain/Cardano/blocks) — block-level lookups and time-window queries - [Cardano Inputs and Outputs API](/docs/blockchain/Cardano/inputs-outputs) — UTXO-level transaction data - [Cardano Mints API](/docs/blockchain/Cardano/mints) — drill into the mint events behind `mintCount` --- ## Supported Blockchains and Networks URL: https://docs.bitquery.io/docs/blockchain/supported-chains/ See which blockchains Bitquery supports across V1, V2 GraphQL, Kafka, gRPC, ClickHouse Cloud, and Parquet exports. Keep queries fast with indexed filters. # Supported blockchains & networks This guide lists **which blockchains Bitquery indexes** and how that lines up with each **delivery interface** on **[bitquery.io](https://bitquery.io/)**: legacy **[V1 GraphQL](https://docs.bitquery.io/v1/)** (broad catalog—schema reference), **[Data streams & GraphQL](https://bitquery.io/products/data-streams)** and **[WebSocket streams](https://bitquery.io/products/websocket-streams)** for real time, **[Kafka streams](https://bitquery.io/products/kafka-streams)** (protobuf), **[Solana gRPC (CoreCast)](https://bitquery.io/products/solana-grpc-streams)**, **[ClickHouse data warehouse](https://bitquery.io/products/data-warehouse)** with **[MCP server](https://bitquery.io/products/bitquery-mcp-server)** for AI clients, and **[cloud datashares & exports](https://bitquery.io/products/streaming)** (S3, Snowflake, BigQuery, and more). Major networks include **Bitcoin**, **Ethereum**, **Solana**, **BNB Chain**, **Polygon**, **Tron**, **Base**, **Arbitrum**, **Optimism**, **Arc**, and **Cardano**, plus additional L1s in the [matrix below](#supported-chains-matrix)—always validate your plan, entitlement, and live **[GraphQL IDE](https://ide.bitquery.io/)** before shipping. **Legend:** ✓ = included in this product line’s chain catalog below. **—** = not listed in that line’s default set (other Bitquery products or plans may still apply—ask support). --- ## Matrix: chain × product {#supported-chains-matrix} **ClickHouse replica:** SQL over Bitquery’s **[managed ClickHouse data warehouse](https://bitquery.io/products/data-warehouse)**—dedicated clusters with read replicas and real-time ingestion across **40+ chains** (see product page for full positioning). **Chain coverage for your project matches the catalog below** (aligned with cloud-style exports), with **tables and schema** depending on entitlement; for **AI assistants**, use the **[Bitquery MCP server](https://bitquery.io/products/bitquery-mcp-server)** ([technical setup](/docs/mcp/mcp-server/)). | Network | V1 GraphQL | V2 GraphQL / WebSocket | Kafka (protobuf) | Cloud (Parquet / datasets) | ClickHouse replica | |---------|:----------:|:----------------------:|:----------------:|:--------------------------:|:------------------:| | Bitcoin | ✓ | — | ✓ | ✓ | ✓ | | Litecoin | ✓ | — | — | ✓ | ✓ | | Bitcoin Cash | ✓ | — | — | ✓ | ✓ | | Zcash | ✓ | — | — | ✓ | ✓ | | Dash | ✓ | — | — | ✓ | ✓ | | Ethereum | ✓ | ✓ | ✓ | ✓ | ✓ | | BNB Chain (BSC) | ✓ | ✓ | ✓ | ✓ | ✓ | | Avalanche | ✓ | — | — | ✓ | ✓ | | Klaytn | ✓ | — | — | ✓ | ✓ | | Tron | ✓ | ✓ | ✓ | ✓ | ✓ | | Celo | ✓ | — | — | ✓ | ✓ | | Algorand | ✓ | — | — | ✓ | ✓ | | Cronos | ✓ | — | — | ✓ | ✓ | | Solana | ✓ | ✓ | ✓ | ✓ | ✓ | | Cardano | ✓ | — | — | ✓ | ✓ | | Polygon | ✓ | ✓ | ✓ | ✓ | ✓ | | Filecoin | ✓ | — | — | ✓ | ✓ | | Ripple (XRP) | ✓ | — | — | ✓ | ✓ | | Stellar | ✓ | — | — | ✓ | ✓ | | Arbitrum | — | ✓ | ✓ | ✓ | ✓ | | Optimism | — | ✓ | ✓ | ✓ | ✓ | | Base | — | ✓ | ✓ | ✓ | ✓ | | Robinhood | — | ✓ | ✓ | ✓ | ✓ | | [Arc Blockchain API](https://bitquery.io/blockchains/arc-blockchain-api) | — | ✓ | — | — | — | :::note More networks **V1** historically covers **40+** blockchains—see the [V1 docs](https://docs.bitquery.io/v1/) for the full, schema-accurate list and **[Bitquery platform](https://bitquery.io/)** for plans. **V2** may also expose additional networks in the IDE (for example **opBNB**, **TON**) that are not repeated in the short list above—check live schema and [chain docs](/docs/blockchain/introduction/). **Arc** is live in V2 GraphQL, WebSocket subscriptions and the cross-chain `Trading` cubes. For trade streams and the last 30 days, use `Trading.Trades` with `Pair.Market.Network: "Arc"`; use `Trading.Tokens` or `Trading.Pairs` for prices and candles. Use EVM trade cubes only for trades older than 30 days, once Arc archive support is confirmed. Other chain data uses `EVM(network: arc)`; see the [Arc Blockchain API guides](/docs/blockchain/arc-mainnet/). The matrix does not list chain-level Kafka, cloud or ClickHouse coverage for Arc. **Kafka** also exposes multi-chain **`trading.prices`** and **`trading.trades`** topics—see **[Kafka streams](https://bitquery.io/products/kafka-streams)** and [Kafka streaming concepts](/docs/streams/kafka-streaming-concepts/). ::: --- ## gRPC (CoreCast) **Solana only** — filtered protobuf streams to `corecast.bitquery.io`. Not multi-chain. - [Solana gRPC streams (product)](https://bitquery.io/products/solana-grpc-streams) · [CoreCast docs](/docs/grpc/solana/introduction/) --- ## Where to read more | Product | Get started | |--------|-------------| | **V2** | [Bitquery platform](https://bitquery.io/) · [Data streams](https://bitquery.io/products/data-streams) · [WebSocket streams](https://bitquery.io/products/websocket-streams) · Docs: [Intro](/docs/intro/) · Chains: [Ethereum](https://bitquery.io/blockchains/ethereum-blockchain-api), [BNB Chain](/docs/blockchain/BSC/), [Arbitrum](https://bitquery.io/blockchains/arbitrum-blockchain-api), [Optimism](https://bitquery.io/blockchains/optimism-blockchain-api), [Base](https://bitquery.io/blockchains/base-blockchain-api), [Polygon](https://bitquery.io/blockchains/polygon-blockchain-api), [Solana](https://bitquery.io/blockchains/solana-blockchain-api), [Tron](https://bitquery.io/blockchains/tron-blockchain-api), [Robinhood](/docs/blockchain/robinhood/), [Arc Blockchain API](https://bitquery.io/blockchains/arc-blockchain-api), [Arc Testnet](/docs/blockchain/arc-testnet/) | | **V1** | [Bitquery platform](https://bitquery.io/) · [V1 documentation](https://docs.bitquery.io/v1/) · [V1 vs V2 (IDE & schema)](https://docs.bitquery.io/v1/docs/graphql-ide/v1-and-v2) | | **Kafka** | [Kafka streams](https://bitquery.io/products/kafka-streams) · [Real-time streaming hub](https://bitquery.io/products/streaming) · Docs: [Streams overview](/docs/streams/) · [Kafka concepts](/docs/streams/kafka-streaming-concepts/) | | **Cloud** | [Streaming & datashares](https://bitquery.io/products/streaming) · Docs: [Cloud data](/docs/cloud/) · [EVM](/docs/cloud/evm/) · [Solana](/docs/cloud/solana/) · [Bitcoin](/docs/cloud/bitcoin/) · [Tron](/docs/cloud/tron/) | | **ClickHouse replica** | [ClickHouse data warehouse](https://bitquery.io/products/data-warehouse) · [MCP server](https://bitquery.io/products/bitquery-mcp-server) · [MCP docs](/docs/mcp/mcp-server/) | --- ## See also - [ClickHouse data warehouse](https://bitquery.io/products/data-warehouse) — fully managed clusters, replicas, and real-time ingestion - [Data streams & Kafka / WebSocket / gRPC](https://bitquery.io/products/data-streams) - [Blockchain data APIs overview](/docs/blockchain/introduction/) - [gRPC vs WebSocket vs Kafka](/docs/streams/) (docs) --- ## TRC20 USDT API - Transfers, Holders & Flows URL: https://docs.bitquery.io/docs/blockchain/Tron/usdt-trc20-api/ Query and stream USDT TRC20 on Tron with Bitquery GraphQL: live transfers, whale holders, exchange deposit flows, mempool, and cross-chain USDT comparison. # TRC20 USDT API Tron carries more USDT transfer activity than any other chain, which makes TRC20 USDT the single most-queried asset in the Bitquery Tron dataset. This page covers the queries people actually need: live transfer and DEX-trade streams, whale holders, exchange deposit flows, mempool visibility, and a cross-chain comparison. Every example uses the canonical USDT TRC20 contract: ``` TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t ``` :::tip Looking for USDT beyond Tron? This page is Tron-specific. For USDT price, payments, reserves and balances **across all supported chains**, see the [USDT Stablecoin API](/docs/stablecoin-APIs/usdt-api) and the broader [stablecoin API pages](/docs/category/stablecoin-apis). A single-request cross-chain comparison is included [below](#cross-chain). ::: ## Tether USD (USDT) transfers in real time To monitor USDT transfers on Tron in real time, use the following subscription. You can run the query [here](https://ide.bitquery.io/usdt-trc20-transfers_1) ```graphql subscription { Tron { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}}}} ) { Transaction { Hash } Transfer { Amount Sender Receiver Currency { SmartContract Symbol Name Fungible Native } Id AmountInUSD } Block { Number } } } } ``` ## Daily USDT TRC20 transfer volume {#daily-volume} Daily transfer volume, transfer count and unique-address counts. Useful for stablecoin reports, market analytics and macro dashboards. Using `since_relative` instead of a fixed timestamp keeps the query correct whenever it runs — a hardcoded date silently widens the window every day it sits in your codebase. Run the query [here](https://ide.bitquery.io/daily-usdt-trc20-volume). ```graphql query DailyUSDTVolumeTron { Tron { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } Block: { Time: { since_relative: { days_ago: 30 } } } TransactionStatus: { Success: true } } orderBy: { ascendingByField: "Block_Date" } ) { Block { Date(interval: { count: 1, in: days }) } transfers: count senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) volume_usdt: sum(of: Transfer_Amount) volume_usd: sum(of: Transfer_AmountInUSD) } } } ``` `TransactionStatus: { Success: true }` matters here — without it, reverted transfers inflate both the count and the volume. ## Largest USDT transfers (whale movements) {#whale-transfers} Single transfers above a threshold, largest first. This is the fastest way to spot treasury moves, exchange rebalancing and OTC settlement. ```graphql query LargestUSDTTransfers($min_amount: String, $since: DateTime) { Tron { Transfers( limit: { count: 25 } orderBy: { descending: Transfer_Amount } where: { Transfer: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } Amount: { ge: $min_amount } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver } } } } ``` ```json { "min_amount": "1000000", "since": "2026-01-01T00:00:00Z" } ``` ## Top USDT receivers — finding exchange deposit addresses {#top-receivers} Aggregating inbound transfers per receiver surfaces the busiest USDT destinations on Tron. Read two fields together and the address type becomes obvious: - **High `inbound` count and high `distinct_senders`** → an exchange hot wallet or payment processor. Many unrelated parties paying one address. - **High `received` but only a handful of senders** → a treasury, bridge or OTC desk. Few counterparties, large amounts. ```graphql query TopUSDTReceivers($since: DateTime) { Tron { Transfers( limit: { count: 50 } orderBy: { descendingByField: "received" } where: { Transfer: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { Transfer { Receiver } received: sum(of: Transfer_Amount) inbound: count distinct_senders: uniq(of: Transfer_Sender) } } } ``` Swap `Receiver` for `Sender` and `descendingByField: "sent"` to rank outbound flow instead — useful for spotting withdrawal hot wallets. ## USDT balance of an address {#balances} Use the **`Balances`** cube for current token balances. It is live — no snapshot date needed — and returns USD value alongside the raw amount. ```graphql query USDTBalance($addresses: [String!]) { Tron { Balances( where: { Balance: { Address: { in: $addresses } } Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } orderBy: { descending: Balance_Amount } ) { Balance { Address Amount AmountInUSD UpdateCount FirstChangeTime LastChangeTime } Currency { Symbol Name SmartContract } } } } ``` ```json { "addresses": [ "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf", "TStieorQGxR7iVtUtUZPeyyVxQJR4TSQwu" ] } ``` ### Telling hot wallets from cold storage `UpdateCount` alongside `FirstChangeTime` / `LastChangeTime` classifies an address without any labelling data: - **Very high `UpdateCount`, `LastChangeTime` seconds ago** → exchange hot wallet or payment processor. Balance churns constantly. - **Single-digit `UpdateCount` on a large balance** → cold storage, treasury or a custody wallet. Funded once, rarely touched. Drop the `Balance.Address` filter and keep `Currency` to get every USDT balance the cube holds, but see the caution below first. :::caution Ranking all USDT holders on Tron USDT on Tron has tens of millions of holders. An unbounded `orderBy: { descending: Balance_Amount }` across all of them **times out server-side** on both `Balances` and `Holders` — this is a dataset-size limit, not a syntax problem. The `Balances` filter accepts `Balance.Address` only, so it cannot be narrowed by amount. If you need a *top-N whale list* rather than specific addresses, use the `Holders` snapshot cube with an amount floor: ```graphql query USDTWhales($floor: String, $date: String) { Tron { Holders( limit: { count: 100 } orderBy: { descending: Balance_Amount } date: $date where: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } Balance: { Amount: { ge: $floor } } } ) { Holder { Address } Balance { Amount } } } } ``` With `floor: "10000000"` this returns promptly. For a *complete* holder distribution, use [Bitquery Cloud exports](/docs/cloud/) or [Kafka streams](/docs/streams/protobuf/kafka-protobuf-python) rather than a synchronous GraphQL query. For TRC20 tokens far smaller than USDT you can drop the floor entirely. ::: ## USDT TRC20 DEX trades in real time Real-time DEX trades where USDT is the bought currency on Tron — protocol, buyer and seller, amounts and order IDs. Note that most USDT movement on Tron is plain transfers rather than DEX swaps, so this stream is far quieter than the transfer stream above. For trade-oriented work across chains, the [Trading API](/docs/trading/trading-data-overview) carries USD price, market cap and supply on every row. You can run the query [here](https://ide.bitquery.io/USDT-TRC20-DEX-Trades) ```graphql subscription { Tron { DEXTrades( where: {Trade: {Buy: {Currency: {SmartContract: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}}}}} ) { Block { Time } Trade { Dex { ProtocolName ProtocolFamily SmartContract } Buy { Amount Buyer Seller Currency { Decimals Fungible HasURI Name ProtocolName SmartContract Symbol } OrderId AmountInUSD } Sell { Buyer Seller Currency { Fungible Decimals Name Native SmartContract Symbol } AmountInUSD Amount } } } } } ``` ## USDT across chains in one request {#cross-chain} Because `Tron` and `EVM` are separate top-level selectors, you can alias several of them in a **single GraphQL request** and compare the same asset across networks without four round trips. This is the clearest demonstration of why a unified API beats per-chain RPC nodes. The query below compares USDT transfer activity on Tron, Ethereum, BSC and Polygon over one window. Each chain uses its own USDT contract. ```graphql query USDTAcrossChains($since: DateTime) { tron: Tron { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { transfers: count senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) volume: sum(of: Transfer_Amount) } } ethereum: EVM(network: eth) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { transfers: count senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) volume: sum(of: Transfer_Amount) } } bsc: EVM(network: bsc) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { transfers: count senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) volume: sum(of: Transfer_Amount) } } polygon: EVM(network: matic) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f" } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } ) { transfers: count senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) volume: sum(of: Transfer_Amount) } } } ``` ```json { "since": "2026-07-29T00:00:00Z" } ``` USDT contract addresses by chain: | Chain | Selector | USDT contract | Reported symbol | | --- | --- | --- | --- | | Tron | `Tron` | `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` | `USDT` | | Ethereum | `EVM(network: eth)` | `0xdac17f958d2ee523a2206206994597c13d831ec7` | `USDT` | | BNB Smart Chain | `EVM(network: bsc)` | `0x55d398326f99059ff775485246999027b3197955` | `USDT` | | Polygon | `EVM(network: matic)` | `0xc2132d05d31c914a87c6611c10748aeb04b58e8f` | `USDT0` | :::note Transfer counts are not comparable to volume Chains differ enormously in how USDT is used: some see very high transfer counts at small average size, others fewer and much larger transfers. Always read `transfers` and `volume` together — ranking chains on either one alone will mislead you. Note too that Polygon's bridged Tether reports as `USDT0`, so filter by contract, not symbol. ::: ## TRC20 mempool transfers Pending USDT transfers from the Tron mempool, before inclusion in a block — transaction hash, amount, sender and receiver, and the anticipated block number. ```graphql subscription { Tron(mempool: true) { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}}}} ) { Transaction { Hash } Transfer { Amount Sender Receiver Currency { SmartContract Symbol Name Fungible Native } Id AmountInUSD } Block { Number } } } } ``` ## Related APIs - [USDT Stablecoin API](/docs/stablecoin-APIs/usdt-api) — USDT price, payments, reserves and balances across chains - [Tron Transfers API](/docs/blockchain/Tron/tron-transfers) — all TRC10/TRC20 and native TRX transfers - [Tron DEX Trades API](/docs/blockchain/Tron/tron-dextrades) — SunSwap and other Tron DEX activity - [SunSwap API](/docs/blockchain/Tron/sunswap-api) — Tron's largest DEX - [Trading API overview](/docs/trading/trading-data-overview) — structured trades and prices across 10 chains --- ## Tron API Documentation URL: https://docs.bitquery.io/docs/blockchain/Tron/ Tron data API overview: DEX trades and core Tron APIs, how Bitquery differs from Tron RPC, WebSocket and webhook support, plus videos on fees and Sun Pump. # Tron API Documentation :::tip Building a trading app or DEX UI on Tron? For **real-time trades and prices on Tron** (and the last ~30 days), use the curated [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. For **historical Tron data older than ~30 days**, use the chain-level `DEXTrades` / `DEXTradeByTokens` APIs documented below. ::: ## Overview In this section we will see how to fetch data on different tokens, transactions, and DEXs like SunPump and Sunswap on Tron via APIs and Streams. **[Create your account](https://account.bitquery.io/auth/signup)** to get started. If you need help getting data on Tron, reach out to [support](https://t.me/Bloxy_info). ### What is Tron API? Bitquery Tron APIs help you fetch onchain data like trades, transactions, balances, etc using graphQL query. ### What are capabilities of Bitquery Tron API? Bitquery Tron APIs are very flexible, you can fetch trade, transaction, and balance information for a period, for a specific wallet, and join with other information. ### Difference between Tron RPC and Bitquery Tron API? | Tron RPC | Bitquery Tron API | | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | JSON-RPC endpoint exposing raw Tron on-chain state and transactions | GraphQL endpoint over pre-indexed, parsed Tron data (token transfers, DEX trades, logs, calls, etc.) | | No built-in history or analytics—any indexing/aggregation you build or outsource | Historical data, joins, aggregations & real-time subscriptions | | Ideal for submitting transactions | Great for real-time data and historical backtesting without running your own indexer | To access Bitquery Tron API you would require your own **[Access Token](https://account.bitquery.io/user/api_v2/access_tokens)** after signup. ### Does Bitquery support Tron Websocket and Webhooks? Bitquery supports websocket and webhooks; you can convert most GraphQL APIs into GraphQL streams by changing the word `query` to `subscription`. You can monitor this data via a websocket. More docs and code samples are available [here](/docs/subscriptions/websockets/). ## Quick start Run this minimal GraphQL query on **[GraphQL IDE](https://ide.bitquery.io)** after signing up, to fetch the latest 5 DEX trades on Tron: ```graphql query LatestTronTrades { Tron { DEXTrades(limit: { count: 5 }, orderBy: { descending: Block_Time }) { Block { Time } Trade { Dex { ProtocolName } Buy { AmountInUSD Currency { Symbol } } Sell { AmountInUSD Currency { Symbol } } } Transaction { Hash } } } } ``` ## DEX APIs - [SunPump API](/docs/blockchain/Tron/tron-sunpump/) - [SunSwap API](/docs/blockchain/Tron/sunswap-api/) - [Tron Dex Trades](/docs/blockchain/Tron/tron-dextrades/) ## Core Tron APIs - [Balance Updates](/docs/blockchain/Tron/tron-balance-updates/) - [TRC20 USDT API](/docs/blockchain/Tron/usdt-trc20-api/) — transfers, balances, whale holders and exchange deposit flows for USDT on Tron - [NFT](/docs/blockchain/Tron/tron-nft/) - [Mempool](/docs/blockchain/Tron/tron-mempool/) - [Fees](/docs/blockchain/Tron/tron-fees-api/) - [Transactions](/docs/blockchain/Tron/tron-transactions-api/) - [Transfers](/docs/blockchain/Tron/tron-transfers/) ## Does Bitquery support Tron? {#does-bitquery-support-tron} **Yes.** Tron is a **first-class network** in Bitquery: use **V2 GraphQL** with the appropriate **`network`** for Tron (see examples on this site) for **DEX trades** (e.g. SunSwap, SunPump), **transfers**, **balances**, **calls**, and **subscriptions** over **WebSocket**. Historical depth and field availability follow the **dataset** you choose (`combined`, `realtime`, `archive`). Follow the [quick start](#quick-start) below and the topic pages in this section. ## Videos ### Video Tutorial | Comprehensive Guide to Real-Time Tron Data : Trades, NFTs, Mempool etc ### Video Tutorial | How to get Total Fees paid by a Account on Tron Network ### Video Tutorial | How to get Realtime Trades and Liquidity data on Sun Pump ### Video Tutorial | How to track SunPump Token launches to SunSwap ## More guides - [Data Coverage & Retention](/docs/graphql/data-coverage-retention/) — how far back this chain's data goes - [Common errors and what to do](/docs/start/errors/) - [Plans, Points & Limits](/docs/plans/how-billing-works/) - [First query in 5 minutes](/docs/start/first-query/) --- ## Tron Address Balance API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-balance-updates/ Tron Address Balance API: fetch current and historical Tron balances with Bitquery GraphQL balance queries. Run it in the IDE, then ship in your app. # Tron Address Balance API The **Balances** API returns current and historical token balances for an address on Tron. To return only non-zero balances, add `Amount(selectWhere: { gt: "0" })` on the `Balance` field (not in `where`). Use `dataset: combined` or `dataset: archive` as follows: | Dataset | When to use | | -------------- | ------------------------------------------------------------------------------------------- | | **`combined`** | Latest balances. Queries **realtime and archive** databases and merges results. | | **`archive`** | Historical snapshots with `Block.Date`, and balances for **addresses not recently active**. | ## Portfolio of a Tron Wallet Returns balances for all the currecies owned by a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances and `dataset: combined` for the latest balances. [Run in IDE](https://ide.bitquery.io/TronWalletPortfolio-Tron) ```graphql query TronWalletPortfolio($address: String) { Tron(dataset: combined) { Balances( where: { Balance: { Address: { is: $address } } } orderBy: { descending: Balance_AmountInUSD } ) { Currency { Name Symbol SmartContract Native } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` **Variables** ```json { "address": "TFXttAWURRrXrd9JvFPVLEh1esJK8NHxn7" } ``` **Parameters** - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. **Returned fields** - `Currency.Name`, `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Native TRX Balance Returns the native TRX balance for a wallet (not TRC10 or TRC20 tokens). Filter with `Currency: { Native: true }` instead of a token contract address. [Run in IDE](https://ide.bitquery.io/Tron-Balances-for-Native-currency) ```graphql query { Tron(dataset: combined) { Balances( where: { Balance: { Address: { is: "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf" } } Currency: { Native: true } } ) { Currency { Name Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance on a Specific Date Use `Block.Date.till` as the "as of" cutoff (inclusive) — the cube returns the end-of-day balance on that date. Do **not** select `Block` fields in the output, or the result splits into one row per active day instead of a single cumulative balance. Unlike summing Transfers, this includes mints, burns, and genesis supply. For example, the Tether treasury below shows `9.9` USDT on 2019-04-16: the 10 USDT initial supply was written in the contract constructor with no transfer record, minus a 0.1 USDT outgoing transfer the same day. [Run in IDE](https://ide.bitquery.io/tron-usdt-balance-at-date) ```graphql query TronUSDTBalanceAtDate { Tron(dataset: combined) { Balances( where: { Balance: { Address: { in: ["THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC"] } } Block: { Date: { till: "2019-04-16" } } Currency: { SmartContract: { in: ["TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"] } } } ) { Balance { Address Amount } } } } ``` Remove the `Currency` filter to get the balance of every token the address held as of that date. ## Balance for a Specific Token Add a `Currency.SmartContract` filter. Always use the contract address, not the token name. [Run in IDE](https://ide.bitquery.io/tron-token-balance) ```graphql query { Tron(dataset: combined) { Balances( where: { Balance: { Address: { is: "TUTQj7VJ1QjR3t2GJByvrP25yZNFcj38VJ" } } Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } ) { Currency { Name Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance History by Date Returns balance snapshots over time for an address. Use `dataset: archive`. Order by `Block_Date` descending and use `limit` to paginate. Add `Currency.SmartContract` under `Currency` to filter by a specific token. [Run in IDE](https://ide.bitquery.io/tron-balances-by-date) ```graphql query { Tron(dataset: archive) { Balances( where: { Balance: { Address: { is: "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf" } } Currency: {} } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Name Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` ## Total Holder Count of a Tron Token Count the total number of unique addresses holding a Tron TRC20 token with a positive balance. Use the **Holders** API. [Run in IDE](https://ide.bitquery.io/token-holders-count-tron) ```graphql query TokenHolderCount { Tron(dataset: combined) { Holders( where: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } Balance: { Amount: { gt: "0" } } } ) { Currency { Name Symbol SmartContract } holders: uniq(of: Holder_Address) } } } ``` ## Top Token Holders of a Token Returns the top holders of a token ranked by current balance. Use the **Holders** API with `orderBy` and `limit`. [Run in IDE](https://ide.bitquery.io/top-token-holders-of-a-token) ```graphql query TopTokenHolders { Tron(dataset: combined) { Holders( where: { Currency: { SmartContract: { is: "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT" } } Balance: { Amount: { gt: "0" } } } orderBy: { descending: Balance_Amount } limit: { count: 10 } ) { Holder { Address } Currency { Name Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) } } } } ``` --- ## Tron DEXtrades API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-dextrades/ Tron DEXtrades API: get Tron DEX swaps, prices, and OHLC with Bitquery GraphQL queries and live streams. Built for traders and analytics teams. # Tron DEX Trades API :::tip Need real-time Tron DEX data or anything from the last ~30 days? For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API** (filter with `Pair.Market.Network: Tron`). Use this page when you need **historical Tron data older than ~30 days** (with `dataset: combined` or `archive`), raw per-swap detail, or call / event context. ::: **Tron DEX Trades** help you see **who swapped what, when, and at what price** on Tron decentralized exchanges which is useful for dashboards, alerts, research, and trading tools. The examples below are ready-to-run **GraphQL** queries and subscriptions you can copy into the [Bitquery IDE](https://ide.bitquery.io). You can also stream at scale via [Apache Kafka](/docs/streams/kafka-streaming-concepts/). ## Live DEX swap stream (Tron) {#crypto-trades-live-stream} [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api): one row per swap, with USD and supply. Filter **`Pair.Market.Network: Tron`**. [When to use this vs chain DEX APIs](/docs/cubes/dextrades-dextradebytokens-trading-trades). Run this subscription [in the Bitquery IDE](https://ide.bitquery.io/Get-All-DEX-Trades-on-Tron-With-Price-Market-Cap-and-Supply).
Click to expand GraphQL query ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Tron" } } } }) { Side Supply { MaxSupply TotalSupply FullyDilutedValuationUsd CirculatingSupply MarketCap } Trader { Address } TransactionHeader { Fee FeePayer Sender To Hash Index } Amounts { Base Quote } AmountsInUsd { Base Quote } Block { Date Time Timestamp } Pair { Currency { Id Name Symbol } Market { Address Program Network } QuoteCurrency { Id Name Symbol } Token { Address Id IsNative Symbol TokenId Network } QuoteToken { Address Id IsNative Symbol TokenId Network } } Price PriceInUsd } } } ```
## Subscribe to Latest Tron Trades This example uses the chain-specific **DEXTrades** cube via `Tron { DEXTrades }`. For trader + USD swap rows, use the [stream at the top](#crypto-trades-live-stream). You can try the query [here](https://ide.bitquery.io/Latest-trades-on-Tron)
Click to expand GraphQL query ```graphql subscription { Tron { DEXTrades { Block { Time } Trade { Dex { ProtocolName ProtocolFamily SmartContract } Buy { Amount Buyer Seller Currency { Decimals Fungible HasURI Name ProtocolName SmartContract Symbol } OrderId } Sell { Buyer Seller Currency { Fungible Decimals Name Native SmartContract Symbol } } } } } } ```
## Get Token Stats like buyers, sellers, makers, total trades, total volume, buy volume, sell volume This query fetches you all the important token statistics such as number of buyers, sellers, makers, total trades, total volume, buy volume, sell volume. Try the query [here](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-a-tron-pair)
Click to expand GraphQL query ```graphql query MyQuery( $token: String,$pairAddress: String , $min5_timestamp: DateTime, $hr1_timestamp: DateTime) { Tron { DEXTradeByTokens( where: {TransactionStatus: {Success: true}, Trade: {Currency: {SmartContract: {is: $token}}, Dex: {SmartContract: {is: $pairAddress}}}, Block: {Time: {since: $hr1_timestamp}}} ) { Trade { Currency { Name SmartContract Symbol } startPrice: PriceInUSD(minimum: Block_Time) Price_at_min5: PriceInUSD( minimum: Block_Time if: {Block: {Time: {after: $min5_timestamp}}} ) current_price: PriceInUSD(maximum: Block_Time) Dex { ProtocolName ProtocolFamily SmartContract } Side { Currency { Symbol Name SmartContract } } } makers: count(distinct: Transaction_From) makers_5min: count( distinct: Transaction_From if: {Block: {Time: {after: $min5_timestamp}}} ) buyers: count( distinct: Transaction_From if: {Trade: {Side: {Type: {is: sell}}}} ) buyers_5min: count( distinct: Transaction_From if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $min5_timestamp}}} ) sellers: count( distinct: Transaction_From if: {Trade: {Side: {Type: {is: buy}}}} ) sellers_5min: count( distinct: Transaction_From if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $min5_timestamp}}} ) trades: count trades_5min: count(if: {Block: {Time: {after: $min5_timestamp}}}) traded_volume: sum(of: Trade_Side_AmountInUSD) traded_volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {after: $min5_timestamp}}} ) buy_volume: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: sell}}}} ) buy_volume_5min: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $min5_timestamp}}} ) sell_volume: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: buy}}}} ) sell_volume_5min: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $min5_timestamp}}} ) buys: count(if: {Trade: {Side: {Type: {is: sell}}}}) buys_5min: count( if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $min5_timestamp}}} ) sells: count(if: {Trade: {Side: {Type: {is: buy}}}}) sells_5min: count( if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $min5_timestamp}}} ) } } } { "token": "put token address here", "pairAddress": "put pair address here", "hr1_timestamp": "2024-11-14T03:20:00Z", "min5_timestamp": "2024-11-14T04:15:00Z" } ```
## Get Top gainer tokens on Tron Network This query fetches you the top gainer tokens on Tron network. You can try the query [here](https://ide.bitquery.io/top-gainers_1).
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( where: {Transaction: {Result: {Success: true}}} orderBy: {descendingByField: "usd"} limit: {count: 100} ) { Trade { Currency { Symbol Name SmartContract } Side { Currency { Symbol Name SmartContract } } price_last: PriceInUSD(maximum: Block_Number) price_1h_ago: PriceInUSD(minimum: Block_Number) } dexes: uniq(of: Trade_Dex_OwnerAddress) amount: sum(of: Trade_Side_Amount) usd: sum(of: Trade_Side_AmountInUSD) buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) count(selectWhere: {ge: "100"}) } } } ```
![image](https://github.com/user-attachments/assets/59eae28e-bfdd-42ea-b942-fd0c9facf583) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron). ## Get Top bought tokens on Tron Network This query fetches you the top bought tokens on Tron network. You can try the query [here](https://ide.bitquery.io/top-bought).
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( orderBy: {descendingByField: "buy"} where: {Transaction: {Result: {Success: true}}} limit: {count: 100} ) { Trade { Currency { Symbol Name SmartContract } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) } } } ```
Arranged in the descending order of `bought - sold` on [DEXrabbit](https://dexrabbit.bitquery.io/tron). ![image](https://github.com/user-attachments/assets/e3dcd6e7-7ee8-469b-a2ee-de1a3ce63e78) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron). ## Get Top sold tokens on Tron Network This query fetches you the top sold tokens on Tron network. You can try the query [here](https://ide.bitquery.io/top-sold).
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( orderBy: {descendingByField: "sell"} where: {Transaction: {Result: {Success: true}}} limit: {count: 100} ) { Trade { Currency { Symbol Name SmartContract } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) } } } ```
Arranged in the descending order of `sold - bought` on [DEXrabbit](https://dexrabbit.bitquery.io/tron). ![image](https://github.com/user-attachments/assets/fc1e4ae8-8ef9-41c8-bf08-175000cac870) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron). ## Get OHLC data of a token on Tron Network This query fetches you the OHLC data of a specific token on Tron network. You can try the query [here](https://ide.bitquery.io/ohlc0_5).
Click to expand GraphQL query ```graphql query tradingViewPairs($token: String, $base: String) { Tron { DEXTradeByTokens( orderBy: {ascendingByField: "Block_Time"} where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}, Currency: {SmartContract: {is: $token}}, PriceAsymmetry: {lt: 0.1}}} ) { Block { Time(interval: {count: 5, in: minutes}) } Trade { open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) max: PriceInUSD(maximum: Trade_PriceInUSD) min: PriceInUSD(minimum: Trade_PriceInUSD) } volume: sum(of: Trade_Side_Amount) } } } { "token": "TJ9mxWPmQSJswqMakEehFWcAntg73odiAq", "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR" } ```
![image](https://github.com/user-attachments/assets/5ed90e34-a6ed-4c9b-a458-30d81a19d9f1) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/pair/TJ9mxWPmQSJswqMakEehFWcAntg73odiAq/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR). ## Get Latest Trades of a token on Tron Network This query fetches you the latest trades of a specific token on Tron network. You can try the query [here](https://ide.bitquery.io/latest-trades_3).
Click to expand GraphQL query ```graphql query LatestTrades($token: String, $base: String) { Tron { DEXTradeByTokens( orderBy: {descending: Block_Time} limit: {count: 50} where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}, Currency: {SmartContract: {is: $token}}, Price: {gt: 0}}, Transaction: {Result: {Success: true}}} ) { Block { allTime: Time } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } Currency { Symbol SmartContract Name } Price AmountInUSD Amount Side { Type Currency { Symbol SmartContract Name } AmountInUSD Amount } } } } } { "token": "TJ9mxWPmQSJswqMakEehFWcAntg73odiAq", "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR" } ```
![image](https://github.com/user-attachments/assets/af073bde-0e9e-45cf-8d27-bd9176d7bf73) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/pair/TJ9mxWPmQSJswqMakEehFWcAntg73odiAq/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR#pair_latest_trades). ## Get Top Traders of a token on Tron Network This query fetches you the top traders of a specific token on Tron network. You can try the query [here](https://ide.bitquery.io/top-traders_6).
Click to expand GraphQL query ```graphql query TopTraders($token: String, $base: String) { Tron { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}}, Transaction: {Result: {Success: true}}} ) { Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "token": "TJ9mxWPmQSJswqMakEehFWcAntg73odiAq", "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR" } ```
![image](https://github.com/user-attachments/assets/f40658bd-aa9f-4c32-bcf3-792c098ea66e) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/pair/TSig7sWzEL2K83mkJMQtbyPpiVSbR6pZnb/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR#pair_top_traders). ## Get Top Buyers of a token on Tron Network This query fetches you the top 10 buyers of a specific token on Tron network. You can try the query [here](https://ide.bitquery.io/top-buyers-of-token---Tron_1).
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( orderBy: {descendingByField: "bought"} limit: {count: 10} where: {Trade: {Currency: {SmartContract: {is: "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"}}}, TransactionStatus: {Success: true}} ) { Trade { Buyer Currency { Symbol Name SmartContract } } bought: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) } } } ```
## Get Top Sellers of a token on Tron Network This query fetches you the top 10 sellers of a specific token on Tron network. You can try the query [here](https://ide.bitquery.io/top-sellers-of-token---Tron_3).
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( orderBy: {descendingByField: "sold"} limit: {count: 10} where: {Trade: {Currency: {SmartContract: {is: "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"}}}, TransactionStatus: {Success: true}} ) { Trade { Buyer Currency { Symbol Name SmartContract } } sold: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } ```
## Get DEX markets for a specific Token This query fetches you the DEXs where a specific token is being traded on Tron network. You can try the query [here](https://ide.bitquery.io/DEX-Markets-for-a-token_1).
Click to expand GraphQL query ```graphql query ($token: String, $base: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) { Tron { DEXTradeByTokens( orderBy: {descendingByField: "amount"} where: {Trade: {Currency: {SmartContract: {is: $token}}, Side: {Amount: {gt: " "}, Currency: {SmartContract: {is: $base}}}}, Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_3h_ago}}} ) { Trade { Dex { ProtocolFamily ProtocolName } price_last: PriceInUSD(maximum: Block_Number) price_10min_ago: PriceInUSD( maximum: Block_Number if: {Block: {Time: {before: $time_10min_ago}}} ) price_1h_ago: PriceInUSD( maximum: Block_Number if: {Block: {Time: {before: $time_1h_ago}}} ) price_3h_ago: PriceInUSD(minimum: Block_Number) } amount: sum(of: Trade_Side_Amount) pairs: uniq(of: Trade_Side_Currency_SmartContract) trades: count } } } { "token": "TSig7sWzEL2K83mkJMQtbyPpiVSbR6pZnb", "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", "time_10min_ago": "2024-09-20T08:36:40Z", "time_1h_ago": "2024-09-20T07:46:40Z", "time_3h_ago": "2024-09-20T05:46:40Z" } ```
![image](https://github.com/user-attachments/assets/cf2e2b29-8a15-41d1-bbef-41339fd41f60) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/pair/TSig7sWzEL2K83mkJMQtbyPpiVSbR6pZnb/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR#pair_dex_list). ## Get All DEXs info on Tron network This query fetches you all the DEXs information on Tron network such as unique sellers, unique buyers etc. You can try the query [here](https://ide.bitquery.io/all-dexs-info).
Click to expand GraphQL query ```graphql query DexMarkets { Tron { DEXTradeByTokens { Trade { Dex { ProtocolFamily } } buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Sender) count(if: {Trade: {Side: {Type: {is: buy}}}}) } } } ```
![image](https://github.com/user-attachments/assets/01287a30-53e1-4ffa-b5fc-828009282ac5) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/dex_market). ## Get Top Traders on Tron network This query fetches you TOp Traders information on Tron network. You can try the query [here](https://ide.bitquery.io/top-traders-on-tron-network).
Click to expand GraphQL query ```graphql query DexMarkets { Tron { DEXTradeByTokens(orderBy: {descendingByField: "trades"}, limit: {count: 100}) { Trade { Dex { OwnerAddress } } trades: count(if: {Trade: {Side: {Type: {is: buy}}}}) tokens: uniq(of: Trade_Currency_SmartContract) } } } ```
![image](https://github.com/user-attachments/assets/1184d54f-47db-428f-8f71-cd0c591a310b) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/trader). ## Subscribe to Latest Price of a Token in Real-time This query provides real-time updates on price of token `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` in terms of USDT `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`, including details about the DEX. Try the query [here](https://ide.bitquery.io/Track-price-of-a-tron-token-in-realtime)
Click to expand GraphQL query ```graphql subscription MyQuery { Tron { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}}}, TransactionStatus: {Success: true}} ) { Block { Time } Trade { Amount AmountInUSD Buyer Price PriceInUSD Seller Currency { Symbol SmartContract Name } Dex { SmartContract ProtocolName ProtocolFamily } Side { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } } } } } } ```
## Stablecoin Peg Health (Latest Price Across All DEXs) Get the **latest price of a stablecoin across all Tron DEXs**. Returns one row per DEX protocol with the most recent trade price. Useful for monitoring peg health and identifying which exchanges have the stablecoin trading closest to its target peg (e.g., $1.00 for USD-pegged stablecoins). Browse multi-chain stablecoin DEX prices on [DEXrabbit's Stablecoins category](https://dexrabbit.bitquery.io/categories/stablecoins). [Run in Bitquery IDE](https://ide.bitquery.io/peg-health-tron)
Click to expand GraphQL query ```graphql { Tron { DEXTradeByTokens( orderBy: {descending: Block_Time} limitBy: {count: 1 by:Trade_Dex_SmartContract} where: {Trade: { Currency: {SmartContract: {is: "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"}}}} ) { Block { Time } Transaction { Hash } Trade { Amount AmountInUSD Price PriceInUSD Currency { Name SmartContract Symbol } Dex { ProtocolName ProtocolFamily SmartContract } Side { Type Currency { Name SmartContract Symbol } AmountInUSD Amount } } } } } ```
## Volume of Multiple Tokens Across Different Chains Get volume and price change data for multiple tokens trading on different chains (Solana, Ethereum, BSC, Tron) in a single query using the Trading API. Returns volume for 1h, 4h, and 24h periods, plus price change percentages for the same intervals. :::note EVM address format For **EVM chains** (Ethereum, BSC, etc.) in the Trading API, use **all lowercase addresses** in the token ID format (e.g., `bid:eth:0x...` with lowercase hex). Mixed-case addresses may not match. ::: [Run in Bitquery IDE](https://ide.bitquery.io/volume-of-a-token_1)
Click to expand GraphQL query ```graphql query { TokenAsBase: Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Block: { Time: { since_relative: { hours_ago: 24 } } } Price: { IsQuotedInUsd: true } Token: { Id: { in: [ "bid:solana:CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s", "bid:eth:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78", "bid:bsc:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78", "bid:tron:TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT" ] } } Market: { Protocol: { notIn: ["jupiter", "dex_solana_v3"] } } } ) { Token { Name Symbol Id } Price { Average { currentPrice: Mean(maximum: Block_Time) H1Ago: Mean( maximum: Block_Time if: { Block: { Time: { till_relative: { hours_ago: 1 } } } } ) H4Ago: Mean( maximum: Block_Time if: { Block: { Time: { till_relative: { hours_ago: 4 } } } } ) H24Ago: Mean( minimum: Block_Time if: { Block: { Time: { after_relative: { hours_ago: 24 } } } } ) } } Price_change_1h: calculate( expression: "( ( $Price_Average_currentPrice - $Price_Average_H1Ago ) / $Price_Average_H1Ago ) * 100" ) Price_change_4h: calculate( expression: "( ( $Price_Average_currentPrice - $Price_Average_H4Ago ) / $Price_Average_H4Ago ) * 100" ) Price_change_24h: calculate( expression: "( ( $Price_Average_currentPrice - $Price_Average_H24Ago ) / $Price_Average_H24Ago ) * 100" ) v1h: sum(of: Volume_Usd, if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }) v4h: sum(of: Volume_Usd, if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }) v24h: sum(of: Volume_Usd) } } } ```
--- ## More examples Pool-level example below; full-network swap stream is [above](#crypto-trades-live-stream). ### Top Traders by PnL for a Specific Pool (Last 30 Minutes) Rank traders by **`PnL`** on one pool: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **pool-specific trader analytics**. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-tron-pool_1).
Click to expand GraphQL query ```graphql { Trading { Trades( limit: { count: 10 } orderBy: { descendingByField: "PnL" } where: { Block: { Time: { since_relative: { minutes_ago: 30 } } } Pair: { Market: { Address: { is: "TThJt8zaJzJMhCEScH7zWKnp5buVZqys9x" } } } } ) { Trader { Address } Amount_Bought: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } }) Amount_Sold: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } }) Amount_Bought_native: sum(of: Amounts_Base, if: { Side: { is: "Buy" } }) Amount_Sold_native: sum(of: Amounts_Base, if: { Side: { is: "Sell" } }) PnL: calculate(expression: "$Amount_Sold - $Amount_Bought") buys: count(if: { Side: { is: "Buy" } }) sells: count(if: { Side: { is: "Sell" } }) } } } ```
--- ## Get the First 100 Buyers of a Token on Tron Find the **earliest buyers** of any Tron token by using Tron `DEXTradeByTokens` API. This is widely used for **memecoin sniper detection**, **early-holder analysis**, and **alpha groups** monitoring SunPump / SunSwap launches. For live DEX prices across Tron memecoins, see [DEXrabbit's Tron Meme Coins category](https://dexrabbit.bitquery.io/categories/tron-meme). You can try this query [here](https://ide.bitquery.io/first-100-buyers-tron-token).
Click to expand GraphQL query ```graphql query FirstBuyersOfTronToken($token: String) { Tron { DEXTradeByTokens( orderBy: { ascending: Block_Time } limitBy: { by: Trade_Buyer, count: 1 } limit: { count: 100 } where: { Trade: { Currency: { SmartContract: { is: $token } } Side: { Type: { is: buy } } } TransactionStatus: { Success: true } } ) { Block { Time } Trade { Buyer Amount AmountInUSD Price PriceInUSD Currency { Symbol Name SmartContract } Dex { ProtocolName ProtocolFamily } } Transaction { Hash } } } } ``` Variables: ```json { "token": "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT" } ```
## Track New Token Launches on Tron DEXs (SunPump & SunSwap) Surface tokens whose **first ever DEX trade** happened in a recent window — useful for **new launch radars**, **bot discovery**, and **trending token feeds** for the Tron ecosystem. Run this query [in the Bitquery IDE](https://ide.bitquery.io/new-token-launches-tron).
Click to expand GraphQL query ```graphql query NewTronTokenLaunches { Tron { DEXTradeByTokens( orderBy: { ascendingByField: "first_trade" } limitBy: { by: Trade_Currency_SmartContract, count: 1 } limit: { count: 50 } where: { Trade: { Side: { Currency: { SmartContract: { is: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR" } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } TransactionStatus: { Success: true } } ) { Trade { Currency { Name Symbol SmartContract } Dex { ProtocolName ProtocolFamily } first_price: PriceInUSD(minimum: Block_Time) } first_trade: minimum(of: Block_Time) first_buyer: Trade_Buyer } } } ```
## Wallet PnL Across All Tron Trades Compute realized **profit and loss for any Tron wallet** across every token it has traded. Powers **trader leaderboards**, **smart-money copytrading**, and **portfolio dashboards**. Filter `Trade_Sender` to the wallet you want. You can run the query [here](https://ide.bitquery.io/wallet-pnl-tron).
Click to expand GraphQL query ```graphql query WalletPnLTron($wallet: String) { Tron { DEXTradeByTokens( where: { Transaction: { Result: { Success: true } } any: [ { Trade: { Buyer: { is: $wallet } } } { Trade: { Seller: { is: $wallet } } } ] } orderBy: { descendingByField: "pnl" } limit: { count: 100 } ) { Trade { Currency { Symbol Name SmartContract } } bought_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: sell } } } } ) sold_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: buy } } } } ) pnl: calculate(expression: "$sold_usd - $bought_usd") trades: count } } } { "wallet": "TFXttAWURRrXrd9JvFPVLEh1esJK8NHxn7" } ```
## Detect Token Snipers (Buyers Within 60 Seconds of Launch) Spot wallets that bought a Tron token within **60 seconds of its very first DEX trade** — the canonical signature of an automated **sniper bot**. Useful for risk scoring, anti-bot dashboards, and alpha tracking. Try the query [here](https://ide.bitquery.io/tron-snipers-detection).
Click to expand GraphQL query ```graphql query TronSnipers($token: String, $launch_time: DateTime, $sniper_window: DateTime) { Tron { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $token } } Side: { Type: { is: buy } } } Block: { Time: { after: $launch_time, before: $sniper_window } } TransactionStatus: { Success: true } } orderBy: { ascending: Block_Time } limitBy: { by: Trade_Buyer, count: 1 } ) { Block { Time } Trade { Buyer Amount AmountInUSD Price PriceInUSD } Transaction { Hash } } } } { "token": "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT", "launch_time": "2025-01-01T00:00:00Z", "sniper_window": "2025-01-01T00:01:00Z" } ```
--- --- ## Tron Fees API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-fees-api/ Tron Fees API: analyze Tron transaction fees and costs with Bitquery GraphQL queries and streams. Scale further with Kafka or gRPC streams. # Tron Fees API In this document, we will explore several examples related to Tron Fees data. For related memecoin fee and trade analytics on other chains, see [Pump.fun](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/), [PumpSwap](/docs/blockchain/Solana/Pumpfun/pump-swap-api/), [Moonshot](/docs/blockchain/Solana/Moonshot-API/), and [Four.meme](/docs/blockchain/BSC/four-meme-api/). These APIs can also be delivered through Kafka streams for low-latency use cases — contact us on Telegram. If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out. ## Get Trades with Transaction fees Get a list of successful DEX trades on Tron along with the transaction fee details for each trade. You can test the query [here](https://ide.bitquery.io/tron-trades-with-transaction-fees#). ```graphql query MyQuery { Tron { DEXTradeByTokens( where: {Transaction: {Result: {Success: true}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Block { Time Number } Trade { Buyer Seller AmountInUSD Amount PriceInUSD Price Dex { ProtocolName } Currency { SmartContract Name } Side { Buyer Seller Type AmountInUSD Amount Currency { Name SmartContract } } } Transaction { Hash FeeInUSD Fee FeePayer Signatures } } } } ``` ## Get Transfers by an address and Transaction fees paid for the transfer Track wallet token transfers and get the fees paid for each by the address. You can test the query [here](https://ide.bitquery.io/tron-wallet-transfers-with-transaction-fees-paid). ```graphql query MyQuery { Tron { Transfers( limit: {count: 10} orderBy: {descending: Block_Time} where: {Transaction: {Result: {Success: true}, FeePayer: {is: "TBgP9dqfZPfxLXPKPyXZCUT1XScTa3L3YW"}}} ) { Block { Time } Transfer { Currency { Name SmartContract Symbol } Sender Receiver } Transaction { Fee FeeInUSD FeePayer Hash Signatures } } } } ``` ## Total transaction fees paid by an account Get the total fees (in SOL and USD) paid by a specific Tron account across all transfers. You can test the query [here](https://ide.bitquery.io/Tron-total-txn-fees-paid-by-the-Account#). ```graphql query MyQuery { Tron { Transfers( where: {Transaction: {Result: {Success: true}, FeePayer: {is: "TBgP9dqfZPfxLXPKPyXZCUT1XScTa3L3YW"}}} ) { Total_fees_paid_in_USD:sum(of:Transaction_FeeInUSD) Total_fees_paid_in_TRX:sum(of:Transaction_Fee) } } } ``` ## Transaction fees paid by an account for each currency transfers Get total fees paid by a Tron account for transferring each type of token. You can test the query [here](https://ide.bitquery.io/Tron-Transaction-fees-paid-by-Account-aggregated-by-currency). ```graphql query MyQuery { Tron { Transfers( where: {Transaction: {Result: {Success: true}, FeePayer: {is: "TBgP9dqfZPfxLXPKPyXZCUT1XScTa3L3YW"}}} ) { Transfer{ Currency{ Name Symbol } } Total_fees_paid_in_USD:sum(of:Transaction_FeeInUSD) Total_fees_paid_in_TRX:sum(of:Transaction_Fee) } } } ``` ## Video Tutorial | How to get Total Fees paid by a Account on Tron Network --- ## Tron Mempool API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-mempool/ Tron Mempool API: watch Tron pending transactions before confirmation with Bitquery GraphQL subscriptions. Built for traders and analytics teams. # Tron Mempool API In this section we'll have a look at some examples using the Tron Mempool API. ## Latest Mempool Transfers The below subscription provides real-time data on token transfers happening in the TRON mempool including the value of the transferred amount in USD. You can find the query [here](https://ide.bitquery.io/Tron-mempool-transfers) ```graphql subscription { Tron(mempool: true) { Transfers { Transfer { Sender Receiver Amount AmountInUSD Currency { Symbol } } } } } ``` ## Latest Mempool DEX Trades The below subscription provides provides real-time data on decentralized exchange (DEX) trades happening in the TRON mempool including details of buyer,seller, protocol information and the amount with USD values. ```graphql subscription { Tron(mempool: true) { DEXTrades { Block { Time } Trade { Dex { ProtocolName ProtocolFamily SmartContract } Buy { Amount Buyer Seller Currency { Decimals Fungible HasURI Name ProtocolName SmartContract Symbol } OrderId } Sell { Buyer Seller Currency { Fungible Decimals Name Native SmartContract Symbol } } } } } } ``` ## Latest Mempool Transactions The below subscription provides data on all transactions happening in the TRON mempool including Witness information. ```graphql subscription { Tron(mempool: true) { Transactions { Block { Time Number Hash } Contract { Type Address TypeUrl } Transaction { Hash Signatures Result { Success } } Witness { Address Signature Id } } } } ``` ## Latest NFT Mempool Transfers The below subscription provides data on non-fungible token (NFT) transfers happening in the TRON mempool. ```graphql subscription { Tron(mempool: true) { Transfers(where: {Transfer: {Currency: {Fungible: false}}}) { Block { Hash Number Time } Transfer { Amount Currency { Name Symbol Native } Sender Receiver } } } } ``` --- ## Tron NFT API: TRC-721 Transfers, Holders and Collections URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-nft/ Query and stream TRC-721 NFT transfers on Tron with Bitquery GraphQL: latest transfers, one collection, mints and holders, live or from history. # Tron NFT API: TRC-721 Transfers, Holders and Collections NFTs on Tron are TRC-721 tokens, and Bitquery indexes every transfer of them in the `Tron.Transfers` cube with `Currency.Fungible` set to `false`. Each row carries the collection contract, the token id, the sender, the receiver and the transaction, so the same cube answers "what NFTs moved on Tron just now", "who received token 4711 of this collection" and "every transfer of one collection since it launched". Queries return the latest rows; changing `query` to `subscription` streams new transfers as they land. Every example runs in the [IDE](https://ide.bitquery.io). Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. ## Latest NFT transfers on Tron The most recent NFT transfers across all collections. On Tron a large share of these rows are liquidity-position NFTs from DEXs such as SunSwap, which are TRC-721 tokens too. ```graphql { Tron { Transfers( where: { Transfer: { Currency: { Fungible: false } } } limit: { count: 5 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Currency { Name Symbol SmartContract } Id Sender Receiver } } } } ``` ## Transfers of one collection, as they happen NFT activity on Tron is sparse: even the busiest collections, the SunSwap position NFTs, move a handful of times a day. So check a collection with the query form first, then leave the subscription running for the live feed. The example is the SunSwap V4 Positions NFT, `TC8xQzPHfn5KceZV6s6GmZkBCFWWUoPXs1`; the saved IDE stream [here](https://ide.bitquery.io/Websocket-for-tracking-Transfers-of-a-particular-NFT-websocket) uses another contract. ```graphql { Tron { Transfers( where: { Transfer: {Currency: {Fungible: false, SmartContract: {is: "TC8xQzPHfn5KceZV6s6GmZkBCFWWUoPXs1"}}} Block: {Time: {since_relative: {hours_ago: 24}}} } limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Time } Transfer { Id Sender Receiver Currency { Name Symbol } } } } } ``` The same filter as a stream: ```graphql subscription { Tron { Transfers( where: {Transfer: {Currency: {Fungible: false, SmartContract: {is: "TC8xQzPHfn5KceZV6s6GmZkBCFWWUoPXs1"}}}} ) { Block { Hash Number Time } Transfer { Amount Currency { Name Symbol Native } Sender Receiver } } } } ``` ## Useful filters - One token: add `Id: { is: "4711" }` inside `Transfer`. - Mints: `Sender: { is: "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb" }` (the Tron zero address) returns tokens created in the window. - One wallet: `Receiver: { is: "T..." }` or `Sender: { is: "T..." }`. - History: add `dataset: archive` or `combined` to the `Tron` root; without it the query reads the realtime window. ## Related pages - [Tron API hub](/docs/blockchain/Tron/) - [Ethereum NFT collection API](/docs/blockchain/Ethereum/nft/nft-collection-api) - [Optimism NFT API](/docs/blockchain/Optimism/optimism-nft) - [Transfers cube](/docs/cubes/transfers-cube) --- ## Tron SunPump API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-sunpump/ Tron Sunpump: real-time Tron memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Run it in the IDE, then ship in your app. # Sun Pump API In this section, we will explore several examples related to Sun Pump data. These APIs can be provided through different streams including Kafka for zero latency requirements. Please contact us on telegram. For live DEX prices and volume across Tron memecoins (including Sun Pump tokens), see [DEXrabbit's Tron Meme Coins category](https://dexrabbit.bitquery.io/categories/tron-meme). ## Latest Created Sunpump token This query will subscribe you to the latest created sun pump tokens. You will find the newly created token address in `Log { SmartContract }`. Here’s the [query](https://ide.bitquery.io/New-tokens-on-sunpump_1#) to retrieve the latest tokens created on Sun Pump. If you remove `subscription` from the below GraphQL query it will become API, for example check [this api](https://ide.bitquery.io/latest-created-Sunpump-tokens).
Click to expand GraphQL query ```graphql subscription MyQuery { Tron { Events( where: { Transaction: { Result: { Success: true } } Topics: { includes: { Hash: { in: [ "8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0" ] } } } } ) { Log { SmartContract } Contract { Address } Transaction { Hash FeePayer } } } } ```
## Latest Trades on Sunpump Tron To subscribe to latest Sunpump trades you can use [the following stream](https://ide.bitquery.io/Sunpump-trades).
Click to expand GraphQL query ```graphql subscription { Tron { DEXTrades(where: {Trade: {Dex: {ProtocolName: {is: "sun_pump_v1"}}}}) { Transaction { Hash } Trade { Buy { Amount AmountInUSD Buyer Seller Amount AmountInUSD Currency { SmartContract Symbol Name } } Sell { Amount AmountInUSD Buyer Seller Amount AmountInUSD Currency { SmartContract Symbol Name } } } } } } ```
## Get all Pairs in Virtual Liquidity Pool Sun Pump does not use a dedicated pool for each pair; instead, all liquidity is managed within a single contract. You can query the virtual liquidity pools directly by running the following query
Click to expand GraphQL query ```graphql query SunPumpTokenPools { Tron(dataset: combined) { DexPools: Balances( where: {Balance: {Address: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}} orderBy: {descending: Balance_Amount} ) { totalLiquidity: Balance { Amount(selectWhere: {gt: "0"}) } Currency { SmartContract Name Symbol Decimals } } } } ```
Find the query [here](https://ide.bitquery.io/Sun-Pump-Virtual-Liquidity-Pools_1) ## Sunpump Trades in Mempool We simulate transactions in mempool, therefore you can also get trades directly from mempool using [following stream](https://ide.bitquery.io/Sunpump-trades-mempool).
Click to expand GraphQL query ```graphql subscription { Tron (mempool:true) { DEXTrades(where: {Trade: {Dex: {ProtocolName: {is: "sun_pump_v1"}}}}) { Transaction { Hash } Trade { Buy { Amount AmountInUSD Buyer Seller Amount AmountInUSD Currency { SmartContract Symbol Name } } Sell { Amount AmountInUSD Buyer Seller Amount AmountInUSD Currency { SmartContract Symbol Name } } } } } } ```
## OHLC data for specific token on SunPump You can also get ohlc data for specific token using DEXTradeByTokens API. Here is [an example](https://ide.bitquery.io/OHLC0_6).
Click to expand GraphQL query ```graphql query TokenOHLC($token: String) { Tron { DEXTradeByTokens( orderBy: {ascendingByField: "Block_Time"} where: {Trade: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}, PriceAsymmetry: {lt: 0.1}}, Transaction: {Result: {Success: true}}} ) { Block { Time(interval: {count: 5, in: minutes}) allTime: Time } Trade { Buyer Seller Dex { SmartContract ProtocolName ProtocolFamily } Currency { Symbol Name SmartContract } Price Amount Side { AmountInUSD Amount } open: Price(minimum: Block_Number) close: Price(maximum: Block_Number) min: Price(maximum: Trade_Price) max: Price(minimum: Trade_Price) closeUsd: PriceInUSD(maximum: Trade_PriceInUSD) } volume: sum(of: Trade_Side_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "token": "TMaQT6QWTaTxuorH7Aa898Gmt7ibJKc6Ti" } ```
![image](https://github.com/user-attachments/assets/0904c6fa-043e-4da7-895e-cdfed4794ad3) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/sunpump/TMaQT6QWTaTxuorH7Aa898Gmt7ibJKc6Ti). ## Latest Trades for specific token on SunPump You can also get trades for specific token using DEXTradeByTokens API. Here is [an example](https://ide.bitquery.io/trades-for-a-particular-sunpump-token). To learn the difference between DEXTrades and DEXTradeByTokens API, read [this](/docs/cubes/dextrades/) and [this](/docs/cubes/dextradesbyTokens/) doc.
Click to expand GraphQL query ```graphql query SunPumpTokenLatestTrades($token: String) { Tron { DEXTradeByTokens( orderBy: {descending: Block_Time} limit: {count: 50} where: {Trade: {Currency: {SmartContract: {is: $token}}, Price: {gt: 0}}, Transaction: {Result: {Success: true}}} ) { Block { allTime: Time } Trade { Seller Buyer Price Amount AmountInUSD Currency { Name Symbol SmartContract } Side { Type Currency { Name Symbol SmartContract } AmountInUSD Amount } } } } } { "token": "TQFZb7S1gb5D2u7HqmKJRNZXoTjVe428sh" } ```
![image](https://github.com/user-attachments/assets/28c3e59d-750a-4873-a491-df2bbd42c9ad) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/tron/sunpump/TQFZb7S1gb5D2u7HqmKJRNZXoTjVe428sh). :::note Getting SunPump data using transactions API instead of Trades as shown in following examples. ::: ## Latest Buy events on SunPump Tron You can use following stream to get latest buys on Sunpump. You can try [this stream on IDE](https://ide.bitquery.io/latest-Buy-on-SunPump).
Click to expand GraphQL query ```graphql subscription { Tron(mempool: false) { BuyEvents: Events( where: { Transaction: { Data: { includes: "1cc2c911" } Result: { Success: true } } Contract: { Address: { is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw" } } } ) { Log { SmartContract Signature { Name SignatureHash } } Contract { Address } Transaction { Hash Timestamp Index FeePayer } LogHeader { Data } Block { Number } Topics { Hash } } } } ```
## Sunpump Bonding Curve using TRX Balance TRX balance in bonding curve based on dex trades. Calculated as `balance = in_sum - out_sum` Try [this query](https://ide.bitquery.io/SunPump-Bonding-Curve-TRX-Balance).
Click to expand GraphQL query ```graphql { Tron { in: DEXTrades( where: {Trade: {Dex: {SmartContract: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Buy: {Currency: {SmartContract: {is: "TWnCdRpXc7RUPiM24T744rkux1t5VZt7TH"}}}}} ) { sum(of: Trade_Sell_Amount) } out: DEXTrades( where: {Trade: {Dex: {SmartContract: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Sell: {Currency: {SmartContract: {is: "TWnCdRpXc7RUPiM24T744rkux1t5VZt7TH"}}}}} ) { sum(of: Trade_Buy_Amount) } } } ```
Historical TRX balance in bonding curve based on DEX trades. Calculated as `balance = in_sum - out_sum` Use following [query](https://ide.bitquery.io/SunPump-Historical-Bonding-Curve-TRX-Balance).
Click to expand GraphQL query ```graphql { Tron { in: DEXTrades( where: {Trade: {Dex: {SmartContract: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Buy: {Currency: {SmartContract: {is: "TWnCdRpXc7RUPiM24T744rkux1t5VZt7TH"}}}}} ) { Block { Time(interval: {count: 5, in: minutes}) allTime: Time } sum(of: Trade_Sell_Amount) } out: DEXTrades( where: {Trade: {Dex: {SmartContract: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Sell: {Currency: {SmartContract: {is: "TWnCdRpXc7RUPiM24T744rkux1t5VZt7TH"}}}}} ) { Block { Time(interval: {count: 5, in: minutes}) allTime: Time } sum(of: Trade_Buy_Amount) } } } ```
## Latest Sell events on SunPump Tron You can use following stream to get latest sells on Sunpump. You can try [this stream on IDE](https://ide.bitquery.io/sunpump-sell-event).
Click to expand GraphQL query ```graphql subscription { Tron(mempool: false) { SellEvents: Events( where: { Transaction: { Data: { includes: "d19aa2b9" } Result: { Success: true } } Contract: { Address: { is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw" } } } ) { Log { SmartContract Signature { Name SignatureHash } } Contract { Address } Transaction { Hash Timestamp Index FeePayer } LogHeader { Data } Block { Number } Topics { Hash } } } } ```
## First Time Buy Event on Sunpump You can use follow stream to get stream of first time buy event for any new token. You can try [this stream on IDE](https://ide.bitquery.io/Tron-sunpump-first-time-buy-event_1).
Click to expand GraphQL query ```graphql subscription { Tron(mempool: false) { BuyEventsFirstTime: Events( where: { Transaction: { Data: { includes: "2f70d762" } Result: { Success: true } } Contract: { Address: { is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw" } } } ) { Log { SmartContract Signature { Name SignatureHash } } Contract { Address } Transaction { Hash Timestamp Index FeePayer } LogHeader { Data } Block { Number } Topics { Hash } } } } ```
## Tron DEX Trade API Currently Tron DEX trade API doesn't have Sunpump for now, but it has other DEXs including Sunswap and we are in process of adding Sunpump in DEX trades api. You can try [this API on our IDE](https://ide.bitquery.io/Tron-dex-trades).
Click to expand GraphQL query ```graphql subscription { Tron(mempool: false) { DEXTrades(where: {Transaction: {Result: {Success: true}}}) { Trade { Dex { ProtocolName SmartContract OwnerAddress Pair { Name SmartContract } } Buy { Currency { AssetId SmartContract Symbol Fungible } Amount Buyer Seller Price Ids OrderId } Sell { Currency { AssetId SmartContract Symbol Fungible } Price Amount } Success } Transaction { Hash Index Result { Success } Timestamp } Block { Number } } } } ```
## Track Token Launch to Sunswap This query allows you to track when tokens are launched on SunSwap using the `launchToDEX` function. It returns the most recent 10 token launches, displaying details such as the token address, transaction hash, block timestamp, and the method call signature. **Arguments**: Includes the `token` address and any other relevant parameters passed during the `launchToDEX` method call. You can use the **token** argument to get the address of the token that was launched. You can run the query [here](https://ide.bitquery.io/sunmpump-launchtoDEX_1)
Click to expand GraphQL query ```graphql query MyQuery { Tron(network: tron, dataset: realtime) { Calls( where: {Call: {To: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}, Signature: {Name: {is: "launchToDEX"}}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Call { Signature { Name } } Arguments { Value { ... on EVM_ABI_Boolean_Value_Arg { bool } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Integer_Value_Arg { integer } } Name } Transaction { Hash } Block { Time } } } } ```
## Track Token Purchase Events on Sunpump This query allows you to track `TokenPurchased` events on SunPump. It retrieves the 10 most recent token purchase events, showing important details such as the token address, buyer information, transaction hash, and token amount involved. The arguments has key event parameters like the token address, buyer, transaction amount, fees, and token reserve values. You can run the query [here](https://ide.bitquery.io/TokenPurchased-on-Sunpump)
Click to expand GraphQL query ```graphql { Tron { Events( where: {Log: {Signature: {Name: {is: "TokenPurchased"}}}} limit: {count: 10} ) { Log { Signature { Name SignatureHash } } Transaction { Hash Timestamp } Topics { Hash } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Boolean_Value_Arg { bool } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Address_Value_Arg { address } } } Call { From To } } } } ```
## Track Token Creation on Sunpump in Realtime This subscription allows you to track new tokens being created on SunPump in real time. It captures the latest `TokenCreate` events, providing important details such as the token address, creator, and transaction information. The `Arguments` include the token address, creator, and token index. You can run it [here](https://ide.bitquery.io/Latest-tokens-created-on-Sunpump_2)
Click to expand GraphQL query ```graphql subscription{ Tron { Events( where: {Log: {Signature: {Name: {is: "TokenCreate"}}}} ) { Log { Signature { Name SignatureHash } } Transaction { Hash Timestamp } Topics { Hash } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Boolean_Value_Arg { bool } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Address_Value_Arg { address } } } Call { From To } } } } ```
## Video Tutorial on How to get Newly Created Tokens on Sun Pump --- ## Tron Sunswap API URL: https://docs.bitquery.io/docs/blockchain/Tron/sunswap-api/ Query SunSwap on Tron with Bitquery GraphQL: latest trades, per-token trade history, and new Sunpump tokens plus sell events from the Tron mempool. # Tron SunSwap API **[Bitquery](https://bitquery.io)** provides useful tron activity through **GraphQL** (on-demand queries and live **subscriptions**), and high-throughput Kafks streams for enterprise teams. This page documents **SunSwap**-related examples on **Tron**—events, contracts, and streams you can copy into the IDE. For general Tron DEX trade patterns, see the [Tron DEX Trades API](/docs/blockchain/Tron/tron-dextrades). If you are new here, start with [Your first query](/docs/start/first-query). SunSwap trades are part of our full [Tron blockchain API](https://bitquery.io/blockchains/tron-blockchain-api) — see the page for USDT transfers, balances and streaming coverage. If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out. ## New Tokens on Sunpump and Sell event in Tron Mempool You can use following query to get new tokens and sell event using following stream. Here is [link]( https://ide.bitquery.io/Events-with-argumens) using which you can run it on our IDE. ```graphql subscription { Tron(mempool: true) { NewTokenEvents: Events( where: {Log: {SmartContract: {not: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Transaction: {Result: {Success: true}, Data: {includes: "2f70d762"}}, Topics: {includes: {Hash: {in: ["8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"]}}}, Contract: {Address: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}} orderBy: {descending: Block_Time} ) { Log { SmartContract } Transaction { FeePayer } } SellEvents: Events( where: {Log: {SmartContract: {not: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}, Transaction: {Data: {includes: "d19aa2b9"}, Result: {Success: true}}, Contract: {Address: {is: "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"}}} orderBy: {descending: Block_Time} ) { Log { SmartContract Signature { Signature } } Transaction { FeePayer } Arguments { Value { ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` ## Latest Trades on Sunswap To fetch the most recent trades on SunSwap, you can filter the trades by using the SunSwap router address `TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax`. This query will return the latest 100 trades most recent first. The query retrieves details about each trade, including the amounts and prices of tokens bought and sold, as well as information about the trading pair. You can find the query [here](https://ide.bitquery.io/sunswap-v2-latest-Trades) ```graphql query MyQuery { Tron(dataset: realtime, network: tron) { DEXTrades( where: {Contract: {Address: {is: "TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax"}}} limit: {count: 100} orderBy: {descending: Block_Time} ) { Trade { Buy { Amount Currency { Name SmartContract } Buyer Price } Dex { ProtocolName Pair { SmartContract Name } } Sell { Amount Price Currency { Name } } } } } } ``` ## Latest Trades of a Token on Sunswap You can run the query [here](https://ide.bitquery.io/sunswap-latest-Trades-of-token) ```graphql query MyQuery { Tron(dataset: realtime, network: tron) { DEXTrades( where: {Contract: {Address: {is: "TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax"}}, any:[ {Trade: {Buy: {Currency: {SmartContract: {is: "TM3k1FoDYhn3Yadaeqb5aCyvWo7ZbHWjng"}}}}},{Trade: {Sell: {Currency: {SmartContract: {is: "TM3k1FoDYhn3Yadaeqb5aCyvWo7ZbHWjng"}}}}}]} limit: {count: 100} orderBy: {descending: Block_Time} ) { Trade { Buy { Amount Currency { Name SmartContract } Buyer Price } Dex { ProtocolName Pair { SmartContract Name } } Sell { Amount Price Currency { Name SmartContract } } } } } } ``` --- ## Tron Transactions API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-transactions-api/ Tron transactions: blocks and super representatives, real-time transactions by wallet, failed transactions (reverts, out-of-energy) and top fee payers. # Tron Transactions API In this section we'll have a look at some examples using the Tron Transactions API. ## Blocks and Super Representatives The `Blocks` cube carries the block itself plus the `Witness` that produced it, which on Tron is the Super Representative. That makes block production attributable without a separate validator dataset. ```graphql query LatestTronBlocks { Tron { Blocks(limit: { count: 10 }, orderBy: { descending: Block_Number }) { Block { Number Time TransactionsCount Hash ParentNumber } Witness { Address } } } } ``` Group by `Witness` to see how block production and transaction load are distributed across Super Representatives: ```graphql query BlocksPerSuperRepresentative { Tron { Blocks(limit: { count: 30 }, orderBy: { descendingByField: "blocks" }) { Witness { Address } blocks: count transactions: sum(of: Block_TransactionsCount) } } } ``` `Blocks` also streams, one message per block, with no filter needed: ```graphql subscription TronChainTip { Tron { Blocks { Block { Number Time TransactionsCount } Witness { Address } } } } ``` ## Monitor Real-time Transactions by Wallet The subscription query below fetches the transactions on the Tron network for the wallet address `TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf`. ```graphql subscription { Tron { Transactions( where: {Transaction: {FeePayer: {is: "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf"}}} ) { Block { Hash Time Number } Contract { Address } ChainId Transaction { Fee Hash FeePayer Signatures Result { Success Status Message } Time } } } } ``` You can run the query [here](https://ide.bitquery.io/monitor-TRX-address-transactions) ## Failed Transactions on Tron (Reverts & Out-of-Energy Errors) List **failed transactions** for a Tron wallet with the failure message — invaluable for debugging dApps, monitoring bot health, and tracking contract reverts. You can run the query [here](https://ide.bitquery.io/failed-tron-transactions). ```graphql query FailedTronTransactions($address: String, $since: DateTime) { Tron { Transactions( where: { Transaction: { FeePayer: { is: $address } Result: { Success: false } } Block: { Time: { since: $since } } } orderBy: { descending: Block_Time } limit: { count: 50 } ) { Block { Time Number } Transaction { Hash Fee FeePayer Result { Success Status Message } } } } } { "address": "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf", "since": "2025-01-01T00:00:00Z" } ``` ## Top Tron Wallets by Fees Paid (24h) Rank wallets by **TRX fees paid in the last 24 hours** — a popular leaderboard for spotting active bots, MEV searchers, and high-volume traders on Tron. Try the query [here](https://ide.bitquery.io/tron-top-fee-payers-24h). ```graphql query TopTronFeePayers24h { Tron { Transactions( where: { Block: { Time: { since_relative: { hours_ago: 24 } } } Transaction: { Result: { Success: true } } } orderBy: { descendingByField: "fees" } limit: { count: 100 } ) { Transaction { FeePayer } fees: sum(of: Transaction_Fee) txs: count } } } ``` --- ## Tron Transfers API URL: https://docs.bitquery.io/docs/blockchain/Tron/tron-transfers/ Tron Transfers API: monitor Tron native and token transfers in real time with Bitquery GraphQL APIs. Includes filters and field selection tips. # Tron Transfers API In this section we'll have a look at some examples using the Tron Transfers API. ## Subscribe to Recent Whale Transactions of a particular currency The subscription query below fetches the whale transactions on the Tron network. We have used USDT address `TThzxNRLrW2Brp9DcTQU8i4Wd9udCWEdZ3`. You can find the query [here](https://ide.bitquery.io/Whale-transfers-of-USDT-on-Tron) ```graphql subscription{ Tron { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "TThzxNRLrW2Brp9DcTQU8i4Wd9udCWEdZ3"}}, Amount: {ge: "10000"}}} ) { Transaction { Hash } Transfer { Amount Sender Receiver Currency { SmartContract Symbol Name Fungible Native } Id } } } } ``` ## Top Transfers of a Token This query retrieves the top 10 transfers by amount of the token `TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT`. Try the query [here](https://ide.bitquery.io/top-transfers-of-a-token_2). ```graphql query MyQuery { Tron { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"}}}, TransactionStatus: {Success: true}} orderBy: {descending: Transfer_Amount} limit: {count: 10} ) { Transfer { Amount AmountInUSD Currency { Name Symbol SmartContract } } } } } ``` ## Transfers of a wallet address This query fetches you the recent 10 transfers of a specific wallet address `TFXttAWURRrXrd9JvFPVLEh1esJK8NHxn7`. Try the query [here](https://ide.bitquery.io/Transfers-of-a-wallet-API). ```graphql { Tron { Transfers( limit: {count: 10} orderBy: {descending: Block_Time} where: {any: [{Transfer: {Sender: {is: "TFXttAWURRrXrd9JvFPVLEh1esJK8NHxn7"}}}, {Transfer: {Receiver: {is: "TFXttAWURRrXrd9JvFPVLEh1esJK8NHxn7"}}}]} ) { Transaction { Hash Time } Transfer { Amount AmountInUSD Sender Receiver Currency { Name SmartContract } } } } } ``` ## Sender is a particular address This websocket retrieves transfers where the sender is a particular address `TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf`. For this subscription query we use `where` keyword and in that we specify `{Transfer: {Sender: {is: "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf"}}}` to get the desired data. You can find the query [here](https://ide.bitquery.io/Sender-is-particular-address) ```graphql subscription { Tron { Transfers( where: {Transfer: {Sender: {is: "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf"}}} ) { Transfer { Amount Currency { Name SmartContract Native Symbol Fungible } Receiver Sender } Transaction { Hash } } } } ``` ## Daily Transfer Volume of a Tron Token Aggregate **daily transfer volume in USD** for any TRC20 token for analytics dashboards, weekly newsletters, and on-chain reports for stablecoins, governance tokens, and memecoins on Tron. Run this query [here](https://ide.bitquery.io/daily-transfer-volume-tron). ```graphql query DailyTransferVolume($token: String, $since: DateTime) { Tron { Transfers( where: { Transfer: { Currency: { SmartContract: { is: $token } } } Block: { Time: { since: $since } } TransactionStatus: { Success: true } } orderBy: { ascendingByField: "Block_Date" } ) { Block { Date(interval: { count: 1, in: days }) } Transfer { Currency { Symbol Name SmartContract } } transfers: count unique_senders: uniq(of: Transfer_Sender) unique_receivers: uniq(of: Transfer_Receiver) volume: sum(of: Transfer_Amount) volume_usd: sum(of: Transfer_AmountInUSD) } } } ``` Variables: ```json { "token": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "since": "2025-01-01T00:00:00Z" } ``` ## Detect Centralized Exchange (CEX) Deposits on Tron Identify large deposits flowing **into known centralized exchange wallets** on Tron — a classic on-chain signal for **selling pressure** and **whale accumulation**. Replace the receiver list with the exchange addresses you want to monitor (Binance, OKX, Bybit, KuCoin, etc.). Try this subscription [here](https://ide.bitquery.io/cex-deposits-tron). ```graphql subscription CEXDepositsTron { Tron { Transfers( where: { Transfer: { Receiver: { in: [ "TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9", "TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax", "TWd4WrZ9wn84f5x1hZhL4DHvk738ns5jwb" ] } Amount: { ge: "10000" } } } ) { Block { Time } Transfer { Amount AmountInUSD Sender Receiver Currency { Symbol Name SmartContract } } Transaction { Hash } } } } ``` ## Top USDT TRC20 Whale Receivers (Last 24 Hours) Rank addresses by **total USDT TRC20 received** in the last 24 hours — the most-searched Tron whale leaderboard query. Replace the smart contract with any TRC20 token to reuse the pattern. Run the query [here](https://ide.bitquery.io/top-usdt-receivers-24h-tron). ```graphql query TopUSDTReceivers24h { Tron { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } TransactionStatus: { Success: true } } orderBy: { descendingByField: "received_usd" } limit: { count: 50 } ) { Transfer { Receiver Currency { Symbol SmartContract } } received_usd: sum(of: Transfer_AmountInUSD) received_amount: sum(of: Transfer_Amount) txs: count } } } ``` ## Subscribe to the latest NFT token transfers on Tron Let's see an example of NFT token transfers using GraphQL Subscription (Webhook). In the following NFT Token Transfers API, we will be subscribing to all NFT token transfers on Tron network. You can run the query [here](https://ide.bitquery.io/NFT-Token-Transfers-API_5) ```graphql subscription { Tron { Transfers(where: {Transfer: {Currency: {Fungible: false}}}) { Transfer { Amount Currency { Name SmartContract Symbol Fungible HasURI Decimals } URI Sender Receiver } Transaction { Hash } } } } ```