# Bitquery Docs — full text: BSC, Base, Arbitrum, Optimism, Polygon, Arc and other EVM chains > 106 pages. All parts and the curated entry points: https://docs.bitquery.io/llms.txt ## APE Store API - Base Chain Token Trades & Transaction Data URL: https://docs.bitquery.io/docs/blockchain/Base/apestore-base-api/ APE Store on Base: find the APE Store contract and its methods, then query all trades, trades by a trader and trades of a specific token. # APE Store API In this section we will see how we can use the [Transaction](/docs/cubes/transaction-cube/) and [Calls](/docs/schema/evm/calls/) API from Bitquery to get info about trades on APE Store using one of the token address traded on the platform. For this section the token address is the following - `0xb2779752b8abe50e2a06bddd774bf0a40353f867`. ## Get APE Store Address Firstly, we can find the smart contract address of the APE Store using [this](https://ide.bitquery.io/ape-store-token-event_1#) query. ``` graphql query MyQuery { EVM(network: base) { Events( where: {Arguments: {includes: {Value: {Address: {is: "0xb2779752b8abe50e2a06bddd774bf0a40353f867"}}}}} ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Transaction { From Hash To } count } } } ``` The address labeled as `To` under the `Transaction` block is the smart contract address of APE Store. The APE Store address is - `0x0bf8edd756ff6caf3f583d67a9fd8b237e40f58a`. ## Get All the Methods for APE Store We need to get all methods for the APE Store for better understanding of its functionality and get the `signatures` used for buying tokens. [This](https://ide.bitquery.io/methods-for-ape-store#) query returns all the methods associated with the APE Store. ``` graphql query MyQuery { EVM(network: base) { Calls( where: {Transaction: {To: {is: "0x0bf8edd756ff6caf3f583d67a9fd8b237e40f58a"}}} orderBy: {descendingByField: "count"} ) { Call { Signature { Name Signature } } count } } } ``` From the results we get a signature named `buy` that will be analyzed to get the trades on APE Store. ## Get Trades for APE Store [This](https://ide.bitquery.io/ape-store-buys_1#) query returns the `buy` method Calls to the APE Store that are potentially the trades on the APE Store. ``` graphql query MyQuery { EVM(network: base) { Calls( where: {Transaction: {To: {is: "0x0bf8edd756ff6caf3f583d67a9fd8b237e40f58a"}}, Call: {Signature: {Name: {is: "buy"}}}} ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Transaction { Cost From Hash Time GasPrice } } } } ``` ## Get Trades of a Trader [This](https://ide.bitquery.io/ape-store-buys-from-a-wallet) query returns the trades by a particular trader on APE Store. In this example the trader wallet address is - `0x2870cbffae4cf005dd1c3587e2f0db3cb00dbafd`. ``` graphql query MyQuery { EVM(network: base) { Calls( where: {Transaction: {To: {is: "0x0bf8edd756ff6caf3f583d67a9fd8b237e40f58a"}, From: {is: "0x2870cbffae4cf005dd1c3587e2f0db3cb00dbafd"}}, Call: {Signature: {Name: {is: "buy"}}}} ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Transaction { Cost From Hash Time GasPrice } } } } ``` ## Get Trades of a Token [This](https://ide.bitquery.io/ape-store-token-trades) query returns the trades of a token on APE Store. In this example the token is - `0x442a62e390e16cec26998dd965c606efbd06b8ed`. ``` graphql query MyQuery { EVM(network: base) { Calls( where: {Transaction: {To: {is: "0x0bf8edd756ff6caf3f583d67a9fd8b237e40f58a"}}, Call: {Signature: {Name: {is: "buy"}}}, Arguments: {includes: {Value: {Address: {is: "0x442a62e390e16cec26998dd965c606efbd06b8ed"}}}}} ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Transaction { Cost From Hash Time GasPrice } } } } ``` --- ## Aerodrome Finance API — Base DEX Trades & Liquidity URL: https://docs.bitquery.io/docs/blockchain/Base/aerodrome-base-api/ Aerodrome on Base: latest trades, most traded tokens, real-time prices and OHLC for all pairs, new liquidity pools and pool liquidity. # Aerodrome Finance API - Base DEX Trades, Liquidity Pools, Token Analytics Get real-time Aerodrome Finance DEX trades, liquidity pools, token prices, trading volume and comprehensive analytics on Base network. Access live trading data, pool creation events, liquidity metrics and token statistics through our Aerodrome Finance API, Streams and Data services. The GraphQL APIs and Streams below provide extensive data points for the Aerodrome Finance ecosystem. If you have any questions on other data points, reach out to [support](https://t.me/Bloxy_info). You may also be interested in: - [Base Network DEX APIs ➤](/docs/blockchain/Ethereum/dextrades/dex-api/) - [Token Trades APIs ➤](/docs/blockchain/Ethereum/dextrades/token-trades-apis/) - [Liquidity Pool APIs ➤](/docs/blockchain/Ethereum/dextrades/ethereum-liquidity-api/) :::note To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: --- ### Table of Contents ### 1. DEX Trades & Trading Activity - [Subscribe to Latest Trades on Aerodrome Finance ➤](#subscribe-to-latest-trades-on-aerodrome-finance) - [Most Traded Tokens on Aerodrome Finance ➤](#most-traded-tokens-on-aerodrome-finance) - [Realtime Prices, OHLC, Trading Volume of all pairs ➤](#realtime-prices-ohlc-trading-volume-of-all-pairs) ### 2. Liquidity Pools & Analytics - [Latest Liquidity Pools on Aerodrome Finance ➤](#latest-liquidity-pools-on-aerodrome-finance) - [Get Liquidity of a Pool ➤](#get-liquidity-of-a-pool) ### 3. [Video Tutorials](#video-tutorials) ## DEX Trades & Trading Activity ## Subscribe to Latest Trades on Aerodrome Finance Stream real-time DEX trades on Aerodrome Finance with this subscription query. Monitor live buy/sell activity, token pairs, prices, and trading volumes as they happen on the Base network. This query filters Aerodrome DEX trades by the protocol's `OwnerAddress` (`0x420dd381b31aef6683db6b902084cb0ffece40da`). [Subscribe to Aerodrome Finance trades in real-time — Stream ➤](https://ide.bitquery.io/Latest-Trades-on-Aerodrome)
Click to expand GraphQL query ```graphql subscription { EVM(network: base) { DEXTrades( where: { Trade: { Dex: { OwnerAddress: { is: "0x420dd381b31aef6683db6b902084cb0ffece40da" } } } } ) { Block { Time } Trade { Buy { AmountInUSD(selectWhere: { gt: "0" }) Buyer Currency { Name Symbol SmartContract } PriceInUSD Seller } Dex { ProtocolFamily ProtocolName } Sell { Currency { SmartContract Symbol Name } Seller Buyer AmountInUSD } } } } } ```
## Most Traded Tokens on Aerodrome Finance Discover the most actively traded tokens on Aerodrome Finance over any time period. This query analyzes all DEX trades within a specified timeframe and ranks tokens by trade count, helping you identify trending tokens and market activity patterns. [Get most traded tokens on Aerodrome Finance — Query ➤](https://ide.bitquery.io/Most-Traded-Tokens-on-Aerodome-Last-Month)
Click to expand GraphQL query ```graphql query MyQuery { EVM(dataset: archive, network: base) { DEXTradeByTokens( limit: { count: 10 } where: { Block: { Time: { after: "2024-06-10T00:00:00Z" before: "2024-07-10T00:00:00Z" } } Trade: { Dex: { OwnerAddress: { is: "0x420dd381b31aef6683db6b902084cb0ffece40da" } } } } orderBy: { descendingByField: "count" } ) { Trade { Currency { Name SmartContract } } count } } } ```
## Realtime Prices, OHLC, Trading Volume of all pairs Below API gives you instant access to live Aerodrome market data with pre-calculated OHLC, moving averages, and trading volumes updating every second—no complex calculations needed, just plug and play for your trading bots or analytics platform. [Realtime Prices, OHLC, Trading Volume of all pairs — Query ➤](https://ide.bitquery.io/aerodrome-dex---realtime-prices-1-sec-ohlc-trading-volumes)
Click to expand GraphQL query ```graphql subscription { Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Price: { IsQuotedInUsd: true } Market: { ProtocolFamily: { is: "Aerodrome" } } } ) { Token { Name Symbol Address } Price { Average { Estimate Mean ExponentialMoving SimpleMoving WeightedSimpleMoving } Ohlc { Open High Low Close } } QuoteToken { Name Symbol Address } Market { ProtocolFamily } Volume { Base Quote } Interval { Time { Duration Start End } } } } } ```
## Liquidity Pools & Analytics ## Latest Liquidity Pools on Aerodrome Finance Track newly created liquidity pools on Aerodrome Finance in real-time. Discover fresh trading pairs and potential liquidity provision opportunities as pools are created. This query monitors `PoolCreated` events from the Aerodrome Finance smart contract, returning pool addresses, token pairs, and creation timestamps. [Get latest liquidity pools on Aerodrome Finance — Query ➤](https://ide.bitquery.io/Latest-Liquidity-Pools-on-Aerodome)
Click to expand GraphQL query ```graphql { EVM(dataset: combined, network: base) { Events( orderBy: { descending: Block_Number } limit: { count: 10 } where: { Log: { SmartContract: { is: "0x420dd381b31aef6683db6b902084cb0ffece40da" } Signature: { Name: { is: "PoolCreated" } } } } ) { Log { Signature { Name Parsed Signature } SmartContract } Transaction { Hash } Block { Date Number } Arguments { Value { ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
**Response Structure:** The query returns pool creation events with the following information: ```json { "Arguments": [ { "Value": { "address": "0x02f92800f57bcd74066f5709f1daa1a4302df875" } }, { "Value": { "address": "0xf564f589f58ced0127e48e1a02093ba53c2856ed" } }, { "Value": { "bool": false } }, { "Value": { "address": "0xa187378f0f3613e42b6ad5cc063a01060f82763f" } }, { "Value": { "bigInteger": "1539" } } ], "Block": { "Date": "2024-07-10", "Number": "16894743" }, "Log": { "Signature": { "Name": "PoolCreated", "Parsed": true, "Signature": "PoolCreated(address,address,bool,address,uint256)" }, "SmartContract": "0x420dd381b31aef6683db6b902084cb0ffece40da" }, "Transaction": { "Hash": "0xc5049804074b77ccb975b9617974ee40533634b8d6d8cabf2865cebb94c462a4" } } ``` **Understanding the Response:** - **Token Addresses**: The first two address arguments (`0x02f92800f57bcd74066f5709f1daa1a4302df875` and `0xf564f589f58ced0127e48e1a02093ba53c2856ed`) represent the two tokens in the trading pair. - **Pool Address**: The fourth argument (`0xa187378f0f3613e42b6ad5cc063a01060f82763f`) is the newly created liquidity pool address. - **Pool Type**: The boolean value indicates whether the pool is stable or volatile. - **Pool ID**: The bigInteger value is the unique pool identifier. ## Get Liquidity of a Pool Query the current liquidity levels for any Aerodrome Finance pool by pool address. This query retrieves the token balances for both assets in a liquidity pool, allowing you to calculate total value locked (TVL), assess pool depth, and analyze liquidity distribution.
Click to expand GraphQL query ```graphql query MyQuery { EVM(dataset: combined, network: base) { Balances( where: { Balance: { Address: { is: "0x1e039aade407a94df380649b33b52cb8ad41c755" } } Currency: { SmartContract: { in: [ "0x4200000000000000000000000000000000000006" "0xa999542c71febba77602fbc2f784ba9ba0c850f6" ] } } } orderBy: { descending: Balance_Amount } ) { Currency { Name } Balance { Amount(selectWhere: { gt: "0" }) } } } } ```
## Video Tutorials ### Video Tutorial | How to stream Realtime Prices, OHLCV, and Moving Averages for trading pairs on Aerodrome DEX ### Video Tutorial | How to Get Latest Trades and Most Traded Tokens on Aerodrome Finance ### Video Tutorial | How to Get Latest Liquidity Pools and Pool Liquidity on Aerodrome Finance --- ## Aerodrome Gauge Vaults API URL: https://docs.bitquery.io/docs/blockchain/Base/aerodrome-gauge-vaults-api/ Aerodrome gauge vaults on Base: get newly created vaults and the latest deposits, withdraws and ClaimRewards events, overall or for a specific gauge pool. # Aerodrome Gauge Vaults API — Base (Deposits, Withdraws, Rewards) Aerodrome Finance gauge vaults are staking contracts for LP tokens that let liquidity providers earn AERO emissions. veAERO holders (who lock AERO for up to four years) vote every week to direct emissions across pool gauges. LPs staking in the most‑voted gauges earn more AERO, while veAERO voters receive trading fees from the pools they support and may be incentivized by external bribes. Users can also auto‑compound earned AERO into veAERO to build long‑term voting power. This page covers, on Base: - New gauge creation events (where emissions can flow next) - Deposits and withdraws into gauge vaults (LP staking flows) - Reward claims from gauges (realized emissions) You may also be interested in: - [Base Network DEX APIs ➤](/docs/blockchain/Ethereum/dextrades/dex-api/) - [Token Trades APIs ➤](/docs/blockchain/Ethereum/dextrades/token-trades-apis/) - [Liquidity Pool APIs ➤](/docs/blockchain/Ethereum/dextrades/ethereum-liquidity-api/) Use the GraphQL queries below to monitor governance‑directed liquidity incentives across Aerodrome on Base. If you need other data points, reach out to [support](https://t.me/Bloxy_info). :::note To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: --- ### Table of Contents - [Latest Created Aerodrome Gauge Vaults](#latest-created-aerodrome-gauge-vaults) - [Latest Aerodrome Gauge Vaults Deposits](#latest-aerodrome-gauge-vaults-deposits) - [Latest Aerodrome Gauge Vaults ClaimRewards](#latest-aerodrome-gauge-vaults-claimrewards) - [Latest Aerodrome Gauge Vaults Withdraws](#latest-aerodrome-gauge-vaults-withdraws) - [Get Latest Withdraws of a specific gauge pool](#get-latest-withdraws-of-a-specific-gauge-pool) - [Get Latest Deposits of a specific gauge pool](#get-latest-deposits-of-a-specific-gauge-pool) - [Get Latest ClaimRewards on a specific gauge pool](#get-latest-claimrewards-on-a-specific-gauge-pool) ## Latest Created Aerodrome Gauge Vaults Discover newly created gauge vaults on Aerodrome (Base). Gauges are staking contracts that receive veAERO‑directed emissions. Use this to track where future AERO rewards may flow as new pools receive gauges. `0xf5601f95708256a118ef5971820327f362442d2d` is the `Aerodrome : Voter` contract. [Latest Created Gauge Vaults — Query ➤](https://ide.bitquery.io/latest-created-gauges#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Log: { Signature: { Name: { is: "GaugeCreated" } } SmartContract: { is: "0x16613524e02ad97eDfeF371bC883F2F5d6C480A5" } } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name } SmartContract } } } } ```
## Latest Aerodrome Gauge Vaults Deposits Monitor LP staking into gauge vaults. This shows recent `Deposit` events to a gauge contract, helping you track which pools are attracting liquidity ahead of weekly emissions. `0xf5601f95708256a118ef5971820327f362442d2d` is the `Aerodrome : Gauge Implementation` contract. [Latest Gauge Vaults Deposits — Query ➤](https://ide.bitquery.io/latest-gauge-vaults-deposits-transactions#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { To: { is: "0xf5601f95708256a118ef5971820327f362442d2d" } } Log: { Signature: { Name: { is: "Deposit" } } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
## Latest Aerodrome Gauge Vaults ClaimRewards Track when stakers claim accumulated AERO emissions from gauges. Use this to measure realized rewards and active participation across gauge vaults. `0xf5601f95708256a118ef5971820327f362442d2d` is the `Aerodrome : Gauge Implementation` contract. [Latest Aerodrome Gauge Vaults ClaimRewards — Query ➤](https://ide.bitquery.io/latest-gauge-vaults-claimRewards-transactions#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { To: { is: "0xf5601f95708256a118ef5971820327f362442d2d" } } Log: { Signature: { Name: { is: "ClaimRewards" } } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
## Latest Aerodrome Gauge Vaults Withdraws Observe LP exits from gauge vaults via `Withdraw` events. This helps you detect liquidity outflows and shifts in staking positions across pools. `0xf5601f95708256a118ef5971820327f362442d2d` is the `Aerodrome : Gauge Implementation` contract. [Latest Aerodrome Gauge Vaults Withdraws — Query ➤](https://ide.bitquery.io/latest-gauge-vaults-withdraw-transactions_1#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { To: { is: "0xf5601f95708256a118ef5971820327f362442d2d" } } Log: { Signature: { Name: { is: "Withdraw" } } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
## Get Latest Withdraws of a specific gauge pool Filter withdraw activity for a single gauge pool. Useful for monitoring liquidity changes and unstaking patterns of a targeted pool. `0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687` is the `Aerodrome Finance CL100 WETHVVV Pool Gauge` contract. [Get Latest Withdraws of a specific gauge pool — Query ➤](https://ide.bitquery.io/latest-Aerodrome-Finance-CL100-WETHVVV-Pool-Gauge-withdraw-transactions_1)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { From: { is: "0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687" } } Log: { Signature: { Name: { is: "Withdraw" } } } TransactionStatus: { Success: true } } ) { Block { Time Number } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
## Get Latest Deposits of a specific gauge pool View deposit activity for a specific gauge pool to understand where LPs are allocating capital and how staking momentum evolves. `0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687` is the `Aerodrome Finance CL100 WETHVVV Pool Gauge` contract. [Get Latest Deposits of a specific gauge pool — Query ➤](https://ide.bitquery.io/latest-Aerodrome-Finance-CL100-WETHVVV-Pool-Gauge-deposits#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { From: { is: "0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687" } } Log: { Signature: { Name: { is: "Deposit" } } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
## Get Latest ClaimRewards on a specific gauge pool See reward claims for a particular gauge pool to quantify realized emissions by its stakers over time. `0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687` is the `Aerodrome Finance CL100 WETHVVV Pool Gauge` contract. [Get Latest ClaimRewards on a specific gauge pool — Query ➤](https://ide.bitquery.io/latest-Aerodrome-Finance-CL100-WETHVVV-Pool-Gauge-claimRewards-Transactions#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: base) { Events( limit: { count: 10 } orderBy: { descending: Block_Time } where: { Call: { From: { is: "0x5d05ef25a5f933271e1f0fdc02dc3eab6a4ea687" } } Log: { Signature: { Name: { is: "ClaimRewards" } } } TransactionStatus: { Success: true } } ) { Block { Time } Transaction { Hash } Arguments { Index Name Path { Index Name Type } Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Call { From To } Log { Signature { Name Signature } SmartContract } } } } ```
--- ## Arbitrum API Documentation URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/ Arbitrum on-chain data: DEX and perp trades, slippage, liquidity, transfers and balances, plus WebSocket and webhook delivery and cross-chain queries. # Arbitrum API Documentation Unlock the full potential of Arbitrum with comprehensive blockchain data—from GMX perpetual trading analytics and DEX swaps to liquidity monitoring, slippage analysis, cross-chain bridge monitoring, and smart contract interactions. This complete guide delivers production-ready GraphQL APIs, real-time streaming data, and practical examples for tracking trades, balances, liquidity pools, slippage, events, and more across the Arbitrum ecosystem. Whether you're building DeFi dashboards, trading algorithms, or cross-chain applications, discover all the Arbitrum data solutions you need here. Need help crafting a query or subscription? Message us on [support](https://t.me/Bloxy_info). ## What is the Bitquery Arbitrum API? :::tip Building a trading app or DEX UI on Arbitrum? For **real-time trades and prices on Arbitrum** (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 Arbitrum data older than ~30 days**, use the chain-level `DEXTrades` / `DEXTradeByTokens` APIs documented below. ::: It's a GraphQL interface over curated, indexed Arbitrum data. Write powerful queries instead of building and maintaining your own indexer for the fastest L2 solution. ## What can you build with it? Track GMX perpetual positions, monitor DEX liquidity, pool reserves, slippage, and trading volumes, analyze cross-chain bridge flows, stream smart contract events, compute trading KPIs, and power real-time dashboards for the most active L2 ecosystem. ## How is it different from raw Arbitrum RPC? | Feature | Arbitrum RPC | Bitquery Arbitrum API | | ------------------- | -------------------------------- | ------------------------------ | | **Data Format** | Raw JSON-RPC responses | Pre-indexed, enriched GraphQL | | **Historical Data** | No built-in history | Full historical data since L2 | | **Analytics** | Manual aggregation required | Built-in joins, aggregations | | **Real-time** | Basic subscription support | Rich streaming with filtering | | **Use Case** | Transaction submission, node ops | Analytics, monitoring, trading | | **Infrastructure** | Run your own nodes | Fully managed, auto-scaling | ## WebSockets and Webhooks Most queries can be turned into live streams by switching `query` to `subscription`, and consumed over WebSocket. See examples and code snippets [here](/docs/subscriptions/websockets/). ## DEX and Perp APIs - [Arbitrum Dex Trades](./DexTrades) - [GMX API](./gmx-api) - [esGMX API](./esgmx-api) Query and subscribe to perpetual trading data, DEX swaps, liquidity events, and trading analytics across Arbitrum's leading protocols. ## Arbitrum Slippage API - [Arbitrum Slippage API](./arbitrum-slippage-api) Get slippage and price impact data for Arbitrum DEX pools. Understand price impact and liquidity depth for token swaps, calculate maximum input amounts at different slippage tolerances, and monitor real-time slippage data across all DEX pools on Arbitrum. ## Arbitrum Liquidity API - [Arbitrum Liquidity API](./arbitrum-liquidity-api) Monitor real-time liquidity changes, track pool reserves, and analyze liquidity depth for token pairs on Arbitrum DEX pools. Track when liquidity is added or removed, monitor pool health and depth, and analyze liquidity patterns across different pools. ## Core Arbitrum APIs - [Blocks & Transactions](./Blocks_Transactions) - [Smart Contract Calls](./Smart_Contract_Calls) - [Smart Contract Events](./Smart_Contract_Events) - [Balance API](./arbitrum-balance-api) Access comprehensive blockchain data including blocks, transactions, contract interactions, and real-time balance updates. ## Cross-chain - [Arbitrum Cross Chain](./arbitrum-cross-chain) Monitor cross-chain bridge activities, deposits, withdrawals, and asset flows between Arbitrum and other networks. ## Videos ### Video Tutorial | GMX and esGMX ### Video Tutorial | Across Bridge Deposits on Arbitrum ### Video Tutorial | Top Traders of a Token on Arbitrum ### Video Tutorial | Track Realtime DEXTrades of a Token on Arbitrum ### Video Tutorial | OHLC Data of a Token Pair on Arbitrum ### Video Tutorial | Top Bought & Top Sold Tokens on Arbitrum ## 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/) --- ## Arbitrum Address Balance API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-balance-api/ Arbitrum Address Balance API: fetch current and historical Arbitrum balances with Bitquery GraphQL balance queries. Keep queries fast with indexed filters. # Arbitrum Address Balance API The **Balances** API returns current and historical token balances for an address on Arbitrum. 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**. | Examples: [All Token Balances](#balance-of-an-address) · [Native ETH (Arbitrum)](#native-eth-arbitrum-balance) · [Balance on a Date](#balance-on-a-specific-date) · [Specific Token](#balance-for-a-specific-token) · [Holder Snapshot](#token-holder-snapshot) ## Balance of an Address Returns token balances for a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances. [Run in IDE](https://ide.bitquery.io/Arbitrum-Balance-of-an-Address) ```graphql query { EVM(network: arbitrum, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Native ETH (Arbitrum) Balance Returns the native ETH balance for a wallet on Arbitrum (not ERC-20 tokens). Filter with `Currency: { Native: true }` instead of a token contract address. [Run in IDE](https://ide.bitquery.io/arbitrum-native-balances-address) ```graphql query { EVM(network: arbitrum, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" } } Currency: { Native: true } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` **Parameters** - `network: arbitrum`: Arbitrum mainnet. - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. - `Currency.Native: true`: Native ETH on Arbitrum only (see [Native ETH (Arbitrum) Balance](#native-eth-arbitrum-balance)). **Returned fields** - `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Balance on a Specific Date Use `Block.Date.till` for a point-in-time snapshot. Use `dataset: archive` for historical dates and addresses not recently active. [Run in IDE](https://ide.bitquery.io/arbitrum-balances-by-date) ```graphql query { EVM(network: arbitrum, dataset: archive) { Balances( where: { Block: { Date: { till: "2026-05-05" } } Balance: { Address: { is: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance for a Specific Token Add a `Currency.SmartContract` filter. Always use the contract address, not the token name. Use `0x` for native ETH on Arbitrum, or the ERC-20 contract address for a token. [Run in IDE](https://ide.bitquery.io/arbitrum-balances-specific-token) ```graphql query { EVM(network: arbitrum, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" } } Currency: { SmartContract: { is: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Token Holder Snapshot The number of unique holders, token supply, and Gini coefficient for the balance amount before a specific timestamp can be derived using the query below. These stats provide a useful holder snapshot for any given time. [Run in IDE](https://ide.bitquery.io/token-holder-snapshot-arbitrum)
Click to expand GraphQL query ```graphql query { EVM(network: arbitrum, dataset: archive) { Holders( where: { Currency: { SmartContract: { is: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9" } } Balance: { Amount: { gt: "0" } LastChangeTime: { till: "2026-05-20T00:00:00Z" } } Holder: { Address: { not: "0x" } } } ) { Balance { LastChangeTime(maximum: Balance_LastChangeTime) } holders: uniq(of: Holder_Address) supply: sum(of: Balance_Amount) gini(of: Balance_Amount) } } } ```
## 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/arbitrum-balances-history) ```graphql query { EVM(network: arbitrum, dataset: archive) { Balances( where: { Balance: { Address: { is: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF" } } } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` --- ## Arbitrum Cross Chain API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-cross-chain/ Arbitrum Across bridge tracking: get the latest deposits on the Across Protocol SpokePool and the latest transfers to the Arbitrum SpokePool from its events. # Arbitrum Cross Chain API ## Overview Explore the integration of the **Arbitrum Cross Chain API** to track bridge transfers, interact with smart contracts, and fetch detailed transaction data. For detailed reference, visit the [official Arbitrum documentation](https://docs.arbitrum.io/build-decentralized-apps/token-bridging/token-bridge-erc20). Additional information about migrating to the latest version of Across Protocol is available [here](https://docs.across.to/introduction/migration-guides/migration-from-v2-to-v3#event-changes). ## Tracking Across Bridge Transfers Using SpokePool Events SpokePool events in Across Protocol can be used to monitor the status of bridge transfers effectively. Below are queries that retrieve the latest deposits and transfers related to the Arbitrum SpokePool. ### Latest Deposits on Across Protocol Bridge SpokePool Query the latest deposits made on the Across Protocol Bridge SpokePool. Fetch the most recent deposits and associated details using `V3FundsDeposited` events. - **Query link**: [Run this query](https://ide.bitquery.io/Latest-deposits-on-Across-Bridge) ```graphql { EVM(network: arbitrum) { Events( where: { Log: { SmartContract: { is: "0xe35e9842fceaca96570b734083f4a58e8f7c5f2a" } Signature: { Name: { is: "V3FundsDeposited" } } } } orderBy: { descending: Block_Time } ) { Log { SmartContract Signature { Name } } Transaction { From To } Block { Time ParentHash } Arguments { Name Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` --- ### Latest Transfers to Arbitrum SpokePool Retrieve the latest transfers directed to the Arbitrum SpokePool.Get information on transfers to the SpokePool, such as sender, receiver, currency, and block details. - **Query link**: [Run this query](https://ide.bitquery.io/Across-Protocol-Arbitrum-Transfers) ```graphql { EVM(dataset: combined, network: arbitrum) { Transfers( where: { Transaction: { To: { is: "0xe35e9842fceaca96570b734083f4a58e8f7c5f2a" } } Block: { Date: { is: "2024-12-12" } } } limit: { count: 10 } orderBy: { descending: Block_Number } ) { Transfer { Amount Currency { Name Symbol SmartContract } Sender Receiver } Call { Signature { Name } From To Value CallPath } Block { Number Time } } } } ``` ## Video Tutorial | How to track Across Bridge Deposits on Arbitrum --- ## Arbitrum DEX Trades API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/DexTrades/ Arbitrum DEX Trades API: get Arbitrum DEX swaps, prices, and OHLC with Bitquery GraphQL queries and live streams. Scale further with Kafka or gRPC streams. # Arbitrum DEX Trades API :::tip Need real-time Arbitrum 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: Arbitrum`). Use this page when you need **historical Arbitrum data older than ~30 days** (with `dataset: combined` or `archive`), raw per-swap detail, or call / event context. ::: In this section we will see how to get Arbitrum DEX trades information using our API. ## Live DEX swap stream (Arbitrum) {#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: Arbitrum`**. [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) (open a new tab, paste the subscription below, and run). ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Arbitrum" } } } }) { 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 } } } ``` ## Top Trending Pairs on Arbitrum [This](https://ide.bitquery.io/trending-token-pairs-on-Arbitrum) query returns the top trending pairs traded on Arbitrum Chain based on the trade volume for the last 24 hours, and returns info such as latest price, number of buyers and sellers, number of trades in a day and much more. Read [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) to get a better understanding on when to use which cube. ```graphql query pairs( $min_count: String $network: evm_network $time_ago: DateTime $time_10min_ago: DateTime $time_1h_ago: DateTime $time_3h_ago: DateTime $weth: String! $usdc: String! $usdt: String! $usdc2: String! ) { EVM(network: $network) { DEXTradeByTokens( where: { Block: { Time: { since: $time_ago } } any: [ { Trade: { Side: { Currency: { SmartContract: { is: $usdt } } } } } { Trade: { Side: { Currency: { SmartContract: { is: $usdc } } } Currency: { SmartContract: { notIn: [$usdt] } } } } { Trade: { Side: { Currency: { SmartContract: { is: $usdc2 } } } Currency: { SmartContract: { notIn: [$usdt, $usdc] } } } } { Trade: { Side: { Currency: { SmartContract: { is: $weth } } } Currency: { SmartContract: { notIn: [$usdc, $usdt, $usdc2] } } } } { Trade: { Side: { Currency: { SmartContract: { notIn: [$usdc, $usdt, $weth] } } } Currency: { SmartContract: { notIn: [$usdc, $usdc2, $usdt, $weth] } } } } ] } orderBy: { descendingByField: "usd" } limit: { count: 100 } ) { Trade { Currency { Symbol Name SmartContract ProtocolName } Side { Currency { Symbol Name SmartContract 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( maximum: Block_Number if: { Block: { Time: { before: $time_3h_ago } } } ) } dexes: uniq(of: Trade_Dex_OwnerAddress) amount: sum(of: Trade_Side_Amount) usd: sum(of: Trade_Side_AmountInUSD) sellers: uniq(of: Trade_Seller) buyers: uniq(of: Trade_Buyer) count(selectWhere: { ge: $min_count }) } } } ``` Implementation of this data in a full scale project could be seen on [DEXRabbit](https://dexrabbit.bitquery.io/arbitrum/pair). ![Trending Pairs on Arbitrum](/img/dexrabbit/arbitrum/arbitrum_trending_pairs.png) ## Latest Trades for a Token Pair on Arbitrum This query retrieves all DEX trades on the arbitrum where the Arbitrum currency is `ArbitrumCurrency` and the quote currency is `quoteCurrency` that occurred between the specified dates. You can find the query [here](https://ide.bitquery.io/Pair-last-trades_2) ```graphql query ($network: evm_network!, $ArbitrumCurrency: String!, $limit: Int, $quoteCurrency: String!, $from: String, $till: String) { EVM(network: $network, dataset: archive) { sell: DEXTrades( where: {Trade: {Sell: {Currency: {SmartContract: {is: $ArbitrumCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}, Block: {Date: {since: $from, till: $till}}} orderBy: {descending: Block_Date} limit: {count: $limit} ) { ChainId Block { Time Number } Trade { Sell { Buyer Amount Currency { Symbol Name SmartContract } } Buy { Price Amount Currency { Symbol SmartContract Name } } Dex { ProtocolName SmartContract ProtocolFamily ProtocolVersion } } } } } { "network": "arbitrum", "limit": 15, "from": "2023-09-07", "till": "2023-09-07", "ArbitrumCurrency": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8", "quoteCurrency": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" } ``` ## OHLC for a Token Pair [This](https://ide.bitquery.io/ohlc-for-a-pair-on-Arbitrum_1) query returns the OHLC/K Line Data for a specified token pair. For this example we are considering the ARB `0x912ce59144191c1204e64559fe8253a0e49e6548` and USDC `0xff970a61a04b1ca14834a43f5de4533ebddb5cc8` pair. ```graphql query tradingViewPairs( $network: evm_network $dataset: dataset_arg_enum $interval: Int $token: String $base: String $time_ago: DateTime ) { EVM(network: $network, dataset: $dataset) { DEXTradeByTokens( orderBy: { ascendingByField: "Block_Time" } where: { Trade: { Side: { Amount: { gt: "0" } Currency: { SmartContract: { is: $token } } } Currency: { SmartContract: { is: $base } } PriceAsymmetry: { le: 0.1 } } Block: { Time: { since: $time_ago } } } ) { Block { Time(interval: { count: $interval, in: minutes }) } Trade { open: PriceInUSD(minimum: Block_Time) close: PriceInUSD(maximum: Block_Time) max: PriceInUSD(maximum: Trade_PriceInUSD) min: PriceInUSD(minimum: Trade_PriceInUSD) } volume: sum(of: Trade_AmountInUSD) } } } ``` An example for the data visualisation of the data obtained could be seen on the [DEXRabbit](https://dexrabbit.bitquery.io/arbitrum/pair/0x912ce59144191c1204e64559fe8253a0e49e6548/0xff970a61a04b1ca14834a43f5de4533ebddb5cc8). ![OHLC/ K Line for a Pair on Arbitrum](/img/dexrabbit/arbitrum/arbitrum_ohlc_pair.png) ## Latest Trades in Realtime with Subscription This example uses the chain-specific **DEXTrades** cube via `EVM(network: arbitrum) { DEXTrades }` (pool-side Buy/Sell; see [DEXTrades cube](/docs/cubes/dextrades)). USD can be weak on thin pools. For trader + USD swap rows, use the [stream at the top](#crypto-trades-live-stream). You can find the query [here](https://ide.bitquery.io/Arbitrum-Dextrades-subscription) ```graphql subscription { EVM(network: arbitrum) { DEXTrades { Trade { Dex { ProtocolFamily ProtocolName } Sender Buy { Amount Buyer Currency { Name SmartContract Symbol } Price Seller } Sell { Amount Buyer Currency { Name Symbol SmartContract } Price Seller } } } } } ``` ## Top Bought Tokens on Arbitrum network This query will give you top bought tokens on Arbitrum network in last 1 hour. Change the timestamp in `{Block: {Time: {since: "2024-12-24T08:20:00Z"}}}` accordingly. You can find the query [here](https://ide.bitquery.io/top-bought-tokens-on-Arbitrum#) ```graphql query MyQuery { EVM(network: arbitrum) { DEXTradeByTokens( where: {Block: {Time: {since: "2024-12-24T08:20:00Z"}}} limit: {count: 100} orderBy: {descendingByField: "total_bought"} ) { Trade { Currency { Name Symbol SmartContract } } total_bought: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:buy}}}}) total_sold: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:sell}}}}) } } } ``` ## Get Price Change 5min, 1h, 6h and 24h of a specific token Use below query to get price change 5min, 1h, 6h and 24h of a specific token. Change the `Currency{SmartContract}` and `Dex{SmartContract}` according to your needs. Test the query [here] (https://ide.bitquery.io/Price-change-5min-1hr-6hr-24hr-precentage-of-a-specific-token_1). ```graphql query MyQuery { EVM(dataset: combined network:arbitrum) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0x30a538eFFD91ACeFb1b12CE9Bc0074eD18c9dFc9"}}, Dex: {SmartContract: {is: "0xdaAe914e4Bae2AAe4f536006C353117B90Fb37e3"}}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ){ Trade { Price_5min_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{minutes_ago:5}}}}) Price_1h_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{hours_ago:1}}}}) Price_6h_ago: PriceInUSD(minimum: Block_Number if:{Block:{Time:{since_relative:{hours_ago:6}}}}) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum( of: Trade_Side_AmountInUSD ) Price_Change_5min: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100") Price_Change_1h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100") Price_Change_6h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100") Price_Change_24h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100") } } } ``` ## Top 10 Arbitrum Tokens by Price Change in last 1h Use below query to get top 10 Arbitrum Tokens by Price Change in last 1h. Test the query [here] (https://ide.bitquery.io/Top-10-arb-tokens-by-price-change-in-last-1-hr). ```graphql query MyQuery { EVM(dataset: combined network:arbitrum) { DEXTradeByTokens( limit:{count:10} orderBy:{descendingByField:"Price_Change_1h"} where: {TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Name Symbol SmartContract } Price_5min_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) Price_1h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) Price_6h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) Side { Currency { Name Symbol SmartContract } } Dex{ SmartContract } } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum(of: Trade_Side_AmountInUSD) Price_Change_5min: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100" ) Price_Change_1h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100" ) Price_Change_6h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100" ) Price_Change_24h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100" ) } } } ``` ## Top Sold Tokens on Arbitrum network This query will give you top sold tokens on Arbitrum network in last 1 hour. Change the timestamp in `{Block: {Time: {since: "2024-12-24T08:20:00Z"}}}` accordingly. You can find the query [here](https://ide.bitquery.io/Top-Sold-Tokens-on-Arbitrum#) ```graphql query MyQuery { EVM(network: arbitrum) { DEXTradeByTokens( where: {Block: {Time: {since: "2024-12-24T08:20:00Z"}}} limit: {count: 100} orderBy: {descendingByField: "total_sold"} ) { Trade { Currency { Name Symbol SmartContract } } total_bought: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:buy}}}}) total_sold: sum(of:Trade_Side_AmountInUSD if:{Trade:{Side:{Type:{is:sell}}}}) } } } ``` ## Top Traders of a Token on Arbitrum [This](https://ide.bitquery.io/top-traders-for-a-token-on-Arbitrum_3) query returns the top traders of a token on arbitrum based on the volume of trades involving the particular token. This query returns info such as buyers, sellers, DEX Protocol used, amount bought and sold. ```graphql query topTraders($network: evm_network, $time_ago: DateTime, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}}, Block: {Time: {since: $time_ago}}} ) { Trade { Buyer Dex { ProtocolFamily } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "arbitrum", "token": "0x912ce59144191c1204e64559fe8253a0e49e6548", "time_ago": "2024-11-17T08:11:44Z" } ``` The implementation of this data could also be seen on the [DEXRabbit](https://dexrabbit.bitquery.io/arbitrum/token/0x912ce59144191c1204e64559fe8253a0e49e6548#top_traders). ![Top Traders for a token on Arbitrum](/img/dexrabbit/arbitrum/arbitrum_top_traders_token.png) The `DEXTrades` API contains the following information about each trade: - `Dex`: The details of the decentralized exchange where the trade was executed, including the protocol family and the protocol name. - `Sender`: The address of the sender of the trade. - `Buy`: The details of the buy order, including the amount of token bought, the buyer's address, the token's symbol, and the price of the trade. - `Sell`: The details of the sell order, including the amount of token sold, the seller's address, the token's symbol, and the price of the trade. ## Video Tutorial | How to get Top Traders of a Token on Arbitrum ## Video Tutorial | How to track Realtime DEXTrades of a Token on Arbitrum ## Video Tutorial | How to get OHLC Data of a Token Pair on Arbitrum ## Video Tutorial | How to get Top Bought & Top Sold Tokens on Arbitrum network --- ## Arbitrum Liquidity API: Pool Reserves and Liquidity Changes in Real Time URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-liquidity-api/ Read Arbitrum pool reserves and spot prices with Bitquery GraphQL: one pool now or as a stream, every Uniswap v4 pool, and the pools that hold a token, in USD. # Arbitrum Liquidity API: Pool Reserves and Liquidity Changes in Real Time The `DEXPoolEvents` cube under `EVM(network: arbitrum)` emits one row every time a pool's reserves change, whether by a swap, a deposit or a withdrawal. Each row carries the reserves of both tokens after the change, in token units and in USD, the spot price in both directions, the pool and its protocol, and the transaction that moved it. On Arbitrum the rows come from Uniswap v2, v3 and v4 pools and PancakeSwap v3 pools. Balancer, Curve, Fluid and DODO pools have their swaps in the [DEX trades API](/docs/blockchain/Arbitrum/DexTrades) but no reserve rows here, and Camelot is not indexed at all. The cube holds the recent realtime window only and has no archive dataset: to keep a history, record the stream. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The worked pool is the Uniswap v3 WETH/ARB pool, `0xc6f780497a95e246eb9449f5e4770916dcd6396a`, one of the busiest on the chain. ## Reserves of one pool now The newest rows for a pool. `AmountCurrencyA` and `AmountCurrencyB` are the reserves after each change, the `InUSD` twins price them, and `AtoBPrice` is how much of B one unit of A buys at the spot. Saved query [here](https://ide.bitquery.io/latest-liquidity-changes-of-a-specific-pool). ```graphql { EVM(network: arbitrum) { DEXPoolEvents( limit: { count: 10 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { SmartContract: { is: "0xc6f780497a95e246eb9449f5e4770916dcd6396a" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Dex { ProtocolName } } Transaction { Hash } } } } ``` ## Stream one pool The same filter as a subscription delivers a row on every reserve change, which for this pool means several per minute. Saved stream [here](https://ide.bitquery.io/realtime-liquidity-stream-of-a-specific-pool). ```graphql subscription { EVM(network: arbitrum) { DEXPoolEvents( where: { PoolEvent: { Pool: { SmartContract: { is: "0xc6f780497a95e246eb9449f5e4770916dcd6396a" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol } CurrencyB { Symbol } } } Transaction { Hash } } } } ``` ## Every Uniswap v4 pool on Arbitrum Filter on the protocol to follow a whole family of pools. Uniswap v4 keeps all pools inside one PoolManager contract, `0x360e68faccca8ca495c1b759fd9eee466db9fb32` on Arbitrum, so `Pool.SmartContract` is the same on every row and `Pool.PoolId` is the field that tells pools apart. For v2 and v3 pools `PoolId` is empty and `SmartContract` is the pool. Saved stream [here](https://ide.bitquery.io/latest-liquidity-changes-in-uniswap-v4-pools). ```graphql subscription { EVM(network: arbitrum) { DEXPoolEvents( where: { PoolEvent: { Dex: { ProtocolName: { is: "uniswap_v4" } } } } ) { Block { Time } PoolEvent { Pool { PoolId SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } Transaction { Hash } } } } ``` Other protocol names that report on Arbitrum: `uniswap_v3`, `uniswap_v2` and `pancake_swap_v3`. ## Pools that hold a token, with their current reserves `limitBy` on the pool address keeps the newest row per pool, so the result is the current state of every pool that had the token as `CurrencyA` and changed inside the window. Run it a second time with the token under `CurrencyB` to catch pools that list it second. The example is ARB, `0x912ce59144191c1204e64559fe8253a0e49e6548`; sort the rows by the USD reserve in your code to rank the pools. Saved query [here](https://ide.bitquery.io/realtime-liquidity-stream_1). ```graphql { EVM(network: arbitrum) { DEXPoolEvents( limit: { count: 20 } limitBy: { by: PoolEvent_Pool_SmartContract, count: 1 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { CurrencyA: { SmartContract: { is: "0x912ce59144191c1204e64559fe8253a0e49e6548" } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Time } PoolEvent { Dex { ProtocolName } Pool { SmartContract PoolId CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } } } } } ``` ## Fields on every row | Field | Meaning | |---|---| | `PoolEvent.Liquidity.AmountCurrencyA`, `AmountCurrencyB` | Reserves of each token after the change, in token units | | `AmountCurrencyAInUSD`, `AmountCurrencyBInUSD` | The same reserves priced in USD | | `PoolEvent.AtoBPrice`, `BtoAPrice` | Spot price in each direction after the change | | `PoolEvent.Pool.SmartContract`, `PoolId` | Pool contract; for Uniswap v4 the PoolManager plus the pool id | | `PoolEvent.Dex.ProtocolName` | `uniswap_v2`, `uniswap_v3`, `uniswap_v4` or `pancake_swap_v3` | | `Transaction.Hash` | The transaction that changed the reserves | ## The same data over Kafka The `arbitrum.dexpools.proto` topic carries the same rows as protobuf messages with lower latency and no WebSocket to keep alive. Kafka needs its own credentials, separate from the IDE token; see the [Kafka streams hub](/docs/category/kafka-streams). The slippage tables for the same pools are on the [Arbitrum slippage API](/docs/blockchain/Arbitrum/arbitrum-slippage-api) page. ## Related pages - [Arbitrum slippage API](/docs/blockchain/Arbitrum/arbitrum-slippage-api) - [Arbitrum DEX trades API](/docs/blockchain/Arbitrum/DexTrades) - [DEXPools cube](/docs/cubes/evm-dexpool/) - [BNB Chain liquidity API](/docs/blockchain/BSC/bsc-liquidity-api) - [Base liquidity API](/docs/blockchain/Base/base-liquidity-api) --- ## Arbitrum Slippage API: How Much a Pool Can Absorb at Each Slippage Level URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-slippage-api/ Slippage tables for Arbitrum pools with Bitquery GraphQL: the largest trade a pool takes at each level, the minimum output, and the deepest pool for a token. # Arbitrum Slippage API: How Much a Pool Can Absorb at Each Slippage Level The `DEXPoolSlippages` cube under `EVM(network: arbitrum)` publishes a slippage table for a pool every time its reserves change. For seven slippage levels, 0, 10, 50, 100, 200, 500 and 1000 basis points, it gives the largest input the pool can take before the price moves past that level, the minimum output that trade would return, and the average execution price, in both directions. That answers the pre-trade question directly: can this pool take my size at my tolerance, and what do I get back. The tables cover the same pools as the [Arbitrum liquidity API](/docs/blockchain/Arbitrum/arbitrum-liquidity-api): Uniswap v2, v3 and v4 and PancakeSwap v3. The cube holds the recent realtime window only; record the stream for history. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The worked pool is the Uniswap v3 WETH/ARB pool, `0xc6f780497a95e246eb9449f5e4770916dcd6396a`. ## The slippage table of one pool Seven rows per update, one per level. At 50 basis points the `AtoB.MaxAmountIn` row reads as: selling this much WETH moves the price by no more than 0.5%, and `MinAmountOut` is the ARB you get for it. The 0 basis point row carries the spot price with zero size. Saved query [here](https://ide.bitquery.io/Latest-slippage-of-a-pool-on-Uniswap-v3). ```graphql { EVM(network: arbitrum) { DEXPoolSlippages( where: { Price: { Pool: { SmartContract: { is: "0xc6f780497a95e246eb9449f5e4770916dcd6396a" } } } } limit: { count: 7 } orderBy: { descending: Block_Time } ) { Block { Time Number } Price { SlippageBasisPoints AtoB { Price MaxAmountIn MinAmountOut } BtoA { Price MaxAmountIn MinAmountOut } Pool { SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Dex { ProtocolName } } } } } ``` ## One level, as a stream Fix `SlippageBasisPoints` to the tolerance you trade with and subscribe: each message is the pool's new capacity at that level. Saved stream [here](https://ide.bitquery.io/realtime-slippage-on-arbitrum). ```graphql subscription { EVM(network: arbitrum) { DEXPoolSlippages( where: { Price: { Pool: { SmartContract: { is: "0xc6f780497a95e246eb9449f5e4770916dcd6396a" } } SlippageBasisPoints: { eq: 50 } } } ) { Block { Time } Price { SlippageBasisPoints AtoB { Price MaxAmountIn MinAmountOut } BtoA { Price MaxAmountIn MinAmountOut } } } } } ``` ## The deepest pool for a token at a given tolerance Which pool takes the largest WETH sell within 0.5%? Keep the newest row per pool with `limitBy`, fix the level, and compare `AtoB.MaxAmountIn` across pools that list WETH first. On Arbitrum the large WETH pools against USDC and USDT0 lead. Repeat with WETH under `CurrencyB` and read `BtoA` for pools that list it second. ```graphql { EVM(network: arbitrum) { DEXPoolSlippages( where: { Price: { SlippageBasisPoints: { eq: 50 } Pool: { CurrencyA: { SmartContract: { is: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" } } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } limitBy: { by: Price_Pool_SmartContract, count: 1 } orderBy: { descending: Block_Time } limit: { count: 20 } ) { Price { Pool { SmartContract CurrencyB { Symbol SmartContract } } Dex { ProtocolName } AtoB { MaxAmountIn MinAmountOut Price } } } } } ``` ## Reading the fields | Field | Meaning | |---|---| | `Price.SlippageBasisPoints` | The level of the row: 0, 10, 50, 100, 200, 500 or 1000 (100 = 1%) | | `Price.AtoB.MaxAmountIn` | Largest amount of CurrencyA the pool takes within that level | | `Price.AtoB.MinAmountOut` | CurrencyB returned for that input | | `Price.AtoB.Price` | Average execution price of that trade | | `Price.BtoA` | The same three numbers for selling CurrencyB | | `Price.Pool`, `Price.Dex` | Pool contract, the two tokens, protocol name | The `arbitrum.dexpools.proto` Kafka topic carries the same tables as protobuf messages; Kafka needs its own credentials, see the [Kafka streams hub](/docs/category/kafka-streams). ## Related pages - [Arbitrum liquidity API](/docs/blockchain/Arbitrum/arbitrum-liquidity-api) - [Arbitrum DEX trades API](/docs/blockchain/Arbitrum/DexTrades) - [DEXPools cube](/docs/cubes/evm-dexpool/) - [Base slippage API](/docs/blockchain/Base/base-slippage-api) --- ## Arbitrum Smart Contract Calls API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/Smart_Contract_Calls/ Arbitrum smart contract calls: get the full call trace of an Arbitrum transaction, including caller, callee, method signatures and arguments. # Arbitrum Smart Contract Calls API In this section we will see how to get Arbitrum Smart contract calls information using our API. ## Transaction Call Trace for a Arbitrum Transaction This query gets the transaction call trace for an Arbitrum transaction. The `Calls` API in the query returns a list of all calls made by the transaction. You can find the query [here](https://ide.bitquery.io/Transaction-Call-Trace-Arbitrum) ```graphql query myquery($network: evm_network!, $hash: String!) { EVM(dataset: combined, network: $network) { Calls( limit: {count: 10} orderBy: {descending: Block_Time} where: {Transaction: {Hash: {is: $hash}}} ) { Call { From Gas GasUsed To Value CallPath Opcode { Code Name } SelfDestruct Create Delegated Depth InternalCalls Success Reverted Output LogCount Input } Transaction { Hash } Arguments { Index Path { Name } Type Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } { "hash": "0x0ca5e462cace62c893cefb57c4491eabf9aebe873a86f9cb16377a127b17589b", "network": "arbitrum" } ``` Each call contains the following information: - `CallPath`: The call path, which is a list of the contract addresses that were called. - `Create`: Whether the call created a new contract. - `Delegated`: Whether the call was a delegated call. - `Depth`: The depth of the call, which is the number of nested calls. - `From`: The address that made the call. - `Gas`: The gas limit for the call. - `GasUsed`: The gas used by the call. - `Input`: The input data for the call. - `InternalCalls`: The number of internal calls made by the call. - `LogCount`: The number of logs generated by the call. - `Opcode`: The opcode of the call. - `Output`: The output data for the call. - `Reverted`: Whether the call reverted. - `SelfDestruct`: Whether the call self-destructed the contract. - `Success`: Whether the call was successful. - `To`: The address that was called. - `Value`: The value transferred to the called contract. --- ## Arbitrum Smart Contract Events API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/Smart_Contract_Events/ Arbitrum smart contract events: query decoded contract logs on Arbitrum, with an example that tracks DEX swap events by event signature. # Arbitrum Smart Contract Events API In this section we will see how to get Arbitrum Smart Contract Events information using our API. ## Tracking Swap Events on Arbitrum The query returns the 10 most recent `swap` events on the Arbitrum network. We get this by using the signature hash `c42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67` for the swap event. You can find the query [here](https://ide.bitquery.io/Swap-Events-Arbitrum) ```graphql query ($network: evm_network, $limit: Int, $method: String) { EVM(dataset: archive, network: $network) { Events( where: {Log: {Signature: {SignatureHash: {is: $method}}}} limit: {count: $limit} orderBy: {descending: Block_Time} ) { ChainId Transaction { Hash } Log { Signature { Name } } Fee { SenderFee } Block { Time Number } } } } { "limit": 10, "network": "arbitrum", "method": "c42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" } ``` The `Log` field in each event contains the following information: - `Signature`: The signature of the event. - `Name`: The name of the event. The `Transaction` field in each event contains the following information: - `Hash`: The hash of the transaction that emitted the event. The `Fee` field in each event contains the following information: - `SenderFee`: The fee paid by the sender of the transaction. The `Block` field in each event contains the following information: - `Time`: The time at which the block was mined. - `Number`: The block number. --- ## Arbitrum TimeBoost API & Streams URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-timeboost-api/ Arbitrum TimeBoost auctions in real time: a GraphQL subscription on the auction contract returning transaction context and decoded bids for priority inclusion. # Arbitrum TimeBoost API & Streams Arbitrum sequencers traditionally ordered transactions on a first-come-first-serve (FCFS) basis. **TimeBoost** introduced an auction-driven priority lane that lets searchers bid for earlier inclusion. With Bitquery’s Stream you can subscribe to every call that interacts with the TimeBoost auction contract and correlate it with other Arbitrum insights described in our [Arbitrum Overview](./). ## Real-time subscription Use the following subscription in the Bitquery IDE to watch every TimeBoost auction interaction. The query filters on the auction contract address and surfaces both transaction context and decoded ABI arguments. [Run this stream](https://ide.bitquery.io/Arbitrum-Timeboost-Auction-Transactions-in-Realtime) ```graphql subscription { EVM(network: arbitrum) { Events( where: { Transaction: { To: { is: "0x5fcb496a31b7AE91e7c9078Ec662bd7A55cd3079" } } } ) { Block { Number } Call { CallPath InternalCalls Signature { Name } } Topics { Hash } Receipt { CumulativeGasUsed } Transaction { From To Type } Arguments { Name 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 } } } } } } ``` --- ## Arbitrum Token Market Cap API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/arbitrum-token-marketcap-api/ Arbitrum Token Market Cap API: stream Arbitrum market cap, FDV, supply, and price using Bitquery Trading GraphQL APIs. See examples in the Bitquery IDE. # Arbitrum Token Market Cap API Use Bitquery’s **Trading** API **`Tokens`** cube to stream or query **market cap**, **fully diluted valuation (USD)**, **total supply**, **price** (OHLC and averages), and **volume** for tokens traded on **Arbitrum One**. Filter with token/currency **`Id`** values such as **`arbitrum:`** plus a **lowercase** contract address. For schema details and field meanings, see the **[Tokens cube](/docs/trading/crypto-price-api/tokens)** and **[Supply fields](/docs/trading/crypto-price-api/supply-fields)**. :::note Trading API and EVM addresses On **Arbitrum** (EVM), the **Trading** API expects **lowercase** hex in **`Id`** values (e.g. `arbitrum:0x97e6…`, not mixed-case checksum addresses). ::: ## Related APIs - **[Ethereum Token Market Cap API](/docs/blockchain/Ethereum/token-supply/ethereum-token-marketcap-api)** — same patterns with **`eth:`** ids - **[BSC Token Market Cap API](/docs/blockchain/BSC/bsc-token-marketcap-api)** — same patterns with **`bsc:`** ids - **[Polygon (Matic) Token Market Cap API](/docs/blockchain/Matic/matic-token-marketcap-api)** — same patterns with **`matic:`** ids - **[Base Token Market Cap API](/docs/blockchain/Base/base-token-marketcap-api)** — same patterns with **`base:`** ids - **[Solana Token Market Cap API](/docs/blockchain/Solana/solana-token-marketcap-api)** — same patterns with **`solana:`** ids - **[Crypto Price API — Tokens](/docs/trading/crypto-price-api/tokens)** — full `Tokens` cube reference --- ## How do I stream live Arbitrum token market cap, price, and volume? Subscribe to **`Tokens`** where **currency id** includes **`arbitrum`**, with **interval duration** greater than **1** (second). You get **token fields**, **block time**, **supply** (**MarketCap**, **FullyDilutedValuationUsd**), **price** (OHLC and mean), and **volume**. You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/arbitrum-token-marketcap-stream). ```graphql subscription MyQuery { Trading { Tokens( where: {Currency: {Id: {includes: "arbitrum"}}, Interval: {Time: {Duration: {gt: 1}}}} ) { Token { Name Id Address Symbol } Block { Time } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } Price { Average { Mean } Ohlc { Open Low High Close } } Volume { Base BaseAttributedToUsd Quote Usd } } } } ``` --- ## How do I get the latest market cap for a specific token on Arbitrum? Use **`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, and filter **`Token.Id`** with **`includesCaseInsensitive`** (e.g. **`arbitrum:`** + lowercase contract). You can run this query [in the Bitquery IDE](https://ide.bitquery.io/specific-arbitrum-token-latest-marketcap). ```graphql query { Trading { Tokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: {Token: {Id: {includesCaseInsensitive: "arbitrum:0x97e66d3c4d5bcd7c64e3e55af28544c9addf9281"}}, Interval: {Time: {Duration: {gt: 1}}}} ) { Token { Name Id Address Symbol } Block { Time } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } Price { Average { Mean } Ohlc { Open Low High Close } } Volume { Base BaseAttributedToUsd Quote Usd } } } } ``` Replace the `includesCaseInsensitive` value with your token’s **`arbitrum:`** id (lowercase hex). --- ## How do I stream Arbitrum tokens with market cap above $1 million? Subscribe when **`Token.Id`** matches **Arbitrum** (**`arbitrum`**) and **`Supply.MarketCap`** **>** **1,000,000** (USD). You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-arbitrum-tokens-with-marketcap-above-1-million). ```graphql subscription { Trading { Tokens( where: {Token: {Id: {includesCaseInsensitive: "arbitrum"}}, Interval: {Time: {Duration: {gt: 1}}}, Supply: {MarketCap: {gt: 1000000}}} ) { Currency { Name Id Symbol } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } } } } ``` :::tip Threshold and interval Tune **`Supply.MarketCap`** and **`Interval.Time.Duration`** for your alerts or dashboards. See **[Tokens cube](/docs/trading/crypto-price-api/tokens)** for more filters. ::: --- ## How do I get top Arbitrum tokens by market cap? This query ranks **Arbitrum** tokens by **`Supply.MarketCap`**. It uses roughly the **last 24 hours** (`since_relative: { hours_ago: 24 }`), **1-second** intervals, at least **$1,000** **USD volume**, **`limitBy`** one row per **`Token_Id`**, and up to **50** tokens. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Tokens-by-Market-Cap-on-Arbitrum). ```graphql { Trading { Tokens( limit: { count: 50 } limitBy: { count: 1, by: Token_Id } orderBy: { descending: Supply_MarketCap } where: { Block: { Time: { since_relative: { hours_ago: 24 } } } Interval: { Time: { Duration: { eq: 1 } } } Volume: { Usd: { gt: 1000 } } Token: { Network: { is: "Arbitrum" } } } ) { Currency { Id Name Symbol } Price { Average { Mean(maximum: Block_Time) } } Volume { Base(maximum: Block_Time) Quote(maximum: Block_Time) Usd(maximum: Block_Time) } Token { Network Symbol Address } Supply { MarketCap(maximum: Block_Time) FullyDilutedValuationUsd(maximum: Block_Time) TotalSupply(maximum: Block_Time) } } } } ``` --- ## How do I get top Arbitrum tokens by market cap change in 1 hour? Uses a **1-hour** OHLC interval (`Duration: { eq: 3600 }`) and orders by **`change_mcap`**: **(close − open) × total supply**. **`Token.Network`** is **Arbitrum**. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/top-arb-tokens-by-Market-Cap-Change-1h). ```graphql { Trading { Tokens( limit: { count: 50 } orderBy: { descendingByField: "change_mcap" } where: { Interval: { Time: { Duration: { eq: 3600 } } } Token: { Network: { is: "Arbitrum" } } } ) { Currency { Id Name Symbol } Token { Network Symbol Address } Supply { MarketCap FullyDilutedValuationUsd CirculatingSupply TotalSupply MaxSupply } change_mcap: calculate( expression: "($Price_Ohlc_Close-$Price_Ohlc_Open) * Supply_TotalSupply" ) Price { Ohlc { Open Close } } } } } ``` --- ## Arbitrum Transactions API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/Blocks_Transactions/ Arbitrum transactions and blocks: fetch the latest transactions, filter transactions from or to a wallet, and list the latest blocks with GraphQL examples. # Arbitrum Transactions API In this section we'll have a look at some examples using the Arbitrum Transactions API. ## Latest Transactions The query below retrieves the latest 10 transactions on the Arbitrum network. You can find the query [here](https://ide.bitquery.io/Latest-Transactions_3) ```graphql { EVM(network: arbitrum, dataset: archive) { Transactions( limit: {count: 10, offset: 0} orderBy: {descending: Block_Time} where: {Block: {Date: {since: "2023-07-01", till: "2023-07-15"}}} ) { ChainId Block { Number Time } Transaction { To From Hash Value } Receipt { GasUsed } Fee { EffectiveGasPrice SenderFee } } } } ``` ## Latest Transactions From/To a Wallet To retrieve the latest transactions from or to a specific wallet address we will be using the `any` filter which acts as the OR condition. This query fetches the 10 most recent transactions from/to the specified wallet address, ordered by the block time in descending order. ```graphql { EVM(network: arbitrum, dataset: archive) { Transactions( limit: {count: 10} where: {any: {Transaction: {From: {is: "0x16a92c43b270fbb1916501470f70c42cf6f00326"}, To: {is: "0x16a92c43b270fbb1916501470f70c42cf6f00326"}}}} orderBy: {descending: Block_Time} ) { ChainId Block { Number Time } Transaction { To From Hash Value } Receipt { GasUsed } Fee { EffectiveGasPrice SenderFee } } } } ``` ## Latest Blocks The query below retrieves the latest 10 blocks on the Arbitrum network. You can find the query [here](https://ide.bitquery.io/Latest-Arbitrum-blocks) ```graphql query MyQuery { EVM(network: arbitrum) { Blocks(limit: {count: 10}, orderBy: {descending: Block_Time}) { Block { BaseFee Coinbase Difficulty Time Root } } } } ``` --- ## Arbitrum Uniswap v4 API: Swaps, Pools by PoolId, Traders and Liquidity URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/uniswap-v4-api/ Uniswap v4 on Arbitrum with Bitquery GraphQL: live swaps, pools of a token by PoolId, daily pool stats, top traders and reserves, worked on ETH/USDC. # Arbitrum Uniswap v4 API: Swaps, Pools by PoolId, Traders and Liquidity Uniswap v4 on Arbitrum runs through one contract, the PoolManager at `0x360e68faccca8ca495c1b759fd9eee466db9fb32`. Every pool is a record inside it, identified by a `PoolId` hash of the two tokens, the fee, the tick spacing and the hook, not by an address of its own. That changes how you query: the protocol name `uniswap_v4` selects the whole venue, `Trade.PoolId` selects a pool, and on swap rows the buyer and seller fields both show the PoolManager, so the trader is `Transaction.From`. Activity on Arbitrum sits in a few majors: ETH/USDC, USDC against the USDT0 bridged stablecoin, WBTC/USDC, and a rotating set of launch tokens. Every example runs in the [IDE](https://ide.bitquery.io); the `archive` and `combined` ones need an archive add-on, because the free trial is real-time only. The worked pool is ETH/USDC, `PoolId 0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8`, and the worked token is USDC, `0xaf88d065e77c8cc2239327c5edb3a432268e5831`. ## Live swaps across all v4 pools Filter `DEXTrades` on the protocol name and subscribe. Each message is one swap with both sides priced in USD; `Trade.PoolId` says which pool. Saved stream [here](https://ide.bitquery.io/Real-time-trades-for-uniswap-v4-arbitrum). ```graphql subscription { EVM(network: arbitrum) { DEXTrades(where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } } }) { Block { Time } Trade { PoolId Buy { Currency { Symbol SmartContract } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol SmartContract } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Every v4 pool that trades a token Group `DEXTradeByTokens` by `PoolId` with the token in `Currency` to list its pools, ranked by trades in the window, with the other token of each pool and its USD volume. This is how you find the `PoolId` to use in the queries below. Saved query [here](https://ide.bitquery.io/get-virtual-pool-address-for-a-token-on-uniswap-v4-arbitrum). ```graphql { EVM(network: arbitrum) { DEXTradeByTokens( where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "count" } limit: { count: 20 } ) { Trade { PoolId Side { Currency { Symbol SmartContract } } } count volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ``` ## Latest swaps in one pool Filter on the `PoolId`. Saved query [here](https://ide.bitquery.io/Latest-Trades-for-a-currency-pair-on-arbitrum). ```graphql { EVM(network: arbitrum) { DEXTrades( where: { Trade: { PoolId: { is: "0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8" } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Currency { Symbol } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Pool stats for the last 24 hours One row with trades, distinct buyers and sellers, and volume split by direction, for the token you name in `Currency`. Saved query [here](https://ide.bitquery.io/trade-stats-for-a-token-pair-on-uniswap-v4-arbitrum). ```graphql { EVM(network: arbitrum) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8" } Currency: { SmartContract: { is: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Symbol } Side { Currency { Symbol } } } trades: count buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) volumeUsd: sum(of: Trade_Side_AmountInUSD) buyVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } }) sellVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } }) } } } ``` ## Top traders of a pool Because the PoolManager settles every v4 swap, `Trade.Buyer` and `Trade.Seller` on `DEXTrades` are the PoolManager itself. Group by `Transaction.From` instead to rank the accounts that sent the swaps. `bought` sums the token the trader received and `sold` the token it gave up; `Side.Type` describes the counter-side of the trade, which is why the two conditions look reversed. Saved query [here](https://ide.bitquery.io/top-buyers-of-a-currency-on-uniswap-v4-arbitrum). ```graphql { EVM(network: arbitrum) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8" } Currency: { SmartContract: { is: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` Put one of those addresses into `Transaction: { From: { is: "0x..." } }` on the latest-swaps query to see its trades. The [top sellers](https://ide.bitquery.io/top-sellers-of-a-token-on-uniswap-v4-arbitrum) saved query is the same shape sorted on `sold`. ## Reserves of a v4 pool `DEXPoolEvents` emits a row on every reserve change. For v4 the reserves are rebuilt from the concentrated positions around the current price, so they are what the PoolManager holds for that pool, priced in USD. Filter by `PoolId`; drop the filter and keep the protocol name to stream every v4 pool on Arbitrum. Saved stream for [all pools](https://ide.bitquery.io/uniswap-v4-pool-liquidity-arbitrum). ```graphql { EVM(network: arbitrum) { DEXPoolEvents( where: { PoolEvent: { Pool: { PoolId: { is: "0x864abca0a6202dba5b8868772308da953ff125b0f95015adbf89aaf579e903a8" } } } } limit: { count: 5 } orderBy: { descending: Block_Time } ) { Block { Time } PoolEvent { Pool { PoolId CurrencyA { Symbol } CurrencyB { Symbol } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } } } } ``` ## Related pages - [Arbitrum liquidity API](/docs/blockchain/Arbitrum/arbitrum-liquidity-api) - [Arbitrum DEX trades API](/docs/blockchain/Arbitrum/DexTrades) - [Uniswap v4 on Ethereum](/docs/blockchain/Ethereum/dextrades/uniswap-v4-api) - [Uniswap v4 on Base](/docs/blockchain/Base/uniswap-v4-api) - [Uniswap v4 on BNB Chain](/docs/blockchain/BSC/uniswap-v4-api) --- ## Arc Balances & Token Supply API URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-balances-api/ Query Arc wallet balances, balance history, token holders and total supply with Bitquery GraphQL APIs, including multi-wallet portfolio queries. # Arc Balances & Token Supply API Query **wallet balances, holders and token supply on Arc** with Bitquery GraphQL. Four cubes on `network: arc` cover it: | Cube | What it returns | | --- | --- | | `Balances` | Computed current balance per address and currency, with first and last change time and update count | | `Holders` | Current holder and token pairs, ranked by token balance | | `TransactionBalances` | Per-transaction pre- and post-balances, and the token's `TotalSupply` | | `Transfers` | Every transfer in and out of a wallet | Every query on this page was executed against the production endpoint before publishing. :::info Availability checked 16 September 2026 `Balances`, `Holders`, `TransactionBalances` and `Transfers` all returned Arc data. Only the realtime path answered, so leave the `dataset` argument out until `archive` and `combined` are enabled. Join balances to the [latest price query](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/#latest-price-of-a-token) when you need a USD value. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) — network facts, every cube and stream in one place - [Arc Transfers API](/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/) - [Arc DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) - [EVM Balances schema](/docs/schema/evm/balances/) - [EVM Token Supply API](/docs/blockchain/Ethereum/token-supply/evm-token-supply/) ::: **On this page:** [Portfolio](#portfolio-of-a-wallet) · [One token](#balance-of-one-token) · [Batch](#balances-of-several-wallets) · [Top holders](#top-holders-of-a-token) · [History](#balance-history-of-a-wallet) · [Stream](#stream-balance-changes) · [Supply](#total-supply-of-a-token) · [Supply stream](#stream-supply-changes) · [FAQ](#faq) --- ## Portfolio of a wallet ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-portfolio-of-a-wallet) Every currency an address holds, with the computed balance and when it last changed. Native USDC has `Native: true`; the ERC-20 interface at `0x3600...` is listed separately. ```graphql { EVM(network: arc) { Balances( where: {Balance: {Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} orderBy: {descending: Balance_Amount} ) { Currency { Name Symbol SmartContract Native } Balance { Amount FirstChangeTime LastChangeTime UpdateCount } } } } ``` --- ## Balance of one token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-balance-of-one-token) The `balanceOf` equivalent for ERC-20 USDC. For the gas token use `Currency: {Native: true}` instead of a contract filter. ```graphql { EVM(network: arc) { Balances( where: { Balance: {Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}} Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } ) { Currency { Symbol Decimals } Balance { Amount LastChangeTime } } } } ``` --- ## Balances of several wallets ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-balances-of-several-wallets) One call for a batch of addresses, grouped by address and currency. ```graphql { EVM(network: arc) { Balances( where: { Balance: { Address: { in: [ "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb" "0xb40bd0f6b1332daf9e987a0ca33efe6e90d0b938" "0x2bf981e99011ae4050aaa6f33af4bfc26b89f224" ] } } Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } orderBy: {descending: Balance_Amount} ) { Balance { Address Amount } Currency { Symbol } } } } ``` --- ## Top holders of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-top-holders-of-a-token) Current EURC holders ranked by token balance. Add `Balance: {Amount: {gt: "0"}}` so wallets that once held the token but now hold zero do not appear. ```graphql { EVM(network: arc) { Holders( where: { Currency: {SmartContract: {is: "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}} Balance: {Amount: {gt: "0"}} } orderBy: {descending: Balance_Amount} limit: {count: 20} ) { Holder { Address } Balance { Amount FirstChangeTime LastChangeTime UpdateCount } } } } ``` --- ## Balance history of a wallet Each change to a wallet's USDC balance, newest first, with the transaction behind it. `TransactionBalances` returns the balance before and after each transaction; `change` is the difference, so positive values are inflows. ```graphql { EVM(network: arc) { TransactionBalances( limit: {count: 20} orderBy: {descending: Block_Time} where: { TokenBalance: { Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"} Currency: {Native: true} } } ) { Block { Number Time } Transaction { Hash } TokenBalance { PreBalance PostBalance Currency { Symbol } } change: calculate(expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance") } } } ``` ### Net change per currency over a window Sum the transfers in and out per currency to see what a wallet gained or lost over the last 24 hours. ```graphql { EVM(network: arc) { Transfers( where: { any: [ {Transfer: {Receiver: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} {Transfer: {Sender: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} ] Block: {Time: {since_relative: {hours_ago: 24}}} } ) { Transfer { Currency { Symbol SmartContract Native } } inflow: sum(of: Transfer_Amount, if: {Transfer: {Receiver: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}}) outflow: sum(of: Transfer_Amount, if: {Transfer: {Sender: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}}) transfers: count } } } ``` --- ## Stream balance changes Every balance change of a wallet as it happens, from `TransactionBalances`. Widen the filter to a list of addresses or a single token to build alerts. ```graphql subscription { EVM(network: arc) { TransactionBalances( where: { TokenBalance: {Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}} } ) { Block { Number Time } Transaction { Hash } TokenBalance { PreBalance PostBalance Currency { Symbol SmartContract Native } } } } } ``` --- ## Total supply of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-total-supply-of-a-token) `TransactionBalances` records the token's total supply after each transaction that touched it. The latest row is the current supply, already adjusted for decimals. ```graphql { EVM(network: arc) { TransactionBalances( limit: {count: 1} orderBy: {descending: Block_Time} where: { TokenBalance: { Currency: {SmartContract: {is: "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}} } } ) { Block { Time } TokenBalance { Currency { Symbol SmartContract } TotalSupply } } } } ``` --- ## Stream supply changes ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-balances-stream-supply-changes) A new row arrives whenever a mint or burn changes the supply of the token. ```graphql subscription { EVM(network: arc) { TransactionBalances( where: { TokenBalance: { Currency: {SmartContract: {is: "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}} } } ) { Block { Time } Transaction { Hash } TokenBalance { Currency { Symbol } TotalSupply } } } } ``` --- ## FAQ **Does the `Holders` cube work?** Yes. It returned Arc holder rows in the production check on 16 September 2026. Filter `Balance.Amount` above zero for current holders. **Why does the same wallet show USDC twice?** Native USDC (`Native: true`, 18 decimals) and the ERC-20 USDC interface (`0x3600...`, 6 decimals) appear as separate Bitquery currencies. Arc's ERC-20 interface acts on the native balance, so do not add the rows without checking the flow you are measuring. A third row with contract `0xfff...fffe` and no symbol is a system ledger mirror and can be ignored. **Are USD values available?** The balance cubes return token amounts. Fetch current prices from `Trading.Pairs` with `Market.Network: "Arc"`, or use `Trading.Tokens` for prices across pools, then match tokens in your app. Check the price timestamp before valuing a balance. For a historical price more than 30 days old, derive it from `EVM.DEXTrades` or `EVM.DEXTradeByTokens` only after confirming Arc archive data is available. **Is `TotalSupply` raw or decimal-adjusted?** Decimal-adjusted. A token with a billion supply reads `1000000000.000000000000000000`. --- ## Arc Blockchain API: GraphQL and WebSocket URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/ Query and stream Circle’s Arc blockchain data with Bitquery’s Arc Blockchain API. Get trades, transfers, balances and blocks through GraphQL and WebSocket. # Arc Blockchain API Bitquery’s [**Arc Blockchain API**](https://bitquery.io/blockchains/arc-blockchain-api) queries and streams data from Circle’s Arc blockchain (chain ID `5042`). Use `Trading` for trading queries and streams, with `Pair.Market.Network: "Arc"` on `Trading.Trades`. Use `EVM(network: arc)` for transfers, balances, logs, calls, transactions and blocks. :::tip Trading queries and streams Use `Trading.Trades`, `Trading.Tokens` and `Trading.Pairs` for live data and the last 30 days. Use `EVM.DEXTrades` or `EVM.DEXTradeByTokens` only for trades older than 30 days, subject to Arc archive availability. ::: Arc is Circle's EVM-compatible Layer 1. USDC pays gas, blocks reach finality in under a second, and the network is built for payments, foreign exchange and tokenized assets. [Arc launched](https://www.arc.io/blog/arc-mainnet-goes-live-on-september-16-2026) on **16 September 2026**. Circle's current RPC reference still labels its listed Arc endpoints and explorer as permissioned; Bitquery's indexed API is live. :::info Availability checked 16 September 2026 `Trading.Trades`, `Trading.Tokens`, `Trading.Pairs`, and the realtime EVM cubes returned Arc data in production tests. Leave the dataset argument out of `Trading`; it does not support archive or combined. Arc's EVM `dataset: combined` and `dataset: archive` did not answer at this check. ::: :::note API Key Required To query or stream outside the Bitquery IDE, create an [API access token](/docs/authorization/how-to-generate/). ::: --- ## Arc at a glance {#network-facts} | Property | Value | | --- | --- | | Trading network | `Arc` in `Pair.Market.Network` for trades; `Market.Network` for pair candles; `Token.Network` for token candles | | EVM network | `arc` in `EVM(network: arc)` for other chain data | | Chain ID | `5042` | | Gas token | USDC, tracked as `Currency.Native: true` | | USDC ERC-20 interface | `0x3600000000000000000000000000000000000000` (6 decimals) | | EURC | `0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1` (6 decimals) | | USYC | `0x8a5D989Bbb96929F689B0200f435f53dA42bF490` (6 decimals) | | Uniswap v4 PoolManager seen by Bitquery | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | | Arc explorer | [explorer.arc.io](https://explorer.arc.io) (listed as permissioned in Arc's RPC reference) | | Arc RPC | `https://rpc.mainnet.arc.io` (listed as permissioned in Arc's RPC reference) | | Bitquery GraphQL | `https://streaming.bitquery.io/graphql` | Arc's [network reference](https://docs.arc.io/arc/references/rpc-endpoints) confirms chain ID `5042`, USDC as the currency symbol, the RPC and the explorer. Arc's [contract list](https://docs.arc.io/arc/references/contract-addresses) gives the stablecoin addresses. --- ## Quick start: latest Arc swaps {#quick-start} This Trading query returns the newest Arc trade rows with USD amounts and the market name. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-overview-quick-start-latest-arc-mainnet-swaps) ```graphql { Trading { Trades( limit: {count: 10} orderBy: {descending: Block_Time} where: {Pair: {Market: {Network: {is: "Arc"}}}} ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } PriceInUsd Pair { Market { Network Protocol } Token { Id Symbol } QuoteToken { Id Symbol } } } } } ``` Change `query` to `subscription` and remove `limit` and `orderBy` for a live feed. Follow [WebSocket authentication](/docs/authorization/websocket/) to connect. See the [Arc trades guide](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) for token, pool, trader and protocol filters. --- ## Pick the right API {#pick-the-right-api} | What you need | Cube | Guide | | --- | --- | --- | | Recent trades, USD volume and traders | `Trading.Trades` | [DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) | | Recent token prices and OHLCV | `Trading.Tokens`, `Trading.Pairs` | [Prices and candles](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/#ohlcv-candles-for-a-token) | | Trades older than 30 days, once Arc archive is available | `EVM.DEXTrades`, `EVM.DEXTradeByTokens` | [Older history](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/#trades-older-than-30-days) | | New tokens from verified launchpads, then their first trades | `EVM.Events`, then `Trading.Trades` | [Launchpads API](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) | | Argus decoded launches, dev buys, launch calls, token trades and OHLCV | `Events`, `Calls`, `Trading.Trades`, `Trading.Pairs`, `Trading.Tokens` | [Argus Launchpad API](/docs/blockchain/arc-mainnet/argus-launchpad-api/) | | Tolly launches, token trades, trader rankings and OHLCV | `Events`, `Trading.Trades`, `Trading.Pairs`, `Trading.Tokens` | [Tolly Launchpad API](/docs/blockchain/arc-mainnet/tolly-launchpad-api/) | | RadarDEX Classic and Reflection launches, trades and prices | `Events`, `Trading.Trades`, `Trading.Pairs`, `Trading.Tokens` | [RadarDEX Launchpad API](/docs/blockchain/arc-mainnet/radardex-launchpad-api/) | | Minara launches, pool creators, trades and OHLCV | `Events`, `Trading.Trades`, `Trading.Pairs`, `Trading.Tokens` | [Minara Launchpad API](/docs/blockchain/arc-mainnet/minara-launchpad-api/) | | Token and native USDC movement | `Transfers` | [Transfers API](/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/) | | Decoded logs and new pool events | `Events` | [Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) | | Method calls, call trees and reverts | `Calls` | [Calls API](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/) | | Transactions, receipts, blocks and fees | `Transactions`, `Blocks` | [Transactions API](/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/) | | Portfolios, holders, balance history and supply | `Balances`, `Holders`, `TransactionBalances` | [Balances API](/docs/blockchain/arc-mainnet/arc-mainnet-balances-api/) | --- ## USDC on Arc {#usdc} Native USDC and the ERC-20 interface share Arc's USDC model, but Bitquery exposes separate rows so each source stays clear. | Form | Bitquery fields | Decimals | | --- | --- | --- | | Native USDC | `Token.Id: "bid:arc"` and empty `Token.Address` in Trading; `Currency.Native: true`, `SmartContract: "0x"` in EVM transfers and balances | 18 | | ERC-20 USDC | `SmartContract: "0x3600000000000000000000000000000000000000"` | 6 | | System ledger mirror | `0xfffffffffffffffffffffffffffffffffffffffe`, no symbol | raw integer | Filter on `Native: true` for gas-token value transfers. Use the `0x3600...` address for ERC-20 calls and transfers. Exclude the system ledger mirror from token rankings. --- ## DEX data on launch day {#dexes} Production checks found active Uniswap v4, v3 and v2 markets. Use `Trading.Trades` with `Pair.Market.Network: "Arc"` for these trades. The feed can include NFT market fills; filter `Pair.Market.Protocol` or `Pair.Market.ProtocolFamily` when you need a specific swap venue. Arc token IDs use `bid:arc:`, and native USDC uses `bid:arc`. To inspect a trade's calls, logs or transfers, take `TransactionHeader.Hash` and query the matching EVM cube separately. --- ## Datasets and history {#datasets} Trading serves live data and a rolling window of about 30 days. Arc may have less history while indexing starts. Only use the EVM trade cubes for older trades, after archive support is confirmed. On 16 September 2026, only Arc's realtime EVM path answered. The following check measures EVM block history; it does not measure the Trading window: ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-overview-datasets-and-history) ```graphql { EVM(network: arc) { Blocks { count earliest: Block { Number(minimum: Block_Number) Time(minimum: Block_Time) } latest: Block { Number(maximum: Block_Number) Time(maximum: Block_Time) } } } } ``` `dataset: combined` returned an unavailable-data error and `dataset: archive` could not reach its backing host during the check. Retry before treating those modes as live. --- ## Real-time streams {#streaming} Use `Trading.Trades` for trade streams and `Trading.Tokens` or `Trading.Pairs` for price and candle streams. Change the operation to `subscription` and drop `limit`, `orderBy`, and historical time filters. Keep token and trader leaderboards built with aggregates such as `count` or `sum` as HTTP queries; see [streaming limits](/docs/subscriptions/what-does-not-survive-streaming/). The `Ranking.Position` filter on the candle cubes can still be used in a subscription. See [WebSocket subscriptions](/docs/subscriptions/websockets/) and [WebSocket authorization](/docs/authorization/websocket/). --- --- ## Arc Calls & Traces API URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/ Query and stream Arc smart contract calls and traces with Bitquery GraphQL, including selectors, internal calls, deployments, reverts and top methods. # Arc Calls & Traces API Query and stream **smart contract calls on Arc** with Bitquery GraphQL. The `EVM.Calls` cube on `network: arc` holds every call in every transaction, including internal calls, with the decoded method signature, the call path, value, gas, success and revert flags, and the enclosing transaction. It returns what `debug_traceTransaction` and `trace_filter` return, without running a node, and the same query runs as a subscription. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::info Availability checked 16 September 2026 The realtime path returned live calls and populated USD fields. Leave the `dataset` argument out until `combined` and `archive` are enabled. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) — network facts, every cube and stream in one place - [Arc Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) - [Arc Transactions API](/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/) - [EVM Calls schema](/docs/schema/evm/calls/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) ::: **On this page:** [Call anatomy](#what-one-call-row-contains) · [Stream](#stream-calls-to-a-contract) · [Latest](#latest-calls) · [By method](#calls-of-one-method) · [By selector](#calls-by-4-byte-selector) · [Internal calls of a transaction](#internal-calls-of-a-transaction) · [Deployments](#contract-deployments) · [Reverts](#reverted-calls) · [Top methods](#most-called-methods) · [Value-carrying calls](#calls-that-move-native-usdc) · [FAQ](#faq) --- ## What one call row contains | Group | What it gives you | | --- | --- | | `Call` | `From`, `To`, `Value`, `Input`, `Output`, `Gas`, `GasUsed`, `Success`, `Reverted`, `Error`, `Create`, `Delegated`, `SelfDestruct`, `CallPath`, `Index`, `Depth` | | `Call.Signature` | `Name`, full `Signature`, `SignatureHash` (the 4-byte selector, without `0x`) | | `Arguments` | Decoded, typed inputs for registered ABIs | | `Transaction` | Hash, `From`, `To`, value, gas and fee fields | | `Receipt` | `Status`, `GasUsed`, deployed `ContractAddress` | | `Block` | `Number`, `Time` | A transaction's top-level call has `Call.Index` 0 and an empty `CallPath`; internal calls have deeper paths. Filter `Call: {Index: {eq: 0}}` when you want one row per transaction. ### Example addresses on this page | Item | Address | | --- | --- | | Uniswap v4 PoolManager | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | --- ## Stream calls to a contract ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-stream-calls-to-contract) Every call into the Uniswap v4 PoolManager, internal or top-level, as it happens. ```graphql subscription { EVM(network: arc) { Calls( where: {Call: {To: {is: "0x8366a39cc670b4001a1121b8f6a443a643e40951"}}} ) { Block { Number Time } Transaction { Hash From } Call { From To Value Success CallPath Signature { Name Signature SignatureHash } } } } } ``` --- ## Latest calls ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-latest-calls) The most recent top-level calls, one per transaction. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Index: {eq: 0}}} ) { Block { Number Time } Transaction { Hash } Call { From To Value Success Gas GasUsed Signature { Name SignatureHash } } } } } ``` --- ## Calls of one method ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-calls-of-a-method) Filter on the decoded method name and the contract. This reads `transfer` calls into the ERC-20 USDC contract with their decoded arguments. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: { Call: { To: {is: "0x3600000000000000000000000000000000000000"} Signature: {Name: {is: "transfer"}} } } ) { Block { Time } Transaction { Hash } Call { From Success Signature { Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## Calls by 4-byte selector ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-calls-by-selector) When the ABI is not registered, filter on the selector in `Call.Input` instead. This matches `approve(address,uint256)` by its `0x095ea7b3` prefix on any contract. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Input: {startsWith: "0x095ea7b3"}}} ) { Block { Time } Transaction { Hash } Call { From To Input Success Signature { Name } } } } } ``` --- ## Internal calls of a transaction ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-internal-calls-of-transaction) The full call tree of one transaction, ordered by call index. Replace the hash with any recent transaction from the [Transactions API](/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/). ```graphql { EVM(network: arc) { Calls( orderBy: {ascending: Call_Index} where: { Transaction: { Hash: {is: "0x3fb2f3f18ae8ef86dbf6d25f268c861d2982f67308031df45574b5a7fcc02b9f"} } } ) { Call { Index Depth CallPath From To Value Gas GasUsed Success Reverted Delegated Signature { Name Signature } } } } } ``` --- ## Contract deployments ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-contract-deployments) `Call.Create: true` marks a call that deployed a contract. The new address is in `Receipt.ContractAddress` for top-level deployments; for factory deployments read `Call.To` on the create call. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Create: true}} ) { Block { Time Number } Transaction { Hash From } Call { From To Success CallPath } Receipt { ContractAddress } } } } ``` --- ## Reverted calls ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-reverted-calls) Calls that reverted, with the error string when the EVM returned one. Useful for debugging a contract under test. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Reverted: true}} ) { Block { Time } Transaction { Hash From } Call { From To Error CallPath Signature { Name } } } } } ``` --- ## Most called methods ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-most-called-methods) Method signatures ranked by call count over 24 hours. ERC-20 `transfer`, `balanceOf` and `approve` dominate, followed by Uniswap v4 hook callbacks. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Call: {Signature: {Name: {not: ""}}} } ) { Call { Signature { Name Signature SignatureHash } } count contracts: uniq(of: Call_To) } } } ``` --- ## Calls that move native USDC ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-calls-with-value) Internal calls that carried native USDC value. This is how value moves between contracts shows up, since those movements are not ERC-20 `Transfer` events. ```graphql { EVM(network: arc) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Value: {gt: "10"}}} ) { Block { Time } Transaction { Hash } Call { From To Value Index Signature { Name } } } } } ``` --- ## FAQ **How do I get one row per transaction?** Filter `Call: {Index: {eq: 0}}`. Every other row is an internal call. **Why is `Signature.Name` empty on some calls?** The ABI is not registered. The raw `Input` and the selector prefix are still there, so filter with `Input: {startsWith: ...}`, and ask support to register the ABI if you need decoded arguments. **Is `Call.Value` in USDC?** Yes. The gas token on Arc is USDC, so `Call.Value` and `Transaction.Value` are native USDC amounts. `ValueInUSD` also returned populated values in the launch-day check. **Does this replace `debug_traceTransaction`?** For call trees, yes: `CallPath`, `Depth`, `Index`, gas per call and revert reasons are all here. Opcode-level traces are not. **Can I read calls older than the realtime window?** Not yet. Only the realtime path answered on 16 September 2026. Retry `archive` and `combined` before using them. --- ## Arc DEX Trades API & Streams URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/ Query and stream Circle Arc trades with the Bitquery Trading cube. Get token prices, OHLCV, USD volume and wallet activity for the last 30 days. # Arc DEX Trades API & Streams Use **`Trading` for Arc trading queries and live streams**. `Trading.Trades` returns trades, USD amounts, token pairs and trader addresses. Use `Trading.Tokens` for token candles across pools and `Trading.Pairs` for prices from a chosen market. :::tip Choose by time range For live streams and trades within the last **30 days**, use the Trading cube. Filter trades with `Pair: {Market: {Network: {is: "Arc"}}}`. Use `EVM.DEXTrades` or `EVM.DEXTradeByTokens` only for trades **older than 30 days**, after confirming Arc archive availability. Trading has a rolling window; a newly indexed chain may have less than 30 days of data. ::: :::info Availability checked 16 September 2026 `Trading.Trades`, `Trading.Tokens` and `Trading.Pairs` return Arc data. Use the root `Trading` without `dataset: archive` or `dataset: combined`. Arc's EVM archive and combined datasets were unavailable at the launch-day check. ::: Open each example with its **Run in IDE** link. Where available, **Run stream** opens the subscription version. For your own app, [create an API access token](/docs/authorization/how-to-generate/) and send queries to `https://streaming.bitquery.io/graphql`. See [WebSocket authentication](/docs/authorization/websocket/) for streams. :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) - [Arc launchpad token launches and trades](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) - [Trading.Trades reference](/docs/trading/crypto-trades-api/trades-api/) - [Token candles](/docs/trading/crypto-price-api/tokens/) and [pair prices](/docs/trading/crypto-price-api/pairs/) - [Trading data and history](/docs/trading/trading-data-overview/) ::: **On this page:** [Identifiers](#network-and-example-addresses) · [Stream](#stream-real-time-trades) · [Latest](#latest-trades) · [By token](#trades-of-a-token) · [By DEX](#trades-on-one-dex) · [By pool](#trades-in-one-pool) · [By trader](#trades-of-a-wallet) · [OHLCV](#ohlcv-candles-for-a-token) · [Latest price](#latest-price-of-a-token) · [Top tokens](#most-traded-tokens) · [DEX breakdown](#trade-count-by-dex-protocol) · [Top traders](#most-active-traders) · [Older history](#trades-older-than-30-days) · [FAQ](#faq) ## Network and example addresses | Item | Trading field or value | | --- | --- | | Arc trades | `Pair.Market.Network: "Arc"` | | Arc pair candles | `Market.Network: "Arc"` | | Arc token candles | `Token.Network: "Arc"` | | Chain ID | `5042` | | Native USDC | `Token.Id: "bid:arc"`, empty `Token.Address` | | ERC-20 USDC | `bid:arc:0x3600000000000000000000000000000000000000` | | EURC example | `bid:arc:0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1` | | Uniswap v4 | `Pair.Market.Protocol: "uniswap_v4"` | | Uniswap v3 pool example | `Pair.Pool.Address: "0x01be77f0a364bddafd34521892ea4745ebf9b5a2"` | `Pair.Token` is the base token; `Pair.QuoteToken` is the quote token. `Side` is the trade direction for the base token. Token IDs include the chain prefix; use `Address` when filtering with a raw contract address. For a v4 pool, use `Pair.Pool.Id`. `Pair.Pool.Address` is the shared PoolManager, so it alone cannot select one v4 pool. On EVM, `Pair.Market.Address` describes the factory and should not be used as a pool filter. ## Stream real-time trades Subscribe to Arc trades with the Trading cube. The network filter is case-sensitive: use `Arc`. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-stream-real-time-trades) ```graphql subscription { Trading { Trades(where: {Pair: {Market: {Network: {is: "Arc"}}}}) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } Price PriceInUsd Pair { Market { Network Protocol ProtocolFamily } Pool { Address Id } Token { Id Address Symbol } QuoteToken { Id Address Symbol } } } } } ``` The feed can include NFT market fills. Add a protocol filter, as in [Trades on one DEX](#trades-on-one-dex), when you need a specific swap venue. Stream selections use no `limit` or `orderBy`. ## Latest trades Read the latest 20 Arc trade rows. `AmountsInUsd.Quote` gives the USD value of the quote side; use it for USD volume. `PriceInUsd` is the base token's reference USD price and may differ from the executed price during fast moves. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-latest-trades) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: {Pair: {Market: {Network: {is: "Arc"}}}} ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } Price PriceInUsd Pair { Market { Network Protocol } Pool { Address Id } Token { Id Symbol } QuoteToken { Id Symbol } } } } } ``` A transaction can produce several trade rows. Use `count(distinct: TransactionHeader_Hash)` for transaction counts. See the [Trades row notes](/docs/trading/crypto-trades-api/trades-api/#before-you-aggregate-three-things-about-a-trades-row) before reporting exact volumes or counts; duplicate rows can affect sums. ## Trades of a token Match EURC on either side of the pair. The returned amounts and `Side` still describe `Pair.Token`, so check whether EURC is the base or quote token on each row. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-trades-of-a-token) · [Run stream](https://ide.bitquery.io/arc-mainnet-trading-trades-trades-of-a-token-stream) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Pair: {Market: {Network: {is: "Arc"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}}}} ] } ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } Pair { Token { Id Symbol } QuoteToken { Id Symbol } Market { Network Protocol } } } } } ``` To stream this token, change the operation to `subscription` and remove `limit` and `orderBy`. ## Trades on one DEX Use `Pair.Market.Protocol` to select Uniswap v4 on Arc. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-trades-on-one-dex) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Pair: {Market: {Network: {is: "Arc"}, Protocol: {is: "uniswap_v4"}}} } ) { Block { Time } TransactionHeader { Hash } Side Amounts { Base Quote } AmountsInUsd { Quote } Pair { Market { Network Protocol } Pool { Address Id } Token { Id Symbol } QuoteToken { Id Symbol } } } } } ``` ## Trades in one pool Use `Pair.Pool.Address` for a v2 or v3 pool. This example uses the BUILDOG/USDC v3 pool observed at launch. For v4, replace the address filter with `Pool: {Id: {is: "YOUR_POOL_ID"}}`, using an ID from the live trade feed. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-trades-in-one-pool) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Pair: { Market: {Network: {is: "Arc"}} Pool: {Address: {is: "0x01be77f0a364bddafd34521892ea4745ebf9b5a2"}} } } ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } Pair { Pool { Address Id } Token { Id Symbol } QuoteToken { Id Symbol } } } } } ``` ## Trades of a wallet Filter with `Trader.Address`. Replace the sample address with the wallet you want to track. Use `TransactionHeader.Hash` to fetch its [transaction details](/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/), [calls](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/) or [logs](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) in a separate EVM query. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-trades-of-a-wallet) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Pair: {Market: {Network: {is: "Arc"}}} Trader: {Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}} } ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } Pair { Market { Network Protocol } Token { Id Symbol } QuoteToken { Id Symbol } } } } } ``` ## OHLCV candles for a token Use `Trading.Tokens` for hourly EURC candles across its markets. Duration is in seconds: `3600` is one hour, `300` is five minutes. Select one duration to avoid adding overlapping candle intervals. This query returns the newest 24 intervals within the last 24 hours; reverse the rows before plotting from oldest to newest. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-ohlcv-candles-for-a-token-v2) · [Run stream](https://ide.bitquery.io/arc-mainnet-trading-trades-ohlcv-candles-for-a-token-stream-v2) ```graphql { Trading { Tokens( limit: {count: 24} orderBy: {descending: Block_Time} where: { Token: { Network: {is: "Arc"} Address: {is: "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"} } Interval: {Time: {Duration: {eq: 3600}}} Block: {Time: {since_relative: {hours_ago: 24}}} Price: {IsQuotedInUsd: true} } ) { Token { Id Symbol Network } Interval { Time { Start End Duration } } Price { IsQuotedInUsd Ohlc { Open High Low Close } } Volume { Base Usd } } } } ``` Missing intervals may be absent, and the current candle can still change. Check the [Tokens field notes](/docs/trading/crypto-price-api/tokens/#field-notes) before treating every row as a unique candle. For a chart tied to one pool or quote token, use [Trading.Pairs](/docs/trading/crypto-price-api/pairs/) with `Market.Network: "Arc"` and the desired pool or quote-token filter. To stream candle updates, use `subscription` and remove `limit`, `orderBy`, and the historical `Block.Time` filter. The stream sends updates after connection; fetch earlier candles with the HTTP query. ## Latest price of a token Query `Trading.Pairs` with rank 1 for EURC's price from its top market. `Price.Ohlc.Close` is the closing USD price of the returned one-minute interval. Check `Interval.Time.End`: a quiet top market can return a stale interval or no row within the last 24 hours. Widen the time window or use `Trading.Tokens` to check other indexed markets. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-latest-price-of-a-token-v2) · [Run stream](https://ide.bitquery.io/arc-mainnet-trading-trades-latest-price-of-a-token-stream-v2) ```graphql { Trading { Pairs( limit: {count: 1} orderBy: {descending: Block_Time} where: { Market: {Network: {is: "Arc"}} Token: {Address: {is: "0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1"}} Ranking: {Position: {eq: 1}} Interval: {Time: {Duration: {eq: 60}}} Block: {Time: {since_relative: {hours_ago: 24}}} Price: {IsQuotedInUsd: true} } ) { Block { Time } Token { Id Symbol } QuoteToken { Id Symbol } Market { Network Protocol } Pool { Address Id } Interval { Time { Start End Duration } } Price { IsQuotedInUsd Ohlc { Close } } Ranking { Position Weight } Volume { Usd } } } } ``` For the saved price stream, remove `limit`, `orderBy`, and the historical `Block.Time` filter. Keep the token, network, interval, USD and rank filters. The top market can change as trading moves between pools. ## Most traded tokens Rank base tokens by trade-row count over the last 24 hours. These are base-token totals: quote-token activity is not grouped into the same token row. USD volume uses the quote side of each trade. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-most-traded-tokens) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descendingByField: "trade_rows"} where: { Pair: {Market: {Network: {is: "Arc"}}} Block: {Time: {since_relative: {hours_ago: 24}}} } ) { Pair { Token { Id Symbol } } trade_rows: count transactions: count(distinct: TransactionHeader_Hash) traders: count(distinct: Trader_Address) volume_usd: sum(of: AmountsInUsd_Quote) } } } ``` ## Trade count by DEX protocol Compare protocols by trade-row count and USD volume over the last 24 hours. The network-wide result may also include NFT protocols; filter `Pair.Market.ProtocolFamily` to narrow the comparison. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-trade-count-by-dex-protocol) ```graphql { Trading { Trades( limit: {count: 10} orderBy: {descendingByField: "trade_rows"} where: { Pair: {Market: {Network: {is: "Arc"}}} Block: {Time: {since_relative: {hours_ago: 24}}} } ) { Pair { Market { Network Protocol ProtocolFamily } } trade_rows: count traders: count(distinct: Trader_Address) volume_usd: sum(of: AmountsInUsd_Quote) } } } ``` ## Most active traders Rank trader addresses by trade-row count. The same wallet can send several swaps in a single transaction, so the query also returns a distinct transaction count. A wallet address can belong to a bot or router. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-trades-most-active-traders) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descendingByField: "trade_rows"} where: { Pair: {Market: {Network: {is: "Arc"}}} Block: {Time: {since_relative: {hours_ago: 24}}} } ) { Trader { Address } trade_rows: count transactions: count(distinct: TransactionHeader_Hash) base_tokens: count(distinct: Pair_Token_Id) volume_usd: sum(of: AmountsInUsd_Quote) } } } ``` ## Trades older than 30 days Use chain-level `EVM(network: arc)` trade cubes only when the requested trades are older than the Trading window. Choose [`DEXTrades`](/docs/schema/evm/dextrades/) for swaps or [`DEXTradeByTokens`](/docs/cubes/dextradesbyTokens/) for token-based history. For a range that crosses the 30-day cutoff, query recent trades through Trading and older trades through EVM, then join the results in your app. Set the cutoff once in UTC and avoid counting its boundary twice; Trading time bounds are inclusive. The cubes have different row shapes, so do not add their raw row counts as if they were the same measure. Arc's `dataset: archive` and `dataset: combined` did not answer at the 16 September 2026 check. Confirm support and the date range before using either mode. The [Arc history check](/docs/blockchain/arc-mainnet/#datasets) explains the launch-day limits. Do not send archive or combined arguments to `Trading`. ## FAQ **Which cube should I use for Arc trading streams?** Use `Trading.Trades` with `Pair.Market.Network` set to `Arc`. Use `Trading.Tokens` or `Trading.Pairs` for candle and price streams. **When should I use `DEXTrades` or `DEXTradeByTokens`?** Only for trades older than 30 days, subject to Arc archive support. Query EVM events, calls, transfers and transactions separately when you need those types of data. **Which fields give USD prices and volume?** `Trading.Trades` uses `PriceInUsd` and `AmountsInUsd.Quote`. Candle cubes use `Price.Ohlc` and `Volume.Usd`. Field names are case-sensitive. **Does Arc already have 30 days of Trading history?** The Trading cube's window is about 30 days, but Arc's available history depends on when indexing began. A rolling limit does not guarantee a full 30 days for a newly indexed chain. **How do I identify native USDC?** In Trading, native USDC has ID `bid:arc` and an empty address. ERC-20 USDC has ID `bid:arc:0x3600000000000000000000000000000000000000`. In EVM transfer and balance cubes, use `Currency.Native: true` for native USDC. --- ## Arc Events API & WebSocket Streams URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-events-api/ Query and stream Arc smart contract events with Bitquery GraphQL, including decoded logs, topics, arguments and new Uniswap pool events in real time. # Arc Events API & WebSocket Streams Stream **every smart contract event on Arc** with Bitquery GraphQL. The `EVM.Events` cube on `network: arc` returns each log with decoded, typed arguments for known signatures, the raw topics, and the transaction, internal call and receipt that produced it. It covers what `eth_getLogs` and `eth_subscribe("logs")` return, and adds server-side filtering on decoded values. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::info Availability checked 16 September 2026 The realtime path and USD fields returned live data. Leave the `dataset` argument out until `combined` and `archive` are enabled. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) — network facts, every cube and stream in one place - [Arc Calls API](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/) - [Arc DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) - [Arc Transfers API](/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/) - [EVM Events schema](/docs/schema/evm/events/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) ::: **On this page:** [Event anatomy](#what-one-event-row-contains) · [Firehose](#stream-all-events) · [By contract](#events-from-one-contract) · [By signature](#one-event-across-all-contracts) · [By topic0](#filter-by-raw-topic0) · [By argument](#filter-by-a-decoded-argument) · [New v4 pools](#new-uniswap-v4-pools) · [New v3 and v2 pools](#new-uniswap-v3-and-v2-pools) · [Busiest contracts](#busiest-contracts-and-signatures) · [Undecoded events](#undecoded-events) · [FAQ](#faq) --- ## What one event row contains | Group | What it gives you | | --- | --- | | `Log` | `SmartContract` (the code that produced the log), log `Index`, and `Signature` (`Name`, full `Signature`, `SignatureHash`) | | `LogHeader` | `Address`, the emitting address as `eth_getLogs` would return it | | `Topics` | The raw indexed topics; topic0 is the signature hash | | `Arguments` | Decoded, typed values (`address`, `bigInteger`, `string`, `hex`, `bool`, `integer`) with names | | `Transaction` | Hash, `From`, `To`, value, gas and fee fields | | `Call` | The internal call that emitted the log, with its signature and success flags | | `Receipt` | `GasUsed`, `CumulativeGasUsed`, deployed `ContractAddress` | | `Block` | `Number`, `Time` | Hash fields (`SignatureHash`, `Topics.Hash`) are hex strings **without** a `0x` prefix. ### Example addresses on this page | Item | Address | | --- | --- | | Uniswap v4 PoolManager | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | | Uniswap v3 factory seen at launch | `0xf0db7b58379503491d857db50ac9ece64c653918` | | Uniswap v2 factory seen at launch | `0x89e5db8b5aa49aa85ac63f691524311aeb649eba` | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | | EURC | `0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1` | --- ## Stream all events ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-stream-all-events) One socket, every event on the chain. Good for building an indexer; heavy for anything else, so use the filtered streams below in production. ```graphql subscription { EVM(network: arc) { Events { Block { Number Time } Transaction { Hash From To } LogHeader { Address } Log { Index Signature { Name Signature SignatureHash } } Topics { Hash } Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` --- ## Events from one contract ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-events-from-a-contract) `LogHeader.Address` is the `address` filter of `eth_getLogs`. This reads the latest events of the ERC-20 USDC contract. ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { LogHeader: {Address: {is: "0x3600000000000000000000000000000000000000"}} } ) { Block { Time } Transaction { Hash } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## One event across all contracts ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-swap-events) Filter by decoded signature name to watch one event type from every contract that emits it. This catches every `Swap`, from Uniswap v2 pairs, v3 pools and the v4 PoolManager alike. ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: {Log: {Signature: {Name: {is: "Swap"}}}} ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } } } } } } ``` --- ## Filter by raw topic0 ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-events-by-topic0) When you have the signature hash rather than the name, filter on `Log.Signature.SignatureHash`. This is the ERC-20 `Transfer(address,address,uint256)` hash, written without `0x`. ```graphql { EVM(network: arc) { Events( limit: {count: 10} orderBy: {descending: Block_Time} where: { Log: { Signature: { SignatureHash: {is: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"} } } } ) { Block { Time } Transaction { Hash } LogHeader { Address } Topics { Hash } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## Filter by a decoded argument ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-events-by-argument) Server-side filtering on decoded values is what a node cannot do. This finds every event whose argument named `to` equals a wallet, across all contracts and signatures. ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Arguments: { includes: { Name: {is: "to"} Value: {Address: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}} } } } ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## New Uniswap v4 pools ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-new-uniswap-v4-pools) Uniswap v4 carried most launch-day swaps. A new pool is an `Initialize` event on the PoolManager; its arguments give the pool `id`, the two currencies, the fee tier, tick spacing, hook address and opening price. ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { LogHeader: {Address: {is: "0x8366a39cc670b4001a1121b8f6a443a643e40951"}} Log: {Signature: {Name: {is: "Initialize"}}} } ) { Block { Time Number } Transaction { Hash From } Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Bytes_Value_Arg { hex } } } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to get each new pool the moment it is created. --- ## New Uniswap v3 and v2 pools ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-new-v3-v2-pools) Several v3 and v2 factory deployments appeared on Arc, so filter on the event name rather than one factory address. `PoolCreated` is v3, `PairCreated` is v2; both carry the two tokens and the new pool address in their arguments. ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: {Log: {Signature: {Name: {in: ["PoolCreated", "PairCreated"]}}}} ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Integer_Value_Arg { integer } } } } } } ``` --- ## Busiest contracts and signatures ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-busiest-event-contracts) Which contracts and event types dominate the log stream over 24 hours. Run this first on any network you have not explored yet. ```graphql { EVM(network: arc) { contracts: Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { LogHeader { Address } count } signatures: Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Log { Signature { Name Signature } } count } } } ``` --- ## Undecoded events ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-undecoded-events) Events whose ABI is not registered arrive with an empty `Signature.Name` and no `Arguments`, but the raw `Topics` and `Log.SmartContract` are still there. This lists the contracts emitting the most undecoded events; if one matters to you, ask support to register its ABI. ```graphql { EVM(network: arc) { Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Log: {Signature: {Name: {is: ""}}} } ) { LogHeader { Address } Topics { Hash } count } } } ``` --- ## FAQ **How do I map my `eth_getLogs` filter?** `address` becomes `LogHeader.Address`, `topics[0]` becomes `Log.Signature.SignatureHash` (without `0x`), and a fixed block range becomes a `Block.Number` filter. Everything else on this page is extra: decoded arguments, argument filters and joined transaction context. **`LogHeader.Address` or `Log.SmartContract`?** `LogHeader.Address` is the emitting address. `Log.SmartContract` is the code that produced the log, which differs behind proxies. Filter on `LogHeader.Address` to watch a deployed address. **Why do some events have an empty name?** Their ABI is not registered yet. The raw topics and data are still delivered. See [Undecoded events](#undecoded-events). **Can I get history beyond the realtime window?** Not yet. Only the realtime path answered on 16 September 2026. Retry `archive` and `combined` before using them. **How do I follow one Uniswap v4 pool?** Take the pool `id` from its `Initialize` event and filter `Swap` events on the PoolManager whose first argument (`id`) matches it, using the [argument filter](#filter-by-a-decoded-argument) with `Value: {Bytes: ...}`, or read the pool's trades through the [DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) by its two currencies. --- ## Arc Launchpads API & Streams URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/ Find and stream token launches from verified Arc launchpads with Bitquery GraphQL, then query trades, prices and OHLCV for each launched token. # Arc Launchpads API & Streams Find and stream **new token launches on Arc**, then follow each token into its first trades. Use `EVM.Events` for launch events, `Trading.Trades` for recent trades and live streams, and `Trading.Tokens` for prices and candles. This page covers six launchpads whose own sites publish Arc contracts or contract interfaces and whose launch events were found through Bitquery: [Argus](https://argus.world/docs), [RadarDEX](https://www.radardex.pro/), [Tolly](https://tollylabs.com/guide), [Warp](https://circlewarp.fun/), [Archemist](https://archemist.fun/docs), and [PEGD](https://pegd.fun/docs). Every query on this page was executed against the production endpoint before publishing. For platform-specific launch feeds and Trading cube examples, use the [Argus Launchpad API](/docs/blockchain/arc-mainnet/argus-launchpad-api/), [Tolly Launchpad API](/docs/blockchain/arc-mainnet/tolly-launchpad-api/) and [RadarDEX Launchpad API](/docs/blockchain/arc-mainnet/radardex-launchpad-api/). For Minara.fun, use the separate [Minara Launchpad API](/docs/blockchain/arc-mainnet/minara-launchpad-api/). It includes verified strategy and fee-hook contracts, token/pool/creator checks, and Trading cube examples. Minara is outside the six-platform queries below. :::info Availability checked 16 September 2026 The realtime path returned live launch events and trades. Leave the `dataset` argument out until `combined` and `archive` are enabled for Arc. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) - [Arc DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) - [Arc Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) - [EVM Events schema](/docs/schema/evm/events/) - [Trading.Trades reference](/docs/trading/crypto-trades-api/trades-api/) - [Trading token candles](/docs/trading/crypto-price-api/tokens/) ::: **On this page:** [Launchpad contracts](#verified-launchpad-contracts) · [Event topics](#read-the-launched-token-address) · [Stream launches](#stream-launches) · [Latest launches](#latest-launches) · [Launch counts](#launch-count-by-platform) · [Token trades](#trades-for-a-launched-token) · [OHLCV](#ohlcv-for-a-launched-token) --- ## Verified launchpad contracts The contract and event pair is the stable ID for each launchpad. Display names can change; contracts and event hashes do not. | Launchpad | Arc launch contract | Launch event | Signature hash | | --- | --- | --- | --- | | Argus | `0xb021be536808f551b31789422fd28a6c9c6e97da` | `TokenCreated` | `1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a` | | RadarDEX Classic | `0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a` | `TokenLaunched` | `851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66` | | RadarDEX Reflection | `0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8` | `TokenLaunched` | `851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66` | | Tolly | `0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b` | `TokenCreated` | `875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255` | | Warp | `0x0dcad158e98bc24455f9e94f46709d8a5f6d1255` | `TokenCreated` | `0b4cfda446fdf9ec5a85855f088c154869eb62e3e723d7d80319b680f90e0cfd` | | Archemist V2 | `0x297cebc4de347347205cd08667b56ee951dd8810` | `TokenCreated` | `8e83c293b82cf6e864a90c1ccffea5e0f1ec23b271eff78e78f1dbd5e32a9c7d` | | PEGD V4 | `0xd0aa679ec263e8f9bc929426eb9eab2e061d2c5f` | `KeyLaunched` | `4b5a1abdb5ebec3e01fa29e6e1f5e3095f8b3cfaed9ffcd46ad35e7ebc58039e` | Sources: [Argus contract reference](https://github.com/arguspad/argus-world), [RadarDEX launch page](https://www.radardex.pro/), [Tolly guide](https://tollylabs.com/guide), [Warp contracts](https://circlewarp.fun/), [Archemist protocol reference](https://archemist.fun/docs), and [PEGD developer API](https://pegd.fun/docs#developer-api). The table lists current contracts observed on 17 September 2026. Keep old addresses in your index if you need launches from earlier contract versions. Launches are concentrated. In a sample hour on 17 September 2026, Argus emitted 2,983 launch events against 10 from Tolly and 2 from Archemist; the [launch count query](#launch-count-by-platform) reproduces this split for any window, and it is the figure to trust over any count quoted here, since the chain keeps moving. Argus also runs older and forked deployments that emit the same hash, including `0xa5628a11c412596e1f63b75a2c0284f843c549d6` and `0x629c9592c88788b6b31e377e34f7884de9d81ffd`. The portal in the table carried 99.9% of all launches recorded against that hash on both 17 and 18 September 2026, so filtering on it alone is enough for almost every use. Add the others to the address list only if you need those rows. --- ## Read the launched token address Bitquery exposes the raw indexed values in `Topics`: - `Topics[0]` is the event signature hash. - For Argus, RadarDEX, Tolly, Warp, and Archemist, `Topics[1]` contains the launched token address. - For PEGD, `Topics[2]` contains the launched token address; `Topics[1]` is the launch ID. - The address is left-padded to 32 bytes. Take its final 40 hex characters and add `0x`. For example, this topic: ```text 00000000000000000000000091dbd2d6cfe189bea443a9aaab5019d432f7fd99 ``` maps to this token: ```text 0x91dbd2d6cfe189bea443a9aaab5019d432f7fd99 ``` Custom launch events may have an empty decoded `Name`. Filter on `SignatureHash` and read `Topics`; both are present even when the ABI is not in the decoder. --- ## Stream launches Change nothing else to receive launches from all six platforms over one WebSocket. Add or remove contract and signature pairs as launchpads deploy new versions. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-launchpads-stream-launches) ```graphql subscription { EVM(network: arc) { Events( where: { LogHeader: { Address: { in: [ "0xb021be536808f551b31789422fd28a6c9c6e97da" "0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a" "0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8" "0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b" "0x0dcad158e98bc24455f9e94f46709d8a5f6d1255" "0x297cebc4de347347205cd08667b56ee951dd8810" "0xd0aa679ec263e8f9bc929426eb9eab2e061d2c5f" ] } } Log: { Signature: { SignatureHash: { in: [ "1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a" "851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66" "875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255" "0b4cfda446fdf9ec5a85855f088c154869eb62e3e723d7d80319b680f90e0cfd" "8e83c293b82cf6e864a90c1ccffea5e0f1ec23b271eff78e78f1dbd5e32a9c7d" "4b5a1abdb5ebec3e01fa29e6e1f5e3095f8b3cfaed9ffcd46ad35e7ebc58039e" ] } } } } ) { Block { Number Time } Transaction { Hash From } LogHeader { Address } Log { Signature { SignatureHash } } Topics { Hash } } } } ``` Map `LogHeader.Address` to the contract table to name the launchpad. --- ## Latest launches Use the same filters with `query`, a row limit, and descending block time to fetch the newest launches. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-launchpads-latest-launches) ```graphql { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { LogHeader: { Address: { in: [ "0xb021be536808f551b31789422fd28a6c9c6e97da" "0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a" "0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8" "0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b" "0x0dcad158e98bc24455f9e94f46709d8a5f6d1255" "0x297cebc4de347347205cd08667b56ee951dd8810" "0xd0aa679ec263e8f9bc929426eb9eab2e061d2c5f" ] } } Log: { Signature: { SignatureHash: { in: [ "1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a" "851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66" "875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255" "0b4cfda446fdf9ec5a85855f088c154869eb62e3e723d7d80319b680f90e0cfd" "8e83c293b82cf6e864a90c1ccffea5e0f1ec23b271eff78e78f1dbd5e32a9c7d" "4b5a1abdb5ebec3e01fa29e6e1f5e3095f8b3cfaed9ffcd46ad35e7ebc58039e" ] } } } } ) { Block { Number Time } Transaction { Hash From } LogHeader { Address } Log { Signature { SignatureHash } } Topics { Hash } } } } ``` --- ## Launch count by platform Group launch events by emitting contract to compare activity during the last hour. The result uses contract addresses, so map them to the table above in your app. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-docs-launchpads-launch-count-by-platform) ```graphql { EVM(network: arc) { Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 1}}} LogHeader: { Address: { in: [ "0xb021be536808f551b31789422fd28a6c9c6e97da" "0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a" "0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8" "0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b" "0x0dcad158e98bc24455f9e94f46709d8a5f6d1255" "0x297cebc4de347347205cd08667b56ee951dd8810" "0xd0aa679ec263e8f9bc929426eb9eab2e061d2c5f" ] } } Log: { Signature: { SignatureHash: { in: [ "1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a" "851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66" "875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255" "0b4cfda446fdf9ec5a85855f088c154869eb62e3e723d7d80319b680f90e0cfd" "8e83c293b82cf6e864a90c1ccffea5e0f1ec23b271eff78e78f1dbd5e32a9c7d" "4b5a1abdb5ebec3e01fa29e6e1f5e3095f8b3cfaed9ffcd46ad35e7ebc58039e" ] } } } } ) { LogHeader { Address } count } } } ``` --- ## Trades for a launched token Read the token address from the [launch event topics](#read-the-launched-token-address), then use it in `Trading.Trades`. Most listed launchpads put the address in `Topics[1]`; PEGD uses `Topics[2]`. Match both `Pair.Token` and `Pair.QuoteToken` to catch the token on either side of the pair. This example follows DUKE, launched through Argus. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-launchpads-trades-for-a-launched-token) · [Run stream](https://ide.bitquery.io/arc-mainnet-trading-launchpads-trades-for-a-launched-token-stream) ```graphql { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Pair: {Market: {Network: {is: "Arc"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0x41358defd0dedc90528b3f1835715e907b686e6a"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0x41358defd0dedc90528b3f1835715e907b686e6a"}}}} ] } ) { Block { Time } TransactionHeader { Hash } Trader { Address } Side Amounts { Base Quote } AmountsInUsd { Quote } PriceInUsd Pair { Token { Id Address Symbol } QuoteToken { Id Address Symbol } Market { Network Protocol } Pool { Address Id } } } } } ``` Change `{` to `subscription {` to receive the same trades live. :::caution Example tokens go quiet Launched tokens stop trading quickly. An empty list means this token has gone quiet, not that the query is wrong — take a current address from [Latest launches](#latest-launches). ::: ## OHLCV for a launched token `Trading.Tokens` returns USD candles across the token's markets. `Volume.Usd` is USD volume and `Volume.Base` is token volume. The candle cube carries no trade count, so use `Trading.Trades` when you need one. ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-trading-launchpads-ohlcv-for-a-launched-token) · [Run stream](https://ide.bitquery.io/arc-mainnet-trading-launchpads-ohlcv-for-a-launched-token-stream) ```graphql { Trading { Tokens( limit: {count: 12} orderBy: {descending: Block_Time} where: { Token: { Network: {is: "Arc"} Address: {is: "0x41358defd0dedc90528b3f1835715e907b686e6a"} } Interval: {Time: {Duration: {eq: 300}}} Block: {Time: {since_relative: {hours_ago: 24}}} } ) { Token { Id Symbol Network } Interval { Time { Start End Duration } } Price { Ohlc { Open High Low Close } } Volume { Base Usd } } } } ``` Some launchpads create Uniswap v3 pools, while others use v4 or a bonding curve before moving liquidity. Keeping the token filter on `Trading` follows the token across those routes. Use `EVM.DEXTrades` or `EVM.DEXTradeByTokens` only for history older than 30 days, after confirming Arc archive support. --- ## Arc Testnet API: Circle's Stablecoin L1 via GraphQL, WebSocket and Kafka URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/ Arc testnet API (chain ID 5042002): trades, transfers, balances, events, calls, transactions and blocks on Circle's USDC-gas Layer 1 via Bitquery GraphQL, WebSocket streams and Kafka topics. # Arc Testnet API: Circle's Stablecoin L1 via GraphQL, WebSocket and Kafka :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet API](/docs/blockchain/arc-mainnet/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: **Arc** is Circle's EVM-compatible Layer 1 built for stablecoin finance: **USDC is the native gas token**, blocks finalize in well under a second on the Malachite BFT consensus, and the chain carries USDC, EURC and a growing set of DeFi deployments led by Uniswap v4. Bitquery indexes the **Arc testnet** as `EVM(network: arc_testnet)` and publishes it as Kafka topics under `arc-testnet.*`, so you can test before deploying the same queries to mainnet, Ethereum, Base or Robinhood Chain. This page is the map. Use it to pick the cube that answers your question, then jump to the linked guide. :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: --- ## Arc testnet at a glance {#network-facts} | Property | Value | | --- | --- | | Bitquery network name | `arc_testnet` in `EVM(network: arc_testnet)` | | Kafka topic prefix | `arc-testnet.` | | Chain ID | `5042002` | | Stack | EVM, Circle Arc Layer 1, Malachite BFT consensus | | Gas token | USDC, tracked as `Currency.Native: true` | | USDC (ERC-20 interface, 6 decimals) | `0x3600000000000000000000000000000000000000` | | EURC (6 decimals) | `0x89b50855aa3be2f677cd6303cec089b5f319d72a` | | Uniswap v4 PoolManager | `0x1d70945634f618eefdf9edaadb59b9a183cef929` | | Public explorer | [testnet.arcscan.app](https://testnet.arcscan.app). Bitquery is an indexed data API, not an explorer or an RPC node | | GraphQL endpoint | `https://streaming.bitquery.io/graphql` for queries and subscriptions | --- ## What is different on a testnet {#testnet-limits} Arc testnet is indexed with the same EVM schema as every other chain, with four differences you should know before writing queries. | Difference | What it means for your query | | --- | --- | | **USD values are 0** | Every `...InUSD` field (`AmountInUSD`, `PriceInUSD`, `ValueInUSD`, `CostInUSD`) returns 0. There is no token price index on a testnet. Native prices such as `Trade.Price` work, and since most pairs quote in USDC they are effectively dollar prices. | | **Realtime dataset only** | There is no archive for the testnet. Leave the `dataset` argument out; `archive` and `combined` return errors. The realtime window is a rolling range of recent blocks; measure it with `Block { Time(minimum: Block_Time) }`. | | **No `Trading` cubes** | `Trading.Trades`, `Tokens` and `Pairs` cover mainnet chains with USD pricing. Use the chain-level `DEXTrades` and `DEXTradeByTokens` cubes. | | **Some cubes are unavailable** | `Holders` needs the archive and is not served. `DEXPoolEvents` and `DEXPoolSlippages` have no data yet. `Balances` and `TransactionBalances` work. | Arc **mainnet** is indexed with USD pricing, the `Trading` cubes and the `Holders` cube. Use the [Arc Mainnet API](/docs/blockchain/arc-mainnet/) for production data. Its `archive` and `combined` datasets are not enabled yet. --- ## Quick start: stream every swap on Arc testnet {#quick-start} Paste this into the [Bitquery IDE](https://ide.bitquery.io) to watch the network trade in real time. Uniswap v4 carries most of the volume, with v3, v2, Curve and Aerodrome deployments behind it. ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-dex-trades) ```graphql subscription { EVM(network: arc_testnet) { DEXTrades { Block { Number Time } Transaction { Hash From } Trade { Dex { ProtocolFamily ProtocolName SmartContract } Buy { Amount Buyer Seller Price Currency { Name Symbol SmartContract } } Sell { Amount Buyer Seller Price Currency { Name Symbol SmartContract } } } } } } ``` Change `subscription` to `query`, add `limit: {count: 10}` and `orderBy: {descending: Block_Time}`, and the same selection set returns the latest trades instead. OHLCV candles, token prices, top tokens and trader activity are on the [Arc Testnet DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api) page. --- ## Pick the right API {#pick-the-right-api} | What you want | Use this | Guide | | --- | --- | --- | | Live swaps, OHLCV, token prices, top tokens, DEX breakdown, trader activity | `DEXTrades`, `DEXTradeByTokens` | [Arc Testnet DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api) | | Who sent what to whom, wallet ledgers, large transfers, most-transferred tokens | `Transfers` | [Arc Testnet Transfers API](/docs/blockchain/arc-testnet/arc-testnet-transfers-api) | | Any decoded contract event, new Uniswap v4/v3/v2 pools, an `eth_getLogs` replacement | `Events` | [Arc Testnet Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api) | | Method calls, internal traces, contract deployments, reverts | `Calls` | [Arc Testnet Calls & Traces API](/docs/blockchain/arc-testnet/arc-testnet-calls-api) | | Transactions, receipts, blocks, USDC gas fees | `Transactions`, `Blocks` | [Arc Testnet Transactions, Blocks & Fees API](/docs/blockchain/arc-testnet/arc-testnet-transactions-api) | | A wallet's portfolio, balance history, active holders, token total supply | `Balances`, `TransactionBalances` | [Arc Testnet Balances & Token Supply API](/docs/blockchain/arc-testnet/arc-testnet-balances-api) | --- ## USDC on Arc: native and ERC-20 {#usdc} USDC is both the gas token and an ERC-20 on Arc, and Bitquery tracks the two as separate currencies. | Form | How it appears | Decimals | | --- | --- | --- | | Native USDC | `Currency.Native: true` with `SmartContract: "0x"` in `Transfers` and `Balances`; the zero address with name `USD Coin` in `DEXTrades` and `DEXTradeByTokens` | 18 | | ERC-20 USDC | `SmartContract: "0x3600000000000000000000000000000000000000"`, symbol `USDC` | 6 | | System ledger | `0xfffffffffffffffffffffffffffffffffffffffe`, no symbol, raw 18-decimal integers mirroring native movements | 0 | Filter on `Native: true` for gas-token value transfers and on the `0x3600...` contract for the ERC-20 interface. Exclude the system ledger from token rankings. Transaction fees are in native USDC, so `Fee.SenderFee` on the [Transactions API](/docs/blockchain/arc-testnet/arc-testnet-transactions-api#gas-fees-in-usdc) is already a dollar figure. --- ## DEXes on Arc testnet {#dexes} | Protocol | `Dex.ProtocolName` | Notes | | --- | --- | --- | | Uniswap v4 | `uniswap_v4` | Most swaps on the testnet. Pools live in the PoolManager singleton, so `Dex.SmartContract` is `0x1d70945634f618eefdf9edaadb59b9a183cef929` and new pools are `Initialize` events. | | Uniswap v3 | `uniswap_v3` | Several factory deployments; `Dex.SmartContract` is the pool. | | Uniswap v2 | `uniswap_v2` | Several factory deployments; `Dex.SmartContract` is the pair. | | Curve | `curve_v1` | Stablecoin pools. | | Aerodrome | `aerodrome_v1` | Light activity. | The [DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api#trade-count-by-dex-protocol) has a live breakdown by protocol, and the [Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api#new-uniswap-v4-pools) streams new pools as they are created. --- ## Real-time streams: WebSocket and Kafka {#streaming} - **WebSocket.** Every query on every page above runs as a subscription: swap `query` for `subscription` and keep the same selection set. See [WebSocket subscriptions](/docs/subscriptions/websockets/) and [authorizing a WebSocket connection](/docs/authorization/websocket/). - **Kafka.** For firehose-scale workloads, Arc testnet is published as protobuf topics under the `arc-testnet.` prefix: `arc-testnet.transactions.proto` (transactions, calls, events), `arc-testnet.tokens.proto` (transfers, balances), `arc-testnet.dextrades.proto` (DEX trades) and `arc-testnet.raw.proto` (raw blocks). The message schemas are the same as every other EVM chain; USD fields in the messages are 0 on the testnet. See [Kafka streaming concepts](/docs/streams/kafka-streaming-concepts/) and the [EVM protobuf streams](/docs/streams/protobuf/chains/EVM-protobuf/). --- ## Datasets and history {#datasets} Only the **`realtime`** dataset exists for Arc testnet. It holds a rolling window of recent blocks, and its depth is not fixed, so measure it before relying on a time range: ```graphql { EVM(network: arc_testnet) { Blocks { count earliest: Block { Time(minimum: Block_Time) } latest: Block { Time(maximum: Block_Time) } } } } ``` `dataset: archive` and `dataset: combined` return errors on the testnet. Arc mainnet serves the `Holders` cube, but its `archive` and `combined` datasets are not enabled yet. --- --- ## Arc Testnet Balances & Token Supply API URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-balances-api/ Query wallet balances, balance history and token total supply on Circle's Arc testnet with Bitquery GraphQL: full portfolios, multi-wallet batches, per-token balance changes and TransactionBalances supply. # Arc Testnet Balances & Token Supply API :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet Balances & Token Supply API](/docs/blockchain/arc-mainnet/arc-mainnet-balances-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Query **wallet balances and token supply on Arc testnet** with Bitquery GraphQL. Two cubes on `network: arc_testnet` cover it: | Cube | What it returns | | --- | --- | | `Balances` | Computed current balance per address and currency, with first and last change time and update count | | `TransactionBalances` | Per-transaction pre- and post-balances, and the token's `TotalSupply` | For the net flow over a time window, the page also uses `Transfers`. Every query on this page was executed against the production endpoint before publishing. :::warning Testnet limits - `...InUSD` fields are **0**. Value holdings with the [latest price query](/docs/blockchain/arc-testnet/arc-testnet-trades-api/#latest-price-of-a-token) if you need a dollar figure. - Only `dataset: realtime` exists; leave the `dataset` argument out. - The token-centric **`Holders`** cube is not available on Arc testnet because it is served from the archive dataset. Rank `Balances` rows by amount, as in [top holders of a token](#top-holders-of-a-token), for holder rankings within the realtime window. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet Transfers API](/docs/blockchain/arc-testnet/arc-testnet-transfers-api/) - [Arc Testnet DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api/) - [EVM Balances schema](/docs/schema/evm/balances/) - [EVM Token Supply API](/docs/blockchain/Ethereum/token-supply/evm-token-supply/) ::: **On this page:** [Portfolio](#portfolio-of-a-wallet) · [One token](#balance-of-one-token) · [Batch](#balances-of-several-wallets) · [Top holders](#top-holders-of-a-token) · [History](#balance-history-of-a-wallet) · [Stream](#stream-balance-changes) · [Supply](#total-supply-of-a-token) · [Supply stream](#stream-supply-changes) · [FAQ](#faq) --- ## Portfolio of a wallet ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-wallet-portfolio) Every currency an address holds, with the computed balance and when it last changed. Native USDC has `Native: true`; the ERC-20 interface at `0x3600...` is listed separately. ```graphql { EVM(network: arc_testnet) { Balances( where: {Balance: {Address: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} orderBy: {descending: Balance_Amount} ) { Currency { Name Symbol SmartContract Native } Balance { Amount FirstChangeTime LastChangeTime UpdateCount } } } } ``` --- ## Balance of one token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-balance-of-one-token) The `balanceOf` equivalent for ERC-20 USDC. For the gas token use `Currency: {Native: true}` instead of a contract filter. ```graphql { EVM(network: arc_testnet) { Balances( where: { Balance: {Address: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}} Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } ) { Currency { Symbol Decimals } Balance { Amount LastChangeTime } } } } ``` --- ## Balances of several wallets ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-balances-of-several-wallets) One call for a batch of addresses, grouped by address and currency. ```graphql { EVM(network: arc_testnet) { Balances( where: { Balance: { Address: { in: [ "0x2de8906a641d65d490bc60a4179d961d59742bcb" "0x73742278c31a76dbb0d2587d03ef92e6e2141023" "0x49f9636fe15883e16d5e356a4ea08c9fe6bc219b" ] } } Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } orderBy: {descending: Balance_Amount} ) { Balance { Address Amount } Currency { Symbol } } } } ``` --- ## Top holders of a token Addresses ranked by their current balance of one token, from `Balances`. On the testnet this covers balances inside the realtime window rather than a full-chain snapshot, so treat it as a leaderboard of active holders. The top row is usually the Uniswap v4 PoolManager, which holds pool reserves. ```graphql { EVM(network: arc_testnet) { Balances( where: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} } orderBy: {descending: Balance_Amount} limit: {count: 20} ) { Balance { Address Amount(selectWhere: {gt: "0"}) UpdateCount LastChangeTime } Currency { Symbol } } } } ``` --- ## Balance history of a wallet Each change to a wallet's ERC-20 USDC balance, newest first, with the transaction behind it. `TransactionBalances` gives the balance before (`PreBalance`) and after (`PostBalance`) each transaction. ```graphql { EVM(network: arc_testnet) { TransactionBalances( limit: {count: 20} orderBy: {descending: Block_Time} where: { TokenBalance: { Address: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"} Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } } ) { Block { Number Time } Transaction { Hash } TokenBalance { PreBalance PostBalance Currency { Symbol } } } } } ``` ### Net change per currency over a window Sum the wallet's transfers per currency to see what it gained or lost over the last 24 hours. `inflow` counts transfers received, `outflow` counts transfers sent. ```graphql { EVM(network: arc_testnet) { Transfers( where: { any: [ {Transfer: {Sender: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} {Transfer: {Receiver: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} ] Block: {Time: {since_relative: {hours_ago: 24}}} } orderBy: {descendingByField: "transfers"} ) { Transfer { Currency { Symbol SmartContract Native } } inflow: sum(of: Transfer_Amount, if: {Transfer: {Receiver: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}}) outflow: sum(of: Transfer_Amount, if: {Transfer: {Sender: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}}) netChange: calculate(expression: "$inflow - $outflow") transfers: count } } } ``` --- ## Stream balance changes Every balance change of a wallet as it happens, from `TransactionBalances`. Widen the filter to a list of addresses or a single token to build alerts. ```graphql subscription { EVM(network: arc_testnet) { TransactionBalances( where: { TokenBalance: {Address: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}} } ) { Block { Number Time } Transaction { Hash } TokenBalance { PreBalance PostBalance Currency { Symbol SmartContract Native } } } } } ``` --- ## Total supply of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-token-total-supply) `TransactionBalances` records the token's total supply after each transaction that touched it. The latest row is the current supply, already adjusted for decimals. ```graphql { EVM(network: arc_testnet) { TransactionBalances( limit: {count: 1} orderBy: {descending: Block_Time} where: { TokenBalance: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} } } ) { Block { Time } TokenBalance { Currency { Symbol SmartContract } TotalSupply } } } } ``` --- ## Stream supply changes ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-token-supply) A new row arrives whenever a mint or burn changes the supply of the token. ```graphql subscription { EVM(network: arc_testnet) { TransactionBalances( where: { TokenBalance: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} } } ) { Block { Time } Transaction { Hash } TokenBalance { Currency { Symbol } TotalSupply } } } } ``` --- ## FAQ **Why is the `Holders` cube missing?** `Holders` is built from the archive dataset, and the testnet has none. Rank holders by ordering `Balances` by amount within the realtime window, as shown above. The [Arc mainnet balances guide](/docs/blockchain/arc-mainnet/arc-mainnet-balances-api/) uses the full `Holders` cube. **Why does the same wallet show USDC twice?** Native USDC (`Native: true`, 18 decimals) and the ERC-20 USDC interface (`0x3600...`, 6 decimals) are tracked as two currencies. Sum them yourself if you want one USDC figure. A third row with contract `0xfff...fffe` and no symbol is a system ledger mirror and can be ignored. **Are USD values available?** No. Every `...InUSD` field is 0 on the testnet. Because most balances are dollar stablecoins, `Amount` is usually the figure you want anyway. **Is `TotalSupply` raw or decimal-adjusted?** Decimal-adjusted. A token with a billion supply reads `1000000000.000000000000000000`. --- ## Arc Testnet Calls & Traces API URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-calls-api/ Query and stream smart contract calls and internal traces on Circle's Arc testnet with Bitquery GraphQL: method calls by selector, internal calls of a transaction, contract deployments, reverts and top methods. # Arc Testnet Calls & Traces API :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet Calls & Traces API](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Query and stream **smart contract calls on Arc testnet** with Bitquery GraphQL. The `EVM.Calls` cube on `network: arc_testnet` holds every call in every transaction, including internal calls, with the decoded method signature, the call path, value, gas, success and revert flags, and the enclosing transaction. It returns what `debug_traceTransaction` and `trace_filter` return, without running a node, and the same query runs as a subscription. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::warning Testnet: realtime only, USD fields are 0 Only `dataset: realtime` exists for Arc testnet; leave the `dataset` argument out. `Call.ValueInUSD` and the transaction `...InUSD` fields return 0. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api/) - [Arc Testnet Transactions API](/docs/blockchain/arc-testnet/arc-testnet-transactions-api/) - [EVM Calls schema](/docs/schema/evm/calls/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) ::: **On this page:** [Call anatomy](#what-one-call-row-contains) · [Stream](#stream-calls-to-a-contract) · [Latest](#latest-calls) · [By method](#calls-of-one-method) · [By selector](#calls-by-4-byte-selector) · [Internal calls of a transaction](#internal-calls-of-a-transaction) · [Deployments](#contract-deployments) · [Reverts](#reverted-calls) · [Top methods](#most-called-methods) · [Value-carrying calls](#calls-that-move-native-usdc) · [FAQ](#faq) --- ## What one call row contains | Group | What it gives you | | --- | --- | | `Call` | `From`, `To`, `Value`, `Input`, `Output`, `Gas`, `GasUsed`, `Success`, `Reverted`, `Error`, `Create`, `Delegated`, `SelfDestruct`, `CallPath`, `Index`, `Depth` | | `Call.Signature` | `Name`, full `Signature`, `SignatureHash` (the 4-byte selector, without `0x`) | | `Arguments` | Decoded, typed inputs for registered ABIs | | `Transaction` | Hash, `From`, `To`, value, gas and fee fields | | `Receipt` | `Status`, `GasUsed`, deployed `ContractAddress` | | `Block` | `Number`, `Time` | A transaction's top-level call has `Call.Index` 0 and an empty `CallPath`; internal calls have deeper paths. Filter `Call: {Index: {eq: 0}}` when you want one row per transaction. ### Example addresses on this page | Item | Address | | --- | --- | | Uniswap v4 PoolManager | `0x1d70945634f618eefdf9edaadb59b9a183cef929` | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | --- ## Stream calls to a contract ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-calls-to-contract) Every call into the Uniswap v4 PoolManager, internal or top-level, as it happens. ```graphql subscription { EVM(network: arc_testnet) { Calls( where: {Call: {To: {is: "0x1d70945634f618eefdf9edaadb59b9a183cef929"}}} ) { Block { Number Time } Transaction { Hash From } Call { From To Value Success CallPath Signature { Name Signature SignatureHash } } } } } ``` --- ## Latest calls ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-calls) The most recent top-level calls, one per transaction. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Index: {eq: 0}}} ) { Block { Number Time } Transaction { Hash } Call { From To Value Success Gas GasUsed Signature { Name SignatureHash } } } } } ``` --- ## Calls of one method ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-calls-of-a-method) Filter on the decoded method name and the contract. This reads `transfer` calls into the ERC-20 USDC contract with their decoded arguments. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: { Call: { To: {is: "0x3600000000000000000000000000000000000000"} Signature: {Name: {is: "transfer"}} } } ) { Block { Time } Transaction { Hash } Call { From Success Signature { Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## Calls by 4-byte selector ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-calls-by-selector) When the ABI is not registered, filter on the selector in `Call.Input` instead. This matches `approve(address,uint256)` by its `0x095ea7b3` prefix on any contract. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Input: {startsWith: "0x095ea7b3"}}} ) { Block { Time } Transaction { Hash } Call { From To Input Success Signature { Name } } } } } ``` --- ## Internal calls of a transaction ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-internal-calls-of-transaction) The full call tree of one transaction, ordered by call index. Replace the hash with any recent transaction from the [Transactions API](/docs/blockchain/arc-testnet/arc-testnet-transactions-api/). ```graphql { EVM(network: arc_testnet) { Calls( orderBy: {ascending: Call_Index} where: { Transaction: { Hash: {is: "0x9be99a14a7db15fae9b78c68c3bfb41cfd67654a7b8cdf499f56e712d8349fe1"} } } ) { Call { Index Depth CallPath From To Value Gas GasUsed Success Reverted Delegated Signature { Name Signature } } } } } ``` --- ## Contract deployments ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-contract-deployments) `Call.Create: true` marks a call that deployed a contract. The new address is in `Receipt.ContractAddress` for top-level deployments; for factory deployments read `Call.To` on the create call. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Create: true}} ) { Block { Time Number } Transaction { Hash From } Call { From To Success CallPath } Receipt { ContractAddress } } } } ``` --- ## Reverted calls ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-reverted-calls) Calls that reverted, with the error string when the EVM returned one. Useful for debugging a contract under test. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Reverted: true}} ) { Block { Time } Transaction { Hash From } Call { From To Error CallPath Signature { Name } } } } } ``` --- ## Most called methods ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-most-called-methods) Method signatures ranked by call count over 24 hours. ERC-20 `transfer`, `balanceOf` and `approve` dominate, followed by Uniswap v4 hook callbacks. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Call: {Signature: {Name: {not: ""}}} } ) { Call { Signature { Name Signature SignatureHash } } count contracts: uniq(of: Call_To) } } } ``` --- ## Calls that move native USDC ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-calls-with-value) Internal calls that carried native USDC value. This is how value moves between contracts shows up, since those movements are not ERC-20 `Transfer` events. ```graphql { EVM(network: arc_testnet) { Calls( limit: {count: 20} orderBy: {descending: Block_Time} where: {Call: {Value: {gt: "10"}}} ) { Block { Time } Transaction { Hash } Call { From To Value Index Signature { Name } } } } } ``` --- ## FAQ **How do I get one row per transaction?** Filter `Call: {Index: {eq: 0}}`. Every other row is an internal call. **Why is `Signature.Name` empty on some calls?** The ABI is not registered. The raw `Input` and the selector prefix are still there, so filter with `Input: {startsWith: ...}`, and ask support to register the ABI if you need decoded arguments. **Is `Call.Value` in USDC?** Yes. The gas token on Arc is USDC, so `Call.Value` and `Transaction.Value` are native USDC amounts. `ValueInUSD` is 0 on testnet even though the value is dollar-denominated. **Does this replace `debug_traceTransaction`?** For call trees, yes: `CallPath`, `Depth`, `Index`, gas per call and revert reasons are all here. Opcode-level traces are not. **Can I read calls older than the realtime window?** Not on the testnet; only `dataset: realtime` exists. --- ## Arc Testnet DEX Trades API & Streams URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-trades-api/ Query and stream Uniswap v2, v3, v4 and Curve trades on Circle's Arc testnet with Bitquery GraphQL: live swaps, latest trades, OHLCV candles, top tokens, DEX breakdown and trader activity. # Arc Testnet DEX Trades API & Streams :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Query and stream **DEX trades on Arc testnet** with Bitquery GraphQL. Arc is Circle's EVM Layer 1 for stablecoin finance, and its testnet is exposed as `EVM(network: arc_testnet)`. The `DEXTrades` and `DEXTradeByTokens` cubes carry every swap on **Uniswap v4, v3 and v2, Curve and Aerodrome** with buy and sell sides, native-unit prices, the DEX contract, the trader and the transaction. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows over WebSocket. :::warning Testnet: no USD values, no Trading cube, realtime only - Every `...InUSD` field (`AmountInUSD`, `PriceInUSD`, `ValueInUSD`) returns **0** on Arc testnet. There is no token price index for a testnet. Prices in `Trade.Price` and `Trade.PriceInUSD` are ratios of the two sides and work normally. - The multi-chain `Trading` cubes (`Trading.Trades`, `Tokens`, `Pairs`) do **not** include Arc testnet. Use the chain-level `DEXTrades` and `DEXTradeByTokens` cubes on this page. - Only `dataset: realtime` (the default) is served. There is no archive for the testnet, so leave the `dataset` argument out. For live data with USD pricing, use the [Arc Mainnet DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/). The mainnet `archive` and `combined` datasets are not enabled yet. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet Transfers API](/docs/blockchain/arc-testnet/arc-testnet-transfers-api/) - [Arc Testnet Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api/) — Uniswap v4 `Initialize`, v3 `PoolCreated`, v2 `PairCreated` - [Arc Testnet Balances API](/docs/blockchain/arc-testnet/arc-testnet-balances-api/) - [DEXTrades vs DEXTradeByTokens vs Trading.Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades/) - [EVM DEXTrades schema](/docs/schema/evm/dextrades/) ::: **On this page:** [Identifiers](#network-and-example-addresses) · [Stream](#stream-real-time-trades) · [Latest](#latest-trades) · [By token](#trades-of-a-token) · [By DEX](#trades-on-one-dex) · [By pool](#trades-in-one-pool) · [By trader](#trades-of-a-wallet) · [OHLCV](#ohlcv-candles-for-a-token) · [Latest price](#latest-price-of-a-token) · [Top tokens](#most-traded-tokens) · [DEX breakdown](#trade-count-by-dex-protocol) · [Top traders](#most-active-traders) · [FAQ](#faq) --- ## Network and example addresses | Item | Value | | --- | --- | | Network argument | `EVM(network: arc_testnet)` | | Chain ID | `5042002` | | Native gas token | USDC. Appears as `SmartContract: "0x0000000000000000000000000000000000000000"` with symbol `USDC` and name `USD Coin` in `DEXTrades` and `DEXTradeByTokens`; as `"0x"` with `Currency.Native: true` in `Transfers` and `Balances` | | USDC (ERC-20 interface, 6 decimals) | `0x3600000000000000000000000000000000000000` | | EURC (6 decimals) | `0x89b50855aa3be2f677cd6303cec089b5f319d72a` | | USDT (testnet mock, 18 decimals) | `0x175cdb1d338945f0d851a741ccf787d343e57952` | | ARCFOMO (busiest meme token at the time of writing) | `0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0` | | Uniswap v4 PoolManager | `0x1d70945634f618eefdf9edaadb59b9a183cef929`, the `Dex.SmartContract` on every v4 trade | | Uniswap v3 USDC/USDT pool | `0x715f78de0cea7428a5ede4a0c491b05e7a8caff2` | | Uniswap v3 EURC/USDT pool | `0x66a038f2f6000cf42d34c3ccd6c97ccfa16443bd` | These are live examples. Testnet tokens come and go, so swap in any token, pool or trader you care about. :::info Uniswap v4 pools have no address On v4 every pool lives inside the singleton PoolManager, so `Trade.Dex.SmartContract` is the PoolManager and `Trade.Dex.Pair.SmartContract` is the zero address. Identify a v4 pool by its two currencies, or by the `id` argument of the `Initialize` event on the [Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api/#new-uniswap-v4-pools). ::: --- ## Stream real-time trades ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-dex-trades) One WebSocket delivers every swap on the network as blocks are indexed, with both sides, the protocol and the trader. ```graphql subscription { EVM(network: arc_testnet) { DEXTrades { Block { Number Time } Transaction { Hash From } Trade { Dex { ProtocolFamily ProtocolName SmartContract } Buy { Amount Buyer Seller Price Currency { Name Symbol SmartContract } } Sell { Amount Buyer Seller Price Currency { Name Symbol SmartContract } } } } } } ``` --- ## Latest trades ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-dex-trades) The most recent swaps on the network. `Trade.Buy` is the currency the trader received and `Trade.Sell` is what they paid. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash From } Trade { Dex { ProtocolName SmartContract } Buy { Amount Currency { Symbol SmartContract } Price } Sell { Amount Currency { Symbol SmartContract } } } } } } ``` --- ## Trades of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-trades-of-a-token) `DEXTradeByTokens` returns one row per token side of every trade, so a token filter catches it whether it was bought or sold. `Side.Type` says which direction the trade was from the token's point of view. ```graphql { EVM(network: arc_testnet) { DEXTradeByTokens( limit: {count: 20} orderBy: {descending: Block_Time} where: { Trade: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} } } ) { Block { Time } Transaction { Hash } Trade { Amount Price Currency { Symbol } Side { Type Amount Currency { Symbol SmartContract } } Dex { ProtocolName } } } } } ``` --- ## Trades on one DEX ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-uniswap-v4-trades) Filter by `Dex.ProtocolName`. Values seen on Arc testnet are `uniswap_v4`, `uniswap_v3`, `uniswap_v2`, `curve_v1` and `aerodrome_v1`. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 20} orderBy: {descending: Block_Time} where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}}} ) { Block { Time } Transaction { Hash } Trade { Dex { ProtocolName SmartContract } Buy { Amount Currency { Symbol SmartContract } } Sell { Amount Currency { Symbol SmartContract } } } } } } ``` --- ## Trades in one pool ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-trades-in-a-pool) For Uniswap v2 and v3 the pool has its own address in `Trade.Dex.SmartContract`. This example reads the v3 USDC/USDT pool. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Trade: { Dex: {SmartContract: {is: "0x715f78de0cea7428a5ede4a0c491b05e7a8caff2"}} } } ) { Block { Time } Transaction { Hash From } Trade { Buy { Amount Currency { Symbol } Price } Sell { Amount Currency { Symbol } } } } } } ``` --- ## Trades of a wallet ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-trades-of-a-wallet) `Transaction.From` is the externally owned account that signed the swap. `Trade.Buy.Buyer` and `Trade.Sell.Seller` are the addresses that received and paid the tokens, which can be a router rather than the signer. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Transaction: {From: {is: "0x47262d76684b071ba33304e5aa8b424035f3e06c"}} } ) { Block { Time } Transaction { Hash } Trade { Dex { ProtocolName } Buy { Amount Currency { Symbol } Buyer } Sell { Amount Currency { Symbol } Seller } } } } } ``` --- ## OHLCV candles for a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-ohlcv-candles) Hourly candles for ARCFOMO priced in native USDC. `Block.Time(interval: ...)` buckets the trades; `open` and `close` take the price at the lowest and highest block in the bucket. Change `count` and `in` for other intervals. ```graphql { EVM(network: arc_testnet) { DEXTradeByTokens( limit: {count: 24} orderBy: {descendingByField: "Block_Time"} where: { Trade: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} Side: { Currency: {SmartContract: {is: "0x0000000000000000000000000000000000000000"}} } } } ) { Block { Time(interval: {in: hours, count: 1}) } volume: sum(of: Trade_Amount) Trade { high: Price(maximum: Trade_Price) low: Price(minimum: Trade_Price) open: Price(minimum: Block_Number) close: Price(maximum: Block_Number) } count } } } ``` --- ## Latest price of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-token-price) The price of the most recent trade against native USDC. Because the quote is a dollar stablecoin, `Trade.Price` here is effectively a USD price even though `PriceInUSD` is 0 on testnet. ```graphql { EVM(network: arc_testnet) { DEXTradeByTokens( limit: {count: 1} orderBy: {descending: Block_Time} where: { Trade: { Currency: {SmartContract: {is: "0xe2cfd2893ad90e8a5b4f87c5cad22d150b1e12a0"}} Side: { Currency: {SmartContract: {is: "0x0000000000000000000000000000000000000000"}} } } } ) { Block { Time } Trade { Price Currency { Symbol } Side { Currency { Symbol } } Dex { ProtocolName } } } } } ``` --- ## Most traded tokens ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-most-traded-tokens) Tokens ranked by trade count over the last 24 hours. Native USDC is the quote on most pools, so it tops the list; the rows under it are the tokens people actually trade. ```graphql { EVM(network: arc_testnet) { DEXTradeByTokens( limit: {count: 20} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Symbol Name SmartContract } } count volume: sum(of: Trade_Amount) traders: uniq(of: Transaction_From) } } } ``` --- ## Trade count by DEX protocol ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-trades-by-dex) Which DEXes carry the testnet's volume. Uniswap v4 dominates at the time of writing. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 10} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Dex { ProtocolFamily ProtocolName } } count pools: uniq(of: Trade_Dex_SmartContract) traders: uniq(of: Transaction_From) } } } ``` --- ## Most active traders ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-most-active-traders) Signers ranked by swap count. On a testnet the top rows are usually bots and routers; drop the first few addresses to find real wallets. ```graphql { EVM(network: arc_testnet) { DEXTrades( limit: {count: 20} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Transaction { From } count tokens: uniq(of: Trade_Buy_Currency_SmartContract) } } } ``` --- ## FAQ **Why is every `AmountInUSD` and `PriceInUSD` zero?** Arc testnet has no token price index, so USD fields are 0 by design. `Trade.Price` is the ratio between the two sides and is correct. When the quote is USDC or another dollar stablecoin, that ratio is a dollar price. **Can I use `Trading.Trades` with `bid:arc_testnet`?** No. The `Trading` cubes cover mainnet chains with USD pricing. Arc testnet is served only through `EVM(network: arc_testnet)`. **How far back does the data go?** Only the `realtime` dataset exists for the testnet, and it holds a rolling window of recent blocks. Measure it with `Block { Time(minimum: Block_Time) }` rather than assuming a depth. `dataset: archive` and `dataset: combined` return errors. **Why does native USDC show two different contract addresses?** The native gas token is USDC. The trade cubes report it as the zero address with name `USD Coin`; `Transfers` and `Balances` report it as `"0x"` with `Currency.Native: true`. The ERC-20 interface at `0x3600000000000000000000000000000000000000` is a separate currency with 6 decimals and name `USDC`. **Do Solidity selectors and topic hashes work the same as on Ethereum?** Yes. Arc is EVM-compatible, so ABIs, 4-byte selectors and topic0 hashes carry over unchanged. --- ## Arc Testnet Events API & WebSocket Streams URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-events-api/ Stream every smart contract event on Circle's Arc testnet with Bitquery GraphQL: decoded logs by contract, signature, topic0 or argument, plus Uniswap v4 Initialize, v3 PoolCreated and v2 PairCreated feeds. # Arc Testnet Events API & WebSocket Streams :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Stream **every smart contract event on Arc testnet** with Bitquery GraphQL. The `EVM.Events` cube on `network: arc_testnet` returns each log with decoded, typed arguments for known signatures, the raw topics, and the transaction, internal call and receipt that produced it. It covers what `eth_getLogs` and `eth_subscribe("logs")` return, and adds server-side filtering on decoded values. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::warning Testnet: realtime only, USD fields are 0 Only `dataset: realtime` exists for Arc testnet; leave the `dataset` argument out. `Transaction.ValueInUSD`, `Call.ValueInUSD` and the gas `...InUSD` fields return 0. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet Calls API](/docs/blockchain/arc-testnet/arc-testnet-calls-api/) - [Arc Testnet DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api/) - [Arc Testnet Transfers API](/docs/blockchain/arc-testnet/arc-testnet-transfers-api/) - [EVM Events schema](/docs/schema/evm/events/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) ::: **On this page:** [Event anatomy](#what-one-event-row-contains) · [Firehose](#stream-all-events) · [By contract](#events-from-one-contract) · [By signature](#one-event-across-all-contracts) · [By topic0](#filter-by-raw-topic0) · [By argument](#filter-by-a-decoded-argument) · [New v4 pools](#new-uniswap-v4-pools) · [New v3 and v2 pools](#new-uniswap-v3-and-v2-pools) · [Busiest contracts](#busiest-contracts-and-signatures) · [Undecoded events](#undecoded-events) · [FAQ](#faq) --- ## What one event row contains | Group | What it gives you | | --- | --- | | `Log` | `SmartContract` (the code that produced the log), log `Index`, and `Signature` (`Name`, full `Signature`, `SignatureHash`) | | `LogHeader` | `Address`, the emitting address as `eth_getLogs` would return it | | `Topics` | The raw indexed topics; topic0 is the signature hash | | `Arguments` | Decoded, typed values (`address`, `bigInteger`, `string`, `hex`, `bool`, `integer`) with names | | `Transaction` | Hash, `From`, `To`, value, gas and fee fields | | `Call` | The internal call that emitted the log, with its signature and success flags | | `Receipt` | `GasUsed`, `CumulativeGasUsed`, deployed `ContractAddress` | | `Block` | `Number`, `Time` | Hash fields (`SignatureHash`, `Topics.Hash`) are hex strings **without** a `0x` prefix. ### Example addresses on this page | Item | Address | | --- | --- | | Uniswap v4 PoolManager | `0x1d70945634f618eefdf9edaadb59b9a183cef929` | | Uniswap v3 factory (busiest `PoolCreated` emitter) | `0x0fb6eeda6e90e90797083861a75d15752a27f59c` | | Uniswap v2 factory (busiest `PairCreated` emitter) | `0xd67f63a4f26a497b364d1c82e6747aec8b5743a5` | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | | EURC | `0x89b50855aa3be2f677cd6303cec089b5f319d72a` | --- ## Stream all events ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-all-events) One socket, every event on the chain. Good for building an indexer; heavy for anything else, so use the filtered streams below in production. ```graphql subscription { EVM(network: arc_testnet) { Events { Block { Number Time } Transaction { Hash From To } LogHeader { Address } Log { Index Signature { Name Signature SignatureHash } } Topics { Hash } Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` --- ## Events from one contract ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-events-from-a-contract) `LogHeader.Address` is the `address` filter of `eth_getLogs`. This reads the latest events of the ERC-20 USDC contract. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { LogHeader: {Address: {is: "0x3600000000000000000000000000000000000000"}} } ) { Block { Time } Transaction { Hash } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## One event across all contracts ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-swap-events) Filter by decoded signature name to watch one event type from every contract that emits it. This catches every `Swap`, from Uniswap v2 pairs, v3 pools and the v4 PoolManager alike. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: {Log: {Signature: {Name: {is: "Swap"}}}} ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } } } } } } ``` --- ## Filter by raw topic0 ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-events-by-topic0) When you have the signature hash rather than the name, filter on `Log.Signature.SignatureHash`. This is the ERC-20 `Transfer(address,address,uint256)` hash, written without `0x`. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 10} orderBy: {descending: Block_Time} where: { Log: { Signature: { SignatureHash: {is: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"} } } } ) { Block { Time } Transaction { Hash } LogHeader { Address } Topics { Hash } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## Filter by a decoded argument ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-events-by-argument) Server-side filtering on decoded values is what a node cannot do. This finds every event whose argument named `to` equals a wallet, across all contracts and signatures. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Arguments: { includes: { Name: {is: "to"} Value: {Address: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}} } } } ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } } } } ``` --- ## New Uniswap v4 pools ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-new-uniswap-v4-pools) Uniswap v4 carries most of the testnet's swaps. A new pool is an `Initialize` event on the PoolManager; its arguments give the pool `id`, the two currencies, the fee tier, tick spacing, hook address and opening price. `currency0` of the zero address means native USDC. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { LogHeader: {Address: {is: "0x1d70945634f618eefdf9edaadb59b9a183cef929"}} Log: {Signature: {Name: {is: "Initialize"}}} } ) { Block { Time Number } Transaction { Hash From } Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Bytes_Value_Arg { hex } } } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to get each new pool the moment it is created. --- ## New Uniswap v3 and v2 pools ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-new-v3-v2-pools) Several v3 and v2 factory deployments exist on the testnet, so filter on the event name rather than one factory address. `PoolCreated` is v3, `PairCreated` is v2; both carry the two tokens and the new pool address in their arguments. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: {Log: {Signature: {Name: {in: ["PoolCreated", "PairCreated"]}}}} ) { Block { Time } Transaction { Hash } LogHeader { Address } Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Integer_Value_Arg { integer } } } } } } ``` --- ## Busiest contracts and signatures ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-busiest-event-contracts) Which contracts and event types dominate the log stream over 24 hours. Run this first on any network you have not explored yet. ```graphql { EVM(network: arc_testnet) { contracts: Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { LogHeader { Address } count } signatures: Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: {Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Log { Signature { Name Signature } } count } } } ``` --- ## Undecoded events ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-undecoded-events) Events whose ABI is not registered arrive with an empty `Signature.Name` and no `Arguments`, but the raw `Topics` and `Log.SmartContract` are still there. This lists the contracts emitting the most undecoded events; if one matters to you, ask support to register its ABI. ```graphql { EVM(network: arc_testnet) { Events( limit: {count: 10} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Log: {Signature: {Name: {is: ""}}} } ) { LogHeader { Address } Topics { Hash } count } } } ``` --- ## FAQ **How do I map my `eth_getLogs` filter?** `address` becomes `LogHeader.Address`, `topics[0]` becomes `Log.Signature.SignatureHash` (without `0x`), and a fixed block range becomes a `Block.Number` filter. Everything else on this page is extra: decoded arguments, argument filters and joined transaction context. **`LogHeader.Address` or `Log.SmartContract`?** `LogHeader.Address` is the emitting address. `Log.SmartContract` is the code that produced the log, which differs behind proxies. Filter on `LogHeader.Address` to watch a deployed address. **Why do some events have an empty name?** Their ABI is not registered yet. The raw topics and data are still delivered. See [Undecoded events](#undecoded-events). **Can I get history beyond the realtime window?** Not on the testnet; only `dataset: realtime` exists. **How do I follow one Uniswap v4 pool?** Take the pool `id` from its `Initialize` event and filter `Swap` events on the PoolManager whose first argument (`id`) matches it, using the [argument filter](#filter-by-a-decoded-argument) with `Value: {Bytes: ...}`, or read the pool's trades through the [DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api/) by its two currencies. --- ## Arc Testnet Transactions, Blocks & Fees API URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-transactions-api/ Query and stream transactions, receipts, blocks and USDC gas fees on Circle's Arc testnet with Bitquery GraphQL: transaction by hash, address history, failed transactions, block stats and fee analytics. # Arc Testnet Transactions, Blocks & Fees API :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet Transactions, Blocks & Fees API](/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Query and stream **transactions, receipts and blocks on Arc testnet** with Bitquery GraphQL. The `EVM.Transactions` and `EVM.Blocks` cubes on `network: arc_testnet` cover what a block explorer shows for a hash, an address or a block, with fees in **USDC** because USDC is the chain's gas token. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::warning Testnet: realtime only, USD fields are 0 Only `dataset: realtime` exists for Arc testnet; leave the `dataset` argument out. `ValueInUSD`, `CostInUSD`, `GasPriceInUSD` and the other `...InUSD` fields return 0. Fee fields such as `Fee.SenderFee` are native USDC and populated. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet Calls API](/docs/blockchain/arc-testnet/arc-testnet-calls-api/) — the call tree inside a transaction - [Arc Testnet Transfers API](/docs/blockchain/arc-testnet/arc-testnet-transfers-api/) - [EVM Transactions schema](/docs/schema/evm/transactions/) - [EVM Blocks schema](/docs/schema/evm/blocks/) ::: **On this page:** [Stream](#stream-transactions) · [Latest](#latest-transactions) · [By hash](#transaction-by-hash) · [By address](#transactions-of-an-address) · [Failed](#failed-transactions) · [Fees](#gas-fees-in-usdc) · [Latest blocks](#latest-blocks) · [Block by number](#block-by-number) · [Block stats](#block-and-throughput-statistics) · [FAQ](#faq) --- ## Stream transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-transactions) Every transaction as blocks are indexed. Arc produces a block well under every second, so expect a steady feed. ```graphql subscription { EVM(network: arc_testnet) { Transactions { Block { Number Time } Transaction { Hash From To Value Gas Type Nonce } Receipt { Status GasUsed ContractAddress } Fee { SenderFee EffectiveGasPrice } } } } ``` --- ## Latest transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-transactions) ```graphql { EVM(network: arc_testnet) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash From To Value Type } Receipt { Status GasUsed } Fee { SenderFee } } } } ``` --- ## Transaction by hash ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-transaction-by-hash) The equivalent of `eth_getTransactionByHash` plus `eth_getTransactionReceipt` in one call. The example hash is a live USDC value transfer; replace it with any recent hash. ```graphql { EVM(network: arc_testnet) { Transactions( where: { Transaction: { Hash: {is: "0x9be99a14a7db15fae9b78c68c3bfb41cfd67654a7b8cdf499f56e712d8349fe1"} } } ) { Block { Number Time Hash } Transaction { Hash From To Value Gas GasPrice GasFeeCap GasTipCap Nonce Type Index } Receipt { Status GasUsed CumulativeGasUsed ContractAddress } Fee { SenderFee EffectiveGasPrice PriorityFeePerGas Burnt } } } } ``` --- ## Transactions of an address ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-transactions-of-an-address) Sent and received transactions of one address, newest first. This is the explorer's address page. ```graphql { EVM(network: arc_testnet) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ {Transaction: {From: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} {Transaction: {To: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} ] } ) { Block { Number Time } Transaction { Hash From To Value } Receipt { Status } Fee { SenderFee } } } } ``` --- ## Failed transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-failed-transactions) Transactions whose receipt status is 0. Join the [reverted calls](/docs/blockchain/arc-testnet/arc-testnet-calls-api/#reverted-calls) query on the hash to see the revert reason. ```graphql { EVM(network: arc_testnet) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} where: {TransactionStatus: {Success: false}} ) { Block { Time } Transaction { Hash From To Gas } Receipt { GasUsed } Fee { SenderFee } } } } ``` --- ## Gas fees in USDC ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-gas-fee-statistics) Because gas is paid in USDC, `Fee.SenderFee` is already a dollar amount. This gives the average, median and total fee per hour along with the average effective gas price. ```graphql { EVM(network: arc_testnet) { Transactions( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} ) { Block { Time(interval: {in: hours, count: 1}) } count totalFees: sum(of: Fee_SenderFee) avgFee: average(of: Fee_SenderFee) medianFee: median(of: Fee_SenderFee) avgGasPrice: average(of: Fee_EffectiveGasPrice) avgGasUsed: average(of: Receipt_GasUsed) } } } ``` --- ## Latest blocks ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-blocks) ```graphql { EVM(network: arc_testnet) { Blocks( limit: {count: 20} orderBy: {descending: Block_Number} ) { Block { Number Time Hash TxCount GasUsed GasLimit BaseFee Coinbase } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to receive each block header as it is indexed. --- ## Block by number ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-block-by-number) ```graphql { EVM(network: arc_testnet) { Blocks(where: {Block: {Number: {eq: "61696399"}}}) { Block { Number Time Hash ParentHash TxCount GasUsed GasLimit BaseFee Coinbase Difficulty } } } } ``` --- ## Block and throughput statistics ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-block-statistics) Blocks, transactions, average transactions per block and average gas per block for each of the last 24 hours. Divide the block count by 3600 to get blocks per second. ```graphql { EVM(network: arc_testnet) { Blocks( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} ) { Block { Time(interval: {in: hours, count: 1}) } blocks: count transactions: sum(of: Block_TxCount) avgTxPerBlock: average(of: Block_TxCount) avgGasUsed: average(of: Block_GasUsed) medianGasUsed: median(of: Block_GasUsed) } } } ``` --- ## FAQ **What unit is `Fee.SenderFee` in?** Native USDC. Arc pays gas in USDC, so a fee of `0.0025` is a quarter of a cent. `CostInUSD` and `GasPriceInUSD` are still 0 on testnet because there is no price index, even though the native unit is a dollar. **Why is `Transaction.GasPrice` 0 while the fee is not?** Arc transactions are EIP-1559 type 2. Read `Fee.EffectiveGasPrice`, `Transaction.GasFeeCap` and `Transaction.GasTipCap`; the legacy `GasPrice` field is 0 for these. **How fast are blocks?** Well under a second on average. Measure the current rate with the [block statistics](#block-and-throughput-statistics) query rather than assuming a fixed interval. **Can I get a transaction's internal calls and logs from here?** Use the same hash on the [Calls API](/docs/blockchain/arc-testnet/arc-testnet-calls-api/#internal-calls-of-a-transaction) for the call tree and the [Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api/) for the logs. **Is there a block explorer?** Circle's testnet explorer is at [testnet.arcscan.app](https://testnet.arcscan.app). Bitquery is an indexed data API rather than an explorer, and every explorer lookup on this page can be run in bulk or streamed. --- ## Arc Testnet Transfers API & Streams URL: https://docs.bitquery.io/docs/blockchain/arc-testnet/arc-testnet-transfers-api/ Query and stream token transfers on Circle's Arc testnet with Bitquery GraphQL: native USDC, ERC-20 USDC, EURC, wallet ledgers, large transfers, most-transferred tokens and daily volume. # Arc Testnet Transfers API & Streams :::tip Arc mainnet is live Most production integrations should use the [Arc Mainnet Transfers API](/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/) with `EVM(network: arc)`. Use this page only for Arc testnet data. ::: Query and stream **token transfers on Arc testnet** with Bitquery GraphQL. This is the shared **EVM `Transfers`** cube scoped to `network: arc_testnet`, so a query written for Ethereum or Base runs here by changing the network name. Arc's native gas token is **USDC**, and the chain carries an ERC-20 USDC interface, **EURC**, a testnet **USDT** and thousands of test tokens. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows over WebSocket. :::warning Testnet: USD fields are 0 and only the realtime dataset exists `Transfer.AmountInUSD` is always **0** on Arc testnet. Filter and rank by `Transfer.Amount` instead. Leave the `dataset` argument out; `archive` and `combined` return errors on the testnet. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Testnet API overview](/docs/blockchain/arc-testnet/) — network facts, every cube and stream in one place - [Arc Testnet DEX Trades API](/docs/blockchain/arc-testnet/arc-testnet-trades-api/) - [Arc Testnet Balances API](/docs/blockchain/arc-testnet/arc-testnet-balances-api/) - [Arc Testnet Events API](/docs/blockchain/arc-testnet/arc-testnet-events-api/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) - [EVM Transfers schema](/docs/schema/evm/transfers/) ::: **On this page:** [Currencies](#how-usdc-appears-in-transfers) · [Stream](#stream-real-time-transfers) · [Latest](#latest-transfers) · [Native USDC](#native-usdc-transfers) · [By token](#transfers-of-a-token) · [By address](#transfers-of-an-address) · [Between two addresses](#transfers-between-two-addresses) · [Large transfers](#large-transfers) · [Top tokens](#most-transferred-tokens) · [Hourly volume](#hourly-transfer-volume-of-a-token) · [FAQ](#faq) --- ## How USDC appears in Transfers USDC exists in three forms on Arc testnet. Check which one a row is before you sum or rank anything. | Currency | `SmartContract` | `Native` | Decimals | What it is | | --- | --- | --- | --- | --- | | USDC (native) | `0x` | `true` | 18 | The gas token. Value transfers and gas fees. | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | `false` | 6 | The ERC-20 interface most contracts and wallets call. Symbol `USDC`, name `USDC`. | | System ledger | `0xfffffffffffffffffffffffffffffffffffffffe` | `false` | 0 | A system address that emits a raw `Transfer` event mirroring native USDC movements as 18-decimal integers with no symbol. Exclude it from token rankings. | Other stablecoins seen on the testnet: | Token | Address | Decimals | | --- | --- | --- | | EURC | `0x89b50855aa3be2f677cd6303cec089b5f319d72a` | 6 | | USDT (testnet mock) | `0x175cdb1d338945f0d851a741ccf787d343e57952` | 18 | | WUSDC (Wrapped USDC) | `0x911b4000d3422f482f4062a913885f7b035382df` | 18 | --- ## Stream real-time transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-stream-transfers) Every transfer on the network as it is indexed. Filter inside `where` to narrow the socket to a token, an address or a size floor. ```graphql subscription { EVM(network: arc_testnet) { Transfers { Block { Number Time } Transaction { Hash From To } Transfer { Amount Sender Receiver Type Currency { Name Symbol SmartContract Native Decimals } } } } } ``` --- ## Latest transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-latest-transfers) ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol SmartContract Native } } } } } ``` --- ## Native USDC transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-native-usdc-transfers) `Currency: {Native: true}` selects value transfers of the gas token. The floor of 100 USDC keeps dust and fee movements out. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { Transfer: { Currency: {Native: true} Amount: {gt: "100"} } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Native } } } } } ``` --- ## Transfers of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-erc20-usdc-transfers) Filter on the token contract. This example reads the ERC-20 USDC interface; swap in EURC or any test token. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Decimals } } } } } ``` --- ## Transfers of an address ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-transfers-of-an-address) Incoming and outgoing transfers in one list. Replace the address with any wallet or contract. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ {Transfer: {Sender: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} {Transfer: {Receiver: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} ] } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol SmartContract Native } } } } } ``` ### Sent and received totals per token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-address-sent-received) Two aliased selections give the outbound and inbound sums per currency for a wallet. ```graphql { EVM(network: arc_testnet) { sent: Transfers( where: {Transfer: {Sender: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} orderBy: {descendingByField: "amount"} limit: {count: 10} ) { Transfer { Currency { Symbol SmartContract } } amount: sum(of: Transfer_Amount) count } received: Transfers( where: {Transfer: {Receiver: {is: "0x2de8906a641d65d490bc60a4179d961d59742bcb"}}} orderBy: {descendingByField: "amount"} limit: {count: 10} ) { Transfer { Currency { Symbol SmartContract } } amount: sum(of: Transfer_Amount) count } } } ``` --- ## Transfers between two addresses ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-transfers-between-addresses) Flows from one address to another, in either direction. Useful for tracing a faucet, a bridge or a counterparty. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ { Transfer: { Sender: {is: "0xe72f8175ab0991dbb778f6de62009c5bf97c17f7"} Receiver: {is: "0x1d70945634f618eefdf9edaadb59b9a183cef929"} } } { Transfer: { Sender: {is: "0x1d70945634f618eefdf9edaadb59b9a183cef929"} Receiver: {is: "0xe72f8175ab0991dbb778f6de62009c5bf97c17f7"} } } ] } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Native } } } } } ``` --- ## Large transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-large-usdc-transfers) With USD values at 0 on testnet, size filters go on `Transfer.Amount` for one currency at a time. This catches ERC-20 USDC moves above 10,000. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descending: Transfer_Amount} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} Amount: {gt: "10000"} } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol } } } } } ``` --- ## Most transferred tokens ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-most-transferred-tokens) Tokens ranked by transfer count over 24 hours, with distinct senders and receivers. The system ledger address is excluded. ```graphql { EVM(network: arc_testnet) { Transfers( limit: {count: 20} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Transfer: { Currency: {SmartContract: {not: "0xfffffffffffffffffffffffffffffffffffffffe"}} } } ) { Transfer { Currency { Symbol Name SmartContract Native } } count amount: sum(of: Transfer_Amount) senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) } } } ``` --- ## Hourly transfer volume of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-testnet-hourly-transfer-volume) Transfer volume of ERC-20 USDC bucketed by hour, for charts and alerts. ```graphql { EVM(network: arc_testnet) { Transfers( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} where: { Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } } ) { Block { Time(interval: {in: hours, count: 1}) } amount: sum(of: Transfer_Amount) count senders: uniq(of: Transfer_Sender) } } } ``` --- ## FAQ **Why does `AmountInUSD` return 0?** Arc testnet has no token price index, so every USD field is 0. Rank and filter by `Transfer.Amount`, one currency at a time. **Which USDC address should I filter on?** For gas-token value transfers use `Currency: {Native: true}`. For the ERC-20 interface that wallets and contracts call, use `0x3600000000000000000000000000000000000000`. Do not filter on `0xfffffffffffffffffffffffffffffffffffffffe`; it is a system ledger that duplicates native movements as raw integers. **Why are native amounts 18 decimals when USDC has 6?** The EVM represents the gas token in wei-style 18-decimal units regardless of what the token is called. Bitquery applies those 18 decimals to native rows and the contract's own 6 decimals to ERC-20 rows, so `Amount` is a whole-token value in both cases. **Can I read history older than the realtime window?** Not on the testnet. Only `dataset: realtime` exists; `archive` and `combined` return errors. Check the window with `Block { Time(minimum: Block_Time) }`. **How do I stream transfers for one wallet?** Take the [transfers of an address](#transfers-of-an-address) query, change `query` to `subscription` and drop `limit` and `orderBy`. --- ## Arc Transactions, Blocks & Fees API URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-transactions-api/ Query and stream Arc transactions, blocks and USDC gas fees with Bitquery GraphQL, including hashes, address history, failures and fee analytics. # Arc Transactions, Blocks & Fees API Query and stream **transactions, receipts and blocks on Arc** with Bitquery GraphQL. The `EVM.Transactions` and `EVM.Blocks` cubes on `network: arc` cover what a block explorer shows for a hash, an address or a block, with fees in **USDC** because USDC is the chain's gas token. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows. :::info Availability checked 16 September 2026 The realtime path returned transactions and blocks. `CostInUSD`, `GasPriceInUSD` and `Fee.SenderFeeInUSD` were populated. Leave the `dataset` argument out until `combined` and `archive` are enabled. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) — network facts, every cube and stream in one place - [Arc Calls API](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/) — the call tree inside a transaction - [Arc Transfers API](/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/) - [EVM Transactions schema](/docs/schema/evm/transactions/) - [EVM Blocks schema](/docs/schema/evm/blocks/) ::: **On this page:** [Stream](#stream-transactions) · [Latest](#latest-transactions) · [By hash](#transaction-by-hash) · [By address](#transactions-of-an-address) · [Failed](#failed-transactions) · [Fees](#gas-fees-in-usdc) · [Latest blocks](#latest-blocks) · [Block by number](#block-by-number) · [Block stats](#block-and-throughput-statistics) · [FAQ](#faq) --- ## Stream transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-stream-transactions) Every transaction as blocks are indexed. Arc produces a block well under every second, so expect a steady feed. ```graphql subscription { EVM(network: arc) { Transactions { Block { Number Time } Transaction { Hash From To Value Gas Type Nonce } Receipt { Status GasUsed ContractAddress } Fee { SenderFee EffectiveGasPrice } } } } ``` --- ## Latest transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-latest-transactions) ```graphql { EVM(network: arc) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash From To Value Type } Receipt { Status GasUsed } Fee { SenderFee } } } } ``` --- ## Transaction by hash ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-transaction-by-hash) The equivalent of `eth_getTransactionByHash` plus `eth_getTransactionReceipt` in one call. The example hash is a live USDC value transfer; replace it with any recent hash. ```graphql { EVM(network: arc) { Transactions( where: { Transaction: { Hash: {is: "0x3fb2f3f18ae8ef86dbf6d25f268c861d2982f67308031df45574b5a7fcc02b9f"} } } ) { Block { Number Time Hash } Transaction { Hash From To Value Gas GasPrice GasFeeCap GasTipCap Nonce Type Index } Receipt { Status GasUsed CumulativeGasUsed ContractAddress } Fee { SenderFee EffectiveGasPrice PriorityFeePerGas Burnt } } } } ``` --- ## Transactions of an address ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-transactions-of-an-address) Sent and received transactions of one address, newest first. This is the explorer's address page. ```graphql { EVM(network: arc) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ {Transaction: {From: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} {Transaction: {To: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} ] } ) { Block { Number Time } Transaction { Hash From To Value } Receipt { Status } Fee { SenderFee } } } } ``` --- ## Failed transactions ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-failed-transactions) Transactions whose receipt status is 0. Join the [reverted calls](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/#reverted-calls) query on the hash to see the revert reason. ```graphql { EVM(network: arc) { Transactions( limit: {count: 20} orderBy: {descending: Block_Time} where: {TransactionStatus: {Success: false}} ) { Block { Time } Transaction { Hash From To Gas } Receipt { GasUsed } Fee { SenderFee } } } } ``` --- ## Gas fees in USDC ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-gas-fee-statistics) Because gas is paid in USDC, `Fee.SenderFee` is already a dollar amount. This gives the average, median and total fee per hour along with the average effective gas price. ```graphql { EVM(network: arc) { Transactions( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} ) { Block { Time(interval: {in: hours, count: 1}) } count totalFees: sum(of: Fee_SenderFee) avgFee: average(of: Fee_SenderFee) medianFee: median(of: Fee_SenderFee) avgGasPrice: average(of: Fee_EffectiveGasPrice) avgGasUsed: average(of: Receipt_GasUsed) } } } ``` --- ## Latest blocks ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-latest-blocks) ```graphql { EVM(network: arc) { Blocks( limit: {count: 20} orderBy: {descending: Block_Number} ) { Block { Number Time Hash TxCount GasUsed GasLimit BaseFee Coinbase } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to receive each block header as it is indexed. --- ## Block by number ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-block-by-number) ```graphql { EVM(network: arc) { Blocks(where: {Block: {Number: {eq: "21124027"}}}) { Block { Number Time Hash ParentHash TxCount GasUsed GasLimit BaseFee Coinbase Difficulty } } } } ``` --- ## Block and throughput statistics ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-block-statistics) Blocks, transactions, average transactions per block and average gas per block for each of the last 24 hours. Divide the block count by 3600 to get blocks per second. ```graphql { EVM(network: arc) { Blocks( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} ) { Block { Time(interval: {in: hours, count: 1}) } blocks: count transactions: sum(of: Block_TxCount) avgTxPerBlock: average(of: Block_TxCount) avgGasUsed: average(of: Block_GasUsed) medianGasUsed: median(of: Block_GasUsed) } } } ``` --- ## FAQ **What unit is `Fee.SenderFee` in?** Native USDC. Arc pays gas in USDC, so a fee of `0.0025` is a quarter of a cent. The USD fee fields were also populated in the launch-day check. **Which gas-price field should I use?** For EIP-1559 type 2 transactions, use `Fee.EffectiveGasPrice` for the price paid. `Transaction.GasFeeCap` and `Transaction.GasTipCap` show the sender's limits. **How fast are blocks?** Well under a second on average. Measure the current rate with the [block statistics](#block-and-throughput-statistics) query rather than assuming a fixed interval. **Can I get a transaction's internal calls and logs from here?** Use the same hash on the [Calls API](/docs/blockchain/arc-mainnet/arc-mainnet-calls-api/#internal-calls-of-a-transaction) for the call tree and the [Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) for the logs. **Is there a block explorer?** Arc's mainnet explorer is [explorer.arc.io](https://explorer.arc.io). Bitquery is an indexed data API rather than an explorer, and every explorer lookup on this page can be run in bulk or streamed. --- ## Arc Transfers API & Streams URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/arc-mainnet-transfers-api/ Query and stream Arc token transfers with Bitquery GraphQL, including native USDC, ERC-20 USDC, EURC, wallet history, large transfers and daily volume. # Arc Transfers API & Streams Query and stream **token transfers on Arc** with Bitquery GraphQL. This is the shared **EVM `Transfers`** cube scoped to `network: arc`, so a query written for Ethereum or Base runs here by changing the network name. Arc's native gas token is **USDC**, and the chain carries an ERC-20 USDC interface, EURC, USYC and user-issued assets. Every query on this page was executed against the production endpoint before publishing. Change `query` to `subscription` on any of them to stream the same rows over WebSocket. :::info Availability checked 16 September 2026 `Transfer.AmountInUSD` returned populated values. Only the realtime path answered, so leave the `dataset` argument out until `archive` and `combined` are enabled. ::: :::note API Key Required To query or stream data outside the Bitquery IDE, you need an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: :::tip Related docs - [Arc Blockchain API overview](/docs/blockchain/arc-mainnet/) — network facts, every cube and stream in one place - [Arc DEX Trades API](/docs/blockchain/arc-mainnet/arc-mainnet-trades-api/) - [Arc Balances API](/docs/blockchain/arc-mainnet/arc-mainnet-balances-api/) - [Arc Events API](/docs/blockchain/arc-mainnet/arc-mainnet-events-api/) - [Transfers vs Events vs Calls](/docs/start/mental-model-transfers-events-calls/) - [EVM Transfers schema](/docs/schema/evm/transfers/) ::: **On this page:** [Currencies](#how-usdc-appears-in-transfers) · [Stream](#stream-real-time-transfers) · [Latest](#latest-transfers) · [Native USDC](#native-usdc-transfers) · [By token](#transfers-of-a-token) · [By address](#transfers-of-an-address) · [Between two addresses](#transfers-between-two-addresses) · [Large transfers](#large-transfers) · [Top tokens](#most-transferred-tokens) · [Hourly volume](#hourly-transfer-volume-of-a-token) · [FAQ](#faq) --- ## How USDC appears in Transfers USDC exists in three forms on Arc. Check which one a row is before you sum or rank anything. | Currency | `SmartContract` | `Native` | Decimals | What it is | | --- | --- | --- | --- | --- | | USDC (native) | `0x` | `true` | 18 | The gas token and native value-transfer form. Read transaction fee fields for gas fees. | | USDC (ERC-20) | `0x3600000000000000000000000000000000000000` | `false` | 6 | The ERC-20 interface most contracts and wallets call. Symbol `USDC`, name `USDC`. | | System ledger | `0xfffffffffffffffffffffffffffffffffffffffe` | `false` | 0 | A system address that emits a raw `Transfer` event mirroring native USDC movements as 18-decimal integers with no symbol. Exclude it from token rankings. | Official tokens on Arc: | Token | Address | Decimals | | --- | --- | --- | | EURC | `0xbef5f6d51cb62b58e6a8f77868681825c6fe21c1` | 6 | | USYC | `0x8a5d989bbb96929f689b0200f435f53da42bf490` | 6 | --- ## Stream real-time transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-stream-transfers) Every transfer on the network as it is indexed. Filter inside `where` to narrow the socket to a token, an address or a size floor. ```graphql subscription { EVM(network: arc) { Transfers { Block { Number Time } Transaction { Hash From To } Transfer { Amount Sender Receiver Type Currency { Name Symbol SmartContract Native Decimals } } } } } ``` --- ## Latest transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-latest-transfers) ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol SmartContract Native } } } } } ``` --- ## Native USDC transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-native-usdc-transfers) `Currency: {Native: true}` selects value transfers of the gas token. The floor of 100 USDC keeps dust and fee movements out. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { Transfer: { Currency: {Native: true} Amount: {gt: "100"} } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Native } } } } } ``` --- ## Transfers of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-erc20-usdc-transfers) Filter on the token contract. This example reads the ERC-20 USDC interface; swap in EURC or any test token. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Decimals } } } } } ``` --- ## Transfers of an address ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-transfers-of-an-address) Incoming and outgoing transfers in one list. Replace the address with any wallet or contract. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ {Transfer: {Sender: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} {Transfer: {Receiver: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} ] } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol SmartContract Native } } } } } ``` ### Sent and received totals per token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-address-sent-received) Two aliased selections give the outbound and inbound sums per currency for a wallet. ```graphql { EVM(network: arc) { sent: Transfers( where: {Transfer: {Sender: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} orderBy: {descendingByField: "amount"} limit: {count: 10} ) { Transfer { Currency { Symbol SmartContract } } amount: sum(of: Transfer_Amount) count } received: Transfers( where: {Transfer: {Receiver: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"}}} orderBy: {descendingByField: "amount"} limit: {count: 10} ) { Transfer { Currency { Symbol SmartContract } } amount: sum(of: Transfer_Amount) count } } } ``` --- ## Transfers between two addresses ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-transfers-between-addresses) Flows from one address to another, in either direction. Useful for tracing a faucet, a bridge or a counterparty. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Block_Time} where: { any: [ { Transfer: { Sender: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"} Receiver: {is: "0xb92fe925dc43a0ecde6c8b1a2709c170ec4fff4f"} } } { Transfer: { Sender: {is: "0xb92fe925dc43a0ecde6c8b1a2709c170ec4fff4f"} Receiver: {is: "0xada5bb90d0de0bd1b6f3938708f49295a8d1f7cb"} } } ] } ) { Block { Time } Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Native } } } } } ``` --- ## Large transfers ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-large-usdc-transfers) This catches ERC-20 USDC moves above 10,000 and returns both token and USD amounts. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descending: Transfer_Amount} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} Amount: {gt: "10000"} } } ) { Block { Time } Transaction { Hash } Transfer { Amount AmountInUSD Sender Receiver Currency { Symbol } } } } } ``` --- ## Most transferred tokens ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-most-transferred-tokens) Tokens ranked by transfer count over 24 hours, with distinct senders and receivers. The system ledger address is excluded. ```graphql { EVM(network: arc) { Transfers( limit: {count: 20} orderBy: {descendingByField: "count"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Transfer: { Currency: {SmartContract: {not: "0xfffffffffffffffffffffffffffffffffffffffe"}} } } ) { Transfer { Currency { Symbol Name SmartContract Native } } count amount: sum(of: Transfer_Amount) senders: uniq(of: Transfer_Sender) receivers: uniq(of: Transfer_Receiver) } } } ``` --- ## Hourly transfer volume of a token ▶️ [Run in IDE](https://ide.bitquery.io/arc-mainnet-hourly-transfer-volume) Transfer volume of ERC-20 USDC bucketed by hour, for charts and alerts. ```graphql { EVM(network: arc) { Transfers( orderBy: {descendingByField: "Block_Time"} limit: {count: 24} where: { Transfer: { Currency: {SmartContract: {is: "0x3600000000000000000000000000000000000000"}} } } ) { Block { Time(interval: {in: hours, count: 1}) } amount: sum(of: Transfer_Amount) count senders: uniq(of: Transfer_Sender) } } } ``` --- ## FAQ **Does `AmountInUSD` work?** Yes. It returned populated values in the production check on 16 September 2026. **Which USDC address should I filter on?** For gas-token value transfers use `Currency: {Native: true}`. For the ERC-20 interface that wallets and contracts call, use `0x3600000000000000000000000000000000000000`. Do not filter on `0xfffffffffffffffffffffffffffffffffffffffe`; it is a system ledger that duplicates native movements as raw integers. **Why are native amounts 18 decimals when USDC has 6?** The EVM represents the gas token in wei-style 18-decimal units regardless of what the token is called. Bitquery applies those 18 decimals to native rows and the contract's own 6 decimals to ERC-20 rows, so `Amount` is a whole-token value in both cases. **Should I add native and ERC-20 USDC transfers together?** No. Arc's ERC-20 interface acts on the native USDC balance, so the two views can describe linked activity. Choose the form that matches the action you track and guard against double counting. **Can I read history older than the realtime window?** Not yet. Only the realtime path answered on 16 September 2026. Check the window with `Block { Time(minimum: Block_Time) }` and retry `archive` or `combined` before using them. **How do I stream transfers for one wallet?** Take the [transfers of an address](#transfers-of-an-address) query, change `query` to `subscription` and drop `limit` and `orderBy`. --- ## Argus Launchpad API on Arc: Launches, Dev Buys and Trades URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/argus-launchpad-api/ Track Argus token launches on Circle Arc with Bitquery. Decoded TokenCreated, FeeConfigured and DevBuy events, launch calls, Trading cube swaps, USD prices and OHLCV. # Argus Launchpad API on Arc: Launches, Dev Buys and Trades [Argus](https://argus.world/docs) is a token launchpad on Arc, Circle's EVM chain. Launches go through a portal contract that deploys the token, opens a Uniswap v4 curve and sets the fee split in one transaction. Bitquery decodes the portal's launch events and its `launch` call, so you get token name, symbol, creator, taxes and social links as named arguments. Use `EVM.Events` and `EVM.Calls` to find launches. All trading examples below use `Trading.Trades`, `Trading.Pairs`, or `Trading.Tokens`. Argus carries most of the launch activity on Arc. In a sample hour on 17 September 2026 it emitted 2,983 launch events against 10 from Tolly and 2 from Archemist, and 94,843 of the 94,968 launches recorded against its `TokenCreated` signature came from the portal contract below. :::note API access Run the saved examples in the Bitquery IDE, or create an [API access token](/docs/authorization/how-to-generate/) for `https://streaming.bitquery.io/graphql`. For streams, use `wss://streaming.bitquery.io/graphql` with [WebSocket authorization](/docs/authorization/websocket/). ::: ## Find the latest Argus token launches Filter by the portal address and the `TokenCreated` event. `Arguments` returns the token, creator, name, symbol, pool id, image URI, website, Twitter and Telegram. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-latest-launches) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {is: "TokenCreated"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ## Contracts and decoded events | Contract | Arc address | | --- | --- | | Argus launch portal | `0xb021be536808f551b31789422fd28a6c9c6e97da` | | Event | Signature | Key arguments | | --- | --- | --- | | `TokenCreated` | `TokenCreated(address,address,string,string,bytes32,string,string,string,string)` | `token`, `creator`, `name`, `symbol`, `poolId`, `imageURI`, `website`, `twitter`, `telegram` | | `CurveOpened` | `CurveOpened(address,bytes32,address,uint256,uint128,int24,int24)` | `token`, `poolId`, `locker`, `positionId`, `liquidity`, `tickLower`, `tickUpper` | | `FeeConfigured` | `FeeConfigured(address,address,uint16,uint16,uint16,uint16,uint16,uint16,uint16,uint16)` | `token`, `hook`, `lpFeeBps`, `buyTaxBps`, `sellTaxBps`, `treasuryBps`, `creatorBps`, `burnBps`, `dividendBps`, `liquidityBps` | | `PartsDeployed` | `PartsDeployed(address,address,address,address)` | `token`, `locker`, `hook`, `splitter` | | `DevBuy` | `DevBuy(address,address,uint256,uint256)` | `token`, `creator`, `quoteIn`, `tokensOut` | Each event's signature hash is its `Topics[0]`. Filter on these when you need rows the decoder has not named: | Event | Signature hash | | --- | --- | | `TokenCreated` | `1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a` | | `PartsDeployed` | `a54419a494ae20a1807712ab7a33ff0928b9a0e6e03e4562885aedb8e8fcd4da` | | `CurveOpened` | `55e45784ac0f1201c142dd0d2119dd11980e98f34cb682c49340d5c28c3a9aa0` | | `FeeConfigured` | `abe14607f311bb63e5b35c469f88100e8fb2ff250876e2364a402e2f2679e8aa` | | `DevBuy` | `84d429ed8af1c9cfe8bb07b556e4120e976c9f4c9232a7f50a15d31d83e232a9` | The first four fire together on every launch. `DevBuy` fires only when the creator buys in the launch transaction, which was 10% of launches on 17 September 2026. The `locker`, `hook` and `splitter` in `PartsDeployed` are deployed **per token**, so they differ on every launch. Read them from the event rather than caching them as protocol constants. Contract and events were checked against Arc data on 17 September 2026. See the [Argus docs](https://argus.world/docs) and the [Arc launchpad contract list](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/#verified-launchpad-contracts). :::caution Decoding start Decoded names and arguments are available from 17 September 2026, 12:48 UTC. Earlier rows have an empty `Signature.Name`, so the queries on this page do not return them. At the time of writing that is 450,457 undecoded rows against 48,249 decoded. To reach the earlier launches, filter on `Topics` instead — see [Launches from before the decoding cutover](#launches-from-before-the-decoding-cutover). ::: To query Trading, take the `token` argument, lowercase it and prefix it with `bid:arc:`. For example, PERP's token ID is `bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e`. These examples use two tokens whose `TokenCreated` events came from the Argus portal: | Sample token | Contract | | --- | --- | | PERP | `0x4389b473460474d68533bde2f873b5a2819f308e` | | GROKBOOK | `0xf25bed776bc17192fbc0630913888d8d1b9bbc1c` | They are user-created examples. Symbols are not unique on a launchpad, so always identify a token by its address. Replace the addresses with a token returned by the launch query. :::tip Build a launchpad token list The Trading cubes do not attach an Argus label to each token. Build that list from launch events, then pass the token IDs into Trading queries. Argus pools are Uniswap v4: `Pair.Market.Address` can be empty and several pools share `Pair.Pool.Address`, so include `Pair.Pool.Id` to select one pool. It matches the `poolId` argument of `TokenCreated`. ::: ## Stream new Argus launches Subscribe with the same portal and event filters. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-launch-stream) ```graphql subscription { EVM(network: arc) { Events( where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {is: "TokenCreated"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` Append new token IDs to your application's list. A Trading subscription has fixed filters: resubscribe with the updated list when a new launch arrives. Keep a time checkpoint and query recent events after reconnecting. Deduplicate launch records by transaction hash and log index. ## Argus launches by creator wallet Filter on the decoded `creator` argument to list every token one wallet launched. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-launches-by-creator) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {is: "TokenCreated"}}} Arguments: {includes: {Name: {is: "creator"}, Value: {Address: {is: "0x01af73b21b0efcd0716577c27fd6a267448db999"}}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ## Launch fees, curve and deployed contracts Filter on the decoded `token` argument to get the three setup events for one launch. `FeeConfigured` carries buy and sell tax and the fee split in basis points. `CurveOpened` has the v4 position and tick range. `PartsDeployed` lists the hook, locker and splitter contracts. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-launch-config) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {in: ["FeeConfigured", "CurveOpened", "PartsDeployed"]}}} Arguments: {includes: {Name: {is: "token"}, Value: {Address: {is: "0x4389b473460474d68533bde2f873b5a2819f308e"}}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ## Creator dev buys `DevBuy` records the creator's first buy in the launch transaction. `quoteIn` is the quote asset amount in its smallest unit (USDC uses 6 decimals) and `tokensOut` is the token amount in 18-decimal units. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-dev-buys) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {is: "DevBuy"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ### Stream dev buys [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-dev-buy-stream) ```graphql subscription { EVM(network: arc) { Events( where: { TransactionStatus: {Success: true} LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}, Removed: false} Log: {Signature: {Name: {is: "DevBuy"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {Name Signature}} Arguments { Name Type Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ## Argus launch calls The `launch` call carries inputs that the events do not: total supply, curve targets, the quote asset and the metadata URI. Struct members arrive as repeated rows in declaration order; `Path.Name` tells you whether a row belongs to the launch parameters (`p`) or the token metadata (`meta`). [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-launch-calls) ```graphql query { EVM(network: arc) { Calls( limit: {count: 10} orderBy: {descending: Block_Time} where: { TransactionStatus: {Success: true} Call: { To: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"} Signature: {Name: {is: "launch"}} Success: true } } ) { Block {Number Time} Transaction {Hash From} Call {From To Signature {Name Signature}} Arguments { Name Type Path {Name} Value { ... on EVM_ABI_Address_Value_Arg {address} ... on EVM_ABI_String_Value_Arg {string} ... on EVM_ABI_BigInt_Value_Arg {bigInteger} ... on EVM_ABI_Integer_Value_Arg {integer} ... on EVM_ABI_Bytes_Value_Arg {hex} } } } } } ``` ## Launches from before the decoding cutover `Topics` is populated whether or not the decoder has named an event, so it reaches the whole history. `Topics[0]` is the signature hash from the [table above](#contracts-and-decoded-events); the indexed `token` and `creator` follow, each left-padded to 32 bytes. This returns every Argus event for one token, including rows that predate the cutover and so carry an empty `Signature.Name` and no `Arguments`. [Run in Bitquery IDE](https://ide.bitquery.io/arc-argus-launches-by-topic) ```graphql { EVM(network: arc) { Events( limit: {count: 10} where: { LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}} Topics: {includes: [{Hash: {is: "0x00000000000000000000000041358defd0dedc90528b3f1835715e907b686e6a"}}]} } ) { Block { Time } Transaction { Hash From } Log { Signature { Name SignatureHash } } Topics { Hash } } } } ``` Take the final 40 hex characters of a padded topic and prefix `0x` to recover an address. Swap the padded token for a signature hash to pull one event type across every token instead. On undecoded rows, match `SignatureHash` against the table above and decode the unindexed fields from the log data in your own client using the full signatures. ## Launch rate per hour Bucket launches by hour and count distinct creators beside them, which separates a real crowd from one wallet minting in a loop. [Run in Bitquery IDE](https://ide.bitquery.io/arc-argus-launch-rate) ```graphql { EVM(network: arc) { Events( orderBy: {descendingByField: "launches"} where: { LogHeader: {Address: {is: "0xb021be536808f551b31789422fd28a6c9c6e97da"}} Log: {Signature: {SignatureHash: {is: "1d8917231579f8ce39407f0d616f36f357b07329b0ce5164d0754ac15145ce0a"}}} Block: {Time: {since_relative: {hours_ago: 6}}} } ) { Block { Time(interval: {in: hours, count: 1}) } launches: count uniqueCreators: count(distinct: Transaction_From) } } } ``` On 17 September 2026 this returned roughly 1,500 to 3,000 launches per hour from 450 to 740 distinct creators. Filtering on `SignatureHash` rather than the event name keeps the count correct across the decoding cutover. ## Recent trades for an Argus token Match the token on either side of the pair. This includes trades where it is the quote asset. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-recent-trades) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` `Side` is relative to `Pair.Token`. If the selected token is `Pair.QuoteToken`, reverse Buy/Sell when describing that token's direction. `PriceInUsd` also refers to `Pair.Token` and is an indexed reference price; use the amount ratio when you need the executed price. Use `AmountsInUsd.Quote` for quoted USD turnover. Do not add base and quote USD amounts from the same row. One transaction can contain several swaps; use a distinct transaction hash count for transaction totals. ## Stream trades for an Argus token The same token filters work as a Trading subscription. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-trade-stream) ```graphql subscription { Trading { Trades( where: { Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` For several tokens, replace each `is` token filter with an `in` list. Keep both the base-token and quote-token branches. ## Rank an Argus token watchlist by volume This sample ranks PERP and GROKBOOK over the last 24 hours. It includes only rows where a listed token is `Pair.Token`, so the Buy/Sell counts have a consistent meaning. Extend the list from launch events to cover more tokens. It is not a total for the whole launchpad. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-watchlist-volume) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: { Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Token: {Id: {in: [ "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e" "bid:arc:0xf25bed776bc17192fbc0630913888d8d1b9bbc1c" ]}} } } ) { Pair {Token {Id Symbol}} trades: count transactions: count(distinct: TransactionHeader_Hash) traders: count(distinct: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) buys: count(if: {Side: {is: "Buy"}}) sells: count(if: {Side: {is: "Sell"}}) } } } ``` :::caution Counts and volume These server aggregates count the indexed rows. The [Trading Trades field notes](/docs/trading/crypto-trades-api/trades-api/#before-you-aggregate-three-things-about-a-trades-row) describe duplicate rows that can affect exact totals. For audited figures, fetch the underlying rows and check duplicates before summing. Wallet counts refer to addresses, not people. ::: ## Most active traders for an Argus token Rank wallets by quoted USD turnover across both pair orientations. This measures activity, not profit. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-top-traders) ```graphql query { Trading { Trades( limit: {count: 10} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}}}} ] } ) { Trader {Address} trades: count transactions: count(distinct: TransactionHeader_Hash) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest price from the top market Use `Trading.Pairs` with rank 1 to retrieve the token's most recent one-minute price interval from its top market. Inspect `Interval.Time.End`: a quiet token can return an old interval, or no row at all. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-top-market-price) ```graphql query { Trading { Pairs( limit: {count: 1} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}} Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Ranking: {Position: {eq: 1}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} QuoteToken {Id Symbol} Pool {Address Id} Market {Network Protocol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Close}} Ranking {Position Weight} Volume {Usd} } } } ``` ## One-minute OHLCV candles `Trading.Tokens` combines indexed pools for the token. This query returns up to 120 one-minute intervals within the last 24 hours, newest first. Plot from oldest to newest. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-argus-ohlcv-candles) ```graphql query { Trading { Tokens( limit: {count: 120} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0x4389b473460474d68533bde2f873b5a2819f308e"}, NetworkBid: {is: "bid:arc"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Open High Low Close}} Volume {Base Usd} } } } ``` `Volume.Usd` is USD volume and `Volume.Base` is token units. Empty intervals may be absent; treat a missing interval as missing data unless your chart has an explicit fill rule. The current interval may still change. The same `Token.Id` and `Interval.Time.Start` can appear more than once; see the [Tokens field notes](/docs/trading/crypto-price-api/tokens/#field-notes). To stream candles, change `query` to `subscription`, remove `limit`, `orderBy`, and the historical `Block.Time` filter, and keep the token and interval filters. ## Related APIs - [Tolly Launchpad API](/docs/blockchain/arc-mainnet/tolly-launchpad-api/) - [RadarDEX Launchpad API](/docs/blockchain/arc-mainnet/radardex-launchpad-api/) - [Minara Launchpad API](/docs/blockchain/arc-mainnet/minara-launchpad-api/) - [Arc Launchpads API](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) - [Arc Blockchain API](/docs/blockchain/arc-mainnet/) - [Trading Trades API](/docs/trading/crypto-trades-api/trades-api/) - [Trading Tokens OHLCV API](/docs/trading/crypto-price-api/tokens/) --- ## BNB Chain DEXtrades API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-dextrades/ BNB Chain DEXtrades API: get BNB Chain DEX swaps, prices, and OHLC with Bitquery GraphQL queries and live streams. Built for traders and analytics teams. # BNB DEX Trades API :::tip Need real-time BNB / BSC 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: Binance Smart Chain`). Use this page when you need **historical BNB / BSC data older than ~30 days** (with `dataset: combined` or `archive`), raw per-swap detail, or call / event context. ::: Bitquery provides BSC DEX trade data through APIs, Streams, and Data Dumps. The examples below show how to access real-time and historical trade data across BSC-based DEXs using GraphQL APIs and subscriptions. Read [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) to get a better understanding on when to use which cube. If you're looking for other data points or have integration questions, reach out to [support](https://t.me/Bloxy_info). Need zero-latency BSC trade data? [Explore our Kafka Streams and request a trial ➤](/docs/streams/protobuf/chains/EVM-protobuf/) You may also be interested in: - [FourMeme APIs ➤](/docs/blockchain/BSC/four-meme-api/) - [BNB Uniswap API ➤](/docs/blockchain/BSC/bsc-uniswap-api/) - [BNB DEX Trades API ➤](/docs/blockchain/BSC/bsc-dextrades/) :::note To query or stream data via GraphQL **outside the Bitquery IDE**, you must generate an API access token. Follow these steps: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: ## Live DEX swap stream (BNB Chain) {#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: Binance Smart Chain`**. [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/All-BNB-Trade-Stream). ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Binance Smart Chain" } } } }) { 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 BSC Trades This example uses the chain-specific **DEXTrades** cube via `EVM(network: bsc) { DEXTrades }` (pool-side Buy/Sell; see [DEXTrades cube](/docs/cubes/dextrades)). USD fields can be empty on thin pools. For swap rows with trader + USD, use the [stream at the top](#crypto-trades-live-stream) of this page. You can find the query [here](https://ide.bitquery.io/subscribe-to-bsc-dex-trades) ```graphql subscription { EVM(network: bsc) { 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 { Decimals Fungible HasURI Name ProtocolName SmartContract Symbol } } } } } } ``` ## Latest Trades of a Token This query will fetch you latest trades for a token for the BSC network. You can test the query [here](https://ide.bitquery.io/latest-trades-of-a-token-on-bsc). ```graphql query LatestTrades($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descending: Block_Time} limit: {count: 50} where: {Trade: {Currency: {SmartContract: {is: $token}}, Price: {gt: 0}}} ) { Block { allTime: Time } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } AmountInUSD Buyer Seller Side { Type Buyer Seller } Price Amount Side { Currency { Symbol SmartContract Name } AmountInUSD Amount } } } } } { "network": "bsc", "token": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c" } ``` ![image](https://github.com/user-attachments/assets/160fa16e-1c75-49f2-a9ac-f3eeccf84276) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/token/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c#last_trades). ## Total Bought, Total Sold, Avg Sell price, Last Active Trade of a specific token by an Address Get total bought, total sold, average sell price, and last active trade time for a specific token by a trader. Test the query [here](https://ide.bitquery.io/Total-buy-total-sell-avg-sell-last-active_1) ```graphql query MyQuery($trader: String, $token: String) { EVM(dataset: realtime, network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $token } } } any: [ { Trade: { Buyer: { is: $trader } } } { Trade: { Seller: { is: $trader } } } ] } ) { Block { last_active_time: Time(maximum: Block_Time) } total_buy: sum( of: Trade_Amount if: { Trade: { Side: { Type: { is: buy } } } } ) total_sell: sum( of: Trade_Amount if: { Trade: { Side: { Type: { is: sell } } } } ) avg_sell_price_usd: average( of: Trade_PriceInUSD if: { Trade: { Side: { Type: { is: sell } } } } ) } } } ``` ```json { "trader": "0xc5C2653d38E241D62F96A4fB8f8497b6126F21dC", "token": "0x49d870B1d21D00c775DD03110Ef4c8FeF4Fd4444" } ``` ## Top Traders of a token This query will fetch you top traders of a token for the BSC network. You can test the query [here](https://ide.bitquery.io/top-traders--token-bsc_3). ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}}} ) { Trade { Buyer 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) } } } { "network": "bsc", "token": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c" } ``` ![image](https://github.com/user-attachments/assets/a6a09516-c36a-4e2f-b658-5c218a5d998b) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/token/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c#top_traders). ## Top Traders by profit in last 7 days This query will fetch you top traders by profit in the last 7 days for the BSC network. You can test the query [here](https://ide.bitquery.io/top-traders-in-last-7-days-by-profit_2). ```graphql query TopTraders($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "profit"} limit: {count: 100} where: {Trade: {Side: {Amount: {gt: "0"}}} Block:{Time:{since_relative:{days_ago:7}}}} ) { Trade { Buyer } profit: calculate(expression:"$sold-$bought") bought: sum(of: Trade_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) sold: sum(of: Trade_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "bsc" } ``` ## Get all Trading Pairs data of a specific token This query will fetch you all the trading pairs of a token for the BSC network. You can test the query [here](https://ide.bitquery.io/trading-pairs-of-a-token). ```graphql query tokenTrades($network: evm_network, $token: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "usd"} where: {Trade: {Currency: {SmartContract: {is: $token}}}, Block: {Time: {after: $time_3h_ago}}} limit: {count: 200} ) { Trade { Currency { Symbol Name SmartContract Fungible } Side { Currency { Symbol Name SmartContract } } price_usd: PriceInUSD(maximum: Block_Number) price_last: Price(maximum: Block_Number) price_10min_ago: Price( maximum: Block_Number if: {Block: {Time: {before: $time_10min_ago}}} ) price_1h_ago: Price( maximum: Block_Number if: {Block: {Time: {before: $time_1h_ago}}} ) price_3h_ago: PriceInUSD(minimum: Block_Number) } usd: sum(of: Trade_AmountInUSD) count } } } { "network": "bsc", "token": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c", "time_10min_ago": "2024-09-22T14:36:55Z", "time_1h_ago": "2024-09-22T13:46:55Z", "time_3h_ago": "2024-09-22T11:46:55Z" } ``` ![image](https://github.com/user-attachments/assets/9042c5a4-dc95-40d1-a723-fad43edc70fe) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/token/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c#token_trades). ## Get First 500 Buyers of a specific token Below API gets you the first 500 buyers of a specific BSC token, here as example we have taken this token `0x031b41e504677879370e9DBcF937283A8691Fa7f`. Try the API [here](https://ide.bitquery.io/first-500-buyers-of-a-specific-BSC-chain-token_2#). ```graphql query MyQuery { EVM(network: bsc, dataset: combined) { DEXTrades( limit: { count: 500 } orderBy: { ascending: Block_Time } limitBy: { count: 1, by: Trade_Sell_Buyer } where: { Trade: { Sell: { Currency: { SmartContract: { is: "0x031b41e504677879370e9DBcF937283A8691Fa7f" } } } } } ) { Block { Time } Trade { Sell { Buyer } } Transaction { From Hash } } } } ``` ## Get all DEXs where a specific token is listed This query will fetch you all the DEXs where a token is listed for the BSC network. You can test the query [here](https://ide.bitquery.io/get-all-dex-markets-for-a-token). ```graphql query tokenDexMarkets($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "amount"} where: {Trade: {Currency: {SmartContract: {is: $token}}}} ) { Trade { Dex { ProtocolFamily ProtocolName } } amount: sum(of: Trade_Amount) pairs: uniq(of: Trade_Side_Currency_SmartContract) trades: count } } } { "network": "bsc", "token": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c" } ``` ![image](https://github.com/user-attachments/assets/0fb63784-d6cc-42ad-b222-3c6d5da7b1e8) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/token/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c#token_dex_list). ## Get Price Change 5min, 1h, 6h and 24h of a specific token Use below query to get price change 5min, 1h, 6h and 24h of a specific token. Change the `Currency{SmartContract}` and `Dex{SmartContract}` according to your needs. Test the query [here] (https://ide.bitquery.io/Price-change-5min-1hr-6hr-precentage-of-a-specific-token_3). ```graphql query MyQuery { EVM(dataset: combined network:bsc) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0x85E92213fcA84aA99AdbAC5049D8426984D64444"}}, Dex: {SmartContract: {is: "0x2450f7D9A146cc7180C2e28f9bdF6Bcd5E28eF0A"}}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ){ Trade { Price_5min_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{minutes_ago:5}}}}) Price_1h_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{hours_ago:1}}}}) Price_6h_ago: PriceInUSD(minimum: Block_Number if:{Block:{Time:{since_relative:{hours_ago:6}}}}) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum( of: Trade_Side_AmountInUSD ) Price_Change_5min: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100") Price_Change_1h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100") Price_Change_6h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100") Price_Change_24h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100") } } } ``` ## Top 10 BSC Tokens by Price Change in last 1h Use below query to get top 10 BSC Tokens by Price Change in last 1h. Test the query [here] (https://ide.bitquery.io/Top-10-bsc-tokens-by-price-change-in-last-1-hr). ```graphql query MyQuery { EVM(dataset: combined network:bsc) { DEXTradeByTokens( limit:{count:10} orderBy:{descendingByField:"Price_Change_1h"} where: {TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Name Symbol SmartContract } Price_5min_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) Price_1h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) Price_6h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) Side { Currency { Name Symbol SmartContract } } Dex{ SmartContract } } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum(of: Trade_Side_AmountInUSD) Price_Change_5min: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100" ) Price_Change_1h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100" ) Price_Change_6h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100" ) Price_Change_24h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100" ) } } } ``` ## Get OHLC data of a token This query will fetch you the OHLC of a token for the BSC network. You can test the query [here](https://ide.bitquery.io/OHLC-for-a-token-on-bsc_1). ```graphql query tradingView($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {ascendingByField: "Block_Time"} where: {Trade: {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_AmountInUSD, selectWhere: {gt: "0"}) } } } { "network": "bsc", "token": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c" } ``` ![image](https://github.com/user-attachments/assets/c884565c-fbd3-4900-8939-6461ebad52cd) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/token/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c). ## Latest Trades of a Token pair This query will fetch you latest trades for a token pair for the BSC network. You can test the query [here](https://ide.bitquery.io/Latest-price-of-a-token-on-bsc). ```graphql query LatestTrades($network: evm_network, $token: String, $base: String) { EVM(network: $network) { 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}}} ) { Block { allTime: Time } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } Currency { Symbol SmartContract Name } Price AmountInUSD Amount Side { Type Currency { Symbol SmartContract Name } AmountInUSD Amount } } } } } { "network": "bsc", "token": "0x711bfe972465a1e9182766ad67aff3c80a0cf308", "base": "0x55d398326f99059ff775485246999027b3197955" } ``` ![image](https://github.com/user-attachments/assets/e9ab60ae-d2d3-4da9-95b0-bb1c79b97550) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/pair/0x711bfe972465a1e9182766ad67aff3c80a0cf308/0x55d398326f99059ff775485246999027b3197955#pair_latest_trades). ## Get OHLC Data For a Particular Token Pair This query will fetch you the OHLC of a token pair for the BSC network. You can test the query [here](https://ide.bitquery.io/BSC-OHLC-API-For-Token-Pair). ```graphql query tradingViewPairs { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( orderBy: {ascendingByField: "Block_Time"} where: {TransactionStatus: {Success: true}, Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: "0x55d398326f99059ff775485246999027b3197955"}}}, Currency: {SmartContract: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, Success: true}} limit: {count: 10} ) { Block { Time(interval: {count: 60, in: seconds}) } min: quantile(of: Trade_PriceInUSD, level: 0.1) max: quantile(of: Trade_PriceInUSD, level: 0.9) close: average(of: Trade_PriceInUSD) open: average(of: Trade_PriceInUSD) volume: sum(of: Trade_Side_AmountInUSD) } } } ``` ## Top Traders of a token pair This query will fetch you top traders of a token pair for the BSC network. You can test the query [here](https://ide.bitquery.io/pair-top-traders_2). ```graphql query pairTopTraders($network: evm_network, $token: String, $base: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}}} ) { Trade { Buyer 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) } } } { "network": "bsc", "token": "0x711bfe972465a1e9182766ad67aff3c80a0cf308", "base": "0x55d398326f99059ff775485246999027b3197955" } ``` ![image](https://github.com/user-attachments/assets/c7227a7b-eb1d-40e8-80e7-4412fb069c7f) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/pair/0x711bfe972465a1e9182766ad67aff3c80a0cf308/0x55d398326f99059ff775485246999027b3197955#pair_top_traders). ## Get Latest Trades on a specific DEX Use the **[Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)** to stream **live swaps** on BNB Chain. The example below only shows **PancakeSwap v3**: set **`Pair.Market.Network`** to **`Binance Smart Chain`** and **`Pair.Market.Protocol`** to **`pancake_swap_v3`**. Each event is one swap, with price in USD and the trader address. See [all BSC swaps](/docs/trading/crypto-trades-api/trades-api#how-do-i-stream-all-dex-trades-on-bsc-bnb-chain) in the Trades API doc, or open [every BSC swap in the IDE](https://ide.bitquery.io/All-BNB-Trade-Stream). For pool-level queries on PancakeSwap using **`EVM { DEXTrades }`**, use the [PancakeSwap API](/docs/blockchain/BSC/pancake-swap-api). ```graphql subscription { Trading { Trades( where: { Pair: { Market: { Network: { is: "Binance Smart Chain" } Protocol: { is: "pancake_swap_v3" } } } } ) { 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 } } } ``` To stream **a token on that DEX**, keep the same **`Pair.Market`** filters and add **`Pair.Token`** / **`Pair.QuoteToken`** (e.g. contract or **`Pair.Token.Id`**) — same patterns as token streams in the [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api). For a **DEXTrades**-style example keyed on factory + token, see this [IDE query](https://ide.bitquery.io/latest-trades-of-a-token-on-a-DEX). ## Get all DEXs where a specific token pair is listed This query will fetch you all the DEXs where a token pair is listed for the BSC network. You can test the query [here](https://ide.bitquery.io/pair-dex-list_5). ```graphql query pairDexList($network: evm_network, $token: String, $base: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "amount"} where: {Trade: {Currency: {SmartContract: {is: $token}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}}, 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 } } } { "network": "bsc", "token": "0x711bfe972465a1e9182766ad67aff3c80a0cf308", "base": "0x55d398326f99059ff775485246999027b3197955", "time_10min_ago": "2024-09-22T14:55:14Z", "time_1h_ago": "2024-09-22T14:05:14Z", "time_3h_ago": "2024-09-22T12:05:14Z" } ``` ![image](https://github.com/user-attachments/assets/9c48a155-6cce-4d14-b3ef-3cd32f77d66f) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/pair/0x711bfe972465a1e9182766ad67aff3c80a0cf308/0x55d398326f99059ff775485246999027b3197955#pair_dex_list). ## Top Gainers This query will fetch you top gainers for the BSC network. You can test the query [here](https://ide.bitquery.io/bsc-top-gainers). ```graphql query ($network: evm_network) { EVM(network: $network) { DEXTradeByTokens(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"}) } } } { "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/09a64034-a323-44c5-ab35-e21bde6a6fba) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc). ## Top Bought tokens This query will fetch you top bought tokens for the BSC network. Arranged in descending order of `bought - sold`. You can test the query [here](https://ide.bitquery.io/top-bought-bsc). ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens(orderBy: {descendingByField: "buy"}, 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}}}}) } } } { "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/46f1ea39-902b-4e84-850b-9575791964e7) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc). ## Top Sold tokens This query will fetch you top sold tokens for the BSC network. Arranged in descending order of `sold - bought`. You can test the query [here](https://ide.bitquery.io/top-sold-bsc). ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens(orderBy: {descendingByField: "sell"}, 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}}}}) } } } { "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/87e94f6a-cb15-4315-bb60-f72718548b2e) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc). ## Get all DEXs on BSC Network This query retrieves all the DEXes operating on BSC network and gives info such as `ProtocolName` , `ProtocolVersion` and `ProtocolFamily`. Find the query [here](https://ide.bitquery.io/Get-all-the-DEXs-on-BSC-network). ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTrades { Trade { Dex { ProtocolName ProtocolVersion ProtocolFamily } } count } } } ``` ## Subscribe to Latest Price of a Token in Real-time on BSC This query provides real-time updates on price of ETH `0x2170Ed0880ac9A755fd29B2688956BD959F933F8` in terms of WBNB `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`, including details about the DEX, market, and order specifics. Find the query [here](https://ide.bitquery.io/realtime-price-of-a-ETH-in-terms-of-WBNB) ```graphql subscription { EVM(network: bsc) { DEXTrades( where: {Trade: {Sell: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}, Buy: {Currency: {SmartContract: {is: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8"}}}}} ) { Block { Time } Trade { Buy { Amount AmountInUSD Buyer Seller Price_in_terms_of_sell_currency: Price PriceInUSD Currency { Name Symbol SmartContract } OrderId } Sell { Amount Buyer Seller Price_in_terms_of_buy_currency: Price Currency { Symbol SmartContract Name } OrderId } Dex { ProtocolFamily ProtocolName SmartContract ProtocolVersion } } } } } ``` ## Latest USD Price of a Token The below query retrieves the USD price of a token on BSC by setting `{Trade: {Buy: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}}}` . Check the field `PriceInUSD` for the USD value. You can access the query [here](https://ide.bitquery.io/realtime-usd-price-of-a-WBNB). ```graphql subscription { EVM(network: bsc) { DEXTrades( where: {Trade: {Buy: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } PriceAsymmetry(selectWhere: {lt: 1}) } } } } ``` ## Stablecoin Peg Health (Latest Price Across All DEXs) Get the **latest price of a stablecoin across all BSC 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/evm-peg-health_1) ```graphql { EVM(network: bsc) { DEXTradeByTokens( orderBy: {descending: Block_Time} limitBy: {count: 1 by:Trade_Dex_SmartContract} where: {Trade: { Currency: {SmartContract: {is: "CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s"}}}} ) { 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 } } } } } ``` ## Get all the DEXs on BSC network This query will fetch you all the DEXs info for the BSC network. You can test the query [here](https://ide.bitquery.io/all-dexs-info-on-bsc). ```graphql query DexMarkets($network: evm_network) { EVM(network: $network) { DEXTradeByTokens { Trade { Dex { ProtocolFamily } } buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Sender) count(if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/ec575065-8546-4831-9529-22ade580f1f5) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/dex_market). ## Get a specific DEX statistics This query will fetch you a specific DEX stats for the BSC network. You can test the query [here](https://ide.bitquery.io/particular-dex-stats). ```graphql query DexMarkets($network: evm_network, $market: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {ascendingByField: "Block_Time"} where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}} ) { Block { Time(interval: {count: 1, in: hours}) } trades: count buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Sender) tokens: uniq(of: Trade_Currency_SmartContract) } } } { "market": "Uniswap", "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/e48eeb0e-24e6-4865-8010-3616f384c309) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/dex_market/Uniswap). ## Get All Trading Pairs on a particular DEX This query will fetch you all trading pairs on a particular DEX for the BSC network. You can test the query [here](https://ide.bitquery.io/trading-pairs-on-a-specific-dex_1). ```graphql query DexMarkets($network: evm_network, $market: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "usd"} where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}, Block: {Time: {after: $time_3h_ago}}} limit: {count: 200} ) { Trade { Currency { Symbol Name SmartContract Fungible } Side { Currency { Symbol Name SmartContract } } price_usd: PriceInUSD(maximum: Block_Number) price_last: Price(maximum: Block_Number) price_10min_ago: Price( maximum: Block_Number if: {Block: {Time: {before: $time_10min_ago}}} ) price_1h_ago: Price( maximum: Block_Number if: {Block: {Time: {before: $time_1h_ago}}} ) price_3h_ago: PriceInUSD(minimum: Block_Number) } usd: sum(of: Trade_AmountInUSD) count } } } { "market": "Uniswap", "network": "bsc", "time_10min_ago": "2024-09-22T15:11:25Z", "time_1h_ago": "2024-09-22T14:21:25Z", "time_3h_ago": "2024-09-22T12:21:25Z" } ``` ![image](https://github.com/user-attachments/assets/e12bd461-3092-43d5-b579-acf8fc435671) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/dex_market/Uniswap). ## Top Traders on a DEX This query will fetch you Top Traders on a particular DEX for the BSC network. You can test the query [here](https://ide.bitquery.io/top-traders-on-a-specific-dex_1). ```graphql query DexMarkets($network: evm_network, $market: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}} ) { Trade { Buyer Dex { OwnerAddress ProtocolFamily ProtocolName } Currency { SmartContract Symbol Name } Side { Currency { SmartContract Symbol Name } } } volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "market": "Uniswap", "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/390ff5a1-8ff3-4385-9461-76de2d650eb9) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/dex_market/Uniswap#traders). ## Latest Trades on a DEX This query will fetch you latest trades on a particular DEX for the BSC network. You can test the query [here](https://ide.bitquery.io/latest-trades-on-a-particular-dex). ```graphql query LatestTrades($network: evm_network, $market: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descending: Block_Time} limit: {count: 50} where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}} ) { Block { Time } Transaction { Hash } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } AmountInUSD Price Amount Side { Type Currency { Symbol SmartContract Name } AmountInUSD Amount } Currency { Symbol SmartContract Name } } } } } { "market": "Uniswap", "network": "bsc" } ``` ![image](https://github.com/user-attachments/assets/4dd6bae1-10a2-4528-9f34-77808c594c5f) You can check the data here on [DEXrabbit](https://dexrabbit.bitquery.io/bsc/dex_market/Uniswap#trades). ## Aggregated Token Data (Volume & Price, Last 24h) Get up to 100 tokens with aggregated USD volume and average price over the last 24 hours, plus volume and price for 1h, 4h, and 24h via conditional metrics (Trading API; includes BSC and other chains). ▶️ [Aggregated Token Data](https://ide.bitquery.io/aggregated-data) ```graphql { Trading { Tokens( limit: { count: 100 } limitBy: { count: 1, by: Token_Id } where: { Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Token { Address Id IsNative Name Network Symbol TokenId } Volume { Usd H1VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }) H4VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }) H24VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 24 } } } }) } Price { Average { currentPrice: Mean(maximum: Block_Time) H1Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) H4Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 4 } } } } ) H24Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 24 } } } } ) } } } } } ``` ## 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) ```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) } } } ``` --- ## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply) The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which. ### Get All DEX Trades on BSC With Price, Market Cap, and Supply Stream **all BSC DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Network: Binance Smart Chain`** to capture every swap across all BSC DEXs in a single subscription. You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-BSC-with-Price-Marketcap-supply).
Click to expand GraphQL query ```graphql subscription { Trading { Trades( where: { Pair: { Market: { Network: { is: "Binance Smart Chain" } } } } ) { 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 } } } ```
### 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-bsc-pool).
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: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } ) { 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" } }) } } } ```
--- ## Video Tutorial on BSC DEXTrades API | How to get BSC Decentralized Exchange Data with DEX Trades API --- ## BNB Chain Gra Fun API URL: https://docs.bitquery.io/docs/blockchain/BSC/gra-fun-api/ GRA.fun on BNB Chain: new token creations, transfers, buys, sells and redeems, transaction details, and token trades on PancakeSwap v3 including first trades. # GRA.fun API :::tip Need real-time GRA.fun 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 GRA.fun swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical GRA.fun data older than ~30 days**, raw per-swap detail, or call / event context. ::: In this section we'll have a look at some examples using the BSC Transfers API. ## New Token Created Retrieve newly created tokens on the gra.fun platform using [query below](https://ide.bitquery.io/grafun-new-token-created-api). ```graphql { EVM(network: bsc) { Events( where: {Transaction: {To: {is: "0x8341b19a2a602eae0f22633b6da12e1b016e6451"}}, Call: {Signature: {Name: {is: "createPool"}}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Block { Number Time } Transaction { Hash To From } Log { Index Signature { Name } } Log { Signature { Name } } Arguments { Name 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 } } } Call { Signature { Name } From To } } } } ``` ## GRA fun All Transfers/Trades Retrieve all transfer and trade events related to the GRA fun using [this query](https://ide.bitquery.io/gra-fun-all-transfers). ```graphql { EVM(network: bsc) { Transfers( orderBy: {descending: Block_Time} limit: {count: 10} where: {Transaction: {To: {is: "0x8341b19a2a602eae0f22633b6da12e1b016e6451"}}} ) { Transaction { Hash From To } Call { Signature { Signature Name SignatureHash } } Transfer { Amount AmountInUSD Currency { Name Symbol SmartContract } Receiver Sender } } } } ``` ## GRA fun Redeem Transactions Retrieve all redeemed transactions using [this query](https://ide.bitquery.io/Gra-fun-redeem-transactions). ```graphql { EVM(network: bsc) { Events( orderBy: {descending: Block_Time} limit: {count: 100} where: {Transaction: {To: {is: "0x8341b19a2a602eae0f22633b6da12e1b016e6451"}}, Call: {Signature: {SignatureHash: {is: "1e9a6950"}}}} ) { Transaction { Hash From To } Call { CallPath CallerIndex Create Delegated Error From Gas GasUsed Index InternalCalls Reverted SelfDestruct Signature { Name SignatureHash } Success To Value } Log { Signature { Name Signature SignatureHash } } Arguments { Name Index Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` ## GRA fun Buy Transactions Retrieve all buy transactions from GRA.fun using [this query](https://ide.bitquery.io/Gra-fun-buy-transactions). ```graphql { EVM(network: bsc) { Events( orderBy: {descending: Block_Time} limit: {count: 100} where: {Transaction: {To: {is: "0x8341b19a2a602eae0f22633b6da12e1b016e6451"}}, Call: {Signature: {SignatureHash: {is: "db61c76e"}}}} ) { Transaction { Hash From To } Call { CallPath CallerIndex Create Delegated Error From Gas GasUsed Index InternalCalls Reverted SelfDestruct Signature { Name SignatureHash } Success To Value } Log { Signature { Name Signature SignatureHash } } Arguments { Name Index Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` ## GRA fun Sell Transactions Retrieve all sell transactions on GRA fun using [this query](https://ide.bitquery.io/Gra-fun-sell-transactions). ```graphql { EVM(network: bsc) { Events( orderBy: {descending: Block_Time} limit: {count: 100} where: {Transaction: {To: {is: "0x8341b19a2a602eae0f22633b6da12e1b016e6451"}}, Call: {Signature: {SignatureHash: {is: "2dc8f867"}}}} ) { Transaction { Hash From To } Call { CallPath CallerIndex Create Delegated Error From Gas GasUsed Index InternalCalls Reverted SelfDestruct Signature { Name SignatureHash } Success To Value } Log { Signature { Name Signature SignatureHash } } Arguments { Name Index Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ``` ## GRA fun Transaction Details Retrieve detailed information about a specific transaction using [this query](https://ide.bitquery.io/gra-fun-detailed-transfer-of-a-transaction). You can check Sender and Receiver of Transfers to understand what bought and sold. ```graphql { EVM(network: bsc, dataset: combined) { Transfers( orderBy: {descending: Block_Time} limit: {count: 10} where: {Transaction: {Hash: {is: "0xcf6b5a0789dacbf9fadffe0c00d208b5df39fadfef21302fe382cf6f6b433d3c"}}} ) { Transaction { Hash From To } Call { Signature { Signature Name SignatureHash } } Transfer { Amount AmountInUSD Currency { Name Symbol SmartContract } Receiver Sender } } } } ``` To get all transfers of on GRA.fun, please check [this query](https://ide.bitquery.io/gra-fun-all-transfers). ## Trades of a token on pancake v3 Use this API to get Pancake V3 APIs using [this api](https://ide.bitquery.io/Trades-of-token-on-pancake-v3) ```graphql { EVM(dataset: archive, network: bsc) { DEXTrades( orderBy: {descending: Block_Time} limit: {count: 100} where: {Block: {Date: {since: "2024-08-01"}}, any: [{Trade: {Buy: {Currency: {SmartContract: {is: "0xcac007926755e2675e201223f7d4d68c74fd3439"}}}}}, {Trade: {Sell: {Currency: {SmartContract: {is: "0xcac007926755e2675e201223f7d4d68c74fd3439"}}}}}]} ) { Trade { Dex { SmartContract ProtocolName ProtocolVersion } Buy { Amount AmountInUSD Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } Sell { Amount AmountInUSD Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } } } } } ``` ## First trade of a token on pancake v3 Get 1st trade of token on Pancake v3 using [this api](https://ide.bitquery.io/Trades-of-token-on-pancake-v3_5). ```graphql { EVM(dataset: combined, network: bsc) { DEXTrades( orderBy: [{ascending: Block_Time}{ascending:Transaction_Index}] limit: {count: 1} where: {Block: {Date: {since: "2024-07-01"}}, any: [{Trade: {Buy: {Currency: {SmartContract: {is: "0xcac007926755e2675e201223f7d4d68c74fd3439"}}}}}, {Trade: {Sell: {Currency: {SmartContract: {is: "0xcac007926755e2675e201223f7d4d68c74fd3439"}}}}}]} ) { Trade { Dex { SmartContract ProtocolName ProtocolVersion } Buy { Amount AmountInUSD Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } Sell { Amount AmountInUSD Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } } } } } ``` --- ## BNB Chain Liquidity API: PancakeSwap Pool Reserves in Real Time URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-liquidity-api/ BNB Chain pool reserves and spot prices with Bitquery GraphQL: PancakeSwap v2, v3 and Infinity pools, one pool now or streamed, every pool holding CAKE. # BNB Chain Liquidity API: PancakeSwap Pool Reserves in Real Time The `DEXPoolEvents` cube under `EVM(network: bsc)` emits one row every time a pool's reserves change, whether by a swap, a deposit or a withdrawal. Each row carries the reserves of both tokens after the change, in token units and in USD, the spot price in both directions, the pool and its protocol, and the transaction that moved it. BNB Chain is PancakeSwap territory, and the cube reports its three pool types under their own names: v2 pairs as `uniswap_v2`, the name shared by every Uniswap v2 fork, v3 pools as `pancake_swap_v3`, and Infinity pools as `pancakeswap_infinity`, alongside `uniswap_v3` and `uniswap_v4` pools. The cube holds the recent realtime window only and has no archive dataset: to keep a history, record the stream. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The worked pool is the PancakeSwap v3 USDT/WBNB pool, `0x172fcd41e0913e95784454622d1c3724f546f849`, the busiest pool on the chain. ## What the pool holds right now Ten rows, newest first, each a snapshot taken after one change. Read `AmountCurrencyA` and `AmountCurrencyB` for the two reserves, their `InUSD` twins for the dollar value, and `AtoBPrice` for the spot rate of A in B at that moment. Saved query [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-a-Specific-Pool_2). ```graphql { EVM(network: bsc) { DEXPoolEvents( limit: { count: 10 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { SmartContract: { is: "0x172fcd41e0913e95784454622d1c3724f546f849" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Dex { ProtocolName } } Transaction { Hash } } } } ``` ## Follow the pool as it moves Subscribe with the same pool filter and a row arrives on every reserve change; on this pool that is many rows a second, so batch them on your side. Saved stream [here](https://ide.bitquery.io/Realtime-Liquidity-Stream-of-a-Specific-Pool_1). ```graphql subscription { EVM(network: bsc) { DEXPoolEvents( where: { PoolEvent: { Pool: { SmartContract: { is: "0x172fcd41e0913e95784454622d1c3724f546f849" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol } CurrencyB { Symbol } } } Transaction { Hash } } } } ``` ## Every PancakeSwap Infinity pool Infinity pools live inside one manager contract, like Uniswap v4, so `Pool.SmartContract` repeats on every row and `Pool.PoolId` identifies the pool. Filter on the protocol name to follow all of them; swap in `uniswap_v4` for the Uniswap v4 pools on BNB Chain. Saved stream [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-Pools-in-a-Specific-DEX-Protocol---Uniswap-V4). ```graphql subscription { EVM(network: bsc) { DEXPoolEvents( where: { PoolEvent: { Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } ) { Block { Time } PoolEvent { Pool { PoolId SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } Transaction { Hash } } } } ``` ## Where a token sits To see every pool that holds CAKE, `0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82`, keep the newest row per pool with `limitBy` and ask for pools that list CAKE as `CurrencyA` inside the window; a second run with CAKE under `CurrencyB` catches the pools that list it second. The PancakeSwap v2 CAKE/WBNB pair comes out on top by a wide margin. Rank the rows by the USD reserve in your code. Saved query [here](https://ide.bitquery.io/Realtime-Liquidity-Stream_2). ```graphql { EVM(network: bsc) { DEXPoolEvents( limit: { count: 20 } limitBy: { by: PoolEvent_Pool_SmartContract, count: 1 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { CurrencyA: { SmartContract: { is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Time } PoolEvent { Dex { ProtocolName } Pool { SmartContract PoolId CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } } } } } ``` ## How to read a row - Reserves after the change: `Liquidity.AmountCurrencyA` and `AmountCurrencyB` in token units, `AmountCurrencyAInUSD` and `AmountCurrencyBInUSD` in dollars. - Spot rate after the change: `AtoBPrice` and `BtoAPrice`. - Which pool: `Pool.SmartContract` for v2 and v3 pools; for Infinity and Uniswap v4 the manager address plus `Pool.PoolId`. - Which protocol: `Dex.ProtocolName`, one of `uniswap_v2` (every v2 fork, PancakeSwap v2 included), `pancake_swap_v3`, `pancakeswap_infinity`, `uniswap_v3` or `uniswap_v4`. - Which transaction: `Transaction.Hash`. ## Kafka instead of WebSocket The `bsc.dexpools.proto` topic delivers these rows as protobuf messages, which is the better fit for BNB Chain's volume: no socket to keep alive and consumers can be scaled out. Kafka credentials are separate from the IDE token; the [Kafka streams hub](/docs/category/kafka-streams) explains how to get them. ## Related pages - [BNB Chain DEX trades API](/docs/blockchain/BSC/bsc-dextrades) - [PancakeSwap Infinity API](/docs/blockchain/BSC/bsc-pancakeswap-infinity-api) - [DEXPools cube](/docs/cubes/evm-dexpool/) - [Arbitrum liquidity API](/docs/blockchain/Arbitrum/arbitrum-liquidity-api) - [Base liquidity API](/docs/blockchain/Base/base-liquidity-api) --- ## BNB Chain NFT API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-nft/ Track BNB Chain NFT trades, ownership, and metadata with Bitquery GraphQL queries, filters, and real-time streaming options. # BSC NFT API In this section we'll have a look at some examples using the BSC NFT API. ## Track Transfers of a specific NFT on BSC in Realtime This query subscribes you to the real time non-fungible token (NFT) transfers of a specific nft contract on the BSC network. You can find the query [here](https://ide.bitquery.io/Track-realtime-NFT-Transfers-of-a-specific-NFT-on-BSC-chain) ```graphql subscription { EVM(network: bsc) { Transfers( where: {Transfer: {Currency: {Fungible: false, SmartContract: {is: "0x3d2c83bbbbfb54087d46b80585253077509c21ae"}}}} ) { Block { Hash Number } Transfer { Amount Currency { Name SmartContract Symbol Native } Sender Receiver } } } } ``` --- ## BNB Chain Pancake Swap API URL: https://docs.bitquery.io/docs/blockchain/BSC/pancake-swap-api/ Query and stream PancakeSwap trades on BNB Chain with Bitquery GraphQL: latest swaps, live subscriptions, token prices, OHLC and trader activity. # Pancake Swap API For coverage, plans and streaming options on BNB Chain, see the [Binance Smart Chain API](https://bitquery.io/products/binance-smart-chain-api-post) page. :::tip Need real-time PancakeSwap 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 PancakeSwap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use the `EVM` queries on this page for raw per-swap detail or call and event context. An `EVM` query without a `dataset` argument runs on the realtime dataset, which holds only the last few days; add `dataset: combined` or `dataset: archive` for **historical PancakeSwap data**. ::: In this section we will use APIs from Bitquery to get the on-chain trade related data, trade metrics, trades for a token or a trader on the Pancake Swap DEX. To get the trade activities of the Pancake Swap exclusively we have added a filter out trades based on `Factory Contract` address, `0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865` for the case of Pancake Swap V3. To get the trades and trade related data for Pancake Swap V1 or V2 you would need their respective addresses. Create your account and get started by following the [Quickstart instructions](/docs/start/first-query/). ## Bitquery DEX Data Access Options - **GraphQL APIs**: Query historical and real-time EVM data with flexible filtering and aggregation - **Real-time Streams**: Subscribe to live EVM blockchain events via WebSocket subscriptions - **Cloud Solutions**: Access EVM data through AWS, GCP, and Snowflake or your custom cloud solution. - **Kafka Streams**: High-throughput data streaming for enterprise applications ## Getting Started with Bitquery: - [BSC DEX Trades](/docs/blockchain/BSC/bsc-dextrades/): Real time DEX Trading data via examples. - [BSC Uniswap APIs](/docs/blockchain/BSC/bsc-uniswap-api/): Uniswap Trades on BSC network with the help of examples. - [BSC Four Meme APIs](/docs/blockchain/BSC/four-meme-api/): Four Meme Trades on BSC network with the help of examples. - [Trade APIs](/docs/trading/crypto-price-api/examples/): Multi-chain Trade API Examples. ## Get Latest Trades on Pancake Swap This API returns the [most recent trades on PancakeSwap v3](https://ide.bitquery.io/Latest-BSC-PancakeSwap-v3-dextrades).
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { DEXTrades( orderBy: [ { descending: Block_Time } { descending: Transaction_Index } { descending: Trade_Index } ] where: { TransactionStatus: { Success: true } Trade: { Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } limit: { count: 20 } ) { Block { Time Number } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ```
## Streaming Latest Trades on Pancake Swap This subscription [streams the latest trades on PancakeSwap v3](https://ide.bitquery.io/Latest-BSC-PancakeSwap-v3-dextrades---Stream_2).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { DEXTrades( where: { TransactionStatus: { Success: true } Trade: { Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } ) { Block { Time Number } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ```
## Subscribe to Mempool Trades on Pancake Swap This subscription [streams PancakeSwap v3 trades from the mempool](https://ide.bitquery.io/Mempool---Latest-BSC-PancakeSwap-v3-dextrades---Stream_1), before they are confirmed.
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { TransactionStatus: { Success: true } Trade: { Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } ) { Block { Time Number } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ```
## Latest Trades of a Token on Pancake Swap This returns the [latest trades of one token on PancakeSwap v3](https://ide.bitquery.io/BSC-PancakeSwap-v3-Trades-for-a-token), CAKE (`0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82`) in this example. You can also [stream the same trades live](https://ide.bitquery.io/Stream---BSC-PancakeSwap-v3-Trades-for-a-token).
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { DEXTradeByTokens( limit: { count: 20 } orderBy: [ { descending: Block_Time } { descending: Transaction_Index } { descending: Trade_Index } ] where: { Trade: { Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } Currency: { SmartContract: { is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } } } ) { Block { Time Number } TransactionStatus { Success } Log { Signature { Name Signature } SmartContract } Receipt { ContractAddress } Call { From Gas GasUsed InternalCalls Signature { Name Signature } To Value } Trade { Amount AmountInUSD Buyer Price PriceInUSD Buyer Seller Sender Success URIs Fees { Amount AmountInUSD Payer Recipient } Dex { ProtocolName ProtocolFamily } Currency { Name Symbol SmartContract } Side { Amount AmountInUSD Buyer Currency { Name Symbol SmartContract } Ids OrderId Seller Type URIs } } Transaction { Hash From To } } } } ```
Also, checkout the [Four Meme](/docs/blockchain/BSC/four-meme-api/) documentation for APIs related to Four Meme tokens and Four Meme Exchange. ## Get Top Traders of a Token on Pancake Swap Returns the [top 100 traders of CAKE on PancakeSwap v3](https://ide.bitquery.io/top-traders-of-a-token-on-pancakeswap-bsc) by USD volume. It ranks `Transaction.From`, the account that sent each swap, since on a sale `Trade.Buyer` is the pool or a router. `Side.Type` describes the counter-side of each trade, so `bought` sums the rows where `Side.Type` is `sell`. `PriceAsymmetry: { lt: 0.1 }` leaves out trades whose two sides disagree on value ([PriceAsymmetry reference](/docs/graphql/metrics/priceAsymmetry/)). > Note: This queries the `realtime` database by default. To query `archive` data, change the `dataset` parameter and add a date period as a filter
Click to expand GraphQL query ```graphql { EVM(network: bsc) { DEXTradeByTokens( orderBy: { descendingByField: "volumeUsd" } limit: { count: 100 } where: { Trade: { Currency: { SmartContract: { is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } PriceAsymmetry: { lt: 0.1 } } } ) { Transaction { From } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum( of: Trade_Amount if: { Trade: { Side: { Type: { is: sell } } } } ) sold: sum( of: Trade_Amount if: { Trade: { Side: { Type: { is: buy } } } } ) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ```
## Get Trading Volume, Buy Volume, Sell Volume of a Token Returns the [traded, buy and sell volume of CAKE](https://ide.bitquery.io/trade_volume_bsc_pancakeswap) on PancakeSwap v3 over the last 24 hours. `PriceAsymmetry: { lt: 0.1 }` drops mispriced trades, which would otherwise skew the USD sums.
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } PriceAsymmetry: { lt: 0.1 } } TransactionStatus: { Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract Decimals } } traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD) sell_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: buy } } } } ) buy_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: sell } } } } ) } } } ```
## Get Metadata of a Token Returns a [token's metadata](https://ide.bitquery.io/get-metadata-pancakeswap): `Name`, `Symbol`, `SmartContract` and `Decimals`.
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Trade: { Currency: { SmartContract: { is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } ) { Trade { Currency { Name Symbol SmartContract ProtocolName HasURI Fungible Decimals } } } } } ```
## OHLC of a Token on Pancake Swap This returns [OHLC (K-line) data for one token against another](https://ide.bitquery.io/bsc-pancakeswap-ohlc-using-trading-api). This query uses the `Trading` cube from the [Crypto Price APIs](/docs/trading/crypto-price-api/)
Click to expand GraphQL query ```graphql { Trading(dataset: realtime) { Pairs( where: { Price: { IsQuotedInUsd: false } Interval: { Time: { Duration: { eq: 1 } } } Currency: { Id: { is: "bid:eth" } } QuoteCurrency: { Id: { is: "usdc" } } Market: { Protocol: { is: "pancake_swap_v3" } } } limit: { count: 10 } orderBy: { descending: Interval_Time_End } ) { Token { Id Symbol Address NetworkBid Network Name } QuoteToken { Id Symbol Address Name NetworkBid } Interval { Time { Start End Duration } } Volume { Usd Quote Base } Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Estimate ExponentialMoving Mean SimpleMoving WeightedSimpleMoving } } } } } ```
## Price Change Percentage for a Token on Pancake Swap This returns the [price change percentage of a PancakeSwap token](https://ide.bitquery.io/Percentage-price-change-for-a-pancake-swap-token) over `24hr`, `1hr` and `5 min`, using the [calculate expression](/docs/graphql/capabilities/expression/) feature.
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } } Dex: { OwnerAddress: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract } price_24hr: PriceInUSD(minimum: Block_Time) price_1hr: PriceInUSD( if: { Block: { Time: { is_relative: { hours_ago: 1 } } } } ) price_5min: PriceInUSD( if: { Block: { Time: { is_relative: { minutes_ago: 1 } } } } ) current: PriceInUSD } change_24hr: calculate( expression: "( $Trade_current - $Trade_price_24hr ) / $Trade_price_24hr * 100" ) change_1hr: calculate( expression: "( $Trade_current - $Trade_price_1hr ) / $Trade_price_1hr * 100" ) change_5min: calculate( expression: "( $Trade_current - $Trade_price_5min ) / $Trade_price_5min * 100" ) } } } ``` ```json { "currency": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } ```
## New Liquidity Pools Created on Pancake Swap This returns the [latest pool creation events on PancakeSwap v3](https://ide.bitquery.io/New-pools-created-on-PancakeSwap-v3). You can also [stream new pools as they are created](https://ide.bitquery.io/Stream---New-pools-created-on-PancakeSwap-v3). To make sure that we are only getting newly created liquidity pools on Pancake Swap, we are applying the conditon that the `LogHeader` is `0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865`.
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { Events( orderBy: [ { descending: Block_Time } { descending: Transaction_Index } { descending: Log_Index } ] where: { LogHeader: { Address: { is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } Log: { Signature: { Name: { is: "PoolCreated" } } } } ) { Block { Time Number Hash } Receipt { ContractAddress } Topics { Hash } TransactionStatus { Success } LogHeader { Address Index Data } Transaction { Hash From To } Log { EnterIndex ExitIndex Index LogAfterCallIndex Pc SmartContract Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
## Subscribe the Liquidity Addition Event on Pancake Swap Liquidity addition is an important event related to any liquidity pool. This subscription [streams liquidity additions to PancakeSwap v3 pools](https://ide.bitquery.io/Stream---Liqiidity-add-for-all-tokens-on-PancakeSwap-v3) in real time. To make sure that we are only getting liquidity addition events for Pancake Swap we are placing condition that the transaction is sent to `0x46A15B0b27311cedF172AB29E4f4766fbE7F4364` address.
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { Events( orderBy: [ { descending: Block_Time } { descending: Transaction_Index } { descending: Log_Index } ] where: { Log: { Signature: { Name: { is: "Mint" } } } Transaction: { To: { is: "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364" } } } ) { Block { Time Number Hash } Receipt { ContractAddress } Topics { Hash } TransactionStatus { Success } LogHeader { Address Index Data } Transaction { Hash From To } Log { EnterIndex ExitIndex Index LogAfterCallIndex Pc SmartContract Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
## Subscribe the Liquidity Removal Event on Pancake Swap This subscription [streams liquidity removals from PancakeSwap v3 pools](https://ide.bitquery.io/Stream---Liquidity-remove-for-all-tokens-on-PancakeSwap-v3).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { Events( orderBy: [ { descending: Block_Time } { descending: Transaction_Index } { descending: Log_Index } ] where: { Log: { Signature: { Name: { is: "Burn" } } } Transaction: { To: { is: "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364" } } } ) { Block { Time Number Hash } Receipt { ContractAddress } Topics { Hash } TransactionStatus { Success } LogHeader { Address Index Data } Transaction { Hash From To } Log { EnterIndex ExitIndex Index LogAfterCallIndex Pc SmartContract Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
## Get the Latest Pool Reserves for a Pair on Pancake Swap This returns the latest reserves of one PancakeSwap v3 pool, given its address (`0xafb2da14056725e3ba3a30dd846b6bbbd7886c56` in this example).
Click to expand GraphQL query ```graphql { EVM(dataset: combined, network: bsc) { Balances( where: { Currency: { SmartContract: { in: [ "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c" ] } } Balance: { Address: { is: "0xafb2da14056725e3ba3a30dd846b6bbbd7886c56" } } } ) { Balance { Amount(selectWhere: { gt: "0" }) } Currency { Name Symbol SmartContract Decimals } } } } ```
## All Pairs of a Token on Pancake Swap This returns [every pair of a token on PancakeSwap v3](https://ide.bitquery.io/All-pools-of-a-token-on-pancake-swap_2). The result contains info of the liquidity pool such as currency details, trade amount, number of trades and price of token in USD in various time frames.
Click to expand GraphQL query ```graphql query pairDexList( $network: evm_network $base: String $time_10min_ago: DateTime $time_1h_ago: DateTime $time_3h_ago: DateTime $time_ago: DateTime $owner: String ) { EVM(network: $network) { DEXTradeByTokens( orderBy: { descendingByField: "amount" } where: { TransactionStatus: { Success: true } Trade: { Currency: { SmartContract: { is: $base } } Side: { Amount: { gt: "0" } } Dex: { OwnerAddress: { is: $owner } } } Block: { Time: { after: $time_ago } } } ) { Trade { Currency { Name SmartContract } Side { Currency { Name SmartContract } } Dex { SmartContract } 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( maximum: Block_Number if: { Block: { Time: { before: $time_3h_ago } } } ) } amount: sum(of: Trade_Side_AmountInUSD) trades: count } } } ``` ```json { "network": "bsc", "owner": "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865", "base": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82", "time_10min_ago": "2025-04-10T09:03:33Z", "time_1h_ago": "2025-04-10T08:13:33Z", "time_3h_ago": "2025-04-10T06:13:33Z", "time_ago": "2025-04-07T09:13:33Z" } ```
## Video Tutorials ### Get Pancakeswap Token Trade Metrics using Bitquery API ### How to get PancakeSwap trades in realtime --- ## BNB Chain Slippage API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-slippage-api/ BNB Chain Slippage API: measure BNB Chain DEX price impact and slippage with Bitquery GraphQL pool metrics. Covers archive history and realtime data. # BSC Slippage API In this section we will see how to get BSC DEX pool slippage information using our API. The slippage API helps you understand price impact and liquidity depth for token swaps on BSC DEX pools. ## Understanding Slippage and Price Impact Slippage refers to the difference between the expected price of a trade and the actual execution price. When swapping tokens in a DEX pool, larger trades can move the price due to limited liquidity, resulting in slippage. The DEXPoolSlippages API provides detailed information about: - Maximum input amounts that can be swapped at different slippage tolerances - Minimum output amounts guaranteed at each slippage level - Average execution prices for different trade sizes - Price impact calculations for both swap directions (A to B and B to A) For a comprehensive explanation of how DEX pools work, liquidity calculations, and price tables, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/). ## Realtime Slippage Monitoring This subscription query returns real-time slippage data for all DEX pools on BSC. You can monitor price impact and liquidity depth as trades occur. You can find the query [here](https://ide.bitquery.io/realtime-slippage-on-bsc) ```graphql subscription { EVM(network: bsc) { DEXPoolSlippages { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` ## Latest Slippage for a Specific Pool This query retrieves the latest slippage data for a specific DEX pool on BSC. Use this to check current liquidity depth and price impact for a particular token pair. You can find the query [here](https://ide.bitquery.io/Latest-slippage-of-a-pool-on-Pancakeswap) ```graphql query { EVM(network: bsc) { DEXPoolSlippages( where: {Price: {Pool: {SmartContract: {is: "0x42161084d0672e1d3f26a9b53e653be2084ff19c"}}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` > **Note:** This query can be converted to a subscription to monitor in real-time. Simply replace `query` with `subscription` to receive live updates whenever the pool's liquidity changes. ## Realtime Slippage Data via Kafka Streams Slippage data can also be obtained via Kafka streams for lower latency and better reliability. The Kafka topic for BSC DEX pools is: **`bsc.dexpools.proto`** Kafka streams provide the same slippage data as GraphQL subscriptions but with several advantages: - Lower latency due to shorter data pipeline - Better reliability with persistent connections - Ability to read from latest offset without gaps - Better scalability with multiple consumers For detailed information on how to connect to Kafka streams, subscribe to topics, and parse messages, refer to the [Kafka Streaming Concepts documentation](/docs/streams/kafka-streaming-concepts/). > **Note:** IDE credentials will not work with Kafka Streams. You need separate Kafka credentials. Please contact sales on our official telegram channel or fill out the [form on our website](https://bitquery.io/forms/api). ## Understanding the Response The `DEXPoolSlippages` API response contains the following information: - **`Price`**: Price information for swaps at a specific slippage tolerance - **`AtoB`**: Price data for swapping CurrencyA to CurrencyB - `Price`: Average execution price for swaps at this slippage level - `MinAmountOut`: Minimum output amount guaranteed at this slippage level - `MaxAmountIn`: Maximum input amount that can be swapped at this slippage level - **`BtoA`**: Price data for swapping CurrencyB to CurrencyA (same structure as AtoB) - **`SlippageBasisPoints`**: Slippage tolerance in basis points (100 = 1%) - **`Pool`**: Pool information including token pair details - **`Dex`**: DEX protocol information (Uniswap V2, V3, V4, etc.) - **`Block`**: Block information when the slippage data was recorded - `Time`: Timestamp of the block - `Number`: Block number For more details on how slippage is calculated and when new pool records are emitted, see the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#when-is-a-new-dexpool-record-emitted-in-the-apis--streams). ## Use Cases ### Liquidity Depth Analysis Use the slippage API to analyze which pools can handle large trades without significant price impact. By examining `MaxAmountIn` values at different slippage levels, you can: - Identify pools with sufficient liquidity for your trade size - Determine optimal slippage tolerance settings - Estimate price impact before executing trades ### Multi-Pool Price Comparison Compare execution prices across different pools and slippage scenarios to: - Find the best pool for your specific trade size - Understand price differences between DEX protocols - Optimize trade execution strategies ### Trading Applications #### Live Execution Testing Use the slippage API to test and validate trade execution strategies in real-time: - **Pre-trade validation**: Check if your intended trade size can be executed within acceptable slippage bounds before submitting - **Execution simulation**: Calculate expected price impact and minimum output amounts for different trade sizes - **Strategy backtesting**: Monitor historical slippage data to validate trading algorithms and optimize entry/exit points - **Risk assessment**: Evaluate maximum position sizes that can be entered without exceeding your slippage tolerance #### Detecting Liquidity Shocks and Toxic Order Flow The slippage API helps identify temporary price dislocations and liquidity shocks that can be exploited or avoided: - **Flow toxicity detection**: Monitor sudden changes in `MaxAmountIn` values to detect when pools experience large outflows or inflows - **Price impact analysis**: Track how `MinAmountOut` changes relative to `MaxAmountIn` to identify when pools become less liquid - **Mean reversion opportunities**: Identify pools where large swaps have created temporary price dislocations that may revert - **Toxic order flow avoidance**: Use slippage data to avoid entering positions when liquidity is thin or when large trades are likely to move price against you For a practical implementation example of using slippage data for automated trading strategies, including flow toxicity detection and mean-reversion trading, see the [AMM Flow Toxicity Alpha Engine](https://github.com/Divyn/amm-flow-toxicity-alpha-engine) repository. This system demonstrates how to: - Detect large swaps that move price significantly (50-500 basis points) - Verify isolation from trending markets - Execute fade trades against temporary price impacts - Manage positions with dynamic stop losses and take profits based on slippage data For more advanced use cases, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#advanced-use-cases-and-processing-patterns). --- ## BNB Chain Transfers API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-transfers/ BNB Chain Transfers API: monitor BNB Chain native and token transfers in real time with Bitquery GraphQL APIs. Includes filters and field selection tips. # BSC Transfers API In this section we'll have a look at some examples using the BSC Transfers API. ## Subscribe to Recent Whale Transactions of a particular currency The subscription query below fetches the whale transactions on the BSC network. We have used WBNB address `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`. You can find the query [here](https://ide.bitquery.io/Whale-transfers-of-USDC-on-BSC) ```graphql subscription{ EVM(network: bsc) { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}, Amount: {ge: "10000"}}} ) { Transaction { From Hash } Transfer { Amount Sender Receiver Currency { SmartContract Symbol Name Fungible Native } Id } } } } ``` ## Sender is a particular address This websocket retrieves transfers where the sender is a particular address `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`. For this subscription query we use `where` keyword and in that we specify `{Transfer: {Sender: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}` to get the desired data. You can find the query [here](https://ide.bitquery.io/Transfers-where-sender-is-a-particular-address) ```graphql subscription { EVM(network: bsc) { Transfers( where: {Transfer: {Sender: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}} ) { Transfer { Amount AmountInUSD Currency { Name SmartContract Native Symbol Fungible } Receiver Sender } Transaction { Hash } } } } ``` ## Transactions From/To An Address with Transfer Details [Run Query](https://ide.bitquery.io/Sender-OR-Receiver-Transfer-Example-BSC) ```graphql query MyQuery { EVM(dataset: archive, network: bsc) { Transfers( where: {any: [{Transaction: {From: {is: "0x2b9dfb290ad7b54a5b86da25c3a629bfc7152167"}}}, {Transaction: {To: {is: "0x2b9dfb290ad7b54a5b86da25c3a629bfc7152167"}}}], Transfer: {}, Block: {Date: {since: "2025-08-10", till: "2025-08-29"}}} limit: {count: 10000} orderBy: {descending: Block_Time} ) { Transfer { Amount AmountInUSD Sender Receiver Currency { Symbol Name } Index } Transaction { Hash } Block { Number Time } } } } ``` ## Subscribe to the latest NFT token transfers on BSC 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 BSC network. You can run the query [here](https://ide.bitquery.io/Track-realtime-NFT-Transfers-on-BSC-chain) ```graphql subscription { EVM(network: bsc) { Transfers( where: { Transfer: { Currency: { Fungible: false } } } ) { Block { Hash Number } Transfer { Amount Currency { Name SmartContract Symbol Native } Sender Receiver } } } } ``` ## Check if an address ever interacted with predict.fun (USDT → protocol receivers) Predict.fun flows on BSC often show up as USDT (`0x55d398326f99059fF775485246999027B3197955`) transfers **from** the user's wallet **to** one of the protocol contract addresses listed below. `limit: { count: 1 }` is enough for a historic “has this wallet interacted?” probe. **Try it:** [IDE — predict.fun interaction check](https://ide.bitquery.io/check-if-an-address-interacted-with-predictfun-ever) ```graphql query ($address: String) { EVM(dataset: realtime, network: bsc) { Transfers( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Transfer: { Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } Sender: { is: $address } Receiver: { in: [ "0x8BC070BEdAB741406F4B1Eb65A72bee27894B689" "0x6bEb5a40C032AFc305961162d8204CDA16DECFa5" "0x365fb81bd4A24D6303cd2F19c349dE6894D8d58A" "0x8A289d458f5a134bA40015085a8F50Ffb681B41d" "0xF1f8F5C641F20C48526269EF7DFF19172Efa9783" "0xFbC2259aBB3F01c019ECE1d0200Ee673BB7BA34F" "0xF2311C668aAA8dEc48D5da577d3018eb94b3132F" "0xD172f3FBabe763Ee8E52D8b32421574236dA6057" ] } } } ) { Block { Time } Transaction { Hash } Transfer { Sender Receiver Amount } } } } ``` **Variables:** ```json { "address": "0x75b976434245E1Fc037f9c7645C5aCdDdA6b00A4" } ``` ## Deterministic Pagination for Backfilling Transfers When backfilling BSC transfer data or building a historical index, use deterministic pagination to guarantee no records are missed or duplicated. **Try it live:** [Deterministic Transfer API](https://ide.bitquery.io/Reliable-transfer-api) ```graphql { EVM(dataset: combined, network: bsc) { Transfers( where: { Transfer: { Success: true } } orderBy: { ascending: [ Block_Number, Transaction_Index, Call_Index, Log_Index, Transfer_Index, Transfer_Type ] } limit: { count: 10, offset: 0 } ) { Block { Time Number } Transaction { Hash From Index } Transfer { Amount AmountInUSD Sender Receiver Index Currency { Symbol Name SmartContract Decimals Native } } Call { Index } Log { LogAfterCallIndex Index } Transfer { Type } } } } ``` The composite `orderBy` across `Block_Number`, `Transaction_Index`, `Call_Index`, `Log_Index`, `Transfer_Index`, and `Transfer_Type` uniquely positions every transfer, making offset-based pagination safe for backfilling. Increment `offset` by the `count` value on each request. You can pull up to **25,000 records in a single request** by setting `count: 25000`. ## Why does my wallet inflow/outflow query miss some transactions on BSC? {#why-does-my-wallet-inflowoutflow-query-miss-some-transactions-on-bsc} Bitquery indexes all transactions from the blockchain. If you're missing inflow/outflow records in your query, first verify you're using the correct dataset—either `realtime` or `combined`—based on your needs. If your query still appears to miss transactions, please report the issue to the Bitquery team via [Telegram](https://t.me/bloxy_info). --- ## BNB Chain Uniswap API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-uniswap-api/ BNB Chain Uniswap API: GraphQL examples for v3 trades, top traders, hourly OHLC, 24-hour volume and top tokens, filtered to Uniswap's own factory. Most uniswap_v2 trades there are PancakeSwap V2. # BSC Uniswap API :::tip Real-time data or the last 30 days? Use the Trading cube For real-time trades and anything from the last 30 days, use the [Trading cube](/docs/trading/trading-data-overview): [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns MEV-filtered swaps with a USD price on every row. Use the `EVM` queries on this page for raw per-swap detail or call and event context. An `EVM` query without a `dataset` argument runs on the realtime dataset, which holds only the last few days; add `dataset: combined` or `dataset: archive` for older history. ::: ## Filter by factory to exclude forks `Trade.Dex.ProtocolName` records which code a pool runs. Forks of v2 and v3 run the same code, so their trades carry the same `uniswap_v2` and `uniswap_v3` labels. On BNB Chain the forks dominate. In Bitquery's trade data for 17 and 18 September 2026, more than 99% of transactions labelled `uniswap_v2` went through other factories' pools, about 96% through PancakeSwap V2 alone. For `uniswap_v3` the share was more than a quarter. To keep only Uniswap's own pools, filter on the contract that owns them, as every example on this page now does. | Version | Filter field | Address on BNB Chain | | --- | --- | --- | | v2 | `Trade.Dex.OwnerAddress` | `0x8909dc15e40173ff4699343b6eb8132c65e18ec6` | | v3 | `Trade.Dex.OwnerAddress` | `0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7` | | v4 | `Trade.Dex.SmartContract` | `0x28e2ea090877bf75740558f6bfb36a5ffee9e9df` | `OwnerAddress` is the factory that deployed the pool. A v4 pool has no factory: its `OwnerAddress` is the zero address, and the PoolManager is its `SmartContract`. In the Trading cube, filter `Pair.Market.Address` to the v2 or v3 factory, or `Pair.Market.Program` to the v4 PoolManager. Addresses are from the official [deployments list](https://developers.uniswap.org/deployments). The link in each example's description opens an earlier copy saved in the Bitquery IDE, which may still filter by `ProtocolName` or use older conditions and time windows. Use the code on this page when you need Uniswap's own pools only. ## Live Uniswap v3 Trades on BSC (Trading API, recommended) This subscription streams every Uniswap v3 trade on BSC in real time with **USD price and USD amounts on every row**, MEV-filtered. Run it [in the IDE](https://ide.bitquery.io/Trading-API-Uniswap-v3-Trades-BSC). ```graphql subscription { Trading { Trades( where: {Pair: {Market: {Network: {is: "Binance Smart Chain"}, Address: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}}} ) { Block { Time } Price PriceInUsd AmountsInUsd { Base Quote } Trader { Address } Pair { Token { Symbol } QuoteToken { Symbol } Market { Protocol } } } } } ``` ## Get Latest Trades on Uniswap v3 The query below returns the [latest DEX trades on BSC Uniswap v3](https://ide.bitquery.io/uniswap-v3-trades-bsc). ```graphql query MyQuery { EVM(dataset: realtime, network: bsc) { DEXTrades( where: {Trade: {Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}}} limit: {count: 10} orderBy:{descending:Block_Time} ) { Transaction { From To } Trade { Dex { ProtocolName SmartContract } Buy { Currency { Name } Price Amount } Sell { Amount Currency { Name } Price } } Block { Time } } } } ``` ## Get Top Traders of a token on uniswap v3 This query returns the [top traders of a token](https://ide.bitquery.io/top-traders-of-a-token-on-uniswapv3-bsc) on the selected network. It ranks `Transaction.From`, the account that sent each swap, since on a sale `Trade.Buyer` is the pool or a router. `Side.Type` describes the counter-side of each trade, so `bought` sums the rows where `Side.Type` is `sell`. `PriceAsymmetry: {lt: 0.1}` drops trades whose two sides disagree badly on value ([PriceAsymmetry reference](/docs/graphql/metrics/priceAsymmetry/)), which would otherwise inflate the USD totals. ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}, PriceAsymmetry: {lt: 0.1}}} ) { Transaction { From } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "bsc", "token": "0x55d398326f99059ff775485246999027b3197955" } ``` ## OHLC in USD of a Token This query retrieves [hourly open, high, low and close prices in USD](https://ide.bitquery.io/OHLC-on-BSC-Uniswap-v3) for one token traded on Uniswap v3. ```graphql { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( orderBy: {descendingByField: "Block_testfield"} where: {Trade: {Currency: {SmartContract: {is: "0x55d398326f99059ff775485246999027b3197955"}}, PriceAsymmetry: {lt: 0.1}, Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}, Side: {Currency: {SmartContract: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, Type: {is: buy}}}} limit: {count: 10} ) { Block { testfield: Time(interval: {in: hours, count: 1}) } volume: sum(of: Trade_Amount) Trade { high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) } count } } } ``` ## Get trading volume, buy volume, sell volume of a token This query returns the [traded, buy and sell volume](https://ide.bitquery.io/trade_volume_bsc_uniswapv3) of token `0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c` on Uniswap v3 over the last 24 hours. `PriceAsymmetry: {lt: 0.1}` drops mispriced trades, which would otherwise skew the USD sums. ```graphql query MyQuery { EVM(network: bsc) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}, PriceAsymmetry: {lt: 0.1}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Name Symbol SmartContract Decimals } } traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD) sell_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: buy}}}} ) buy_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: sell}}}} ) } } } ``` ## Get top bought tokens on uniswap v3 This query returns the [top bought tokens on Uniswap v3](https://ide.bitquery.io/top-bought-tokens-on-bsc-uniswap-v3). Buys are the rows where `Side.Type`, the counter-side, is `sell`. The `PriceAsymmetry` filter keeps mispriced trades out of the totals. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "buy"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "bsc" } ``` ## Get top sold tokens on uniswap v3 This query returns the [top sold tokens on Uniswap v3](https://ide.bitquery.io/top-sold-tokens-on-bsc-uniswap-v3). Sales are the rows where `Side.Type`, the counter-side, is `buy`. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "sell"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "bsc" } ``` ## Get Metadata of a token The query below returns a [token's metadata](https://ide.bitquery.io/get-metadata_1): `Name`, `symbol`, `SmartContract Address` and `Decimals`. ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( limit: {count: 1} orderBy: {descending: Block_Time} where: {Trade: {Currency: {SmartContract: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, Dex: {OwnerAddress: {is: "0xdb1d10011ad0ff90774d0c6bb92e5c5c8b4461f7"}}}} ) { Trade { Currency { Name Symbol SmartContract ProtocolName HasURI Fungible Decimals } } } } } ``` --- ## BNB Chain Uniswap v4 API: Stablecoin Pools, Swaps, Traders and Reserves URL: https://docs.bitquery.io/docs/blockchain/BSC/uniswap-v4-api/ Uniswap v4 on BNB Chain with Bitquery GraphQL: live swaps, the v4 pools of USDT by PoolId, the USDT/USDC pool's daily stats, top traders and reserves. # BNB Chain Uniswap v4 API: Stablecoin Pools, Swaps, Traders and Reserves On BNB Chain, Uniswap v4 is above all a stablecoin venue: the USDT/USDC pools inside its PoolManager, `0x28e2ea090877bf75740558f6bfb36a5ffee9e9df`, turn over tens of millions of dollars a day, while meme launches route a long tail of smaller pools through the same contract. Because v4 keeps every pool inside the PoolManager, pools are told apart by `PoolId`, a hash of the two tokens, the fee, the tick spacing and the hook, and on swap rows the buyer and seller fields both show the PoolManager, so the trader is `Transaction.From`. PancakeSwap Infinity uses the same singleton design on BNB Chain and has [its own page](/docs/blockchain/BSC/bsc-pancakeswap-infinity-api). Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the worked token is USDT, `0x55d398326f99059ff775485246999027b3197955`, and the worked pool is the busiest USDT/USDC pool, `PoolId 0x628ea54a6450645d2bb7b2911c8c6f3d7f3944c2f4703c259a1b85bf5569870b`. ## Which v4 pools trade USDT Start here to get a `PoolId`. Grouping `DEXTradeByTokens` by `PoolId` with USDT in `Currency` lists every v4 pool of the token, its counter token, and the trades and USD volume in the window. Saved query [here](https://ide.bitquery.io/get-virtual-pool-address-for-a-token-on-uniswap-v4-bsc). ```graphql { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "count" } limit: { count: 20 } ) { Trade { PoolId Side { Currency { Symbol SmartContract } } } count volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ``` ## Daily stats of the USDT/USDC pool Trades, distinct buyers and sellers, and USD volume split by direction, for the pool and the token you name. Saved query [here](https://ide.bitquery.io/trade-stats-for-a-token-pair-on-uniswap-v4-bsc_1). ```graphql { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x628ea54a6450645d2bb7b2911c8c6f3d7f3944c2f4703c259a1b85bf5569870b" } Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Symbol } Side { Currency { Symbol } } } trades: count buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) volumeUsd: sum(of: Trade_Side_AmountInUSD) buyVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } }) sellVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } }) } } } ``` ## Latest swaps in the pool Filter `DEXTrades` on the `PoolId`. Saved query [here](https://ide.bitquery.io/Latest-Trades-for-a-currency-pair-on-bsc). ```graphql { EVM(network: bsc) { DEXTrades( where: { Trade: { PoolId: { is: "0x628ea54a6450645d2bb7b2911c8c6f3d7f3944c2f4703c259a1b85bf5569870b" } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Currency { Symbol } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Live swaps across every v4 pool on BNB Chain The protocol filter as a subscription. On BNB Chain this stream is busy, so filter on `PoolId` or on a token when you only need part of it. Saved stream [here](https://ide.bitquery.io/Real-time-trades-for-uniswap-v4-bsc). ```graphql subscription { EVM(network: bsc) { DEXTrades(where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } } }) { Block { Time } Trade { PoolId Buy { Currency { Symbol SmartContract } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol SmartContract } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Top traders of the pool The PoolManager settles both sides of every v4 swap, so `Trade.Buyer` and `Trade.Seller` on `DEXTrades` are the PoolManager; rank accounts by `Transaction.From` instead. `bought` sums the token the trader received and `sold` the token it paid; `Side.Type` describes the counter-side, which is why the conditions look swapped. Saved query [here](https://ide.bitquery.io/top-buyers-of-a-currency-on-uniswap-v4-bsc); the [top sellers](https://ide.bitquery.io/top-sellers-of-a-token-on-uniswap-v4-pool-bsc) query is the same sorted on `sold`. ```graphql { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x628ea54a6450645d2bb7b2911c8c6f3d7f3944c2f4703c259a1b85bf5569870b" } Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` ## Reserves of the pool `DEXPoolEvents` rows carry the reserves the PoolManager holds for the pool after each change, in token units and USD. For v4 they are rebuilt from the concentrated positions around the current price. Filter on `PoolId`, or keep only the protocol name to stream every v4 pool. Saved queries [by pool](https://ide.bitquery.io/uniswap-v4-pool-liquidity-by-poolid-bsc) and [all pools](https://ide.bitquery.io/uniswap-v4-pool-liquidity-bsc). ```graphql subscription { EVM(network: bsc) { DEXPoolEvents( where: { PoolEvent: { Pool: { PoolId: { is: "0x628ea54a6450645d2bb7b2911c8c6f3d7f3944c2f4703c259a1b85bf5569870b" } } } } ) { Block { Time } PoolEvent { Pool { PoolId CurrencyA { Symbol } CurrencyB { Symbol } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } } } } ``` ## Related pages - [BNB Chain liquidity API](/docs/blockchain/BSC/bsc-liquidity-api) - [BNB Chain DEX trades API](/docs/blockchain/BSC/bsc-dextrades) - [PancakeSwap Infinity API](/docs/blockchain/BSC/bsc-pancakeswap-infinity-api) - [Uniswap v4 on Ethereum](/docs/blockchain/Ethereum/dextrades/uniswap-v4-api) - [Uniswap v4 on Arbitrum](/docs/blockchain/Arbitrum/uniswap-v4-api) --- ## BSC API Documentation URL: https://docs.bitquery.io/docs/blockchain/BSC/ BSC API overview: BNB Chain DEX trades, slippage, liquidity, balances and pending transactions, plus how the API compares with RPC and Kafka streams. # BSC API Documentation :::tip Building a trading app or DEX UI on BNB Chain (BSC)? For **real-time trades and prices on BNB Chain (BSC)** (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 BNB Chain (BSC) data older than ~30 days**, use the chain-level `DEXTrades` / `DEXTradeByTokens` APIs documented below. ::: In this section we will see how to fetch data on different tokens, transactions, DEXs like Uniswap, Pancakeswap, Four Meme, liquidity pools, and slippage data etc via APIs and Streams. If you need help getting data on Binance Smart Chain,reach out to [support](https://t.me/Bloxy_info) #### What is BSC API? Bitquery BSC APIs help you fetch onchain data like trades, transactions, balances, liquidity pools, and slippage data by writing a graphQL query. ### What are capabilities of Bitquery BSC API? Bitquery BSC APIs are very flexible, you can fetch trade, transaction, balance, liquidity, and slippage information for a specific wallet and join with other information. ### Difference between BSC RPC, Bitquery BSC API and Bitquery Kafka Stream? | BSC RPC | Bitquery BSC API | Bitquery Kafka Stream | | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | JSON-RPC endpoint exposing raw EVM on-chain state and transactions | GraphQL endpoint over pre-indexed, parsed BSC chain data (token transfers, DEX trades, logs, calls, etc.) | Provides fully managed Kafka topics (bsc.dextrades.proto, bsc.tokens.proto, bsc.transactions.proto) | | No built-in history or analytics—any indexing/aggregation you build or outsource | Historical data, joins, aggregations & real-time subscriptions | Delivers pre-parsed, enriched Protocol-Buffers events (DEX trades, token transfers and transactions) | | Ideal for submitting transactions | Great for real-time data and historical backtesting without running your own indexer | Great for Enterprise usage with built-in replication/failover and no node ops or custom parsing needed | Read more about Kafka streams [here](/docs/streams/protobuf/chains/EVM-protobuf/) and contact sales via [Telegram](https://t.me/Bloxy_info) or [form](https://bitquery.io/forms/api) for a **Trial**. ### Does Bitquery support BSC Websocket and BSC Webhooks? Bitquery supports websocket and webhooks, you can convert most of the graphQL APIs into graphQL streams by changing the word `query` to `subscription`. You can monitor this data via a websocket. More [code samples available here](/docs/subscriptions/websockets/) ## Can I monitor BSC pending transactions using Bitquery? {#can-i-monitor-bsc-pending-transactions-using-bitquery} **Yes.** Use **GraphQL subscriptions** with **`EVM(network: bsc, mempool: true)`** on the shapes documented for mempool (see [mempool subscriptions](/docs/subscriptions/mempool-subscriptions/) and the [Ethereum mempool API](/docs/blockchain/Ethereum/mempool/mempool-api/)—the same patterns apply to **BSC**). For **lower-latency** broadcast data, use **Kafka** streams as described on the **[BSC mempool stream](/docs/blockchain/BSC/bsc-mempool-stream/)** page. You need a valid **V2 OAuth token** for requests outside the IDE ([authorization](/docs/authorization/how-to-generate/)). ## BSC DEX APIs - [BSC Dex Trades](./bsc-dextrades) - [BSC NFT Trade API](./bsc-nft) - [Uniswap Trades API](./bsc-uniswap-api) - [Pancakeswap Trades API](./pancake-swap-api) - [Four Meme Trade API](./four-meme-api) · [DEXrabbit Four.meme tokens](https://dexrabbit.bitquery.io/categories/four-meme-ecosystem) - [GRA Fun API](./gra-fun-api) - [Building Four Meme Trading Bot](../../streams/sniper-trade-using-bitquery-kafka-stream) ## BSC Slippage API - [BSC Slippage API](./bsc-slippage-api) Get slippage and price impact data for BSC DEX pools. Understand price impact and liquidity depth for token swaps, calculate maximum input amounts at different slippage tolerances, and monitor real-time slippage data across all DEX pools on BSC. ## BSC Liquidity API - [BSC Liquidity API](./bsc-liquidity-api) Monitor real-time liquidity changes, track pool reserves, and analyze liquidity depth for token pairs on BSC DEX pools. Track when liquidity is added or removed, monitor pool health and depth, and analyze liquidity patterns across different pools. ## BSC Balance APIs - [BSC Balance API](./bsc-balance-updates) — `EVM.Balances` for current and historical token balances - [BSC Transaction Balance Tracker](./transaction-balance-tracker/) — Real-time balance changes with reason codes (`EVM.TransactionBalances`) ## Other BSC APIs - [BSC Mempool API](./bsc-mempool-stream) - [BSC Transfers API](./bsc-transfers) - [BSC Events API](./bsc-events-api) - [BSC Calls API](./bsc-calls-api) - [Binance Exchange Wallet Monitoring](../../usecases/binance-exchange-wallet-monitoring) ## Videos ### Four Meme | How to Get Top Traders of a Token on BSC Four Meme DEX ### Track Newly Created Tokens and Liquidity Pools on BSC ### Video Tutorial on Getting Real Time BSC DEXTrades ### Video Tutorial on BSC Protobuf Streams | Building BSC Sniper Trading Bot Using Bitquery Protobuf Kafka Streams ## 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/) --- ## BSC Balance API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-balance-updates/ BSC Balance API: fetch current and historical BNB Chain balances with Bitquery GraphQL balance queries. Scale further with Kafka or gRPC streams. # BSC Balance API The **Balances** API returns current and historical token balances for an address on BSC. 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**. | ## Balance of an Address Returns token balances for a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances. [Run in IDE](https://ide.bitquery.io/BSC-Balance-of-an-Address) ```graphql query { EVM(network: bsc, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xf9D48e42d0FEb477a0286B206eDbafefA3577F63" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` **Parameters** - `network: bsc`: BNB Smart Chain mainnet. - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. **Returned fields** - `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Balance on a Specific Date Use `Block.Date.till` for a point-in-time snapshot. Use `dataset: archive` for historical dates and addresses not recently active. [Run in IDE](https://ide.bitquery.io/BSC-Balances-by-Date) ```graphql { EVM(network: bsc, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xf9D48e42d0FEb477a0286B206eDbafefA3577F63" } } Block: { Date: { till: "2026-04-01" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } } } } ``` ## 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/BSC-Balances-Specific-Token) ```graphql query { EVM(network: bsc, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xf9D48e42d0FEb477a0286B206eDbafefA3577F63" } } Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } ) { Currency { 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/BSC-Balances-History) ```graphql query { EVM(network: bsc, dataset: archive) { Balances( where: { Balance: { Address: { is: "0xf9D48e42d0FEb477a0286B206eDbafefA3577F63" } } Currency: {} } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` ## Wallet Balance for a Specific Token on a Date Use `dataset: archive`, `Block.Date.till`, `orderBy: { descending: Block_Date }`, and `limit: { count: 1 }` to get the balance as of that date. [Run in IDE](https://ide.bitquery.io/BSC-Wallet-Balance-Token-at-Date) ```graphql query { EVM(network: bsc, dataset: archive) { Balances( where: { Block: { Date: { till: "2026-05-05" } } Balance: { Address: { is: "0xf9D48e42d0FEb477a0286B206eDbafefA3577F63" } } Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } limit: { count: 1 } orderBy: { descending: Block_Date } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Top Holders of a Token Use the **Holders** API (`EVM.Holders`) to get the top holders of a token. Use `dataset: combined` for the latest holder data. [Run in IDE](https://ide.bitquery.io/BSC-Top-Holders) ```graphql { EVM(network: bsc, dataset: combined) { Holders( where: { Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } orderBy: { descending: Balance_Amount } limit: { count: 10 } ) { Holder { Address } Balance { Amount(selectWhere: { gt: "0" }) } } } } ``` ## Token Holder Count Get the number of unique holders for a BEP-20 token using `uniq(of: Holder_Address)`. [Run in IDE](https://ide.bitquery.io/BSC-Token-Holder-Count) ```graphql query { EVM(network: bsc, dataset: combined) { Holders( where: { Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } ) { uniq(of: Holder_Address) } } } ``` ## Holder Count with Balance Above a Threshold Count holders whose balance exceeds a minimum threshold. Use `if` condition on the aggregate. [Run in IDE](https://ide.bitquery.io/BSC-Holders-Threshold) ```graphql query { EVM(network: bsc, dataset: combined) { Holders( where: { Currency: { SmartContract: { is: "0x55d398326f99059ff775485246999027b3197955" } } } ) { uniq(of: Holder_Address, if: { Balance: { Amount: { gt: "1000" } } }) } } } ``` ## Get Token Holdings and Holding Time of an Address Get the token holdings of an address and calculate the holding time using `FirstChangeTime` and `LastChangeTime` from the `Holders` API. [Run in IDE](https://ide.bitquery.io/BSC-Holdings-Holding-Time) ```graphql query ($trader: String, $token: String) { EVM(network: bsc, dataset: combined) { Holders( where: { Holder: { Address: { is: $trader } } Currency: { SmartContract: { is: $token }, Fungible: true } Balance: { Amount: { gt: "0" } } } ) { Holder { Address } Balance { Amount FirstChangeTime LastChangeTime } Currency { Symbol Name SmartContract Decimals } } } } ``` ```json { "trader": "0xc5C2653d38E241D62F96A4fB8f8497b6126F21dC", "token": "0x49d870B1d21D00c775DD03110Ef4c8FeF4Fd4444" } ``` :::warning Important: Rebasing Token Limitations **Rebasing tokens are not supported for accurate balance calculations.** Rebasing tokens (like Mountain Protocol's USDM) automatically adjust their total supply and individual balances through mechanisms other than traditional transfer transactions. This means: - **Balance calculations may be inaccurate** - Our balance tracking doesn't capture rebasing adjustments - **Balance updates may be missing** - Individual holder balances change without visible transactions - **Historical balance data will be incorrect** - Past balances don't reflect rebasing adjustments **Before calculating balances for any token, verify it's not a rebasing token by:** 1. Checking the token's official documentation 2. Looking for rebasing mechanisms in the smart contract 3. Consulting token issuer resources **Example of rebasing token:** Mountain Protocol USDM (`0x59d9356e565ab3a36dd77763fc0d87feaf85508c` on Arbitrum) - [Documentation](https://docs.mountainprotocol.com/legacy-docs/usdm-token) **Supported chains:** This limitation applies to all EVM chains (Ethereum, Arbitrum, BSC, Base, etc.) ::: --- ## BSC Gas Balance Tracker: Gas Bought, Refunded and Collected on BNB Chain URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-gas-balance-tracker/ Gas on BNB Chain from balance changes with Bitquery GraphQL: gas bought and refunded per transaction for an address, the busiest payers, and a stream. # BSC Gas Balance Tracker: Gas Bought, Refunded and Collected on BNB Chain BNB Chain reports gas the way Ethereum does, in three balance changes per transaction: the sender's BNB drops by the gas limit times the gas price before execution, reason code 6; whatever gas was not used comes back after execution, reason code 7; and the fee for the gas that was used is credited to the block producer, reason code 5. The `TransactionBalances` cube records all three with the balance before and after, so the gas an address paid is the code 6 debit minus the code 7 refund, transaction by transaction. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the cube holds the recent realtime window only. The example address is a bot that sends transactions every few seconds, `0x10168749958f03a7c95432bd934058c77be787b0`; swap in any sender. ## Gas bought per transaction for one address Code 6 rows for the sender over the last hour; the time window keeps the scan small on a chain this busy. `gasBought` is the balance before minus the balance after, which equals `Gas` times `GasPrice` on the transaction. `calculate` only sees fields that are selected, so keep both balances in the query. Saved query [here](https://ide.bitquery.io/Latest-balance-and-gas-fee-paid-for-an-address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 6 } Address: { is: "0x10168749958f03a7c95432bd934058c77be787b0" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time Number } TokenBalance { PreBalance PostBalance PostBalanceInUSD } Transaction { Hash Gas GasPrice } gasBought: calculate( expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance" ) } } } ``` ## Gas refunded to the same address Code 7 rows are the unused gas coming back; a transaction that used its whole gas limit has none. Subtract this from the code 6 debit of the same hash to get the gas the transaction really cost. Saved query [here](https://ide.bitquery.io/Latest-balance-after-unused-gas-fee-returned--for-an-address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 7 } Address: { is: "0x10168749958f03a7c95432bd934058c77be787b0" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } TokenBalance { PreBalance PostBalance } Transaction { Hash } refund: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` ## The busiest gas payers right now Group code 6 rows by address over a short window and count them. The top of the list is bots and exchange hot wallets. Saved query [here](https://ide.bitquery.io/top-gas-fee-collectors-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 6 } } Block: { Time: { since_relative: { minutes_ago: 10 } } } } orderBy: { descendingByField: "transactions" } limit: { count: 20 } ) { TokenBalance { Address } transactions: count } } } ``` ## Several addresses at once `in` takes a list, and `limitBy` on the address keeps the newest row per address, so one query returns the latest gas debit of every wallet you watch. Saved query [here](https://ide.bitquery.io/Latest-balance-and-gas-fee-paid-for-multiple-addresses-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 6 } Address: { in: [ "0x10168749958f03a7c95432bd934058c77be787b0" "0x42d73da3daca18374ee1ab8d700351350a3b0064" ] } } Block: { Time: { since_relative: { hours_ago: 1 } } } } limitBy: { by: TokenBalance_Address, count: 1 } orderBy: { descending: Block_Time } ) { Block { Time } TokenBalance { Address PreBalance PostBalance } Transaction { Hash Gas GasPrice } gasBought: calculate( expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance" ) } } } ``` ## Stream the gas one address pays The code 6 filter as a subscription delivers a message for every transaction the address sends, as it is indexed. Saved stream [here](https://ide.bitquery.io/Monitor-balance-and-gas-fee-paid-for-an-address-using-stream-bsc). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 6 } Address: { is: "0x10168749958f03a7c95432bd934058c77be787b0" } } } ) { Block { Time } TokenBalance { PreBalance PostBalance } Transaction { Hash GasPrice } gasBought: calculate( expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance" ) } } } ``` ## Where the fees go The fee for used gas is credited with reason code 5 to BNB Chain's fee holder, `0xfffffffffffffffffffffffffffffffffffffffe`, and moved to the ValidatorSet contract at the end of each block. The [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) streams those credits and shows fee income per block and per validator. ## Related pages - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) - [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) - [Base gas balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker) - [Balance change reason codes](/docs/blockchain/BSC/transaction-balance-tracker/#balance-change-reason-codes) --- ## BSC MEV Balance Tracker: Priority Fees and Block Producer Income URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker/ Track MEV on BNB Chain from balance changes with Bitquery GraphQL: stream fee credits, rank the largest tips, follow one bot and see fee income per block. # BSC MEV Balance Tracker: Priority Fees and Block Producer Income MEV on BNB Chain leaves one clean trace in balance data: the fee a transaction pays to be included ahead of others. The `TransactionBalances` cube records that credit as a balance change with reason code 5, `BalanceIncreaseRewardTransactionFee`, with the balance before and after it, so the tip is the difference between the two. This page streams those credits, ranks the largest, follows what one bot pays and shows how the fees reach the validator that produced the block. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The cube holds the recent realtime window only, so queries need a time filter and history has to be collected as it streams. ## Where the fee credit lands on BNB Chain On Ethereum a code 5 credit goes to the block builder's own address. On BNB Chain it goes to one fixed address, `0xfffffffffffffffffffffffffffffffffffffffe`, the fee holder that the Parlia consensus uses as the coinbase while a block's transactions execute. At the end of the block the validator moves the collected fees into the ValidatorSet system contract, `0x0000000000000000000000000000000000001000`, with a system transaction whose `Value` is the block's fee income. Two consequences for your filters: - Every code 5 row carries the fee holder as `TokenBalance.Address`; the transaction that paid the tip is in `Transaction`. - Rows on the ValidatorSet contract with `Transaction.Value` above zero are one per block; `Transaction.From` is the validator that earned them. ## Stream every priority fee The `tip` field subtracts the balance before from the balance after, so each message carries the fee in BNB. Saved stream [here](https://ide.bitquery.io/Track-MEV-Related-Balance-Updates-bsc). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Number Time } TokenBalance { Address PreBalance PostBalance Currency { Symbol } } Transaction { Hash From To GasPrice } tip: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` ## Largest tips in the last ten minutes Sort by the computed field to find the transactions that paid most for their position. `calculate` can only reference fields that are selected, so keep `PreBalance` and `PostBalance` in the query. Saved query [here](https://ide.bitquery.io/Track-Large-MEV-Transactions-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 20 } orderBy: { descendingByField: "tip" } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Time: { since_relative: { minutes_ago: 10 } } } } ) { Block { Number Time } TokenBalance { PreBalance PostBalance } Transaction { Hash From To GasPrice } tip: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` ## What one bot pays Filter on `Transaction.From` to follow a single sender. The example address is a bot that pays some of the largest tips on the network; put any sender in its place. Saved query [here](https://ide.bitquery.io/Filter-by-MEV-Bot-or-Builder-Address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 20 } orderBy: { descending: Block_Time } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Transaction: { From: { is: "0x4848489f0b2bedd788c696e2d79b6b69d7484848" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Number Time } TokenBalance { PreBalance PostBalance } Transaction { Hash To } tip: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` Change `query` to `subscription` and drop `limit`, `orderBy` and the time filter to get an alert each time the address pays a tip. ## Fee income per block and per validator The validator's deposit into the ValidatorSet contract closes each block. `limitBy` on the transaction hash keeps one row per block, `Transaction.Value` is the block's fee income and `Transaction.From` is the validator. Saved query [here](https://ide.bitquery.io/Aggregate-MEV-Rewards-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 20 } limitBy: { by: Transaction_Hash, count: 1 } orderBy: { descending: Block_Number } where: { TokenBalance: { Address: { is: "0x0000000000000000000000000000000000001000" } Currency: { Native: true } } Transaction: { Value: { gt: "0" } } Block: { Time: { since_relative: { minutes_ago: 10 } } } } ) { Block { Number Time } Transaction { Hash From Value } } } } ``` Group the same rows by `Transaction.From` with `uniq(of: Transaction_Hash)` to count the blocks each validator produced in the window; the [BSC miner balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker) shows that query. ## Related pages - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) - [BSC miner balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker) - [BSC validator balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-validator-balance-tracker) - [Ethereum MEV balance tracker](/docs/blockchain/Ethereum/balances/transaction-balance-tracker/eth-mev-balance-tracker) - [Balance change reason codes](/docs/blockchain/BSC/transaction-balance-tracker/#balance-change-reason-codes) --- ## BSC Mempool Stream - Real-Time Transaction Monitoring URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-mempool-stream/ BSC Mempool Stream - Real-Time Transaction Monitoring: watch BNB Chain pending transactions before confirmation with Bitquery GraphQL subscriptions. # BSC Mempool Stream - Real-Time Transaction Monitoring Monitor BSC (BNB Smart Chain) mempool transactions in real-time before they are confirmed on-chain. Track pending DEX trades, token creations, transfers, and detect opportunities early with Bitquery's Mempool APIs and Streams. Any Bitquery GraphQL stream can be converted to a mempool monitoring stream by setting `mempool: true`. We also provide low-latency Kafka streams to monitor broadcasted data, which are much faster than GraphQL mempool streams. Read more about Kafka streams [here](/docs/streams/protobuf/chains/EVM-protobuf/). :::note To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: --- ## How do I stream BSC pending transactions (mempool) using Bitquery? {#how-do-i-stream-bsc-pending-transactions-mempool-using-bitquery} Use a **GraphQL `subscription`** on the Bitquery streaming **WebSocket** [`wss://streaming.bitquery.io/graphql`](/docs/subscriptions/websockets/) with root **`EVM(network: bsc, mempool: true)`**. The **`mempool: true`** flag switches the stream to **broadcast / simulated pending** traffic instead of only confirmed blocks. Under that root, subscribe to the same APIs you use on-chain—**`Transactions`**, **`Transfers`**, **`DEXTrades`**, **`Events`**, and others—with `where` filters as needed. Authenticate the socket per [WebSocket authorization](/docs/authorization/websocket/). For mempool semantics (ordering, time window, vs confirmed subscriptions), read [Subscribing to mempool updates](/docs/subscriptions/mempool-subscriptions/). For lower latency at scale, consider **Kafka** [EVM protobuf streams](/docs/streams/protobuf/chains/EVM-protobuf/). Minimal example—pending transaction headers on BSC: ```graphql subscription BscMempoolTransactions { EVM(network: bsc, mempool: true) { Transactions { Block { Time } Transaction { Hash Cost To From } } } } ``` Try it in the IDE: [BSC mempool transactions](https://ide.bitquery.io/bsc-mempool-txs). Richer **`Transfers`** and **DEX** mempool patterns are in [Mempool Streaming Examples](#mempool-streaming-examples) below. --- ## Table of Contents ### 1. [How do I stream BSC pending transactions (mempool) using Bitquery?](#how-do-i-stream-bsc-pending-transactions-mempool-using-bitquery) ### 2. [How Mempool Simulation Works](#how-do-we-simulate-txs-for-bitquery-mempool-apis--streams) ### 3. Mempool Streaming Examples - [Stream Four Meme Trades in Mempool ➤](#stream-four-meme-trades-in-mempool---detect-them-early) - [Stream Four Meme Token Creation in Mempool ➤](#stream-four-meme-token-creation-in-mempool---detect-them-first) - [Stream All Transactions in Mempool ➤](#streaming-transactions-in-mempool-on-bsc) - [Stream DEX Trades in Mempool ➤](#streaming-trades-in-mempool-on-bsc) --- ## How do we simulate txs for Bitquery Mempool APIs & Streams? When a transaction is received by the node but not yet included in a block, Bitquery uses the following context to send mempool data: - The transaction is executed in the EVM (using the current pending block context). - The system captures the simulated receipt and trace. For each batch of simulated transactions, Bitquery records the block header used as the execution context. ``` message BroadcastedTransactionsMessage { Chain Chain = 1; BlockHeader Header = 2; repeated Transaction Transactions = 3; } ``` ## Mempool Streaming Examples ### Stream Four Meme Trades in Mempool - Detect Them Early Monitor Four Meme DEX trades in real-time as they appear in the mempool, before they are confirmed on-chain. This allows you to detect trading opportunities early and front-run or back-run trades. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-mempool-trades)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades(where: {Trade: {Dex: {ProtocolName: {is: "fourmeme_v1"}}}}) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ```
### Stream Four Meme Token Creation in Mempool - Detect Them First Track new Four Meme token creations in the mempool instantly. Be the first to know when a new token is being created, before it's confirmed on-chain. [Run Stream ➤](https://ide.bitquery.io/track-Four-meme-token-creation-in-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: {Transaction: {To: {is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b"}}, Log: {Signature: {Name: {is: "TokenCreate"}}}} ) { Log { Signature { Name Signature } } Arguments { Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... 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 } } Name Type } Transaction { Hash To From } } } } ```
### Streaming Transactions in Mempool on BSC Monitor all pending transactions and transfers on BSC in real-time. Track transaction details including sender, receiver, gas, amounts, and token information before blocks are mined. [Run Stream ➤](https://ide.bitquery.io/bsc-mempool-txs)
Click to expand GraphQL query ```graphql subscription { EVM(mempool: true, network: bsc) { Transfers { Log { Index } Transaction { Time Type To Gas From Cost Hash } Transfer { Amount Currency { Name } Type } TransactionStatus { Success FaultError EndError } Block { Time } Call { Signature { Name } } } } } ```
### Streaming Trades in Mempool on BSC Stream all DEX trades happening in the BSC mempool in real-time. Monitor buy/sell activity, prices, volumes, and trading pairs across all DEXs before transactions are confirmed. [Run Stream ➤](https://ide.bitquery.io/monitor-mempool-trades-bsc)
Click to expand GraphQL query ```graphql subscription { EVM(mempool: true, network: bsc) { DEXTradeByTokens { Block { Number } Transaction { Hash } Trade { Price PriceInUSD Currency { Name } Amount Buyer Dex { ProtocolName } Side { Seller Buyer AmountInUSD Amount Currency { Name Symbol } } } } } } ```
--- ## Related Resources You may also be interested in: - [Four Meme API Documentation ➤](/docs/blockchain/BSC/four-meme-api/) - [BSC DEX Trades API ➤](/docs/schema/evm/dextrades/) - [Kafka Protobuf Streams for EVM ➤](/docs/streams/protobuf/chains/EVM-protobuf/) - [WebSocket Subscriptions ➤](/docs/authorization/websocket/) ## Need Help? If you have any questions or need assistance with BSC mempool streams, reach out to our [Telegram support](https://t.me/Bloxy_info). --- ## BSC Miner Balance Tracker: Block Producer Rewards on BNB Chain URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker/ BNB Chain has validators, not miners, so mining codes never fire. Track block producer income with Bitquery GraphQL: fees per transaction, block and validator. # BSC Miner Balance Tracker: Block Producer Rewards on BNB Chain BNB Chain has never had miners. Blocks are produced by a fixed set of validators under the Parlia consensus, so the two mining codes in the balance schema, 1 for an uncle reward and 2 for a block reward, never appear in BNB Chain data. A filter on them returns nothing, and the last query on this page shows that. What a block producer earns instead is the gas paid by the transactions in its block, and the `TransactionBalances` cube shows that income in two places: as a code 5 credit for each transaction, and as one deposit per block into the ValidatorSet contract. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the cube covers the recent realtime window only. ## How block producer income shows up 1. While a block executes, each transaction's fee is credited to the fee holder `0xfffffffffffffffffffffffffffffffffffffffe` with reason code 5. 2. At the end of the block, the validator sends the collected total to the ValidatorSet system contract `0x0000000000000000000000000000000000001000`. `Transaction.From` on that deposit is the validator and `Transaction.Value` is the block's income. 3. Validators withdraw their share from the contract later; those withdrawals are ordinary transfers. ## Fee income per block One row per block, newest first. Saved query [here](https://ide.bitquery.io/Track-Block-Mining-Rewards-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 20 } limitBy: { by: Transaction_Hash, count: 1 } orderBy: { descending: Block_Number } where: { TokenBalance: { Address: { is: "0x0000000000000000000000000000000000001000" } Currency: { Native: true } } Transaction: { Value: { gt: "0" } } Block: { Time: { since_relative: { minutes_ago: 10 } } } } ) { Block { Number Time } Transaction { Hash From Value } } } } ``` The deposit rows do not stream well as a subscription on BNB Chain because the filter has to scan every balance row on the network; poll this query, or stream the code 5 credits below, which are keyed by the fee holder and arrive at once. ## Blocks produced per validator Group the deposits by the validator address; `uniq` on the transaction hash counts blocks. Saved query [here](https://ide.bitquery.io/Historical-Miner-Balance-Data-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 50 } orderBy: { descendingByField: "blocks" } where: { TokenBalance: { Address: { is: "0x0000000000000000000000000000000000001000" } Currency: { Native: true } } Transaction: { Value: { gt: "0" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Transaction { From } blocks: uniq(of: Transaction_Hash) } } } ``` ## Income of one validator Add the validator to `Transaction.From`. The example is one of the validators with the most blocks; take any address from the query above. Validators rotate, so a quiet hour is normal for a single address and the window here is a day. Saved query [here](https://ide.bitquery.io/Filter-by-Miner-Address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 20 } limitBy: { by: Transaction_Hash, count: 1 } orderBy: { descending: Block_Number } where: { TokenBalance: { Address: { is: "0x0000000000000000000000000000000000001000" } Currency: { Native: true } } Transaction: { Value: { gt: "0" } From: { is: "0x9bb56c2b4dbe5a06d79911c9899b6f817696acfc" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Number Time } Transaction { Hash Value } } } } ``` ## Fee credits per transaction The per-transaction view is reason code 5 on the fee holder. The [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) streams these with the tip computed per row and ranks the largest. Saved stream [here](https://ide.bitquery.io/Track-Transaction-Fee-Rewards-bsc). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Number Time } TokenBalance { Address PreBalance PostBalance } Transaction { Hash From } } } } ``` ## Why the mining codes return nothing Codes 1 and 2 exist in the schema because the same cube serves chains with a proof-of-work past. On BNB Chain the count is zero in any window. Saved query [here](https://ide.bitquery.io/Track-Uncle-Block-Rewards-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [1, 2] } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { count } } } ``` ## Related pages - [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) - [BSC validator balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-validator-balance-tracker) - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) - [Balance change reason codes](/docs/blockchain/BSC/transaction-balance-tracker/#balance-change-reason-codes) --- ## BSC Self-Destruct Balance Tracker: Destroyed Contracts and Who Gets the BNB URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-self-destruct-balance-api/ Self-destructs on BNB Chain with Bitquery GraphQL: the contract that empties (code 13), the recipient of its BNB (code 12), the SELFDESTRUCT calls, a stream. # BSC Self-Destruct Balance Tracker: Destroyed Contracts and Who Gets the BNB When a contract on BNB Chain runs `selfdestruct`, its BNB moves to the address it names in one step, and the `TransactionBalances` cube records both ends: the destroyed contract's balance falling to zero with reason code 13, and the recipient's balance rising with reason code 12. On BNB Chain almost all of it is one pattern: an MEV bot deploys a helper contract with CREATE2, runs its trade through it and destroys it inside the same transaction, sweeping the leftover BNB back. A few hundred destructions a day, most of them into the same handful of recipients. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the cube covers the recent realtime window only. The third code in this family, 14, marks BNB sent to an account that was already destroyed in the same transaction and does not occur in live data. ## The destroyed contracts Code 13 rows: `TokenBalance.Address` is the contract that destroyed itself, `PreBalance` is what it held, `PostBalance` is zero. `Transaction.From` is usually the bot that deployed it. Saved query [here](https://ide.bitquery.io/Self-Destruct-Balance-Decrease-API-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 13 } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time Number } TokenBalance { Address PreBalance PostBalance PostBalanceInUSD } Transaction { Hash From To } } } } ``` ## Who received the BNB Code 12 rows are the other side of the same transactions: the recipient named in the `selfdestruct` call, with its balance before and after. Saved query [here](https://ide.bitquery.io/Self-Destruct-Balance-Increase-API-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 12 } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time Number } TokenBalance { Address PreBalance PostBalance PostBalanceInUSD } Transaction { Hash From To } received: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` Group the same rows by `TokenBalance.Address` with `count` to see which recipients collect most often; in live data a few MEV addresses dominate. ## One recipient's self-destruct inflow Filter code 12 on the recipient. The example is one of the busiest MEV recipients on the chain, which collects from freshly destroyed helpers many times an hour; put any address in its place. Saved query [here](https://ide.bitquery.io/Track-Self-Destruct-Balance-Changes-for-Specific-Address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 12 } Address: { is: "0xc6acbee42e9e323140c1ed060c2f6ea9cc3b4b75" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } TokenBalance { PreBalance PostBalance } Transaction { Hash To } received: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` ## The SELFDESTRUCT calls themselves The `Calls` cube records the opcode, so you can list destructions even when the contract held nothing and no balance row exists. `Call.From` is the contract that died and `Call.To` the recipient. Saved query [here](https://ide.bitquery.io/Track-recent-ephemeral-contract-patterns-bsc). ```graphql { EVM(network: bsc) { Calls( where: { Call: { Opcode: { Name: { is: "SELFDESTRUCT" } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Call { From To Value } Transaction { Hash From } } } } ``` ## Stream every self-destruct Both codes in one subscription; each destruction produces one row of each. Self-destructs run to a few hundred a day on BNB Chain, so expect minutes between messages; the queries above are the quicker way to look. Saved stream [here](https://ide.bitquery.io/All-Self-Destruct-Event-Balances-Stream-bsc). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [12, 13] } } } ) { Block { Time Number } TokenBalance { Address BalanceChangeReasonCode PreBalance PostBalance PostBalanceInUSD } Transaction { Hash From To } } } } ``` ## Totals for a window `count` and `uniq` over code 13 rows give how many contracts died and how many distinct bots were behind them; the same over code 12 gives the recipients. Saved query [here](https://ide.bitquery.io/Aggregate-Self-Destruct-Statistics-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 13 } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { destroyed: count senders: uniq(of: Transaction_From) recipients: uniq(of: Transaction_To) } } } ``` ## Related pages - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) - [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) - [BSC smart contract calls API](/docs/blockchain/BSC/bsc-calls-api) - [Balance change reason codes](/docs/blockchain/BSC/transaction-balance-tracker/#balance-change-reason-codes) --- ## BSC Smart Contract Calls API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-calls-api/ BSC smart contract calls: track the latest calls on BNB Chain and newly created tokens in real time, with GraphQL examples and a video walkthrough. # BSC Smart Contract Calls API In this section we will see how to get BSC Smart contract calls information using our API. ## Track Latest Calls on BNB The below query retrieves the latest successful smart contract calls on the BNB Smart Chain (BSC). It fetches details about contract interactions, transaction metadata, and associated block information. You can run it [here](https://ide.bitquery.io/Latest-Calls-on-BSC-network) ```graphql { EVM(network: bsc) { Calls( where: {Arguments: {length: {ne: 0}}, TransactionStatus: {Success: true}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Arguments { Name 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_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } } } Transaction { Hash To Type From } Receipt { ContractAddress } Block { Time } } } } ``` ## Track Latest Created Tokens on BSC This subscription websocket lets you track the newly created tokens on BSC network. You will find the newly created token contract address in the response under `Receipt: ContractAddress` field. You can find the query [here](https://ide.bitquery.io/Newly-Created-Tokens-on-BSC-network_2#) ```graphql subscription { EVM(network: bsc) { Calls( where: {Call: {Create: true}, Arguments: {length: {ne: 0}}, Receipt: {ContractAddress: {not: "0x0000000000000000000000000000000000000000"}}, TransactionStatus: {Success: true}} ) { Arguments { Name 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_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } } } Transaction { Hash } Receipt { ContractAddress } Block { Time } } } } ``` ## Video Tutorial on BSC API | How to Track Newly Created Tokens & Pools in Realtime on BSC --- ## BSC Smart Contract Events API URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-events-api/ BSC smart contract events: track newly created liquidity pools on BNB Chain from factory events, with a GraphQL example and a video walkthrough. # BSC Smart Contract Events API In this section we will see how to get BSC Smart Contract Events information using our API. ## Track Newly Created Pools on BSC This subscription websocket lets you track the newly created pools on Uniswap V3 `0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7`. And we are listening for a particular event here named as `PoolCreated` because whenever a new pool is created on Uniswap V3 this event is fired. You can get the newly created pool address in the response in `arguments`. You can find the query [here](https://ide.bitquery.io/Newly-Created-Pools-on-Uniswap-v3-on-BSC-network_3#) ```graphql subscription { EVM(network: bsc) { Events( where: {Log: {SmartContract: {is: "0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7"}, Signature: {Name: {is: "PoolCreated"}}}, TransactionStatus: {Success: true}} ) { Log { Signature { Name Parsed Signature } SmartContract } Transaction { Hash } Block { Date Number } Arguments { Type 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 } } } } ``` ## Video Tutorial on BSC API | How to Track Newly Created Tokens & Pools in Realtime on BSC --- ## BSC Token Market Cap API: Market Cap, FDV and Supply of BNB Chain Tokens URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-token-marketcap-api/ Market cap, FDV, supply and price for BNB Chain tokens with Bitquery GraphQL: one token now, a watchlist, hourly history, a chain stream and an alert. # BSC Token Market Cap API: Market Cap, FDV and Supply of BNB Chain Tokens The `Tokens` cube of the Trading API keeps, for every token that trades on BNB Chain, a rolling set of candles with price, USD volume, circulating and total supply, market cap and fully diluted valuation. Market cap is circulating supply times the trade-weighted price, computed from on-chain trades, so it follows the market with a delay of a block rather than an hour. Tokens are addressed by id, `bid:bsc:` followed by the lowercase contract, and the chain is `Token.Network: "Binance Smart Chain"`. The cube keeps about a month; the [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) gives on-chain total supply at any recent transaction if you only need supply. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the worked token is CAKE, `0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82`. ## Market cap of one token now Match the id exactly, keep one candle size and a short window, and take the newest row. Without the window the query scans the whole cube and times out; without the duration it returns one row per candle size. Saved query [here](https://ide.bitquery.io/specific-bsc-token-latest-marketcap_1). ```graphql { Trading { Tokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Token: { Id: { is: "bid:bsc:0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } Interval: { Time: { Duration: { eq: 60 } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } Token { Name Symbol Address Network } Price { Ohlc { Close } Average { Mean } } Supply { CirculatingSupply TotalSupply MarketCap FullyDilutedValuationUsd } Volume { Usd } } } } ``` ## A watchlist in one query `in` takes a list of ids and `limitBy` on the token id keeps the newest row per token. The example is CAKE, WBNB and USDT. ```graphql { Trading { Tokens( limitBy: { by: Token_Id, count: 1 } orderBy: { descending: Block_Time } where: { Token: { Id: { in: [ "bid:bsc:0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" "bid:bsc:0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c" "bid:bsc:0x55d398326f99059ff775485246999027b3197955" ] } } Interval: { Time: { Duration: { eq: 60 } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } Token { Symbol Id } Price { Ohlc { Close } } Supply { MarketCap FullyDilutedValuationUsd CirculatingSupply TotalSupply } Volume { Usd } } } } ``` ## Hourly market cap over the last day One-hour candles carry the market cap at the close of each hour, with open and close price and the hour's USD volume, which is enough for a chart or a change-over-24-hours figure. Saved query [here](https://ide.bitquery.io/top-bsc-tokens-by-Market-Cap-Change-1h). ```graphql { Trading { Tokens( limit: { count: 24 } orderBy: { descending: Block_Time } where: { Token: { Id: { is: "bid:bsc:0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82" } } Interval: { Time: { Duration: { eq: 3600 } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Interval { Time { Start } } Price { Ohlc { Open Close } } Supply { MarketCap } Volume { Usd } } } } ``` ## Stream market cap updates for every BNB Chain token Filter `Currency.Id` on the chain prefix and subscribe. Each message is a candle closing for some token; `Duration` above one second skips the tick-level candles. Saved stream [here](https://ide.bitquery.io/bsc-token-marketcap-stream). ```graphql subscription { Trading { Tokens( where: { Currency: { Id: { includes: "bsc" } } Interval: { Time: { Duration: { gt: 1 } } } } ) { Block { Time } Token { Symbol Id } Interval { Time { Duration } } Price { Ohlc { Close } } Supply { MarketCap FullyDilutedValuationUsd TotalSupply } Volume { Usd } } } } ``` ## Alert when a token crosses a market cap Add a `Supply.MarketCap` bound to the stream and only tokens above it arrive, which is a launch screener in one filter. Saved stream [here](https://ide.bitquery.io/realtime-stream-bsc-tokens-with-marketcap-above-1-million_1). ```graphql subscription { Trading { Tokens( where: { Token: { Network: { is: "Binance Smart Chain" } } Interval: { Time: { Duration: { gt: 1 } } } Supply: { MarketCap: { gt: 1000000 } } } ) { Block { Time } Token { Symbol Id } Supply { MarketCap TotalSupply } Price { Ohlc { Close } } } } } ``` ## Why some market caps look absurd Market cap here is on-chain supply times an on-chain price. A token with a huge minted supply and a few dollars of trades in a thin pool can show a market cap in the billions, and a plain "top tokens by market cap" ranking of the cube is led by those. Rank inside a list you trust, as in the watchlist query, or bound the ranking with `Volume: { Usd: { gt: ... } }` and `Supply: { MarketCap: { lt: ... } }` and treat the result as a screen rather than a league table. The saved [top tokens by market cap](https://ide.bitquery.io/Top-Tokens-by-Market-Cap-on-bsc) query shows the bounded form. ## Related pages - [Base token market cap API](/docs/blockchain/Base/base-token-marketcap-api) - [Ethereum token market cap API](/docs/blockchain/Ethereum/token-supply/ethereum-token-marketcap-api) - [Tokens cube](/docs/trading/crypto-price-api/tokens) - [Supply fields](/docs/trading/crypto-price-api/supply-fields) - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) --- ## BSC Transaction Balance Tracker API: Balance Changes With a Reason Code URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/ How the BNB Chain balance tracker works: one row per balance change with pre and post balance and a reason code, which codes occur, and the tracker pages. # BSC Transaction Balance Tracker API: Balance Changes With a Reason Code The `TransactionBalances` cube under `EVM(network: bsc)` writes one row for every balance that a transaction changes: the address, the currency, the balance before and after, the USD value, and for BNB a reason code that says why it moved. A transfer, a gas charge, a gas refund, a fee credit to the block producer and a self-destruct each carry their own code, so one filter separates them without decoding calls. The same rows serve as a live stream and as a query over the recent realtime window; the cube has no archive dataset, so keep what you need by recording the stream. Every example on the tracker pages runs in the [IDE](https://ide.bitquery.io) on a free account. ## The reason codes that occur on BNB Chain Native BNB rows carry one of these in live data. The rest of the schema, listed further down, belongs to other chains' history and returns nothing here. | Code | Name | What it marks | Page | |---|---|---|---| | 10 | BalanceChangeTransfer | BNB moved by a transaction or an internal call | [Transaction tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) | | 6 | BalanceDecreaseGasBuy | Gas limit charged to the sender before execution | [Gas tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-gas-balance-tracker) | | 7 | BalanceIncreaseGasReturn | Unused gas refunded after execution | [Gas tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-gas-balance-tracker) | | 5 | BalanceIncreaseRewardTransactionFee | Fee for used gas credited to the fee holder, then deposited to the ValidatorSet contract per block | [MEV tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker), [Miner tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker) | | 12, 13 | BalanceIncreaseSelfdestruct, BalanceDecreaseSelfdestruct | Recipient and contract of a `selfdestruct` | [Self-destruct tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-self-destruct-balance-api) | | 0 | BalanceChangeUnspecified | Everything without a more specific reason, and every token row | [Transaction tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker) | Codes 1 and 2, the mining rewards, never appear because BNB Chain has validators, not miners; code 3, consensus-layer withdrawals, never appears because withdrawals are not transactions; code 14 has no live occurrences. The [miner tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker) shows the count query that proves it and what block producers earn instead. ## The tracker pages - [BSC transaction balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker): stream one address, latest BNB or BEP-20 balance of a wallet, pool reserves, token supply and market cap. - [BSC gas balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-gas-balance-tracker): gas bought and refunded per transaction for an address, the busiest gas payers, a live gas stream. - [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker): every priority fee as it is paid, the largest tips, one bot's spending, fee income per block. - [BSC miner balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-miner-balance-tracker): what block producers earn on a chain without miners, per block and per validator. - [BSC validator balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-validator-balance-tracker): the staking side of validator balances. - [BSC self-destruct balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-self-destruct-balance-api): contracts that destroy themselves and the addresses that collect their BNB. - [BSC transfer balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-transfer-balance-tracker): balance changes caused by transfers. ## One row, three shapes The fields a row carries depend on the currency. - **BNB:** `BalanceChangeReasonCode`, `PreBalance`, `PostBalance`, `PostBalanceInUSD`. - **BEP-20 tokens:** `PostBalance`, `PostBalanceInUSD`, `TotalSupply`, `TotalSupplyInUSD`; no pre-balance and no reason code. - **NFTs:** `PostBalance` and `TokenOwnership`; no USD values. ## The smallest useful query The newest balance changes of one address, any currency, which is the shape most of the tracker pages build on. ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 10 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } } } ) { Block { Time } TokenBalance { BalanceChangeReasonCode PreBalance PostBalance PostBalanceInUSD Currency { Symbol Native } } Transaction { Hash } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to follow the address live. Kafka carries the same rows on the `bsc.tokens.proto` topic; see the [Kafka streams hub](/docs/category/kafka-streams). ## The full code list {#balance-change-reason-codes} Defined for every EVM chain the cube serves; only the codes in the first table occur on BNB Chain. | Code | Reason | Description | |---|---|---| | 0 | BalanceChangeUnspecified | No specific reason recorded | | 1 | BalanceIncreaseRewardMineUncle | Uncle block reward (proof-of-work chains) | | 2 | BalanceIncreaseRewardMineBlock | Block mining reward (proof-of-work chains) | | 3 | BalanceIncreaseWithdrawal | Consensus-layer validator withdrawal | | 4 | BalanceIncreaseGenesisBalance | Balance allocated at genesis | | 5 | BalanceIncreaseRewardTransactionFee | Fee for used gas credited to the block producer | | 6 | BalanceDecreaseGasBuy | Gas limit charged before execution | | 7 | BalanceIncreaseGasReturn | Unused gas refunded after execution | | 8 | BalanceIncreaseDaoContract | DAO refund contract credit (Ethereum, 2016) | | 9 | BalanceDecreaseDaoAccount | DAO account debit (Ethereum, 2016) | | 10 | BalanceChangeTransfer | Value moved by a call | | 11 | BalanceChangeTouchAccount | Zero-value transfer that creates an account | | 12 | BalanceIncreaseSelfdestruct | Recipient of a self-destructed contract's balance | | 13 | BalanceDecreaseSelfdestruct | Contract emptied by self-destruct | | 14 | BalanceDecreaseSelfdestructBurn | Value sent to an account already destroyed in the same transaction | | 15 | BalanceChangeRevert | Balance restored after a failed call | --- ## BSC Transaction Balance Tracker: Balances Before and After a Transaction URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-transaction-balance-tracker/ Stream and query BNB Chain balance changes with Bitquery GraphQL: every address a transaction touched, one wallet's BNB and USDT, pool reserves and supply. # BSC Transaction Balance Tracker: Balances Before and After a Transaction The `TransactionBalances` cube records, for each transaction on BNB Chain, every address whose balance changed and the balance before and after, in BNB, BEP-20 tokens and NFTs. A wallet tracker, a fee monitor and a pool reserve feed all come from the same rows. Native rows carry a reason code that says why the balance moved: 10 for a transfer, 6 and 7 for gas bought and returned, 5 for the fee credited to the block producer, 12 and 13 for self-destructs, 0 when no specific reason applies. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The cube covers the recent realtime window only, so queries carry a `limit` and, for wide filters, a time window. ## Stream one address BNB Chain produces so many balance rows that a stream over the whole network, one token or a broad reason code does not deliver in practice; filter on an address, or use the reason code 5 stream on the [MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker), which is keyed to one address. The example is a busy exchange wallet, so rows arrive within seconds; a quiet wallet streams only when it transacts. Saved stream [here](https://ide.bitquery.io/Subscribe-to-Transaction-Balances-for-a-Specific-Address-bsc). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } } } ) { Block { Number Time } TokenBalance { BalanceChangeReasonCode PreBalance PostBalance PostBalanceInUSD Currency { Symbol SmartContract Native } } Transaction { Hash From To } } } } ``` ## Latest BNB balance of an address The newest native row for the address; `PostBalance` is the balance after that transaction. Saved query [here](https://ide.bitquery.io/latest-native-balance-of-an-address-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } Currency: { Native: true } } } ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD BalanceChangeReasonCode } Transaction { Hash } } } } ``` ## Latest balance of an address in one token The same query with the token contract in place of the native flag. The example is USDT on BNB Chain, `0x55d398326f99059fF775485246999027B3197955`. Saved query [here](https://ide.bitquery.io/latest-balance-of-an-address-for-a-specific-token-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } Currency: { SmartContract: { is: "0x55d398326f99059fF775485246999027B3197955" } } } } ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD Currency { Symbol Name } } Transaction { Hash } } } } ``` An address that has not moved the token inside the realtime window has no row here; use the [Balances cube](/docs/cubes/balances-cube) for a balance that does not depend on recent activity. ## Latest reserves of a pool A pool is an address like any other, so its token balances are its reserves. `limitBy` on the token contract keeps the newest row per token, and the time window keeps the query fast on a busy pool. The example is the PancakeSwap v3 WBNB/USDT pool. Saved query [here](https://ide.bitquery.io/latest-liquidity-of-a-bsc-pool). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 2 } limitBy: { by: TokenBalance_Currency_SmartContract, count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x36696169C63e42cd08ce11f5deeBbCeBae652050" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } TokenBalance { Currency { Symbol SmartContract } PostBalance PostBalanceInUSD } } } } ``` ## Latest supply and market cap of a token Token rows carry `TotalSupply` and `TotalSupplyInUSD` as of that transaction, so the newest row for a token gives its supply and on-chain market cap. The example is CAKE. Saved query [here](https://ide.bitquery.io/Total-Supply-and-onchain-Marketcap-of-a-specific-token-bsc). ```graphql { EVM(network: bsc) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Currency: { SmartContract: { is: "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" } } } } ) { Block { Time } TokenBalance { Currency { Symbol Name } TotalSupply TotalSupplyInUSD } } } } ``` ## Which fields each currency type carries - **BNB:** `BalanceChangeReasonCode`, `PreBalance`, `PostBalance`, `PostBalanceInUSD`. - **BEP-20:** `PostBalance`, `PostBalanceInUSD`, `TotalSupply`, `TotalSupplyInUSD`; no pre-balance or reason code. - **NFTs:** `PostBalance` and `TokenOwnership`; no USD values. ## Related pages - [BSC transaction balance tracker overview](/docs/blockchain/BSC/transaction-balance-tracker/) - [BSC gas balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-gas-balance-tracker) - [BSC MEV balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-mev-balance-tracker) - [Balances and Holders cubes](/docs/cubes/balances-cube) --- ## BSC Transfer Balance Tracker URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-transfer-balance-tracker/ BSC Transfer Balance Tracker: monitor BNB Chain native and token transfers in real time with Bitquery GraphQL APIs. Keep queries fast with indexed filters. # BSC Transfer Balance Tracker The BSC Transfer Balance Tracker API provides real-time balance updates for all addresses involved in Transfers on the BSC blockchain, and provides option to filter out based on the direction of transfer you want to target. The BSC Transfer Balance is tracked by marking the the `BalanceUpdateReason` equals `10`. :::note The queries covered this section are only valid for the Native Currency Transfer. ::: ## Get Balance Info for an Address after Transfer [This](https://ide.bitquery.io/balance-update-from-transfer-for-an-address-bsc) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a particular address after a transfer, irrespective of the direction of transfer.
Click here to expand ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {is: "0xYourAddressInput"}}} orderBy: {descending: Block_Time} limit: {count: 1} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
## Stream Balance Info for Transfer in Real Time [This](https://ide.bitquery.io/balance-update-from-transfer-for-an-address--stream-bsc) subscription allows us to stream Balance Updates for an address due to transfer in Real Time.
Click here to expand ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {is: "0xYourAddressInput"}}} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
## Get Balance Info for Multiple Addresses after Transfer [This](https://ide.bitquery.io/balance-update-from-transfer-for-multiple-addresses-bsc_1) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a list of addresses after a transfer, irrespective of the direction of transfer.
Click here to expand ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}} orderBy: {descending: Block_Time} limitBy: {by:TokenBalance_Address count: 1} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
## Stream Balance Update due to Transfer for Multiple Addresses in Real Time [This](https://ide.bitquery.io/balance-update-from-transfer-for-multiple-addresses--stream-bsc) subscription allows us to stream Balance Updates for a list of addresses due to transfer in Real Time.
Click here to expand ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {in: ["0xYourAddressInput", "0xYourAddressInput"]}}} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
## Get Balance Info for an Address after Transfer Sent [This](https://ide.bitquery.io/Balance-update-after-transfer-sent-bsc) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a particular address after it sends a transfer.
Click here to expand ```graphql query MyQuery { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {From: {is: "0xYourAddressInput"}}} orderBy: {descending: Block_Time} limit: {count: 1} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Stream Balance Info for Transfer Sent in Real Time [This](https://ide.bitquery.io/Balance-update-after-transfer-sent--stream-bsc) subscription allows us to stream Balance Updates for a transfer sent by an address in Real Time.
Click here to expand ```graphql subscription { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {From: {is: "0xYourAddressInput"}}} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Get Balance Info for Multiple Addresses after Transfer Sent [This](https://ide.bitquery.io/Balance-update-after-transfer-sent-from-multiple-addresses-bsc) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a list of addresses after they send a transfer.
Click here to expand ```graphql query MyQuery { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {From: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}} orderBy: {descending: Block_Time} limitBy: {by:Transaction_From count: 1} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Stream Balance Info for Multiple Addresses for Transfer Sent in Real Time [This](https://ide.bitquery.io/Balance-update-after-transfer-sent-from-multiple-addresses--stream-bsc) subscription allows us to stream Balance Updates for a list of addresses due to transfer sent in Real Time.
Click here to expand ```graphql subscription { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {From: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Get Balance Info for an Address after Transfer Recieved [This](https://ide.bitquery.io/Balance-update-after-transfer-received-bsc) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a particular address after it recieves a transfer.
Click here to expand ```graphql query MyQuery { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {To: {is: "0xYourAddressInput"}}} orderBy: {descending: Block_Time} limit: {count: 1} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Stream Balance Info for Transfer Recieved in Real Time [This](https://ide.bitquery.io/Balance-update-after-transfer-received--stream-bsc) subscription allows us to stream Balance Updates for a transfer recieved by an address in Real Time.
Click here to expand ```graphql subscription { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {To: {is: "0xYourAddressInput"}}} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Get Balance Info for Multiple Addresses after Transfer Recieved [This](https://ide.bitquery.io/Balance-update-after-transfer-received-from-multiple-addresses-bsc) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a list of addresses after they recieve a transfer.
Click here to expand ```graphql query MyQuery { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {To: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}} orderBy: {descending: Block_Time} limitBy: {by:Transaction_To count: 1} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Stream Balance Info for Multiple Addresses for Transfer Recieved in Real Time [This](https://ide.bitquery.io/Balance-update-after-transfer-received-from-multiple-addresses--stream-bsc) subscription allows us to stream Balance Updates for a list of addresses due to transfer recieved in Real Time.
Click here to expand ```graphql subscription { EVM { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {To: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}} ) { Block{ Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction{ From To Hash } amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance") amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD") } } } ```
## Get Balance Updates for the Last 24 hours Use [this](https://ide.bitquery.io/Balance-Updates-for-transfer-in-last-24-hours-bsc) API endpoint for getting Balance Updates due to Transfers for a particular address irrespective of the direction of Transfer. This could be used in applications that maintains a record for a wallet.
Click here to expand ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {is: "0xYourAddressInput"}}, Block: {Time: {since_relative: {hours_ago: 24}}}} orderBy: {descending: Block_Time} ) { Block { Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction { From To Hash } transfer_amount: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) transfer_amount_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) } } } ```
## Get Balance Updates for the Last 24 hours Use [this](https://ide.bitquery.io/Balance-Updates-for-multiple-addresses-transfer-in-last-24-hours-bsc) API endpoint for getting Balance Updates due to Transfers for a list of addresses irrespective of the direction of Transfer. This could be used in Dashboard Applications that shows record for multiple wallets.
Click here to expand ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {in: ["0xYourAddressInput1", "0xYourAddressInput2"]}}, Block: {Time: {since_relative: {hours_ago: 24}}}} orderBy: {descending: Block_Time} ) { Block { Time } TokenBalance { PreBalance PostBalance PreBalanceInUSD PostBalanceInUSD } Transaction { From To Hash } transfer_amount: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) transfer_amount_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) } } } ```
--- ## BSC Validator Balance Tracker URL: https://docs.bitquery.io/docs/blockchain/BSC/transaction-balance-tracker/bsc-validator-balance-tracker/ BSC Validator Balance Tracker: stream BNB Chain balance changes with reason codes using Bitquery GraphQL subscriptions. See examples in the Bitquery IDE. # BSC Validator Balance Tracker The BSC Validator Balance Tracker API provides real-time balance updates for BSC validators, tracking their staking rewards, withdrawals, and balance changes. ## Track Validator Balance Updates Monitor balance changes for BSC validators, including staking rewards and withdrawals from the beacon chain. Try the API [here](https://ide.bitquery.io/Track-Validator-Balance-Updates-bsc_1). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [211, 5] } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` **Note:** BalanceChangeReasonCode 3 corresponds to `BalanceIncreaseWithdrawal` - ETH withdrawn from the beacon chain. ## Track Validator Rewards Track validator rewards and balance increases from staking activities. Try the API [here](https://ide.bitquery.io/Track-Validator-Rewards-bsc_1). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 211 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` **Balance Change Reason Codes for Validators:** - **Code 211**: `BalanceIncreaseRewardMineBlock` - BalanceChangeCode when BSC is distributing rewards to validator. ## Filter by Validator Address Track balance changes for a specific validator address: Try the API [here](https://ide.bitquery.io/Filter-by-Validator-Address-bsc_1). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { Address: { is: "0xValidatorAddressHere" } BalanceChangeReasonCode: { eq: 211 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` ## Top Validators by Total Tips earned in last 24 hrs Ranks validators by cumulative priority fees (reason code 5) received in the last 24 hours. Test the query [here](https://ide.bitquery.io/top-validators-by-total-tips-in-last-24-hrs-bsc). ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { TransactionBalances( limit: { count: 10 } orderBy: { descendingByField: "Total_tip_native" } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { TokenBalance { Address BalanceChangeReasonCode Currency { Name Symbol SmartContract } } Post: sum(of: TokenBalance_PostBalance) Post_USD: sum(of: TokenBalance_PostBalanceInUSD) Pre: sum(of: TokenBalance_PreBalance) Pre_USD: sum(of: TokenBalance_PreBalanceInUSD) Total_tip_native: calculate(expression: "$Post - $Pre") Total_tip_usd: calculate(expression: "$Post_USD - $Pre_USD") number_of_tips: count } } } ``` ## Total Tips earned by a Validator in last 24 hrs Returns the total priority fees (native and USD) earned by a specific validator over the last 24 hours. Test the query [here](https://ide.bitquery.io/total-tips-received-by-a-validator-in-last-24-hrs-bsc). ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } Address: { is: "0xValidatorAddressHere" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { TokenBalance { Address BalanceChangeReasonCode Currency { Name Symbol SmartContract } } Post: sum(of: TokenBalance_PostBalance) Post_USD: sum(of: TokenBalance_PostBalanceInUSD) Pre: sum(of: TokenBalance_PreBalance) Pre_USD: sum(of: TokenBalance_PreBalanceInUSD) Total_tip_native: calculate(expression: "$Post - $Pre") Total_tip_usd: calculate(expression: "$Post_USD - $Pre_USD") number_of_tips: count } } } ``` ## Avg Tip in last 10 Blocks Calculates the average tip for each of the last 10 blocks. Test the query [here](https://ide.bitquery.io/last-10-blocks-avg-tip-in-native-bnb). ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { TransactionBalances( limit: { count: 10 } orderBy: { descending: Block_Number } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Number } TokenBalance { BalanceChangeReasonCode Currency { Name Symbol SmartContract } } Post: sum(of: TokenBalance_PostBalance) Post_USD: sum(of: TokenBalance_PostBalanceInUSD) Pre: sum(of: TokenBalance_PreBalance) Pre_USD: sum(of: TokenBalance_PreBalanceInUSD) Total_tip_native: calculate(expression: "$Post - $Pre") Total_tip_usd: calculate(expression: "$Post_USD - $Pre_USD") number_of_tips: count avg_tip_in_this_block: calculate( expression: "$Total_tip_native / $number_of_tips" ) avg_tip_usd_in_this_block: calculate( expression: "$Total_tip_usd / $number_of_tips" ) } } } ``` ## Avg Tip given in terms of Avg Gas Fees in last 10 blocks Compares average user tip to average total gas fee per block across the last 10 blocks. Test the query [here](https://ide.bitquery.io/Average-Tip-in-terms-of-avg-gas-Fee-bsc). ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { TransactionBalances( limit: { count: 10 } orderBy: { descending: Block_Number } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Number } TokenBalance { BalanceChangeReasonCode Currency { Name Symbol SmartContract } } avg_gasfees_in_this_block: average(of: Fee_SenderFee) Post: sum(of: TokenBalance_PostBalance) Post_USD: sum(of: TokenBalance_PostBalanceInUSD) Pre: sum(of: TokenBalance_PreBalance) Pre_USD: sum(of: TokenBalance_PreBalanceInUSD) Total_tip_native: calculate(expression: "$Post - $Pre") Total_tip_usd: calculate(expression: "$Post_USD - $Pre_USD") number_of_tips: count avg_tip_in_this_block: calculate( expression: "$Total_tip_native / $number_of_tips" ) avg_tip_usd_in_this_block: calculate( expression: "$Total_tip_usd / $number_of_tips" ) tip_in_terms_of_gasfees: calculate( expression: "( $avg_gasfees_in_this_block - $avg_tip_in_this_block ) / $avg_gasfees_in_this_block" ) } } } ``` --- ## Base API Documentation URL: https://docs.bitquery.io/docs/blockchain/Base/ Base chain data: DEX and protocol trades, slippage, liquidity, tokens, transfers, balances and NFTs, with WebSocket and webhook support. # Base API Documentation :::tip Building a trading app or DEX UI on Base? For **real-time trades and prices on Base** (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 Base 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 tokens, transactions, DEXs like Aerodrome and Uniswap, liquidity pools, and slippage data on Base via APIs and Streams. If you need help getting data on Base, reach out to [support](https://t.me/Bloxy_info). ### What is Base API? Bitquery Base APIs help you fetch onchain data like trades, transactions, balances, token holders, liquidity pools, and slippage data etc using graphQL query. ### What are capabilities of Bitquery Base API? Bitquery Base APIs are very flexible; you can fetch trade, transaction, balance, liquidity, and slippage information for a period, for a specific wallet, and join with other information. ### Difference between Base RPC and Bitquery Base API? | Base RPC | Bitquery Base API | | --- | --- | | JSON-RPC endpoint exposing raw EVM on-chain state and transactions | GraphQL endpoint over pre-indexed, parsed Base chain 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 | ### Does Bitquery support Base 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 to fetch the latest 5 DEX trades on Base: ```graphql query LatestBaseTrades { EVM(network: base) { DEXTrades(limit: { count: 5 }, orderBy: { descending: Block_Time }) { Block { Time } Trade { Dex { ProtocolName } Buy { AmountInUSD Currency { Symbol } } Sell { AmountInUSD Currency { Symbol } } } Transaction { Hash } } } } ``` ## DEX and Protocol APIs - [Aerodrome API](./aerodrome-base-api) - [Uniswap v3 on Base API](./base-uniswap-api) - [Base Dex Trades](./base-dextrades) - [ApeStore API](./apestore-base-api) - [Clanker API](./base-clanker-api) · [DEXrabbit Clanker tokens](https://dexrabbit.bitquery.io/categories/clanker-ecosystem) - [Jump (Base) API](./base-jump-base-api) ## Base Slippage API - [Base Slippage API](./base-slippage-api) Get slippage and price impact data for Base DEX pools. Understand price impact and liquidity depth for token swaps, calculate maximum input amounts at different slippage tolerances, and monitor real-time slippage data across all DEX pools on Base. ## Base Liquidity API - [Base Liquidity API](./base-liquidity-api) Monitor real-time liquidity changes, track pool reserves, and analyze liquidity depth for token pairs on Base DEX pools. Track when liquidity is added or removed, monitor pool health and depth, and analyze liquidity patterns across different pools. ## Tokens, Transfers, Balances - [Base Coins API](./base-coins-api) - [Base Transfers](./base-transfers) - [Base Address Balance API](./base-balance-updates) ## NFTs - [Base NFT](./base-nft) - [Zora on Base API](./base-zora-api) ## AI Agent - [Building an AI Trading Agent on Base](./ai-agent-base-data) ## Videos ### Video Tutorial | Aerodrome: Latest Trades & Most Purchased Tokens ### Video Tutorial | Aerodrome: Latest Liquidity Pools & Pool Liquidity ### Video Tutorial | Base DEX Trades API ### Video Tutorial | Base Transfers in Realtime ### Video Tutorial | Latest Memecoins on Base Browse live Base memecoin DEX prices on [DEXrabbit's Base Meme Coins category](https://dexrabbit.bitquery.io/categories/base-meme-coins). ### Video Tutorial | Base Balance Updates ### Video Tutorial | Build AI Trading Agent on Base ## 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/) --- ## Base Address Balance API URL: https://docs.bitquery.io/docs/blockchain/Base/base-balance-updates/ Base Address Balance API: fetch current and historical Base balances with Bitquery GraphQL balance queries. Great for bots, dashboards, and alerts. # Base Address Balance API To rank a token's holders, see the [Token Holders API](/docs/blockchain/Ethereum/token-holders/token-holder-api) (`EVM.Holders`). The **Balances** API returns current and historical token balances for an address on Base. 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**. | Examples: [All Token Balances](#balance-of-an-address) · [Native ETH (Base)](#native-eth-base-balance) · [Balance on a Date](#balance-on-a-specific-date) · [Specific Token](#balance-for-a-specific-token) · [Holder Snapshot](#token-holder-snapshot) ## Balance of an Address Returns token balances for a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances. [Run in IDE](https://ide.bitquery.io/base-balances-address) ```graphql { EVM(network: base, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) Address } } } } ``` ## Native ETH (Base) Balance Returns the native ETH balance for a wallet on Base (not ERC-20 tokens). Filter with `Currency: { Native: true }` instead of a token contract address. [Run in IDE](https://ide.bitquery.io/base-native-balances-address) ```graphql { EVM(network: base, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } Currency: { Native: true } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) Address } } } } ``` **Parameters** - `network: base`: Base mainnet. - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. - `Currency.Native: true`: Native ETH on Base only (see [Native ETH (Base) Balance](#native-eth-base-balance)). **Returned fields** - `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Balance on a Specific Date Use `Block.Date.till` for a point-in-time snapshot. Use `dataset: archive` for historical dates and addresses not recently active. [Run in IDE](https://ide.bitquery.io/base-balances-by-date) ```graphql query { EVM(network: base, dataset: archive) { Balances( where: { Block: { Date: { till: "2026-05-01" } } Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance for a Specific Token Add a `Currency.SmartContract` filter. Always use the contract address, not the token name. Use `0x` for native ETH on Base, or the ERC-20 contract address for a token. [Run in IDE](https://ide.bitquery.io/base-balances-specific-token) ```graphql query { EVM(network: base, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } Currency: { SmartContract: { is: "0x09403da25c27024c7418fc942dda8ffa70bc7c62" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Token Holder Snapshot The number of unique holders, token supply, and Gini coefficient for the balance amount before a specific timestamp can be derived using the query below. These stats provide a useful holder snapshot for any given time. [Run in IDE](https://ide.bitquery.io/token-holder-snapshot-base)
Click to expand GraphQL query ```graphql query MyQuery($network: evm_network!, $address: String!) { EVM(network: $network, dataset: combined) { Holders( where: {Currency: {SmartContract: {is: $address}}, Balance: {Amount: {gt: "0"}, LastChangeTime: {till: "2026-06-30T00:00:00Z"}}} ) { Balance { LastChangeTime(maximum: Balance_LastChangeTime) } holders: uniq(of: Holder_Address) supply: sum(of: Balance_Amount) gini(of: Balance_Amount) } } } ``` ```json { "network": "base", "address": "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } ```
## 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/base-balances-history) ```graphql query { EVM(network: base, dataset: archive) { Balances( where: { Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } Currency: {} } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` ## Wallet Balance for a Specific Token on a Date Get a wallet's balance for a specific token with `Balance.Address` and `Currency.SmartContract`. This example uses native ETH (`SmartContract: "0x"`) with `dataset: combined`. For a balance on a calendar date, use [Balance on a Specific Date](#balance-on-a-specific-date) with `dataset: archive` and `Block.Date.till`. [Run in IDE](https://ide.bitquery.io/base-wallet-balance-token-at-date) ```graphql query { EVM(network: base, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xbaed383ede0e5d9d72430661f3285daa77e9439f" } } Currency: { SmartContract: { is: "0x" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` --- ## Base Bankr (Doppler) API URL: https://docs.bitquery.io/docs/blockchain/Base/base-bankr-api/ Bankr (Doppler) tokens on Base: new launches, market cap and FDV, OHLC candles, real-time swaps, V4 pools, and top buyers and sellers. # Base Bankr (Doppler) API This page provides a set of queries to track tokens launched by **[Bankr](https://bankr.bot/)** on Base. Bankr deploys tokens using the **[Doppler Protocol](https://docs.doppler.lol/)** (canonical contracts maintained by Whetstone Research). Each token is minted into the Doppler **Airlock** orchestrator, seeded into a **Uniswap V4** multicurve pool via an initializer contract, and traded on V4 from the moment it launches. Bankr uses Doppler's `NoOpMigrator`, which means **liquidity never migrates** — the multicurve LP stays in the same V4 pool forever and fees stream out through `StreamableFeesLockerV2` to the creator and Doppler. Because of this, there is **no on-chain `Graduated` event** for Bankr tokens; "graduation" is inferred from curve exhaustion (initializer's token balance reaching zero, or the pool tick crossing the final curve segment). For the broader DEX schema, see: - [Crypto Trades API ➤](/docs/trading/crypto-trades-api/trades-api) - [Crypto Price API ➤](/docs/trading/crypto-price-api/) - [Base DEX Trades API ➤](/docs/blockchain/Base/base-dextrades) - [Uniswap V4 API ➤](/docs/blockchain/Base/uniswap-v4-api) - [Base Token Market Cap API ➤](/docs/blockchain/Base/base-token-marketcap-api) :::note To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/). ::: ## Bankr / Doppler Contract Map (Base) | Component | Address | Role | | ---------------------------------- | -------------------------------------------- | ------------------------------------------------------------------- | | **Airlock** | `0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12` | Orchestrator — emits `Create` per launch, receives the initial mint | | **DecayMulticurveInitializer** | `0xd59ce43…` | Holds the V4 LP position (current default) | | **ScheduledMulticurveInitializer** | `0xA36715d…` | Holds the V4 LP position (original Feb 2025 deployment) | | **Uniswap V4 PoolManager** | `0x498581fF718922c3f8e6A244956aF099B2652b2b` | Singleton where swaps actually clear | | **NoOpMigrator** | (reverts on call) | Bankr's migrator slot — disables migration by design | ## Latest Tokens Launched via Bankr Every Bankr launch emits a `Create(address,address,address,address)` event on the Airlock contract. This query returns the most recent launches with the new token address and deployer. [ Try it in the IDE ](https://ide.bitquery.io/Latest-Bankr-launches-Doppler-Airlock-Base) ```graphql { EVM(network: base) { Events( limit: { count: 25 } orderBy: { descending: Block_Time } where: { LogHeader: { Address: { is: "0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12" } } Log: { Signature: { Name: { is: "Create" } } } } ) { Block { Time } Transaction { Hash From } Arguments { Name Value { __typename ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` The four positional arguments are typically `(asset, numeraire, initializer, migrator)`. The first address is the newly created token; the third is the multicurve initializer holding its LP; the fourth identifies whether the launch uses `NoOpMigrator` or a real migrator. ## Recent Bankr Tokens Created by a Deployer Filter `Create` events on the Airlock by **`Transaction.From`** to list every Bankr token launched by a specific wallet. Replace the deployer address with the wallet you want to track. [ Try it in the IDE ](https://ide.bitquery.io/All-bankers-tokens-created-by-a-deployer) ```graphql { EVM(network: base, dataset: realtime) { Events( limit: { count: 50 } orderBy: { descending: Block_Time } where: { Log: { SmartContract: { is: "0x660eaaedebc968f8f3694354fa8ec0b4c5ba8d12" } Signature: { Name: { is: "Create" } } } Transaction: { From: { is: "0x36d4f6cddca1219440a5983f4d4459b20682e103" } } } ) { Block { Time } Transaction { Hash From } Arguments { Name Value { __typename ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` The first address in `Arguments` is the newly minted token contract. ## Real-time Stream of Bankr Launches Convert the above query into a subscription to be notified of every new token the moment it lands on Base. [ Try it in the IDE ](https://ide.bitquery.io/Realtime-stream-Bankr-launches-Base) ```graphql subscription { EVM(network: base) { Events( where: { LogHeader: { Address: { is: "0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12" } } Log: { Signature: { Name: { is: "Create" } } } } ) { Block { Time } Transaction { Hash From } Arguments { Name Value { __typename ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` ## Latest Market Cap, FDV, Price for a Bankr Token `Trading.Tokens` returns the latest 1-second interval row with USD price, OHLC, supply, market cap, and FDV. Filter by `Token.Address` + `Token.Network: "Base"`. Example uses OSAURUS (`0xa739D3728C13ad5a0d480525A6B9618863AA5bA3`). [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-latest-marketcap-OHLC) ```graphql query { Trading { Tokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Token: { Address: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } Network: { is: "Base" } } Interval: { Time: { Duration: { eq: 1 } } } } ) { Token { Address Symbol Name } Block { Time } Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving WeightedSimpleMoving } } Supply { TotalSupply CirculatingSupply MarketCap FullyDilutedValuationUsd } Volume { Base Quote Usd } } } } ``` ## Real-time Market Cap & OHLC Stream Subscribe to live 1-second OHLC + market cap updates for a specific Bankr token. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-realtime-marketcap-OHLC-stream) ```graphql subscription { Trading { Tokens( where: { Token: { Address: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } Network: { is: "Base" } } Interval: { Time: { Duration: { gt: 1 } } } } ) { Token { Address Symbol Name } Block { Time } Price { Ohlc { Open High Low Close } Average { Mean } } Supply { MarketCap FullyDilutedValuationUsd TotalSupply } Volume { Usd } } } } ``` ## OHLC Candles (1-Minute) for a Bankr Token Build candlestick charts directly from `Trading.Tokens` using 60-second intervals. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-1min-OHLC-candles) ```graphql query { Trading { Tokens( limit: { count: 100 } orderBy: { descending: Block_Time } where: { Token: { Address: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } Network: { is: "Base" } } Interval: { Time: { Duration: { eq: 60 } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Time } Interval { Time { Start End Duration } } Price { Ohlc { Open High Low Close } } Volume { Base Quote Usd } } } } ``` ## Real-time DEX Swaps for a Bankr Token Bankr trades clear on the Uniswap V4 singleton. Use the **[Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)** (`Trading.Trades`) to stream swap-level rows with **USD price**, **market cap**, **supply**, **trader**, and **V4 pool id**. Filter by **`Pair.Market.Network: "Base"`**, **`Pair.Market.Protocol: "uniswap_v4"`**, and **`Pair.Token.Id`** (use **`base:`** + lowercase contract, e.g. `base:0xa739d3728c13ad5a0d480525a6b9618863aa5ba3`). [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-V4-swaps-realtime) ```graphql subscription { Trading { Trades( where: { Pair: { Market: { Network: { is: "Base" }, Protocol: { is: "uniswap_v4" } } Token: { Id: { is: "base:0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } } } } ) { Side Supply { CirculatingSupply MarketCap FullyDilutedValuationUsd } Trader { Address } TransactionHeader { Hash Sender } Amounts { Base Quote } AmountsInUsd { Base Quote } Block { Time } Price PriceInUsd Pair { Market { Network Protocol Program } Token { Address Symbol } QuoteToken { Address Symbol } Pool { Id Address } } } } } ``` ## All Pools for a Bankr Token (V4 PoolIds) A Bankr token can have multiple V4 multicurve pools (e.g., one against WETH and one against USDC). List them with trade counts. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-all-V4-pools) ```graphql { EVM(network: base) { DEXTradeByTokens( where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } } } } ) { Trade { PoolId Side { Currency { Symbol SmartContract } } } trades: count } } } ``` ## Top Buyers of a Bankr Token (Last 24h) Rank wallets by USD spent on a specific Bankr token over the last 24 hours. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-top-buyers-24h) ```graphql { EVM(network: base) { DEXTradeByTokens( limit: { count: 25 } orderBy: { descendingByField: "spentUsd" } where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } } Side: { Type: { is: buy } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Buyer } spentUsd: sum(of: Trade_Side_AmountInUSD) buys: count } } } ``` ## Top Sellers of a Bankr Token (Last 24h) Same shape as above, but for sells. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-token-top-sellers-24h) ```graphql { EVM(network: base) { DEXTradeByTokens( limit: { count: 25 } orderBy: { descendingByField: "receivedUsd" } where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0xa739d3728c13ad5a0d480525a6b9618863aa5ba3" } } Side: { Type: { is: sell } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Seller } receivedUsd: sum(of: Trade_Side_AmountInUSD) sells: count } } } ``` ## Base Tokens Above a Market Cap Threshold Stream every Base token currently above $100k FDV. Useful as a high-mcap or "graduated by mcap" alert. [ Try it in the IDE ](https://ide.bitquery.io/Base-tokens-above-100k-marketcap-stream) ```graphql subscription { Trading { Tokens( where: { Token: { Network: { is: "Base" } } Interval: { Time: { Duration: { gt: 1 } } } Supply: { FullyDilutedValuationUsd: { gt: 100000 } } } ) { Token { Address Symbol Name } Supply { MarketCap FullyDilutedValuationUsd TotalSupply } Price { Ohlc { Close } } Volume { Usd } } } } ``` To narrow strictly to Bankr-deployed tokens, intersect with the list of token addresses emitted by `Airlock.Create` (first query on this page). ## Newly Launched Bankr Tokens With Trades (Last Hour) Combine the launch feed with trading data to surface tokens that launched in the last hour and already have on-chain volume. [ Try it in the IDE ](https://ide.bitquery.io/Bankr-tokens-last-hour-with-trades) ```graphql { Trading { Tokens( limit: { count: 50 } limitBy: { by: Token_Address, count: 1 } orderBy: { descending: Block_Time } where: { Token: { Network: { is: "Base" } } Interval: { Time: { Duration: { eq: 1 } } } Block: { Time: { since_relative: { minutes_ago: 60 } } } Volume: { Usd: { gt: 100 } } } ) { Token { Address Symbol Name } Block { Time } Price { Ohlc { Open Close } } Volume { Usd } Supply { FullyDilutedValuationUsd MarketCap } } } } ``` --- ## Base Chain DEX Trades API URL: https://docs.bitquery.io/docs/blockchain/Base/base-dextrades/ Query and stream Base chain DEX trades with Bitquery GraphQL: live swap streams, real-time token prices, USD pricing and per-pair trade history. # Base Chain DEX Trades API :::tip Need real-time Base 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: Base`). Use this page when you need **historical Base data older than ~30 days** (with `dataset: combined` or `archive`), raw per-swap detail, or call / event context. For full-chain coverage — Aerodrome and Uniswap trades, transfers, balances and bridge flows — see the [Base API](https://bitquery.io/blockchains/base-blockchain-api) page. ::: In this section we will see how to get Base DEX trades information using our API. ## Live DEX swap stream (Base) {#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: Base`**. [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/All-Base-Trade-Stream). ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Base" } } } }) { 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 Base Trades This example uses the chain-specific **DEXTrades** cube via `EVM(network: base) { DEXTrades }` (pool-side Buy/Sell; see [DEXTrades cube](/docs/cubes/dextrades)). USD can be weak on small tokens. For trader + USD swap rows, use the [stream at the top](#crypto-trades-live-stream). Read [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) to get a better understanding on when to use which cube. You can find the query [here](https://ide.bitquery.io/subscribe-to-dex-trades-on-base) ```graphql subscription MyQuery { EVM(network: base) { DEXTrades { Block { Time Number } Transaction { Hash } Call { Signature { Name Signature } } Log { Index SmartContract Signature { Signature Name } } Trade { Sender Buy { Buyer AmountInUSD Amount Seller PriceInUSD Price Currency { Name Symbol SmartContract } } Dex { SmartContract ProtocolName ProtocolVersion } Sell { Buyer AmountInUSD Amount Seller PriceInUSD Price Currency { Name Symbol SmartContract } } } } } } ``` ## Subscribe to Latest Price of a Token in Real-time This query provides real-time updates on price of USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` in terms of DAI `0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb`, including details about the DEX, market, and order specifics. Find the query [here](https://ide.bitquery.io/Price-of-USDC-in-terms-of-DAI-on-Base-network#) ```graphql subscription { EVM(network: base) { DEXTrades( where: {Trade: {Sell: {Currency: {SmartContract: {is: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}}, Buy: {Currency: {SmartContract: {is: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}}}}} ) { Block { Time } Trade { Buy { Amount Buyer Seller Price_in_terms_of_sell_currency: Price Currency { Name Symbol SmartContract } } Sell { Amount Buyer Seller Price_in_terms_of_buy_currency: Price Currency { Symbol SmartContract Name } } } } } } ``` ## Latest USD Price of a Token The below query retrieves the USD price of a token on Base chain by setting `SmartContract: {is: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}` . Check the field `PriceInUSD` for the USD value. You can access the query [here](https://ide.bitquery.io/Get-latest-price-of-DAI-in-USD-on-Base#). ```graphql subscription { EVM(network: base) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}}}} ) { Transaction { Hash } Trade { Buyer AmountInUSD Amount Price PriceInUSD Seller Currency { Name Symbol SmartContract } Dex { ProtocolFamily SmartContract ProtocolName } Side { Amount AmountInUSD Buyer Seller Currency { Name SmartContract Symbol } } } } } } ``` ## Get First 500 Buyers of a specific token Below API gets you the first 500 buyers of a specific Base chain token, here as example we have taken this token `0x58538e6A46E07434d7E7375Bc268D3cb839C0133`. Try the API [here](https://ide.bitquery.io/first-500-buyers-of-a-specific-base-token#). ```graphql query MyQuery { EVM(network: base, dataset: combined) { DEXTrades( limit: { count: 500 } orderBy: { ascending: Block_Time } limitBy: { count: 1, by: Trade_Sell_Buyer } where: { Trade: { Sell: { Currency: { SmartContract: { is: "0x58538e6A46E07434d7E7375Bc268D3cb839C0133" } } } } } ) { Block { Time } Trade { Sell { Buyer } } Transaction { From Hash } } } } ``` ## Get Price Change 5min, 1h, 6h and 24h of a specific token Use below query to get price change 5min, 1h, 6h and 24h of a specific token. Change the `Currency{SmartContract}` and `Dex{SmartContract}` according to your needs. Test the query [here] (https://ide.bitquery.io/Price-change-5min-1hr-6hr-24h-precentage-of-a-specific-token). ```graphql query MyQuery { EVM(dataset: combined network:base) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0x1111111111166b7FE7bd91427724B487980aFc69"}}, Dex: {SmartContract: {is: "0xEdc625B74537eE3a10874f53D170E9c17A906B9c"}}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ){ Trade { Price_5min_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{minutes_ago:5}}}}) Price_1h_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{hours_ago:1}}}}) Price_6h_ago: PriceInUSD(minimum: Block_Number if:{Block:{Time:{since_relative:{hours_ago:6}}}}) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum( of: Trade_Side_AmountInUSD ) Price_Change_5min: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100") Price_Change_1h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100") Price_Change_6h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100") Price_Change_24h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100") } } } ``` ## Top 10 Base Tokens by Price Change in last 1h Use below query to get top 10 Base Tokens by Price Change in last 1h. Test the query [here] (https://ide.bitquery.io/Top-10-base-tokens-by-price-change-in-last-1-hr). ```graphql query MyQuery { EVM(dataset: combined network:base) { DEXTradeByTokens( limit:{count:10} orderBy:{descendingByField:"Price_Change_1h"} where: {TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Name Symbol SmartContract } Price_5min_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) Price_1h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) Price_6h_ago: PriceInUSD( minimum: Block_Number if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) Price_24h_ago: PriceInUSD(minimum: Block_Number) CurrentPrice: PriceInUSD(maximum: Block_Number) Side { Currency { Name Symbol SmartContract } } Dex{ SmartContract } } volume_5min: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} ) volume_1h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 1}}}} ) volume_6h: sum( of: Trade_Side_AmountInUSD if: {Block: {Time: {since_relative: {hours_ago: 6}}}} ) volume_24h: sum(of: Trade_Side_AmountInUSD) Price_Change_5min: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100" ) Price_Change_1h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100" ) Price_Change_6h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100" ) Price_Change_24h: calculate( expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100" ) } } } ``` ## Aggregated Token Data (Volume & Price, Last 24h) Get up to 100 tokens with aggregated USD volume and average price over the last 24 hours, plus volume and price for 1h, 4h, and 24h via conditional metrics (Trading API; includes Base and other chains). ▶️ [Aggregated Token Data](https://ide.bitquery.io/aggregated-data) ```graphql { Trading { Tokens( limit: { count: 100 } limitBy: { count: 1, by: Token_Id } where: { Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Token { Address Id IsNative Name Network Symbol TokenId } Volume { Usd H1VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }) H4VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }) H24VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 24 } } } }) } Price { Average { currentPrice: Mean(maximum: Block_Time) H1Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) H4Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 4 } } } } ) H24Ago: Mean( minimum: Block_Time if: { Block: { Time: { since_relative: { hours_ago: 24 } } } } ) } } } } } ``` --- ## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply) The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which. ### Get All DEX Trades on Base With Price, Market Cap, and Supply Stream **all Base DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Network: Base`** to capture every swap across all Base DEXs in a single subscription. You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-Base-with-Price-Marketcap-supply).
Click to expand GraphQL query ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Base" } } } }) { 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 } } } ```
### 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-base-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: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865" } } } } ) { 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" } }) } } } ```
--- ## Video Tutorial | How to get Base Decentralized Exchange Data with DEX Trades API --- ## Base Chain Token Transfers API URL: https://docs.bitquery.io/docs/blockchain/Base/base-transfers/ Base Chain Token Transfers API: monitor Base native and token transfers in real time with Bitquery GraphQL APIs. Run it in the IDE, then ship in your app. # Base Chain Token Transfers API In this section we'll have a look at some examples using the Base Transfers API. ## Subscribe to Recent Whale Transactions of a particular currency The subscription query below fetches the whale transactions on the Base network. We have used USDC address `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`. You can find the query [here](https://ide.bitquery.io/Whale-transfers-of-USDC-on-base#) ```graphql subscription { EVM(network: base) { Transfers( where: {Transfer: {Currency: {SmartContract: {is: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}, Amount: {ge: "10000"}}} ) { Transaction { From Hash } Transfer { Amount Sender Receiver Currency { SmartContract Symbol Name Fungible Native } Id } } } } ``` ## Sender is a particular address This websocket retrieves transfers where the sender is a particular address `0x3304E22DDaa22bCdC5fCa2269b418046aE7b566A`. For this subscription query we use `where` keyword and in that we specify `{Transfer: {Sender: {is: "0x3304E22DDaa22bCdC5fCa2269b418046aE7b566A"}}}` to get the desired data. You can find the query [here](https://ide.bitquery.io/Sender-is-a-particular-address_3#) ```graphql subscription { EVM(network: base) { Transfers( where: {Transfer: {Sender: {is: "0x3304E22DDaa22bCdC5fCa2269b418046aE7b566A"}}} ) { Transfer { Amount AmountInUSD Currency { Name SmartContract Native Symbol Fungible } Receiver Sender } Transaction { Hash } } } } ``` ## Subscribe to the latest NFT token transfers on Base Chain 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 Base network. You can run the query [here](https://ide.bitquery.io/NFT-Token-Transfers-API_4#) ```graphql subscription { EVM(network: base) { Transfers(where: {Transfer: {Currency: {Fungible: false}}}) { Transfer { Amount AmountInUSD Currency { Name SmartContract Symbol Fungible HasURI Decimals } URI Sender Receiver } Transaction { Hash } } } } ``` ## Get all transfers of a particular NFT This below query will give you all the transfers of a particular NFT `0xb68CA010776B4584cf49893E75b66583eb884948`. You can test out the query [here](https://ide.bitquery.io/get-all-transfers-of-a-specific-nft). ```graphql query MyQuery { EVM(network: base, dataset: realtime) { Transfers( where: {Transfer: {Currency: {Fungible: false, SmartContract: {is: "0xb68CA010776B4584cf49893E75b66583eb884948"}}}} ) { Transfer { Amount AmountInUSD Currency { Name Native SmartContract Symbol } Id Sender Receiver } Transaction { From Hash } } } } ``` ## Transactions From or To an address We use the `any` filter [ OR condition] to get transactions from or to a wallet. [Run Query](https://ide.bitquery.io/tx-from-to-base-address) ```graphql query MyQuery { EVM(dataset: archive, network: base) { Transfers( limit: {count: 100, offset: 0} where: { any: [ {Transaction: {From: {is: "0x0b2a7f1c6b7fae642a20434be47359e19bfadf4d"}, To: {is: "0x0b2a7f1c6b7fae642a20434be47359e19bfadf4d"}}} {Block: {Date: {after: "2025-08-01"}}} ] } ) { Block { Time Number Date } Transfer { Receiver Sender Currency { Decimals Name SmartContract Symbol ProtocolName } Amount AmountInUSD } Transaction { Hash From To } } } } ``` ## Video Tutorial | How to get Token Transfers data on Base in Realtime ## Deterministic Pagination for Backfilling Transfers When backfilling Base transfer data or building a historical index, use deterministic pagination to guarantee no records are missed or duplicated. **Try it live:** [Deterministic Transfer API](https://ide.bitquery.io/Reliable-transfer-api) ```graphql { EVM(dataset: combined, network: base) { Transfers( where: { Transfer: { Success: true } } orderBy: { ascending: [ Block_Number, Transaction_Index, Call_Index, Log_Index, Transfer_Index, Transfer_Type ] } limit: { count: 10, offset: 0 } ) { Block { Time Number } Transaction { Hash From Index } Transfer { Amount AmountInUSD Sender Receiver Index Currency { Symbol Name SmartContract Decimals Native } } Call { Index } Log { LogAfterCallIndex Index } Transfer { Type } } } } ``` The composite `orderBy` across `Block_Number`, `Transaction_Index`, `Call_Index`, `Log_Index`, `Transfer_Index`, and `Transfer_Type` uniquely positions every transfer, making offset-based pagination safe for backfilling. Increment `offset` by the `count` value on each request. You can pull up to **25,000 records in a single request** by setting `count: 25000`. --- ## Base Clanker API URL: https://docs.bitquery.io/docs/blockchain/Base/base-clanker-api/ Clanker tokens on Base: get the latest tokens created through Clanker, or the latest tokens launched by a specific user, with GraphQL query examples. # Base Clanker API This section provides you with a set of queries that provides an insight about the Clank fun. Clank.fun is a platform on the Base blockchain that allows users to launch and trade meme coins. Each coin is deployed as an ERC-20 token on Uniswap V3 with permanently locked single-sided liquidity of 1,000,000,000 coin. To launch a token, users must hold at least 1,000,000 $CLANKFUN tokens. Token creators earn 0.4% of the trading volume in liquidity provider (LP) fees, which can be claimed anytime on clanker.world. You can see [Uniswap guide](/docs/blockchain/Base/base-uniswap-api/) to get latest trades of these tokens, top traders, OHLCV, get token metadata, top bought tokens, top sold tokens, etc. For live DEX prices across Clanker-launched tokens, see [DEXrabbit's Clanker category](https://dexrabbit.bitquery.io/categories/clanker-ecosystem). ## Latest Tokens created using Clanker Below query will get you latest tokens created using Clank.fun. The query respose will contain `name`, `symbol`, `tokenAddress`, `deployer`, `supply`, `fid` and `positionId` of the created token. Try out the API in the Bitquery IDE playground [here](https://ide.bitquery.io/Latest-token-created-on-Clanker-on-Base). ```graphql { EVM(network: base) { Events( limit: { count: 10 } orderBy: [{ descending: Block_Time }, { descending: Transaction_Index }] where: { Log: { Signature: { Name: { is: "TokenCreated" } } } LogHeader: { Address: { is: "0x375C15db32D28cEcdcAB5C03Ab889bf15cbD2c5E" } } } ) { Block { Time } Transaction { From Hash } Arguments { Name Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Log { Signature { Name } } } } } ``` ## Latest Token created by specific user using Clanker Below query will get you latest tokens created by a particular address using Clank.fun. The query respose will contain `name`, `symbol`, `tokenAddress`, `deployer`, `supply`, `fid` and `positionId` of the created token. Try out the API in the Bitquery IDE playground [here](https://ide.bitquery.io/Latest-token-created-on-Clanker-on-Base-by-specific-user). ```graphql { EVM(network: base) { Events( limit: { count: 10 } orderBy: [{ descending: Block_Time }, { descending: Transaction_Index }] where: { Transaction: { From: { is: "0x002f07b0d63e8ac14f8ef6b73ccd8caf1fef074c" } } Log: { Signature: { Name: { is: "TokenCreated" } } } LogHeader: { Address: { is: "0x375C15db32D28cEcdcAB5C03Ab889bf15cbD2c5E" } } } ) { Block { Time } Transaction { From Hash } Arguments { Name Value { __typename ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Log { Signature { Name } } } } } ``` --- ## Base Gas Balance Tracker: Fees Paid by Senders and Collected by Vaults URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker/ Track gas on Base from balance changes with Bitquery GraphQL: the three fee vaults, the largest fee credits, what one address paid, and a live fee stream. # Base Gas Balance Tracker: Fees Paid by Senders and Collected by Vaults Base reports gas differently from Ethereum in the `TransactionBalances` cube. Ethereum splits a fee into a gas purchase, a refund and a tip, with reason codes 6, 7 and 5. Base emits two codes only: - **Code 0** for every ordinary balance change: the sender's ETH goes down by the value sent plus the gas paid, and the receiver's goes up by the value. - **Code 5** for the fee credited to the three OP Stack fee vaults: `0x4200000000000000000000000000000000000011` (SequencerFeeVault), `0x4200000000000000000000000000000000000019` (BaseFeeVault) and `0x420000000000000000000000000000000000001a` (L1FeeVault). So the gas a sender paid is read from its own code 0 row, and the fees the network collected are read from the vaults' code 5 rows. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the cube covers the recent realtime window only, so queries carry a time filter. ## Fee vault balances now `limitBy` on the address keeps the newest row per vault; `PostBalance` is the balance after the latest credit. Saved query [here](https://ide.bitquery.io/top-gas-fee-collectors-base). ```graphql { EVM(network: base) { TransactionBalances( limitBy: { by: TokenBalance_Address, count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Time: { since_relative: { minutes_ago: 5 } } } } ) { Block { Time } TokenBalance { Address PostBalance PostBalanceInUSD } } } } ``` ## Largest fee credits in the last ten minutes Each code 5 row is one transaction's contribution to one vault; `fee` is the balance after minus the balance before. Sort on it to find the transactions that paid most. ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 20 } orderBy: { descendingByField: "fee" } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Time: { since_relative: { minutes_ago: 10 } } } } ) { Block { Number Time } TokenBalance { Address PreBalance PostBalance } Transaction { Hash From To } fee: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` ## What one address paid in gas The sender's own code 0 row holds the balance before and after; subtracting the value sent leaves the gas. Filter on the address as both the balance owner and the transaction sender. If the address also received ETH inside the same transaction, for example from a swap, the result goes negative, so read it alongside `Transaction.Value`. Saved query [here](https://ide.bitquery.io/Latest-balance-and-gas-fee-paid-for-an-address-base_1). ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 10 } orderBy: { descending: Block_Time } where: { TokenBalance: { BalanceChangeReasonCode: { eq: 0 } Currency: { Native: true } Address: { is: "0x6c8ab6bd67d4df8d131e952edcb00b7e77183b60" } } Transaction: { From: { is: "0x6c8ab6bd67d4df8d131e952edcb00b7e77183b60" } } } ) { Block { Time } TokenBalance { PreBalance PostBalance PostBalanceInUSD } Transaction { Hash Value } gas: calculate( expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance - $Transaction_Value" ) } } } ``` ## Stream fee income live Every fee credit as it lands, with the sender that paid it. ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Number Time } TokenBalance { Address PreBalance PostBalance } Transaction { Hash From To } fee: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) } } } ``` To watch one wallet's spending instead, stream code 0 rows with `Currency: { Native: true }` and the wallet in both `TokenBalance.Address` and `Transaction.From`, the same filter as the query above. ## Related pages - [Base transaction balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) - [Base MEV balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-mev-balance-tracker) - [Ethereum gas balance tracker](/docs/blockchain/Ethereum/balances/transaction-balance-tracker/eth-gas-balance-tracker) - [Balance change reason codes](/docs/blockchain/Base/transaction-balance-tracker/#balance-change-reason-codes) --- ## Base Jump API: Trace a Launchpad Token on Base from Mint to First Trades URL: https://docs.bitquery.io/docs/blockchain/Base/base-jump-base-api/ Base Jump is no longer active on-chain. Its token is a worked example of tracing any Base launchpad with Bitquery GraphQL: the contract, launch trades, methods. # Base Jump API: Trace a Launchpad Token on Base from Mint to First Trades Base Jump was a token launchpad on Base. Its contract, `0x31C0282Fa6D0A82aD22ab63BbaCd87F62B2a9bfD`, receives no calls in the current realtime window, and the token the original guide used, SIBU at `0xEfC79f30b56f36bc49Bf47e8Dccf969fFF214EeD`, was minted, distributed and traded within a few minutes on 28 October 2024 and has not moved since. The launch still makes a clean worked example, because the steps are the same for any launchpad on Base: find the launchpad contract from the token's first transfers, pull the launch trades, and read the contract's methods while it is live. Every query 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. For launchpads active on Base today see the [Clanker](/docs/blockchain/Base/base-clanker-api), [Zora](/docs/blockchain/Base/base-zora-api), [Bankr](/docs/blockchain/Base/base-bankr-api) and [APE Store](/docs/blockchain/Base/apestore-base-api) pages. One coverage fact shapes the page. On Base the `Transfers` and `DEXTradeByTokens` cubes reach years back on the `combined` dataset, while `Calls` and `Events` cover the realtime window only. So the mint and the trades of a 2024 launch are still queryable, but method-level analysis of a contract only works while it is active. ## Step 1: find the launchpad contract from the token The first transfers of a token show where it was minted and who distributed it. The `Transaction.To` on those rows is the contract the deployer called. For SIBU the mint from the zero address went to the Base Jump contract, which then sent the supply on in the same transaction. Saved query [here](https://ide.bitquery.io/base-jump-token-event). ```graphql { EVM(network: base, dataset: combined) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0xEfC79f30b56f36bc49Bf47e8Dccf969fFF214EeD" } } } } limit: { count: 10 } orderBy: { ascending: Block_Time } ) { Block { Time } Transfer { Sender Receiver Amount Currency { Symbol Name } } Transaction { Hash From To } } } } ``` ## Step 2: pull the launch trades `DEXTradeByTokens` on the `combined` dataset returns every trade of the token with the venue and the other side. For SIBU that is a short burst of Uniswap v3 trades against WETH. Saved query [here](https://ide.bitquery.io/base-jump-buys). ```graphql { EVM(network: base, dataset: combined) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0xEfC79f30b56f36bc49Bf47e8Dccf969fFF214EeD" } } } } limit: { count: 50 } orderBy: { ascending: Block_Time } ) { Block { Time } Trade { Dex { ProtocolName } Amount Side { Amount Currency { Symbol } } } Transaction { Hash From } } } } ``` Replace the selection with `count`, `uniq(of: Transaction_From)` and `Block { first: Time(minimum: Block_Time) last: Time(maximum: Block_Time) }` to size a launch in one row: trades, distinct traders, first and last trade. ## Step 3: read a live contract's methods For a launchpad that is active, group the `Calls` into its contract by signature to see what it exposes and which methods carry the volume. The example is the Clanker contract that emits `TokenCreated` on Base; put the Base Jump contract in its place and the result is empty, which is how you confirm a launchpad has gone quiet. Saved query [here](https://ide.bitquery.io/methods-for-base-jump). ```graphql { EVM(network: base) { Calls( where: { Transaction: { To: { is: "0x375C15db32D28cEcdcAB5C03Ab889bf15cbD2c5E" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "count" } limit: { count: 20 } ) { Call { Signature { Name Signature } } count } } } ``` From there, filter `Calls` on one signature name and select `Arguments` to decode the parameters of each call; the [Clanker page](/docs/blockchain/Base/base-clanker-api) shows that shape for token creation events. ## Related pages - [Base API hub](/docs/blockchain/Base/) - [Base Clanker API](/docs/blockchain/Base/base-clanker-api) - [Base DEX trades API](/docs/blockchain/Base/base-dextrades) - [Base transfers API](/docs/blockchain/Base/base-transfers) --- ## Base Liquidity API: Uniswap and PancakeSwap Pool Reserves in Real Time URL: https://docs.bitquery.io/docs/blockchain/Base/base-liquidity-api/ Base pool reserves and spot prices with Bitquery GraphQL: one pool now or streamed, every Uniswap v4 pool by PoolId, pools holding cbBTC. Aerodrome excluded. # Base Liquidity API: Uniswap and PancakeSwap Pool Reserves in Real Time The `DEXPoolEvents` cube under `EVM(network: base)` emits one row every time a pool's reserves change, whether by a swap, a deposit or a withdrawal. Each row carries the reserves of both tokens after the change, in token units and in USD, the spot price in both directions, the pool and its protocol, and the transaction that moved it. On Base the rows come from Uniswap v2, v3 and v4 pools and from PancakeSwap v3 and Infinity pools. Aerodrome, the largest DEX on Base by volume, is not in this cube: its swaps are in the [Base DEX trades API](/docs/blockchain/Base/base-dextrades) and its pool balances in the [balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker). The cube holds the recent realtime window only and has no archive dataset: to keep a history, record the stream. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The worked pool is the Uniswap v3 WETH/USDC pool, `0xb4cb800910b228ed3d0834cf79d697127bbb00e5`. ## Current reserves of a pool The last ten changes to the pool, newest first. Each row is the state after that change: `AmountCurrencyA` and `AmountCurrencyB` are the reserves, `AmountCurrencyAInUSD` and `AmountCurrencyBInUSD` their dollar value, and `AtoBPrice` the spot rate of A in B. Saved query [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-a-Specific-Pool_4). ```graphql { EVM(network: base) { DEXPoolEvents( limit: { count: 10 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { SmartContract: { is: "0xb4cb800910b228ed3d0834cf79d697127bbb00e5" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Dex { ProtocolName } } Transaction { Hash } } } } ``` ## The same pool, live As a subscription the filter yields a row per reserve change, a few per minute on this pool. Saved stream [here](https://ide.bitquery.io/Realtime-Liquidity-Stream-of-a-Specific-Pool_3). ```graphql subscription { EVM(network: base) { DEXPoolEvents( where: { PoolEvent: { Pool: { SmartContract: { is: "0xb4cb800910b228ed3d0834cf79d697127bbb00e5" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { SmartContract CurrencyA { Symbol } CurrencyB { Symbol } } } Transaction { Hash } } } } ``` ## Every Uniswap v4 pool on Base Uniswap v4 is the busiest source of pool events on Base. All v4 pools live in the PoolManager, `0x498581ff718922c3f8e6a244956af099b2652b2b`, so `Pool.SmartContract` repeats on every row and `Pool.PoolId` is the field that tells pools apart; for v2 and v3 pools `PoolId` is empty. Saved stream [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-Pools-in-a-Specific-DEX-Protocol---Uniswap-V4_5). ```graphql subscription { EVM(network: base) { DEXPoolEvents( where: { PoolEvent: { Dex: { ProtocolName: { is: "uniswap_v4" } } } } ) { Block { Time } PoolEvent { Pool { PoolId SmartContract CurrencyA { Symbol SmartContract } CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } Transaction { Hash } } } } ``` Other protocol names that report on Base: `uniswap_v3`, `uniswap_v2`, `pancake_swap_v3` and `pancakeswap_infinity`. ## Every pool of a token Which pools hold cbBTC, `0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf`, and how much? Ask for pools with cbBTC as `CurrencyA` in the window and keep only the newest row of each with `limitBy` on the pool address; a second run with cbBTC as `CurrencyB` covers the pools that list it second. Because Aerodrome is outside this cube, the answer covers Uniswap and PancakeSwap pools only. Rank by the USD reserve in your code. Saved query [here](https://ide.bitquery.io/top-liquidity-pools-of-cbBTC). ```graphql { EVM(network: base) { DEXPoolEvents( limit: { count: 20 } limitBy: { by: PoolEvent_Pool_SmartContract, count: 1 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { CurrencyA: { SmartContract: { is: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Block { Time } PoolEvent { Dex { ProtocolName } Pool { SmartContract PoolId CurrencyB { Symbol SmartContract } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } } } } } ``` ## Row anatomy A row is one reserve change. `Liquidity` holds the two reserves after it, in token units and in USD; `AtoBPrice` and `BtoAPrice` hold the spot rate both ways; `Pool` names the contract, or for Uniswap v4 and PancakeSwap Infinity the manager plus a `PoolId`; `Dex.ProtocolName` is one of `uniswap_v4`, `uniswap_v3`, `uniswap_v2`, `pancake_swap_v3` and `pancakeswap_infinity`; and `Transaction.Hash` points at the swap, deposit or withdrawal behind it. ## Kafka and slippage The `base.dexpools.proto` topic streams these rows as protobuf with lower latency than WebSocket and needs its own credentials; start at the [Kafka streams hub](/docs/category/kafka-streams). The [Base slippage API](/docs/blockchain/Base/base-slippage-api) turns the same pool states into how much each pool can absorb at a given tolerance. ## Related pages - [Base slippage API](/docs/blockchain/Base/base-slippage-api) - [Base DEX trades API](/docs/blockchain/Base/base-dextrades) - [Uniswap v4 on Base](/docs/blockchain/Base/uniswap-v4-api) - [DEXPools cube](/docs/cubes/evm-dexpool/) - [Arbitrum liquidity API](/docs/blockchain/Arbitrum/arbitrum-liquidity-api) --- ## Base MEV Balance Tracker URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-mev-balance-tracker/ Base MEV Balance Tracker: stream Base balance changes with reason codes using Bitquery GraphQL subscriptions. Copy GraphQL snippets for production apps. # Base MEV Balance Tracker The Base MEV (Maximal Extractable Value) Balance Tracker API provides real-time balance updates related to MEV activities, including transaction fee rewards, block builder rewards, and other MEV-related balance changes. ## Track MEV-Related Balance Updates Monitor balance changes related to MEV activities, including transaction fee rewards and block builder rewards. Try the API [here](https://ide.bitquery.io/Track-MEV-Related-Balance-Updates-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` **Balance Change Reason Code for MEV:** - **Code 5**: `BalanceIncreaseRewardTransactionFee` - Transaction tip increasing block builder's balance (MEV-related) ## Track Block Builder Rewards Monitor transaction fee rewards received by block builders (MEV extractors): Try the API [here](https://ide.bitquery.io/Track-Block-Builder-Rewards-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } Block: { Number: { gt: "0" } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash GasPrice } } } } ``` ## Filter by MEV Bot or Builder Address Track balance changes for specific MEV bots or block builders: Try the API [here](https://ide.bitquery.io/Filter-by-MEV-Bot-or-Builder-Address-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { Address: { is: "0xMEVBotOrBuilderAddressHere" } BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash GasPrice } } } } ``` ## Track Large MEV Transactions Monitor large transaction fee rewards that may indicate significant MEV extraction: Try the API [here](https://ide.bitquery.io/Track-Large-MEV-Transactions-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } PostBalanceInUSD: { gt: "1000" } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash GasPrice } } } } ``` --- ## Base Miner Balance Tracker URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-miner-balance-tracker/ Base Miner Balance Tracker: stream Base balance changes with reason codes using Bitquery GraphQL subscriptions. Copy GraphQL snippets for production apps. # Base Miner Balance Tracker The Base Miner Balance Tracker API provides real-time balance updates for Base miners, tracking their mining rewards, uncle block rewards, and transaction fee rewards. ## Track Miner Balance Updates Monitor balance changes for Base miners, including block rewards, uncle block rewards, and transaction fee rewards. Try the API [here](https://ide.bitquery.io/Track-Miner-Balance-Updates-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [1, 2, 5] } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` **Balance Change Reason Codes for Miners:** - **Code 1**: `BalanceIncreaseRewardMineUncle` - Reward for mining an uncle block - **Code 2**: `BalanceIncreaseRewardMineBlock` - Reward for mining a block - **Code 5**: `BalanceIncreaseRewardTransactionFee` - Transaction tip increasing block builder's balance ## Track Block Mining Rewards Track rewards received by miners for successfully mining blocks: Try the API [here](https://ide.bitquery.io/Track-Block-Mining-Rewards-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 2 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` ## Track Uncle Block Rewards Monitor rewards for mining uncle blocks: Try the API [here](https://ide.bitquery.io/Track-Uncle-Block-Rewards-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 1 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` ## Track Transaction Fee Rewards Monitor transaction fee rewards received by miners: Try the API [here](https://ide.bitquery.io/Track-Transaction-Fee-Rewards-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { eq: 5 } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` ## Filter by Miner Address Track balance changes for a specific miner address: Try the API [here](https://ide.bitquery.io/Filter-by-Miner-Address-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { Address: { is: "0xMinerAddressHere" } BalanceChangeReasonCode: { in: [1, 2, 5] } } } ) { Block { Time Number } TokenBalance { Currency { Symbol } PreBalance PostBalance Address BalanceChangeReasonCode PostBalanceInUSD } Transaction { Hash } } } } ``` --- ## Base NFT Trades and Metadata API URL: https://docs.bitquery.io/docs/blockchain/Base/base-nft/ Base NFT API: track Base NFT trades, ownership, and metadata with Bitquery GraphQL and streams. Includes filters and field selection tips. # Base Chain NFT API In this section we'll have a look at some examples on how to get NFT information on Base using the NFT API. ## Track transfers of an NFT This query subscribes you to the real time transfers of a specific non-fungible token (NFT) on the Base network. You can find the query [here](https://ide.bitquery.io/Transfers-of-a-particular-NFT_1#) ```graphql subscription { EVM(network: base) { Transfers( where: { Transfer: { Currency: { Fungible: false SmartContract: { is: "0x1195Cf65f83B3A5768F3C496D3A05AD6412c64B7" } } } } ) { Block { Hash Number } Transfer { Amount Currency { Name Symbol Native } Sender Receiver } } } } ``` --- ## Base Network Coins API URL: https://docs.bitquery.io/docs/blockchain/Base/base-coins-api/ Base coins: latest coins created on Base, plus an AERO walkthrough covering DEX trades, top ten holders, AERO/USDC OHLC data and total supply. # Base Network Coins API In the recent times, base network has seen rise of many Memecoins and token based ecosystems. In this guide, we will see some queries that could provide beneficial information about these coins, for people to take informed investment decisions. ## Latest Coins Created on Base [This](https://ide.bitquery.io/Latest-Coin-on-Base-Coin_3) query returns the details of all the tokens and Memecoins created on the Base Network for a particular day. ```graphql query LatestCoins { EVM(network: base) { Calls( where: { Call: { Create: true } Arguments: { length: { ne: 0 } } Receipt: { ContractAddress: { not: "0x0000000000000000000000000000000000000000" } } } orderBy: { descending: Block_Time } ) { Arguments { Name 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_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } } } Transaction { Hash } Receipt { ContractAddress } Block { Time } } } } ``` The `Receipt{ ContractAddress }` field returns the contract address of the newly created token or Memecoin. ## Analysis of AERO Coin In this section, we have a list of queries that returns data that affects investment decisions. For this part, we have chosen AERO token as the token is currently trending and have high trade volume. ### Latest DEX Trades with AERO coin [This](https://ide.bitquery.io/Subscription-for-Latest-Trades-for-AERO_1) subscription returns the information on latest trades involving AERO coins like `timestamp`, `PriceInUSD`, `buyer`, `seller` and details about `side currency`, where `0x940181a94A35A4569E4529A3CDfB74e38FD98631` is the smart contract address of AERO Coin. ```graphql subscription { EVM(network: base) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } } AmountInUSD: { gt: "0" } Success: true } } ) { Block { Time } Trade { AmountInUSD Buyer Currency { Name Symbol SmartContract } PriceInUSD Seller Side { Currency { Name Symbol SmartContract } } Dex { ProtocolFamily ProtocolName } } Transaction { Hash } } } } ``` ### Top Ten Holders of AERO Coin Using the following query on the `Holders` cube we can get the top 10 holders of AERO, where `0x940181a94A35A4569E4529A3CDfB74e38FD98631` is the contract address of the AERO coin. `date` sets the snapshot day, and the `Balance.Amount` floor keeps the ranking fast. ```graphql query MyQuery { EVM(network: base) { Holders( date: "2026-09-30" where: { Currency: { SmartContract: { is: "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } } Balance: { Amount: { ge: "1000000" } } } orderBy: { descending: Balance_Amount } limit: { count: 10 } ) { Holder { Address } Balance { Amount } Currency { Name Symbol SmartContract } } } } ``` ### OHLC Data for AERO/USDC Pair [This](https://ide.bitquery.io/OHLC-of-AERO-Coin_1) query returns the OHLC parameters and `volume` for the AERO/USDC trade pair for a one hour window. ```graphql { EVM(network: base, dataset: combined) { DEXTradeByTokens( orderBy: { descendingByField: "Block_testfield" } where: { Trade: { Currency: { SmartContract: { is: "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } } Side: { Currency: { SmartContract: { is: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } } Type: { is: buy } } PriceAsymmetry: { lt: 0.1 } } } limit: { count: 10 } ) { Block { testfield: Time(interval: { in: hours, count: 1 }) } volume: sum(of: Trade_Amount) Trade { high: Price(maximum: Trade_Price) low: Price(minimum: Trade_Price) open: Price(minimum: Block_Number) close: Price(maximum: Block_Number) } count } } } ``` ### Total Supply of AERO Coin [This](https://ide.bitquery.io/Total-supply-of-a-AERO-on-Base) query returns the total supply of a token, which is an important parameter to consider from the investment perspective. Also, it is an important parameter for Market Cap calculation. ```graphql query MyQuery { EVM(network: base, dataset: combined) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } } Success: true } } ) { minted: sum( of: Transfer_Amount if: { Transfer: { Sender: { is: "0x0000000000000000000000000000000000000000" } } } ) burned: sum( of: Transfer_Amount if: { Transfer: { Receiver: { is: "0x0000000000000000000000000000000000000000" } } } ) } } } ``` You can checkout more queries related to tokens and token trades [here](/docs/blockchain/Ethereum/dextrades/token-trades-apis/#ohlc-in-usd-of-a-token). ## Video Tutorial to Get Latest Memecoins on Base --- ## Base PancakeSwap Infinity API URL: https://docs.bitquery.io/docs/blockchain/Base/pancakeswap-infinity-api/ PancakeSwap Infinity on Base: live trades, token price, top traders, OHLC in USD, buy and sell volume, top bought and sold tokens, and token metadata. # Base PancakeSwap Infinity API Bitquery provides PancakeSwap Infinity (Base) data through APIs, Streams and Data Dumps. The GraphQL APIs and streams below show the data Bitquery has for PancakeSwap Infinity on Base. ## Live PancakeSwap Infinity Trades on Base (Trading API, recommended) This subscription streams every PancakeSwap Infinity trade on Base in real time with **USD price and USD amounts on every row**, MEV-filtered. Run it [in the IDE](https://ide.bitquery.io/Trading-API-PancakeSwap-Infinity-Trades-Base). ```graphql subscription { Trading { Trades( where: {Pair: {Market: {Network: {is: "Base"}, Protocol: {is: "pancakeswap_infinity"}}}} ) { Block { Time } Price PriceInUsd AmountsInUsd { Base Quote } Trader { Address } Pair { Token { Symbol } QuoteToken { Symbol } Market { Protocol } } } } } ``` If you have any question on other data points reach out to [support](https://t.me/Bloxy_info) Need zero-latency Base data? [Read about our Kafka Streams and Contact us for a Trial](/docs/streams/kafka-streaming-concepts/). You may also be interested in: - [Clanker APIs ➤](/docs/blockchain/Base/base-clanker-api/) - [Base DEX Trade APIs ➤](/docs/blockchain/Base/base-dextrades/) :::note To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: ## Get Latest Trades on PancakeSwap Infinity Returns the [latest DEX trades on PancakeSwap Infinity](https://ide.bitquery.io/pancakeswap-infinity-trades). ```graphql query MyQuery { EVM(dataset: realtime, network: base) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Transaction { From To } Trade { Dex { ProtocolName SmartContract } Buy { Currency { Name } Price Amount } Sell { Amount Currency { Name } Price } } Block { Time } } } } ``` ## Get Latest Price of a token on PancakeSwap Infinity Returns the [latest price of cbBTC on PancakeSwap Infinity](https://ide.bitquery.io/Get-Latest-Price-of-a-token-on-PancakeSwap-Infinity) from its 10 most recent trades. ```graphql query MyQuery { EVM(dataset: realtime, network: base) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Transaction { From To } Block { Time } Trade { Price PriceInUSD Amount AmountInUSD Currency { Name Symbol SmartContract } Dex { ProtocolName SmartContract } Side { Amount AmountInUSD Currency { Name Symbol SmartContract } } } } } } ``` ## Get Top Traders of a token on PancakeSwap Infinity Returns the [top 100 traders of cbBTC on PancakeSwap Infinity](https://ide.bitquery.io/top-traders-of-a-token-on-pancakeswap) by USD volume. It ranks `Transaction.From`, the account that sent each swap, since on a sale `Trade.Buyer` is the pool or a router. `Side.Type` describes the counter-side of each trade, so `bought` sums the rows where `Side.Type` is `sell`. `PriceAsymmetry: {lt: 0.1}` leaves out trades whose two sides disagree on value ([PriceAsymmetry reference](/docs/graphql/metrics/priceAsymmetry/)). ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {ProtocolName: {is: "pancakeswap_infinity"}}, PriceAsymmetry: {lt: 0.1}}} ) { Transaction { From } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "base", "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } ``` ## OHLC in USD of a Token Returns [hourly open, high, low and close prices in USD](https://ide.bitquery.io/OHLC-on-BASE-pancakeswap-infinity) for cbBTC traded against ETH on PancakeSwap Infinity. ```graphql { EVM(network: base, dataset: realtime) { DEXTradeByTokens( orderBy: { descendingByField: "Block_testfield" } where: { Trade: { Currency: { SmartContract: { is: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } } Side: { Currency: { SmartContract: { is: "0x0000000000000000000000000000000000000000" } } Type: { is: buy } } PriceAsymmetry: { lt: 0.1 } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } limit: { count: 10 } ) { Block { testfield: Time(interval: { in: hours, count: 1 }) } volume: sum(of: Trade_Amount) Trade { high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) } count } } } ``` ## Get trading volume, buy volume, sell volume of a token Returns the [traded, buy and sell volume of cbBTC](https://ide.bitquery.io/trade_volume_base_pancakeswap_infinity) (`0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf`) on PancakeSwap Infinity over the last 24 hours. `PriceAsymmetry: { lt: 0.1 }` drops mispriced trades, which would otherwise skew the USD sums. ```graphql query MyQuery { EVM(network: base) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } PriceAsymmetry: { lt: 0.1 } } TransactionStatus: { Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract Decimals } } traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD) sell_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: buy } } } } ) buy_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: sell } } } } ) } } } ``` ## Get top bought tokens on PancakeSwap Infinity Returns the [top bought tokens on PancakeSwap Infinity](https://ide.bitquery.io/top-bought-tokens-on-pancakeswap_infinity). Buys are the rows where `Side.Type`, the counter-side, is `sell`, and the `PriceAsymmetry` filter keeps mispriced trades out of the totals. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "buy"} limit: {count: 100} where: {Trade: {Dex: {ProtocolName: {is: "pancakeswap_infinity"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "base" } ``` ## Get top sold tokens on PancakeSwap Infinity Returns the [top sold tokens on PancakeSwap Infinity](https://ide.bitquery.io/top-sold-tokens-on-pancake-infinty). Sales are the rows where `Side.Type` is `buy`. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "sell"} limit: {count: 100} where: {Trade: {Dex: {ProtocolName: {is: "pancakeswap_infinity"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "base" } ``` ## Get Metadata of a token Returns a [token's metadata](https://ide.bitquery.io/get-metadata-for-base-pancakeswap-infnity-token), here cbBTC's: `Name`, `Symbol`, `SmartContract` and `Decimals`. ```graphql query MyQuery { EVM(network: base, dataset: realtime) { DEXTradeByTokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Trade: { Currency: { SmartContract: { is: "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } ) { Trade { Currency { Name Symbol SmartContract ProtocolName HasURI Fungible Decimals } } } } } ``` --- ## Base Self-Destruct Balance Tracker: Why Base Shows None, and What to Watch URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-self-destruct-balance-api/ Self-destruct codes never fire on Base and live data shows no SELFDESTRUCT calls, because the opcode only deletes same-transaction contracts. Proof queries. # Base Self-Destruct Balance Tracker: Why Base Shows None, and What to Watch The balance schema has three reason codes for `selfdestruct`: 13 for the contract whose balance empties, 12 for the address that receives it, and 14 for value sent to an account already destroyed in the same transaction. On Base none of them fire. Since the Cancun rules reached the OP Stack, `SELFDESTRUCT` only deletes a contract created in the same transaction; in every other case it just moves the balance, and Base's balance cube reports every native movement as reason code 0 or, for fees, code 5. On top of that, live Base data shows no `SELFDESTRUCT` calls at all in the `Calls` cube over a day. This page gives you the two queries that prove it, so an empty result is a fact rather than a bug, and the queries that catch the patterns people are usually looking for. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. ## Confirm it: the codes are empty A count over the last day. Change the network to `bsc` and the same query returns a few hundred rows, which is the quickest way to see that the schema is shared and the behaviour is the chain's. Saved query [here](https://ide.bitquery.io/Aggregate-Self-Destruct-Statistics-base). ```graphql { EVM(network: base) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [12, 13, 14] } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { count } } } ``` ## Confirm it: no SELFDESTRUCT calls The `Calls` cube keeps the opcode of every internal call, so it would show a destruction even for a contract that held nothing. Saved query [here](https://ide.bitquery.io/Track-recent-ephemeral-contract-patterns-base). ```graphql { EVM(network: base) { Calls( where: { Call: { Opcode: { Name: { is: "SELFDESTRUCT" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Call { From To Value } Transaction { Hash From } } } } ``` Leave this one running as a subscription if you want to be told the moment a destruction does happen: drop `limit`, `orderBy` and the time filter and change `query` to `subscription`. ## What people are usually looking for on Base - **Short-lived helper contracts.** On BNB Chain and Ethereum, MEV bots destroy their helpers; on Base they simply leave them. Find them with the `Calls` cube: filter `Call.Opcode.Name` on `CREATE` or `CREATE2` and group by `Transaction.From` to see who deploys contracts in bulk, then query the [transaction balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) for the balances those contracts hold. - **A contract being emptied.** Filter `TransactionBalances` on the contract as `TokenBalance.Address` with `Currency: { Native: true }`; a code 0 row whose `PostBalance` is zero is the sweep. - **Fees and sequencer income.** Reason code 5 rows on the fee vaults, covered on the [Base gas balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker). ## The self-destruct queries, ready for other chains Both blocks below run unchanged on `bsc` and `eth`, where the codes do fire. Code 13 rows are the contracts that emptied, code 12 rows the recipients. Saved stream [here](https://ide.bitquery.io/All-Self-Destruct-Event-Balances-Stream-base). ```graphql subscription { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { BalanceChangeReasonCode: { in: [12, 13] } } } ) { Block { Time Number } TokenBalance { Address BalanceChangeReasonCode PreBalance PostBalance PostBalanceInUSD } Transaction { Hash From To } } } } ``` The [BSC self-destruct balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-self-destruct-balance-api) walks through the full set on a chain where the pattern is live. ## Related pages - [Base transaction balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) - [Base gas balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker) - [BSC self-destruct balance tracker](/docs/blockchain/BSC/transaction-balance-tracker/bsc-self-destruct-balance-api) - [Balance change reason codes](/docs/blockchain/Base/transaction-balance-tracker/#balance-change-reason-codes) --- ## Base Slippage API URL: https://docs.bitquery.io/docs/blockchain/Base/base-slippage-api/ Base Slippage API: measure Base DEX price impact and slippage with Bitquery GraphQL pool metrics. Scale further with Kafka or gRPC streams. # Base Slippage API In this section we will see how to get Base DEX pool slippage information using our API. The slippage API helps you understand price impact and liquidity depth for token swaps on Base DEX pools. ## Understanding Slippage and Price Impact Slippage refers to the difference between the expected price of a trade and the actual execution price. When swapping tokens in a DEX pool, larger trades can move the price due to limited liquidity, resulting in slippage. The DEXPoolSlippages API provides detailed information about: - Maximum input amounts that can be swapped at different slippage tolerances - Minimum output amounts guaranteed at each slippage level - Average execution prices for different trade sizes - Price impact calculations for both swap directions (A to B and B to A) For a comprehensive explanation of how DEX pools work, liquidity calculations, and price tables, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/). ## Realtime Slippage Monitoring This subscription query returns real-time slippage data for all DEX pools on Base. You can monitor price impact and liquidity depth as trades occur. You can find the query [here](https://ide.bitquery.io/realtime-slippage-on-base) ```graphql subscription { EVM(network: base) { DEXPoolSlippages { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` ## Latest Slippage for a Specific Pool This query retrieves the latest slippage data for a specific DEX pool on Base. Use this to check current liquidity depth and price impact for a particular token pair. You can find the query [here](https://ide.bitquery.io/Latest-slippage-of-a-pool-on-Uniswap-v3) ```graphql query { EVM(network: base) { DEXPoolSlippages( where: {Price: {Pool: {SmartContract: {is: "0x42161084d0672e1d3f26a9b53e653be2084ff19c"}}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` > **Note:** This query can be converted to a subscription to monitor in real-time. Simply replace `query` with `subscription` to receive live updates whenever the pool's liquidity changes. ## Realtime Slippage Data via Kafka Streams Slippage data can also be obtained via Kafka streams for lower latency and better reliability. The Kafka topic for Base DEX pools is: **`base.dexpools.proto`** Kafka streams provide the same slippage data as GraphQL subscriptions but with several advantages: - Lower latency due to shorter data pipeline - Better reliability with persistent connections - Ability to read from latest offset without gaps - Better scalability with multiple consumers For detailed information on how to connect to Kafka streams, subscribe to topics, and parse messages, refer to the [Kafka Streaming Concepts documentation](/docs/streams/kafka-streaming-concepts/). > **Note:** IDE credentials will not work with Kafka Streams. You need separate Kafka credentials. Please contact sales on our official telegram channel or fill out the [form on our website](https://bitquery.io/forms/api). ## Understanding the Response The `DEXPoolSlippages` API response contains the following information: - **`Price`**: Price information for swaps at a specific slippage tolerance - **`AtoB`**: Price data for swapping CurrencyA to CurrencyB - `Price`: Average execution price for swaps at this slippage level - `MinAmountOut`: Minimum output amount guaranteed at this slippage level - `MaxAmountIn`: Maximum input amount that can be swapped at this slippage level - **`BtoA`**: Price data for swapping CurrencyB to CurrencyA (same structure as AtoB) - **`SlippageBasisPoints`**: Slippage tolerance in basis points (100 = 1%) - **`Pool`**: Pool information including token pair details - **`Dex`**: DEX protocol information (Uniswap V2, V3, V4, etc.) - **`Block`**: Block information when the slippage data was recorded - `Time`: Timestamp of the block - `Number`: Block number For more details on how slippage is calculated and when new pool records are emitted, see the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#when-is-a-new-dexpool-record-emitted-in-the-apis--streams). ## Use Cases ### Liquidity Depth Analysis Use the slippage API to analyze which pools can handle large trades without significant price impact. By examining `MaxAmountIn` values at different slippage levels, you can: - Identify pools with sufficient liquidity for your trade size - Determine optimal slippage tolerance settings - Estimate price impact before executing trades ### Multi-Pool Price Comparison Compare execution prices across different pools and slippage scenarios to: - Find the best pool for your specific trade size - Understand price differences between DEX protocols - Optimize trade execution strategies ### Trading Applications #### Live Execution Testing Use the slippage API to test and validate trade execution strategies in real-time: - **Pre-trade validation**: Check if your intended trade size can be executed within acceptable slippage bounds before submitting - **Execution simulation**: Calculate expected price impact and minimum output amounts for different trade sizes - **Strategy backtesting**: Monitor historical slippage data to validate trading algorithms and optimize entry/exit points - **Risk assessment**: Evaluate maximum position sizes that can be entered without exceeding your slippage tolerance #### Detecting Liquidity Shocks and Toxic Order Flow The slippage API helps identify temporary price dislocations and liquidity shocks that can be exploited or avoided: - **Flow toxicity detection**: Monitor sudden changes in `MaxAmountIn` values to detect when pools experience large outflows or inflows - **Price impact analysis**: Track how `MinAmountOut` changes relative to `MaxAmountIn` to identify when pools become less liquid - **Mean reversion opportunities**: Identify pools where large swaps have created temporary price dislocations that may revert - **Toxic order flow avoidance**: Use slippage data to avoid entering positions when liquidity is thin or when large trades are likely to move price against you For a practical implementation example of using slippage data for automated trading strategies, including flow toxicity detection and mean-reversion trading, see the [AMM Flow Toxicity Alpha Engine](https://github.com/Divyn/amm-flow-toxicity-alpha-engine) repository. This system demonstrates how to: - Detect large swaps that move price significantly (50-500 basis points) - Verify isolation from trending markets - Execute fade trades against temporary price impacts - Manage positions with dynamic stop losses and take profits based on slippage data For more advanced use cases, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#advanced-use-cases-and-processing-patterns). --- ## Base Token Market Cap API: Market Cap, FDV and Supply for Tokens on Base URL: https://docs.bitquery.io/docs/blockchain/Base/base-token-marketcap-api/ Market cap, FDV, supply and price for Base tokens with Bitquery GraphQL: AERO or cbBTC now, a watchlist, hourly history, a live stream and a threshold alert. # Base Token Market Cap API: Market Cap, FDV and Supply for Tokens on Base Base tokens trade against ETH and USDC on Aerodrome, Uniswap and the launchpads, and the `Tokens` cube of the Trading API turns those trades into candles that carry price, USD volume, circulating and total supply, market cap and fully diluted valuation, refreshed every block. Address a token by id, `bid:base:` plus its lowercase contract, and the chain by `Token.Network: "Base"`. The cube keeps about a month of candles; the [Base transaction balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) gives total supply at any recent transaction if supply alone is enough. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; the worked tokens are AERO, `0x940181a94a35a4569e4529a3cdfb74e38fd98631`, and cbBTC, `0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf`. ## Market cap of one token now Exact id, one candle size, a short window, newest row first. The window matters: without it the query scans the whole cube and times out. Saved query [here](https://ide.bitquery.io/specific-base-token-latest-marketcap). ```graphql { Trading { Tokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Token: { Id: { is: "bid:base:0x940181a94a35a4569e4529a3cdfb74e38fd98631" } } Interval: { Time: { Duration: { eq: 60 } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } Token { Name Symbol Address Network } Price { Ohlc { Close } Average { Mean } } Supply { CirculatingSupply TotalSupply MarketCap FullyDilutedValuationUsd } Volume { Usd } } } } ``` For AERO the market cap and the FDV differ by about half, because only part of the supply is in circulation; for cbBTC they are equal, since every minted coin circulates. ## A watchlist in one query List the ids and keep the newest row per token with `limitBy`. The example is AERO, cbBTC and WETH on Base. ```graphql { Trading { Tokens( limitBy: { by: Token_Id, count: 1 } orderBy: { descending: Block_Time } where: { Token: { Id: { in: [ "bid:base:0x940181a94a35a4569e4529a3cdfb74e38fd98631" "bid:base:0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" "bid:base:0x4200000000000000000000000000000000000006" ] } } Interval: { Time: { Duration: { eq: 60 } } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } Token { Symbol Id } Price { Ohlc { Close } } Supply { MarketCap FullyDilutedValuationUsd CirculatingSupply TotalSupply } Volume { Usd } } } } ``` ## A day of hourly market cap One-hour candles hold the market cap at each close with the hour's open, close and USD volume; the difference between the first and last row is the 24-hour change. Saved query [here](https://ide.bitquery.io/top-base-tokens-by-Market-Cap-Change-1h). ```graphql { Trading { Tokens( limit: { count: 24 } orderBy: { descending: Block_Time } where: { Token: { Id: { is: "bid:base:0x940181a94a35a4569e4529a3cdfb74e38fd98631" } } Interval: { Time: { Duration: { eq: 3600 } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Interval { Time { Start } } Price { Ohlc { Open Close } } Supply { MarketCap } Volume { Usd } } } } ``` ## Stream every Base token's market cap Filter on the chain prefix in `Currency.Id` and subscribe; each message is a candle closing for some Base token. `Duration` above one second leaves out the tick-level candles. Saved stream [here](https://ide.bitquery.io/base-token-marketcap-stream). ```graphql subscription { Trading { Tokens( where: { Currency: { Id: { includes: "base" } } Interval: { Time: { Duration: { gt: 1 } } } } ) { Block { Time } Token { Symbol Id } Interval { Time { Duration } } Price { Ohlc { Close } } Supply { MarketCap FullyDilutedValuationUsd TotalSupply } Volume { Usd } } } } ``` ## Alert on tokens above a market cap A `Supply.MarketCap` bound on the stream turns it into a screener for launches that crossed a size. Saved stream [here](https://ide.bitquery.io/realtime-stream-base-tokens-with-marketcap-above-1-million). ```graphql subscription { Trading { Tokens( where: { Token: { Network: { is: "Base" } } Interval: { Time: { Duration: { gt: 1 } } } Supply: { MarketCap: { gt: 1000000 } } } ) { Block { Time } Token { Symbol Id } Supply { MarketCap TotalSupply } Price { Ohlc { Close } } } } } ``` ## Why rankings need bounds Market cap here is on-chain supply times an on-chain price, and Base has thousands of launchpad tokens with enormous supplies and a few dollars of trades in one thin pool. A raw "top tokens by market cap" over the cube is led by them. Rank inside a list you trust, as the watchlist query does, or bound the ranking with `Volume: { Usd: { gt: ... } }` and `Supply: { MarketCap: { lt: ... } }`; the saved [top tokens by market cap](https://ide.bitquery.io/Top-Tokens-by-Market-Cap-on-Base) query shows the bounded form. ## Related pages - [BSC token market cap API](/docs/blockchain/BSC/bsc-token-marketcap-api) - [Ethereum token market cap API](/docs/blockchain/Ethereum/token-supply/ethereum-token-marketcap-api) - [Tokens cube](/docs/trading/crypto-price-api/tokens) - [Supply fields](/docs/trading/crypto-price-api/supply-fields) - [Base transaction balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) --- ## Base Transaction Balance Tracker API URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/ Base Transaction Balance Tracker API: stream Base balance changes with reason codes using Bitquery GraphQL subscriptions. # Base Transaction Balance Tracker API - Complete Guide ## What is Transaction Balance Tracker? The **Base Transaction Balance Tracker API** provides real-time balance updates for all addresses involved in transactions on the Base blockchain. Unlike traditional balance APIs that only show current balances, our Transaction Balance Tracker captures every balance change with detailed information about the reason for each change, making it perfect for building comprehensive transaction monitoring, portfolio tracking, and blockchain analytics applications. Our Transaction Balance Tracker APIs track balance changes across different scenarios including regular transactions, miner rewards, MEV activities, and contract self-destruct events. Each balance change is enriched with reason codes, pre/post balances, USD values, and transaction context. ## Key Features - **Real-time Balance Updates**: Stream balance changes as they happen via GraphQL subscriptions - **Balance Change Reason Codes**: Understand why each balance changed (transfers, rewards, gas, self-destruct, etc.) - **Comprehensive Coverage**: Track native ETH, ERC-20 tokens, ERC-721, and ERC-1155 NFTs - **Historical Data**: Access complete historical balance change data since Base genesis - **USD Values**: Get balance values in USD for portfolio tracking and analytics - **Multiple Use Cases**: Monitor miners, MEV bots, self-destruct events, and more ## Getting Started New to Transaction Balance Tracker? Here's how to get started: 1. **[Create a free account](https://ide.bitquery.io/)** - Get instant access to our GraphQL IDE 2. **[Generate your API key](/docs/authorization/how-to-generate/)** - Required for API access 3. **[Run your first query](/docs/start/first-query/)** - Learn the basics in 5 minutes 4. **[Explore examples](#base-transaction-balance-tracker-apis)** - Copy-paste ready queries below Need help crafting a query or subscription? Message us on [support](https://t.me/Bloxy_info). ## How is it different from regular Balance APIs? - Real-time streaming of all balance changes - Pre/post balance values for every change - Balance change reason codes explain why balance changed - Track all addresses in transactions automatically - Historical data with complete change history - Support for native currency, tokens, and NFTs ## Real-time Data & Streaming Get live Base balance updates through our streaming solutions: - **GraphQL Subscriptions**: Convert any query to a live stream by changing `query` to `subscription` - **Kafka Streaming**: High-throughput streaming for enterprise applications See examples and code snippets [here](/docs/subscriptions/websockets/) for GraphQL subscription implementation, and learn about [Kafka streaming](/docs/streams/kafka-streaming-concepts/) for high-volume use cases. ## Base Transaction Balance Tracker APIs ### [Base Transaction Balance Tracker](/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker) The core Transaction Balance Tracker API provides real-time balance updates for all addresses involved in transactions on the Base network, including detailed information about the reason for each balance change. Track native ETH, ERC-20 tokens, and NFTs with pre/post balances, USD values, and balance change reason codes. **Key Features:** - Subscribe to all transaction balances in real-time - Filter by specific addresses or tokens - Get balance change reason codes for native currency - Track ERC-20, ERC-721, and ERC-1155 tokens - Access pre and post balance values ### [Base Miner Balance Tracker](/docs/blockchain/Base/transaction-balance-tracker/base-miner-balance-tracker) Monitor Base miner balances, mining rewards, uncle block rewards, and transaction fee rewards. Track historical and real-time mining activity across the Base network. **Key Features:** - Track block mining rewards (Code 2) - Monitor uncle block rewards (Code 1) - Track transaction fee rewards (Code 5) - Filter by specific miner addresses - Historical mining reward data ### [Base MEV Balance Tracker](/docs/blockchain/Base/transaction-balance-tracker/base-mev-balance-tracker) Track MEV (Maximal Extractable Value) related balance changes including transaction fee rewards, block builder rewards, and other MEV extraction activities. Monitor MEV bots and block builders in real-time. **Key Features:** - Track transaction fee rewards (Code 5) - Monitor block builder rewards - Filter by MEV bot or builder addresses - Track large MEV transactions - Aggregate MEV reward statistics ### [Base Self-Destruct Balance Tracker](/docs/blockchain/Base/transaction-balance-tracker/base-self-destruct-balance-api) Monitor contract self-destruct events, ephemeral contracts (like MEV bots), and security incidents. Track contracts that self-destruct and addresses that receive funds from self-destructed contracts. **Key Features:** - Track contract self-destruct events (Codes 12, 13, 14) - Monitor ephemeral MEV contracts - Track MEV builder payments - Security incident monitoring - Aggregate self-destruct statistics ## Balance Change Reason Codes The Transaction Balance Tracker API uses numeric codes to indicate why a balance changed. These codes are only available for native currency (ETH) transactions, not for fungible tokens or NFTs. | **Code** | **Reason** | **Description** | | -------- | ----------------------------------- | ------------------------------------------------------------------------------- | | 0 | BalanceChangeUnspecified | Unspecified balance change reason | | 1 | BalanceIncreaseRewardMineUncle | Reward for mining an uncle block | | 2 | BalanceIncreaseRewardMineBlock | Reward for mining a block | | 3 | BalanceIncreaseWithdrawal | ETH withdrawn from the beacon chain | | 4 | BalanceIncreaseGenesisBalance | ETH allocated at the genesis block | | 5 | BalanceIncreaseRewardTransactionFee | Transaction tip increasing block builder's balance | | 6 | BalanceDecreaseGasBuy | ETH spent to purchase gas for transaction execution | | 7 | BalanceIncreaseGasReturn | ETH returned for unused gas at the end of execution | | 8 | BalanceIncreaseDaoContract | ETH sent to the DAO refund contract | | 9 | BalanceDecreaseDaoAccount | ETH taken from a DAO account to be moved to the refund contract | | 10 | BalanceChangeTransfer | ETH transferred via a call | | 11 | BalanceChangeTouchAccount | Transfer of zero value to touch-create an account | | 12 | BalanceIncreaseSelfdestruct | Balance added to the recipient as indicated by a self-destructing account | | 13 | BalanceDecreaseSelfdestruct | Balance deducted from a contract due to self-destruct | | 14 | BalanceDecreaseSelfdestructBurn | ETH sent to an already self-destructed account within the same transaction | | 15 | BalanceChangeRevert | Balance reverted back to a previous value due to call failure | ## Field Availability by Currency Type The availability of fields in the `TokenBalance` object depends on the type of currency being tracked: ### Native Currency (ETH) - **Available**: `BalanceChangeReasonCode`, `PreBalance`, `PostBalance`, `PostBalanceInUSD` - **Not Provided**: `TotalSupply`, `TokenOwnership` ### Fungible Tokens (ERC-20) - **Available**: `PostBalance`, `PostBalanceInUSD`, `TotalSupply`, `TotalSupplyInUSD` - **Not Provided**: `PreBalance`, `BalanceChangeReasonCode`, `TokenOwnership` ### NFTs (ERC-721 / ERC-1155) - **Available**: `PostBalance`, `TokenOwnership` - **Not Provided**: `PreBalance`, `BalanceChangeReasonCode`, `TotalSupply`, `TotalSupplyInUSD`, `PostBalanceInUSD` --- ## Base Transaction Balance Tracker: Balances Before and After a Transaction URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-transaction-balance-tracker/ Stream and query Base balance changes with Bitquery GraphQL: every address a transaction touched, one wallet's ETH and USDC, pool reserves and token supply. # Base Transaction Balance Tracker: Balances Before and After a Transaction The `TransactionBalances` cube records, for each transaction on Base, every address whose balance changed and the balance before and after, in ETH, ERC-20 tokens and NFTs. A wallet tracker, a fee monitor and a pool reserve feed all come from the same rows. Native rows carry a reason code; on Base that is 0 for ordinary changes and 5 for fee credits to the fee vaults, and no other code appears. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The cube covers the recent realtime window only, so queries carry a `limit` and, for wide filters, a time window. ## Stream one address Base produces too many balance rows for an unfiltered stream to be practical, so subscribe with a filter: an address, as here, or a reason code, as on the [gas balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker). The example is the Uniswap v4 PoolManager, whose token balances change on every swap, so rows arrive within seconds; a wallet streams only when it transacts. Saved stream [here](https://ide.bitquery.io/Subscribe-to-Transaction-Balances-for-a-Specific-Address-base). ```graphql subscription { EVM(network: base) { TransactionBalances( where: { TokenBalance: { Address: { is: "0x498581ff718922c3f8e6a244956af099b2652b2b" } } } ) { Block { Number Time } TokenBalance { BalanceChangeReasonCode PreBalance PostBalance PostBalanceInUSD Currency { Symbol SmartContract Native } } Transaction { Hash From To } } } } ``` ## Latest ETH balance of an address The newest native row for the address; `PostBalance` is the balance after that transaction. Saved query [here](https://ide.bitquery.io/latest-native-balance-of-an-address-base). ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } Currency: { Native: true } } } ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD BalanceChangeReasonCode } Transaction { Hash } } } } ``` ## Latest balance of an address in one token The same query with the token contract in place of the native flag. The example is USDC on Base, `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`. Saved query [here](https://ide.bitquery.io/latest-balance-of-an-address-for-a-specific-token-base). ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0x238a358808379702088667322f80ac48bad5e6c4" } Currency: { SmartContract: { is: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } } } } ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD Currency { Symbol Name } } Transaction { Hash } } } } ``` An address that has not moved the token inside the realtime window has no row here; use the [Balances cube](/docs/cubes/balances-cube) for a balance that does not depend on recent activity. ## Latest reserves of a pool A pool is an address like any other, so its token balances are its reserves. `limitBy` on the token contract keeps the newest row per token. The example is the Uniswap v3 WETH/USDC 0.05% pool. Saved query [here](https://ide.bitquery.io/latest-liquidity-of-a-base-pool). ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 2 } limitBy: { by: TokenBalance_Currency_SmartContract, count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Address: { is: "0xd0b53D9277642d899DF5C87A3966A349A798F224" } } Block: { Time: { since_relative: { hours_ago: 1 } } } } ) { Block { Time } TokenBalance { Currency { Symbol SmartContract } PostBalance PostBalanceInUSD } } } } ``` ## Latest supply and market cap of a token Token rows carry `TotalSupply` and `TotalSupplyInUSD` as of that transaction, so the newest row for a token gives its supply and on-chain market cap. The example is AERO. Saved query [here](https://ide.bitquery.io/Total-Supply-and-onchain-Marketcap-of-a-specific-token-base). ```graphql { EVM(network: base) { TransactionBalances( limit: { count: 1 } orderBy: { descending: Block_Time } where: { TokenBalance: { Currency: { SmartContract: { is: "0x940181a94A35A4569E4529A3CDfB74e38FD98631" } } } } ) { Block { Time } TokenBalance { Currency { Symbol Name } TotalSupply TotalSupplyInUSD } } } } ``` ## Which fields each currency type carries - **ETH:** `BalanceChangeReasonCode`, `PreBalance`, `PostBalance`, `PostBalanceInUSD`. - **ERC-20:** `PostBalance`, `PostBalanceInUSD`, `TotalSupply`, `TotalSupplyInUSD`; no pre-balance or reason code. - **NFTs:** `PostBalance` and `TokenOwnership`; no USD values. ## Related pages - [Base transaction balance tracker overview](/docs/blockchain/Base/transaction-balance-tracker/) - [Base gas balance tracker](/docs/blockchain/Base/transaction-balance-tracker/base-gas-balance-tracker) - [Base transfers API](/docs/blockchain/Base/base-transfers) - [Balances and Holders cubes](/docs/cubes/balances-cube) --- ## Base Transfer Balance Tracker URL: https://docs.bitquery.io/docs/blockchain/Base/transaction-balance-tracker/base-transfer-balance-tracker/ Base Transfer Balance Tracker: monitor Base native and token transfers in real time with Bitquery GraphQL APIs. Copy GraphQL snippets for production apps. # Base Transfer Balance Tracker The Base Transfer Balance Tracker API provides real-time balance updates for all addresses involved in Transfers on the Base blockchain, and provides option to filter out based on the direction of transfer you want to target. The Base Transfer Balance is tracked by marking the the `BalanceUpdateReason` equals `10`. :::note The queries covered this section are only valid for the Native Currency Transfer. ::: ## Get Balance Info for an Address after Transfer [This](https://ide.bitquery.io/balance-update-from-transfer-for-an-address-base) query returns the Balance Info such as PreBalance, PostBalance, Balances in USD and transfer amount for a particular address after a transfer, irrespective of the direction of transfer.
Click here to expand ```graphql query MyQuery { EVM(network: base) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {is: "0xYourAddressInput"}}} orderBy: {descending: Block_Time} limit: {count: 1} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
## Stream Balance Info for Transfer in Real Time [This](https://ide.bitquery.io/balance-update-from-transfer-for-an-address--stream-base) subscription allows us to stream Balance Updates for an address due to transfer in Real Time.
Click here to expand ```graphql subscription { EVM(network: base) { TransactionBalances( where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}, Address: {is: "0xYourAddressInput"}}} ) { Block { Time } TokenBalance { PostBalance PostBalanceInUSD PreBalance PreBalanceInUSD } amt: calculate( expression: "$TokenBalance_PostBalance - $TokenBalance_PreBalance" ) amt_usd: calculate( expression: "$TokenBalance_PostBalanceInUSD - $TokenBalance_PreBalanceInUSD" ) Transaction { From To } } } } ```
--- ## Base Uniswap API URL: https://docs.bitquery.io/docs/blockchain/Base/base-uniswap-api/ Base Uniswap API: a v2, v3 and v4 trade stream plus GraphQL examples for v3 trades, top traders, hourly OHLC, 24-hour volume and top tokens, each filtered to Uniswap's own contracts on Base. # Base Uniswap API :::tip Need real-time Base Uniswap 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 Base Uniswap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use the `EVM` queries on this page for raw per-swap detail or call and event context. An `EVM` query without a `dataset` argument runs on the realtime dataset, which holds only the last few days; add `dataset: combined` or `dataset: archive` for **historical Base Uniswap data**. ::: Bitquery provides Uniswap data through APIs, Streams and Data Dumps. ## Filter by factory to exclude forks `Trade.Dex.ProtocolName` records which code a pool runs. Forks of v2 and v3 run the same code, so their trades carry the same `uniswap_v2` and `uniswap_v3` labels. In Bitquery's trade data for Base on 18 September 2026, pools from more than 100 other factories carried the `uniswap_v2` label and more than 30 carried `uniswap_v3`. They made up about one in five transactions under the first label and one in seven under the second. To keep only Uniswap's own pools, filter on the contract that owns them, as every example on this page now does. | Version | Filter field | Address on Base | | --- | --- | --- | | v2 | `Trade.Dex.OwnerAddress` | `0x8909dc15e40173ff4699343b6eb8132c65e18ec6` | | v3 | `Trade.Dex.OwnerAddress` | `0x33128a8fc17869897dce68ed026d694621f6fdfd` | | v4 | `Trade.Dex.SmartContract` | `0x498581ff718922c3f8e6a244956af099b2652b2b` | `OwnerAddress` is the factory that deployed the pool. A v4 pool has no factory: its `OwnerAddress` is the zero address, and the PoolManager is its `SmartContract`. In the Trading cube, filter `Pair.Market.Address` to the v2 or v3 factory, or `Pair.Market.Program` to the v4 PoolManager. Addresses are from the official [deployments list](https://developers.uniswap.org/deployments). The link in each example's description opens an earlier copy saved in the Bitquery IDE, which may still filter by `ProtocolName` or use older conditions and time windows. Use the code on this page when you need Uniswap's own pools only. ## Stream Base Uniswap trades Every query on this page also works as a subscription: change `query` to `subscription` and drop the `orderBy`, since a stream already arrives in block order. ```graphql subscription BaseUniswapTrades { EVM(network: base) { DEXTrades( where: { any: [ { Trade: { Dex: { OwnerAddress: { in: ["0x8909dc15e40173ff4699343b6eb8132c65e18ec6", "0x33128a8fc17869897dce68ed026d694621f6fdfd"] } } } } { Trade: { Dex: { SmartContract: { is: "0x498581ff718922c3f8e6a244956af099b2652b2b" } } } } ] } ) { Block { Time } Transaction { Hash } Trade { Dex { ProtocolName SmartContract } Buy { Amount Buyer Currency { Symbol SmartContract } } Sell { Amount Seller Currency { Symbol SmartContract } } } } } } ``` The two conditions cover the v2, v3 and v4 pools listed above. To narrow to one version, keep only that version's address. For a single pool, use `Trade: { Dex: { SmartContract: { is: "" } } }` on v2 and v3, or `Trade: { PoolId: { is: "" } }` on v4. If you have any question on other data points reach out to [support](https://t.me/Bloxy_info) Need zero-latency Base data? [Read about our Kafka Streams and Contact us for a Trial](/docs/streams/kafka-streaming-concepts/). You may also be interested in: - [Clanker APIs ➤](/docs/blockchain/Base/base-clanker-api/) - [Base DEX Trade APIs ➤](/docs/blockchain/Base/base-dextrades/) :::note To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: ## Get Latest Trades on Uniswap v3 The query below returns the [latest DEX trades on Uniswap v3](https://ide.bitquery.io/uniswap-v3-trades_2). ```graphql query MyQuery { EVM(dataset: realtime, network: base) { DEXTrades( where: { Trade: { Dex: { OwnerAddress: { is: "0x33128a8fc17869897dce68ed026d694621f6fdfd" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Transaction { From To } Trade { Dex { ProtocolName SmartContract } Buy { Currency { Name } Price Amount } Sell { Amount Currency { Name } Price } } Block { Time } } } } ``` ## Get Top Traders of a token on uniswap v3 This query returns the [top traders of a token](https://ide.bitquery.io/top-traders-of-a-token-on-uniswapv3_4) on the selected network. It ranks `Transaction.From`, the account that sent each swap, since on a sale `Trade.Buyer` is the pool or a router. `Side.Type` describes the counter-side of each trade, so `bought` sums the rows where `Side.Type` is `sell`. `PriceAsymmetry: {lt: 0.1}` drops trades whose two sides disagree badly on value ([PriceAsymmetry reference](/docs/graphql/metrics/priceAsymmetry/)), which would otherwise inflate the USD totals. ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {OwnerAddress: {is: "0x33128a8fc17869897dce68ed026d694621f6fdfd"}}, PriceAsymmetry: {lt: 0.1}}} ) { Transaction { From } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "base", "token": "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b" } ``` ## OHLC in USD of a Token This query retrieves [hourly open, high, low and close prices in USD](https://ide.bitquery.io/OHLC-on-BASE-Uniswap-v3) for one token traded on Uniswap v3. ```graphql { EVM(network: base, dataset: realtime) { DEXTradeByTokens( orderBy: { descendingByField: "Block_testfield" } where: { Trade: { Currency: { SmartContract: { is: "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b" } } Side: { Currency: { SmartContract: { is: "0x4200000000000000000000000000000000000006" } } Type: { is: buy } } PriceAsymmetry: { lt: 0.1 } Dex: { OwnerAddress: { is: "0x33128a8fc17869897dce68ed026d694621f6fdfd" } } } } limit: { count: 10 } ) { Block { testfield: Time(interval: { in: hours, count: 1 }) } volume: sum(of: Trade_Amount) Trade { high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) } count } } } ``` ## Get trading volume, buy volume, sell volume of a token This query returns the [traded, buy and sell volume](https://ide.bitquery.io/trade_volume_base_uniswapv3) of token `0x22af33fe49fd1fa80c7149773dde5890d3c76f3b` on Uniswap v3 over the last 24 hours. `PriceAsymmetry: {lt: 0.1}` drops mispriced trades, which would otherwise skew the USD sums. ```graphql query MyQuery { EVM(network: base) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b" } } Dex: { OwnerAddress: { is: "0x33128a8fc17869897dce68ed026d694621f6fdfd" } } PriceAsymmetry: { lt: 0.1 } } TransactionStatus: { Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract Decimals } } traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD) sell_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: buy } } } } ) buy_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: { Trade: { Side: { Type: { is: sell } } } } ) } } } ``` ## Get top bought tokens on uniswap v3 This query returns the [top bought tokens on Uniswap v3](https://ide.bitquery.io/top-bought-tokens-on-uniswap-v3). Buys are the rows where `Side.Type`, the counter-side, is `sell`. The `PriceAsymmetry` filter keeps mispriced trades out of the totals. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "buy"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0x33128a8fc17869897dce68ed026d694621f6fdfd"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "base" } ``` ## Get top sold tokens on uniswap v3 This query returns the [top sold tokens on Uniswap v3](https://ide.bitquery.io/top-sold-tokens-on-uniswap-v3). Sales are the rows where `Side.Type`, the counter-side, is `buy`. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "sell"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0x33128a8fc17869897dce68ed026d694621f6fdfd"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "base" } ``` ## Get Metadata of a token The query below returns a [token's metadata](https://ide.bitquery.io/get-metadata-for-base-uniswap-token): `Name`, `symbol`, `SmartContract Address` and `Decimals`. ```graphql query MyQuery { EVM(network: base, dataset: realtime) { DEXTradeByTokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Trade: { Currency: { SmartContract: { is: "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b" } } Dex: { OwnerAddress: { is: "0x33128a8fc17869897dce68ed026d694621f6fdfd" } } } } ) { Trade { Currency { Name Symbol SmartContract ProtocolName HasURI Fungible Decimals } } } } } ``` ## Building with Bitquery and Uniswap API Start with the [Base Sniper Bot guide](/docs/usecases/base-sniper-bot/) to build a working project on these APIs. --- ## Base Uniswap V4 API URL: https://docs.bitquery.io/docs/blockchain/Base/uniswap-v4-api/ Base Uniswap V4 API: query Base Uniswap trades, pools, and prices with Bitquery GraphQL DEX APIs. Scale further with Kafka or gRPC streams. # Uniswap V4 API - Track Trader Activities, Token Trades and Market Behavior Uniswap v4 introduces a major shift in protocol architecture. Instead of deploying a separate smart contract for each liquidity pool, Uniswap v4 uses a singleton PoolManager contract that manages all pools internally as structured state. Each pool in Uniswap v4 is uniquely identified by a `PoolId`, which is derived from the pool configuration (token pair, fee, tick spacing, and optional hooks), rather than a dedicated contract address. Using Bitquery's Uniswap v4 APIs, you can track: - DEX trades across all v4 pools - Trades by specific traders - Token-level trade activity - Real-time trade metrics The Uniswap v4 PoolManager contract emits all pool-related events, including pool initialization, swaps, and liquidity modifications, and serves as the single on-chain source of truth for Uniswap v4 activity on Base. ## Real time Trades on Uniswap V4 [This](https://ide.bitquery.io/Real-time-trades-on-uniswap-v4-base) subscription allows user to stream trades on Uniswap V4 in real time on Base. ```graphql subscription { EVM(network: base) { DEXTrades(where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}}}) { Block{ Time } Trade { PoolId Buy { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD Seller } } Transaction { From To Hash } } } } ``` ## Get All Pool Ids for a Currency Using [this](https://ide.bitquery.io/virtual-pool-addresses-for-a-token-on-uniswap-v4-base) API we can get all the virtual pool addresses (`PoolId`) for a currency on Base. For this example we are getting virtual Pool IDs for WETH(`0x4200000000000000000000000000000000000006`). ```graphql query MyQuery { EVM(network: base) { DEXTradeByTokens( where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}, Currency: {SmartContract: {is: "0x4200000000000000000000000000000000000006"}}}} ) { Trade { PoolId } count } } } ``` ## Latest Trades for a Specific Currencies Pair [This](https://ide.bitquery.io/Latest-trades-for-a-token-pair-on-uniswap-v4-base) API endpoint allows us to filter out the latest trades for a specific pair on Base, using `PoolId` as a filter option. ```graphql { EVM(network: base) { DEXTrades( orderBy: {descending: Block_Time} limit: {count: 100} where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}, PoolId: {is: "0x7c76fa7f6d64061837c3e03002f6362daa51ff9cc3c0ebbed69f140ca3844f30"}}} ) { Block { Time } Trade { PoolId Buy { Currency { Name Symbol SmartContract Decimals } Amount AmountInUSD Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD } } Transaction { From To Hash } } } } ``` ## Uniswap V4 Pair Trade Stats Using [this](https://ide.bitquery.io/trade-stats-for-a-currency-pair-on-uniswap-v4-base) query get pool stats (volume, bought, sold) for a specific Uniswap V4 pool on Base. ```graphql query pairTopTraders { EVM(network: base, dataset: realtime) { DEXTradeByTokens( orderBy: { descendingByField: "volumeUsd" } where: { Block:{ Time: {since_relative: {days_ago: 1}} } Trade: { Dex: { ProtocolName: {is: "uniswap_v4"} } PoolId: {is: "0x7c76fa7f6d64061837c3e03002f6362daa51ff9cc3c0ebbed69f140ca3844f30"} } } ) { Trade { Currency{ Name Symbol SmartContract } } 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) } } } ``` ## Top Buyers of a Token on Uniswap V4 [This](https://ide.bitquery.io/top-buyers-of-a-currency-on-uniswap-v4-pool-base) API returns the top buyers of a token on Uniswap V4 virtual pool on Base, along with the amount bought in token denominations and USD. ```graphql { EVM(network: base) { DEXTrades( orderBy: {descendingByField: "bought_in_usd"} limit: {count: 100} where: { Trade: { Dex: {ProtocolName: {is: "uniswap_v4"}}, Buy: {Currency: {SmartContract: {is: "0x4200000000000000000000000000000000000006"}}} PoolId: {is: "0x7c76fa7f6d64061837c3e03002f6362daa51ff9cc3c0ebbed69f140ca3844f30"} } } ) { Trade { Sell { Currency { Name Symbol SmartContract Decimals } Buyer } } bought:sum(of: Trade_Buy_Amount) bought_in_usd:sum(of: Trade_Buy_AmountInUSD) } } } ``` ## Top Sellers of a Token on Uniswap V4 [This](https://ide.bitquery.io/top-sellers-of-a-currency-on-uniswap-v4-pool-base) API returns the top sellers of a token on Uniswap V4 virtual pool on Base, along with the amount sold in token denominations and USD. ```graphql { EVM(network: base) { DEXTrades( orderBy: {descendingByField: "sold_in_usd"} limit: {count: 10} where: { Trade: { Dex: {ProtocolName: {is: "uniswap_v4"}}, Sell: {Currency: {SmartContract: {is: "0x4200000000000000000000000000000000000006"}}} PoolId: {is: "0x7c76fa7f6d64061837c3e03002f6362daa51ff9cc3c0ebbed69f140ca3844f30"} } } ) { Trade { Buy { Currency { Name Symbol SmartContract Decimals } Seller } } sold:sum(of: Trade_Buy_Amount) sold_in_usd:sum(of: Trade_Buy_AmountInUSD) } } } ``` ## Get Uniswap V4 Pool Liquidity Liquidity for v4 pools is reconstructed by stepping through each price range where liquidity is concentrated , so `AmountCurrencyA` / `AmountCurrencyB` reflect the actual PoolManager balances for that `PoolId`. See the [Base Liquidity API](/docs/blockchain/Base/base-liquidity-api) for the full `DEXPoolEvents` schema. Stream live liquidity for all Uniswap v4 pools on Base. [Run in the Bitquery IDE](https://ide.bitquery.io/uniswap-v4-pool-liquidity-base). ```graphql subscription MyQuery { EVM(network: base) { DEXPoolEvents( where: {PoolEvent: {Dex: {ProtocolName: {is: "uniswap_v4"}}}} ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { PoolId SmartContract CurrencyA { Name Symbol SmartContract } CurrencyB { Name Symbol SmartContract } } } Transaction { Hash } } } } ``` Filter to a specific pool by `PoolId`. [Run in the Bitquery IDE](https://ide.bitquery.io/uniswap-v4-pool-liquidity-by-poolid-base). ```graphql subscription MyQuery { EVM(network: base) { DEXPoolEvents( where: { PoolEvent: { Dex: { ProtocolName: { is: "uniswap_v4" } } Pool: { PoolId: { is: "0x7c76fa7f6d64061837c3e03002f6362daa51ff9cc3c0ebbed69f140ca3844f30" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } Pool { PoolId SmartContract CurrencyA { Name Symbol SmartContract } CurrencyB { Name Symbol SmartContract } } } Transaction { Hash } } } } ``` > In Uniswap v4 all pools live in the singleton PoolManager, so `Pool.SmartContract` is the same across pools — use `Pool.PoolId` to identify each pool. --- ## Base Zora API URL: https://docs.bitquery.io/docs/blockchain/Base/base-zora-api/ Zora on Base: track newly created Zora tokens, latest Zora trades, trades of a specific token, and a wallet's Zora trades up to a block height. # Base Zora API Bitquery provides comprehensive Zora data through APIs, Streams and Data Dumps. This section provides you with a set of GraphQL APIs and streams that offer insights into the Zora protocol on Base blockchain. The below GraphQL APIs and Streams are examples of data points you can get with Bitquery for Zora on Base. If you have any questions on other data points, reach out to [support](https://t.me/Bloxy_info). Need zero-latency Base data? [Read about our Kafka Streams and Contact us for a Trial](/docs/streams/kafka-streaming-concepts/). You may also be interested in: - [Base DEX Trade APIs ➤](/docs/blockchain/Base/base-dextrades/) - [Base Uniswap APIs ➤](/docs/blockchain/Base/base-uniswap-api/) :::note To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: ## Get Newly Created Zora Tokens This query retrieves the list of newly created tokens on Zora Launchpad by monitoring transfers where new tokens are minted (sender is the zero address) with a specific amount. Try out the API [here](https://ide.bitquery.io/Newly-created-zora-tokens#) in the Bitquery IDE. ```graphql { EVM(network: base) { Transfers( orderBy: { descending: Block_Time } limit: { count: 10 } where: { Call: { Create: true } Transfer: { Sender: { is: "0x0000000000000000000000000000000000000000" } Amount: { eq: "1000000000" } } Transaction: { To: { is: "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" } } } ) { Transfer { Sender Receiver Amount AmountInUSD Currency { Name Symbol SmartContract Decimals } } Transaction { From To Hash } Block { Time } } } } ``` You can also stream the latest tokens created in real-time using [this subscription](https://ide.bitquery.io/Newly-created-zora-tokens-stream). ## Latest Trades on Zora This query fetches the latest DEX trades on the Zora protocol (`zora_v4`) on Base blockchain. Try out the API [here](https://ide.bitquery.io/Latest-Zora-Trades-on-Base) in the Bitquery IDE. ```graphql { EVM(dataset: realtime, network: base) { DEXTrades( limit: { count: 20 } orderBy: { descending: Block_Time } where: { Trade: { Dex: { ProtocolName: { is: "zora_v4" } } } } ) { Block { Time Number } Fee { Burnt BurntInUSD EffectiveGasPrice EffectiveGasPriceInUSD GasRefund MinerReward MinerRewardInUSD PriorityFeePerGas PriorityFeePerGasInUSD Savings SavingsInUSD SenderFee SenderFeeInUSD } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Gas Cost CostInUSD GasFeeCap GasFeeCapInUSD GasPrice GasPriceInUSD GasTipCap GasTipCapInUSD Index Nonce Protected Time Type Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` ## All Zora trades for a wallet up to a block height Return **`zora_v4`** trades on Base where the wallet is **Buyer** or **Seller** on the trade, with **`Block.Number` ≤** your chosen ceiling. Uses **`dataset: combined`** for history plus **`limit: 1000`** and **`orderBy: { ascending: Block_Time }`** for chronological pages. The saved IDE query also matches transactions with **`Transaction.From`** equal to `0x152a04d9fde2396c01c05f065a00bd5f6edf5c88d` in the same `any` group—adjust or remove that branch if you only need wallet-based matches. [Run in Bitquery IDE](https://ide.bitquery.io/all-zora-trades-for-a-specific-wallet-up-till-a-block-height) ```graphql query ($address: String) { EVM(dataset: combined, network: base) { DEXTrades( limit: { count: 1000 } orderBy: { ascending: Block_Time } where: { Block: { Number: { le: "36453721" } }, any: [ { Trade: { Buy: { Buyer: { is: $address } } } }, { Trade: { Buy: { Seller: { is: $address } } } }, { Transaction: { From: { is: "0x152a04d9fde2396c01c05f065a00bd5f6edf5c88d" } } } ], Trade: { Dex: { ProtocolName: { is: "zora_v4" } } } } ) { Block { Time Number } Fee { Burnt BurntInUSD EffectiveGasPrice EffectiveGasPriceInUSD GasRefund MinerReward MinerRewardInUSD PriorityFeePerGas PriorityFeePerGasInUSD Savings SavingsInUSD SenderFee SenderFeeInUSD } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Gas Cost CostInUSD GasFeeCap GasFeeCapInUSD GasPrice GasPriceInUSD GasTipCap GasTipCapInUSD Index Nonce Protected Time Type Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` **Variables:** ```json { "address": "0xa9ce7310c6d68b0e08df6de6fc79fc572f882bb1" } ``` ## Latest Trades of a Token on Zora [Run Query](https://ide.bitquery.io/Latest-Trades-of-a-Token-on-Zora-Base) ```graphql { EVM(dataset: realtime, network: base) { DEXTrades( limit: {count: 20} orderBy: {descending: Block_Time} where: {Trade: {Dex: {ProtocolName: {is: "zora_v4"}}, Buy: {Currency: {SmartContract: {is: "0x1111111111166b7fe7bd91427724b487980afc69"}}}}} ) { Block { Time Number } Fee { Burnt BurntInUSD EffectiveGasPrice EffectiveGasPriceInUSD GasRefund MinerReward MinerRewardInUSD PriorityFeePerGas PriorityFeePerGasInUSD Savings SavingsInUSD SenderFee SenderFeeInUSD } Receipt { ContractAddress Status } TransactionStatus { Success } Log { Signature { Name } SmartContract } Call { From InternalCalls Signature { Name Signature } To Value } Transaction { Gas Cost CostInUSD GasFeeCap GasFeeCapInUSD GasPrice GasPriceInUSD GasTipCap GasTipCapInUSD Index Nonce Protected Time Type Value ValueInUSD Hash From To } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` --- ## Binance Meme Rush API URL: https://docs.bitquery.io/docs/blockchain/BSC/binance-memerush-api/ Binance Meme Rush tokens on BNB Chain: track migrations to PancakeSwap, bonding curve progress, token creations, trades, top traders and market cap. # Binance Meme Rush API Binance has launched Meme Rush, a new discovery feature inside the Binance Wallet that gives users early access to trending meme-coins from external launch platforms. Through a partnership with Four.Meme on the BNB Smart Chain, users can create and launch their own meme coins directly via Binance Wallet. Tokens launched in this way typically have contract addresses that start with `0x4444…`. Get ultra low latency Binance Meme Rush memecoin data on BNB Chain: live trades, bonding curve progress, newly created tokens, prices, OHLC, liquidity, migrations, top traders and more. The below GraphQL APIs and Streams are examples of data points you can get with Bitquery. If you have questions on other data points, reach out to [support](https://t.me/Bloxy_info). Need zero-latency BSC data via Kafka? Read about our [Kafka Streams](/docs/streams/kafka-streaming-concepts/) and contact us for a trial. You may also be interested in: - [Crypto Price API ➤](/docs/trading/crypto-price-api/) - [BSC Pancake Swap APIs ➤](/docs/blockchain/BSC/pancake-swap-api/) - [BSC DEX Trades ➤](/docs/blockchain/BSC/bsc-dextrades/) - [PumpFun API ➤](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) ::::note To query or stream data via GraphQL outside the Bitquery IDE, you need to generate an API access token. Follow the steps here to create one: /docs/authorization/how-to-generate/ :::: --- ### Table of Contents ### 1. Token Lifecycle, Migrations & Bonding Curve - [Track All Binance Meme Rush Tokens That Have Migrated to Pancakeswap ➤](#track-all-binance-meme-rush-tokens-that-have-migrated-to-pancakeswap) - [Check if a Binance Meme Rush token has migrated or not ➤](#check-if-a-binance-meme-rush-token-has-migrated-or-not) - [Bonding Curve Progress API for Binance Meme Rush token ➤](#bonding-curve-progress-api-for-binance-meme-rush-token) - [Get Binance Meme Rush Tokens which are above 95% Bonding Curve Progress ➤](#get-binance-meme-rush-tokens-which-are-above-95-bonding-curve-progress) - [Get Binance Meme Rush token creations on Four Meme ➤](#get-binance-meme-rush-token-creations-on-four-meme) - [Get Meme Rush Tokens created by a specific Dev ➤](#get-meme-rush-tokens-created-by-a-specific-dev) - [Get Dev Address of a Meme Rush token ➤](#get-dev-address-of-a-meme-rush-token) ### 2. Trading & Market Data - [Subscribe the Latest Trades of Meme Rush tokens on Four Meme ➤](#subscribe-the-latest-trades-of-meme-rush-tokens-on-four-meme) - [Get Latest Buys and Sells for a Meme Rush Token ➤](#get-latest-buys-and-sells-for-a-meme-rush-token) - [Get Trade Metrics of a Meme Rush Token ➤](#get-trade-metrics-of-a-meme-rush-token) - [Get latest price of a Meme Rush token ➤](#get-latest-price-of-a-meme-rush-token) - [Get ATH price of a Meme Rush Token ➤](#get-ath-price-of-a-meme-rush-token) - [Get Price Change Percentage for a Meme Rush Token ➤](#get-price-change-percentage-for-a-meme-rush-token) - [Get OHLCV data of a Meme Rush Token ➤](#get-ohlcv-data-of-a-meme-rush-token) - [Get Trade Volume and Number of Trades for a Meme Rush Token ➤](#get-trade-volume-and-number-of-trades-for-a-meme-rush-token) ### 3. Trader Insights & Analytics - [Monitor Meme Rush trades of traders on Four.Meme ➤](#monitor-meme-rush-trades-of-traders-on-fourmeme) - [Track Meme Rush Tokens in 14k to 18k Marketcap ➤](#track-meme-rush-tokens-in-14k-to-18k-marketcap) - [Top Buyers for a Meme Rush Token on Four Meme ➤](#top-buyers-for-a-meme-rush-token-on-four-meme) - [Top Traders of a Meme Rush token ➤](#top-traders-of-a-meme-rush-token) ### 4. Market Cap, Liquidity & Metadata - [Get Realtime Market Cap and Price of a Meme Rush Token ➤](#get-realtime-market-cap-and-price-of-a-meme-rush-token) - [Metadata for a Newly Created Meme Rush Token ➤](#metadata-for-a-newly-created-meme-rush-token) - [Get liquidity of a Meme Rush token ➤](#get-liquidity-of-a-meme-rush-token) ### 5. Getting Started - [Bitquery DEX Data Access Options ➤](#bitquery-dex-data-access-options) - [Getting Started with Bitquery ➤](#getting-started-with-bitquery) ## Bitquery DEX Data Access Options - **GraphQL APIs**: Query historical and real-time EVM data with flexible filtering and aggregation - **Real-time Streams**: Subscribe to live EVM blockchain events via WebSocket subscriptions - **Cloud Solutions**: Access EVM data through AWS, GCP, and Snowflake integrations - **Kafka Streams**: High-throughput data streaming for enterprise applications ## Getting Started with Bitquery: - [Learning Track](/docs/start/learning-path/): Learning track to get started with Bitquery GraphQL APIs and streams. - [BSC DEX Trades](/docs/blockchain/BSC/bsc-dextrades/): Real time DEX Trading data via examples. - [BSC Uniswap APIs](/docs/blockchain/BSC/bsc-uniswap-api/): Uniswap Trades on BSC network with the help of examples. - [BSC Pancake Swap APIs](/docs/blockchain/BSC/pancake-swap-api/): Pancake swap Trades on BSC network with the help of examples. - [Trade APIs](/docs/trading/crypto-price-api/examples/): Multi-chain Trade API Examples. ## Track All Binance Meme Rush Tokens That Have Migrated to Pancakeswap This query tracks Binance Meme Rush token migrations to Pancakeswap in realtime by monitoring transactions sent to the Four Meme factory address (`0x5c952063c7fc8610ffdb798152d69f0b9550762b`) and filtering for `PairCreated` and `PoolCreated` events. These events are emitted when a meme rush token graduates from Four Meme and migrates to Pancakeswap. Test it [here](https://ide.bitquery.io/binance-meme-rush-migration-to-pancakeswap).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { Events( where: { Log: { Signature: { Name: { in: ["PairCreated", "PoolCreated"] } } } Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Arguments: { includes: { Value: { Address: { startsWith: "0x4444" } } } } } ) { Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } } } Transaction { Hash } } } } ```
## Check if a Binance Meme Rush token has migrated or not Below query will only show response if a the mentioned meme rush tokens have migrated to Pancakeswap. Note: Please use a `Block{Date}` filter to minimize the data processing and hence the query processing time and get fast responses. Try the query [here](https://ide.bitquery.io/if-meme-rush-token-migrated-from-four-meme-or-not#).
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { DEXTradeByTokens( where: {Block: {Date: {since: "2025-10-10"}}, Trade: {Dex: {OwnerAddress: {in: ["0xca143ce32fe78f1f7019d7d551a6402fc5350c73"]}}, Currency: {SmartContract: {in: ["0x4444ab6a517216ee356dc899b6f28a62249446b5", "0x44443eed3477fe8de8696e0b6021ff72cc6624ef"]}}}} ) { count Trade { Currency { SmartContract } } } } } ```
## Bonding Curve Progress API for Binance Meme Rush token Below query will give you amount of `left tokens` put it in the below given simplied formulae and you will get Bonding Curve progress for the meme rush token. ### Bonding Curve Progress Formula - **Formula**: BondingCurveProgress = 100 - ((leftTokens \* 100) / initialRealTokenReserves) Where: - leftTokens = realTokenReserves - reservedTokens - initialRealTokenReserves = totalSupply - reservedTokens - **Definitions**: - `initialRealTokenReserves` = `totalSupply` - `reservedTokens` - `totalSupply`: 1,000,000,000 (Binance Meme Rush Token) - `reservedTokens`: 200,000,000 - Therefore, `initialRealTokenReserves`: 800,000,000 - `leftTokens` = `realTokenReserves` - `reservedTokens` - `realTokenReserves`: Token balance at the market address. :::note **Simplified Formula**: BondingCurveProgress = 100 - (((balance - 200000000) \* 100) / 800000000) :::
Click to expand GraphQL query ```graphql query MyQuery($token: String) { EVM(dataset: combined, network: bsc) { Balances( where: {Balance: {Address: {is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b"}}, Currency: {SmartContract: {is: $token}}} ) { Currency { Name } Balance { Address balance: Amount } Bonding_Curve_Progress_precentage: calculate( expression: "100 - ((($Balance_balance - 200000000) * 100) / 800000000)" ) } } } ````
Click to expand Query Varibles (Paste this in variables section on IDE) ```json { "token": "0x444478624cb7c53abe549d6449e024f4d8b51bec" } ````
## Get Binance Meme Rush Tokens which are above 95% Bonding Curve Progress Using the above Bonding Curve formula, we can calculate the token balances for the Four Meme Proxy contract (0x5c952063c7fc8610FFDB798152D69F0B9550762b) corresponding to approximately 95% to 100% progress along the bonding curve, that comes out to be `200,000,000` to `240,000,000`. The Binance Meme Rush tokens in the response are arranged in the ascending order of Bonding Curve Percentage, i.e., 95% to 100%.
Click to expand GraphQL query ```graphql query MyQuery { EVM(dataset: combined, network: bsc) { Balances( limit: { count: 10 } where: { Balance: { Address: { is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b" } } Currency: { SmartContract: { startsWith: "0x4444" } } } orderBy: { descending: Balance_Amount } ) { Currency { SmartContract Name } Balance { Address balance: Amount(selectWhere: { ge: "200000000", le: "240000000" }) } Bonding_Curve_Progress_precentage: calculate( expression: "100 - ((($Balance_balance - 200000000) * 100) / 800000000)" ) } } } ```
## Get Binance Meme Rush token creations on Four Meme [Run Query](https://ide.bitquery.io/track-Binance-Meme-Rush-token-creations-on-Four-meme-token) Binance Meme Rush is a new feature launched by Binance Wallet in collaboration with Four.Meme, aimed at enabling users to access meme tokens early in their initial stages, before they are listed on decentralized exchang This query retrieves newly created Binance Meme Rush tokens on Four Meme by listening to the `TokenCreate` event and specifically filtering for event transactions which includes address value in arguments `0x4444`. The response provides: **Token Information:** - **creator**: Wallet address of the token creator - **token**: Contract address of the newly created token - **name**: Token name - **symbol**: Token symbol/ticker - **totalSupply**: Total supply (always 1 billion tokens) **Launch Details:** - **requestId**: Unique identifier for the token creation - **launchTime**: Unix timestamp of when the token launched - **launchFee**: Fee paid
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { Events( where: { Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "TokenCreate" } } } Arguments: { includes: { Value: { Address: { startsWith: "0x4444" } } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Log { Signature { Name Signature } } Arguments { Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... 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 } } Name Type } Transaction { Hash To From } } } } ```
## Get Meme Rush Tokens created by a specific Dev This API fetches Binance Meme Rush tokens created by a specific dev on BSC by tracking token minting transfers signed by a particular dev. `Dev Address` here in example is `0xF4f3eb591c47d14614D3A54aCBA28019e2041066`. Use a date filter based on your needs — shorter time ranges mean faster execution and reduced query time. [Run Query](https://ide.bitquery.io/meme-rush-tokens-created-by-specific-dev)
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { Transfers( where: { Block: { Date: { since: "2025-08-01" } } Transfer: { Sender: { is: "0x0000000000000000000000000000000000000000" } Currency: { SmartContract: { startsWith: "0x4444" } } } Transaction: { From: { in: ["0xF4f3eb591c47d14614D3A54aCBA28019e2041066"] } } } ) { Transaction { From To } Transfer { Sender Receiver Amount Currency { Name Symbol SmartContract } } } } } ```
## Get Dev Address of a Meme Rush token Fetches the developer address that created a specific Meme Rush token on BSC by tracing the minting transfer (from the zero address) of that token’s smart contract. Use a date filter based on your needs — shorter time ranges make the query execute faster and return results more efficiently. Token Address in this example is `0x44442f6b816d4308859470573cb32652c8eee0bb`. [Run Query](https://ide.bitquery.io/check-who-created-this-meme-rush-token)
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { Transfers( where: { Block: { Date: { since: "2025-08-01" } } Transfer: { Currency: { SmartContract: { is: "0x44442f6b816d4308859470573cb32652c8eee0bb" } } Sender: { is: "0x0000000000000000000000000000000000000000" } } } ) { Transaction { From To } Transfer { Sender Receiver Amount Currency { Name Symbol SmartContract } } } } } ```
## Subscribe the Latest Trades of Meme Rush tokens on Four Meme Using subscriptions you can subscribe to the latest trades of Meme Rush tokens on Four Meme as shown in this [example](https://ide.bitquery.io/Latest-trades-of-meme-rush-tokens-on-fourmeme). The subscription returns latest trade info such as buyers and sellers, buy and sell currency details and amount of currency.
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } any: [ { Trade: { Buy: { Currency: { SmartContract: { startsWith: "0x4444" } } } } } { Trade: { Sell: { Currency: { SmartContract: { startsWith: "0x4444" } } } } } ] } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ```
## Get Latest Buys and Sells for a Meme Rush Token [This](https://ide.bitquery.io/Latest-buys-and-sells-for-a-meme-rush-coin-on-four-meme-dex) query retrieves the most recent token buy and sell trades of a specific Meme Rush token on Four Meme Exchange.
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc, dataset: combined) { buys: DEXTrades( where: { Trade: { Buy: { Currency: { SmartContract: { is: $currency } } } Success: true Dex: { ProtocolName: { is: "fourmeme_v1" } } } } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Amount Buyer Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract } } } } sells: DEXTrades( where: { Trade: { Sell: { Currency: { SmartContract: { is: $currency } } } Success: true Dex: { ProtocolName: { is: "fourmeme_v1" } } } } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Currency { Name Symbol SmartContract } } Sell { Amount Buyer Price PriceInUSD Seller } } } } } ``` ```json { "currency": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
You can also check if the token is listed on other DEX using this [example](/docs/blockchain/BSC/bsc-dextrades/#get-all-dexs-where-a-specific-token-is-listed). ## Get Trade Metrics of a Meme Rush Token Use the below query to get trade metrics like volume and trades for a token in different time frames, such as `24 hours`, `1 hour` and `5 minutes`. Test it [here](https://ide.bitquery.io/volume-and-trades-for-a-meme-rush-token-in-different-time-frames).
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } }, Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract } } volume_24hr: sum(of: Trade_Side_AmountInUSD) volume_1hr: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) volume_5min: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } } ) trades_24hr: count trades_1hr: count( if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) trades_5min: count( if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } } ) } } } ``` ```json { "currency": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Get latest price of a Meme Rush token We launched the [Price Index](/docs/trading/crypto-price-api/) in August 2025, allowing you to track price of any token trading onchain. Here's an example of [tracking Meme Rush token prices](https://ide.bitquery.io/latest-meme-rush-token-price-on-four-meme-dex#).
Click to expand GraphQL query ```graphql { Trading { Pairs( where: {Price: {IsQuotedInUsd: false}, Market: {Network: {is: "Binance Smart Chain"}, Program: {is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b"}}, Token: {Address: {is: "0x44442202ff27ee2297c128d0c1ae43a0fbb35701"}}, Interval: {Time: {Duration: {eq: 60}}}} limit: {count: 1} orderBy: {descending: Block_Time} ) { Market { Address Network Program Protocol ProtocolFamily } Price { Average { ExponentialMoving Mean SimpleMoving WeightedSimpleMoving } Ohlc { Close High Low Open } } Token { Address Name Symbol } QuoteToken { Address Name Symbol } Volume { Base Usd } } } } ```
## Get ATH price of a Meme Rush Token Fetches the All-Time High (ATH) price of a specific Meme Rush token on BSC, using the `DEXTradeByTokens` dataset to calculate the 98th percentile of trade prices (approximate ATH). Use a date filter suited to your needs — a shorter duration will make the query run faster and return results more efficiently. Try the API [here](https://ide.bitquery.io/meme-rush-token-ATH-price).
Click to expand GraphQL query ```graphql query tradingView( $network: evm_network $dataset: dataset_arg_enum $token: String ) { EVM(network: $network, dataset: $dataset) { DEXTradeByTokens( limit: { count: 1 } where: { Block: { Date: { since: "2025-10-10" } } TransactionStatus: { Success: true } Trade: { Side: { Currency: { SmartContract: { is: "0x" } } } Currency: { SmartContract: { is: $token } } Success: true } } ) { max: quantile(of: Trade_PriceInUSD, level: 0.98) Block { Time } } } } ``` ```json { "network": "bsc", "token": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701", "dataset": "combined", "local": "EVM", "interval": 60 } ```
## Get Price Change Percentage for a Meme Rush Token Use the below query to get the price change in percentage for various time fields including `24 hours`, `1 hour` and `5 minutes`. Try it [here](https://ide.bitquery.io/Percentage-price-change-for-a-meme-rush-token).
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } }, Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract } price_24hr: PriceInUSD(minimum: Block_Time) price_1hr: PriceInUSD( if: { Block: { Time: { is_relative: { hours_ago: 1 } } } } ) price_5min: PriceInUSD( if: { Block: { Time: { is_relative: { minutes_ago: 1 } } } } ) current: PriceInUSD } change_24hr: calculate( expression: "( $Trade_current - $Trade_price_24hr ) / $Trade_price_24hr * 100" ) change_1hr: calculate( expression: "( $Trade_current - $Trade_price_1hr ) / $Trade_price_1hr * 100" ) change_5min: calculate( expression: "( $Trade_current - $Trade_price_5min ) / $Trade_price_5min * 100" ) } } } ``` ```json { "currency": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Get OHLCV data of a Meme Rush Token Use the below query to get meme rush token OHLCV data. Test it [here](https://ide.bitquery.io/OHLC-for-a-meme-rush-token).
Click to expand GraphQL query ```graphql query tradingView($network: evm_network, $token: String) { EVM(network: $network, dataset: combined) { DEXTradeByTokens( limit: { count: 10 } orderBy: { descendingByField: "Block_Time" } where: { Trade: { Currency: { SmartContract: { is: $token } } PriceAsymmetry: { lt: 0.1 } Dex: { ProtocolName: { is: "fourmeme_v1" } } } } ) { 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) } volumeUSD: sum(of: Trade_Side_AmountInUSD, selectWhere: { gt: "0" }) } } } ``` ```json { "network": "bsc", "token": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Monitor Meme Rush trades of traders on Four.Meme You can use our streams to monitor real time trades of a trader on Four Meme, for example run [this stream](https://ide.bitquery.io/monitor-meme-rush-token-trades-of-a-trader-on-four-meme_1).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } }, Success: true } Transaction: { From: { is: "0x7db00d1f5b8855d40827f34bb17f95d31990306e" } } any: [ { Trade: { Buy: { Currency: { SmartContract: { startsWith: "0x4444" } } } } } { Trade: { Sell: { Currency: { SmartContract: { startsWith: "0x4444" } } } } } ] } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ```
You can also get the trade activities of a user on Pancake Swap using our [Pancake Swap](/docs/blockchain/BSC/pancake-swap-api/) APIs. ## Track Meme Rush Tokens in 14k to 18k Marketcap Tracks live Meme Rush tokens on BSC with a market cap between $14K–$18K, filtered by 14k to 18k Marketcap. Useful for spotting emerging small-cap meme tokens in real time. Try the query [here](https://ide.bitquery.io/meme-rush-tokens-in-14K-to-17K-Marketcap).
Click to expand GraphQL query ```graphql subscription { Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Price: { IsQuotedInUsd: true Average: { Mean: { gt: 0.000014, le: 0.000018 } } } Market: { Protocol: { is: "fourmeme_v1" } Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } Token: { Address: { startsWith: "0x4444" } } } ) { Token { Name Symbol Address } Market { Protocol Program Network Name Address } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } marketcap: calculate(expression: "$Price_Average_Mean * 1000000000") Price { Average { Mean } Ohlc { Close High Low Open } } } } } ```
## Top Buyers for a Meme Rush Token on Four Meme [This](https://ide.bitquery.io/Top-buyers-of-a-meme-rush-token) query returns top buyers of a particular Meme Rush token on Four Meme, with currency smart contract as `0x44442202ff27ee2297c128d0c1ae43a0fbb35701` for this example.
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc, dataset: combined) { DEXTrades( where: { Trade: { Buy: { Currency: { SmartContract: { is: $currency } } } Success: true Dex: { ProtocolName: { is: "fourmeme_v1" } } } } limit: { count: 100 } ) { Trade { Buy { Buyer } } trades: count bought: sum(of: Trade_Buy_Amount) } } } ``` ```json { "currency": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Get Trade Volume and Number of Trades for a Meme Rush Token [This](https://ide.bitquery.io/volume-and-trades-for-a-token-in-different-time-frames_4) query returns the traded volume and number of trades for a particular Meme Rush token in different time frames, namely 24 hours, 1 hour and 5 minutes.
Click to expand GraphQL query ```graphql query MyQuery( $currency: String $time_24hr_ago: DateTime $time_1hr_ago: DateTime $time_5min_ago: DateTime ) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } }, Success: true } Block: { Time: { since: $time_24hr_ago } } } ) { Trade { Currency { Name Symbol SmartContract } } volume_24hr: sum(of: Trade_Side_AmountInUSD) volume_1hr: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since: $time_1hr_ago } } } ) volume_5min: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since: $time_5min_ago } } } ) trades_24hr: count trades_1hr: count(if: { Block: { Time: { since: $time_1hr_ago } } }) trades_5min: count(if: { Block: { Time: { since: $time_5min_ago } } }) } } } ``` ```json { "currency": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701", "time_24hr_ago": "2025-10-23T15:00:00Z", "time_1hr_ago": "2025-10-24T14:00:00Z", "time_5min_ago": "2025-10-24T15:55:00Z" } ```
## Get Realtime Market Cap and Price of a Meme Rush Token To get the market cap of a token we need two things, the latest `PriceInUSD` and `total supply` of the token. Total Supply is 1,000,000,000 (1B) for four meme tokens so we just need to get price and multiply it with 1B. [This](https://ide.bitquery.io/Real-Time-Marektcap-and-price-of-a-meme-rush-token) query helps with getting the latest USD price of a token and hence its latest Marketcap. ``` Market Cap = Total Supply * PriceInUSD ```
Click to expand GraphQL query ```graphql subscription { Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Price: { IsQuotedInUsd: true } Market: { Protocol: { is: "fourmeme_v1" } Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } Token: { Address: { is: "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } } } ) { Token { Name Symbol Address } Market { Protocol Program Network Name Address } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } marketcap: calculate(expression: "$Price_Average_Mean * 1000000000") Price { Average { Mean } Ohlc { Close High Low Open } } } } } ```
## Metadata for a Newly Created Meme Rush Token This query will fetch you trade metrics, such as marketcap, trade volume, token holders and creation time for a newly created Meme Rush token on BSC network.
Click to expand GraphQL query ```graphql query MyQuery($token: String!) { EVM(network: bsc, dataset: combined) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $token } } } } ) { Block { createdAt: Time(minimum: Block_Time) } volume: sum(of: Trade_Side_AmountInUSD) } Holders( date: "2026-09-30" where: { Currency: { SmartContract: { is: $token } } } ) { holders: uniq(of: Holder_Address) } } marketCap: Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Market: { Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } Token: { Address: { is: $token } } } orderBy: { descending: Interval_Time_Start } limit: { count: 1 } ) { Price { Average { Mean } } marketcap: calculate(expression: "Price_Average_Mean * 1000000000") } } } ``` ```json { "token": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Top Traders of a Meme Rush token This query will fetch you top traders of a meme rush token for the BSC network. You can test the query [here](https://ide.bitquery.io/top-traders-of-a-meme-rush-token).
Click to expand GraphQL query ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network, dataset: combined) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {ProtocolName: {is: "fourmeme_v1"}}}} ) { Trade { Buyer Dex { OwnerAddress ProtocolFamily ProtocolName } } buyVolume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) sellVolume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ``` ```json { "network": "bsc", "token": "0x44442202ff27ee2297c128d0c1ae43a0fbb35701" } ```
## Get liquidity of a Meme Rush token Using below API you can get the liquidity of a meme rush token. Subtract `200000000` from the Balance that this query returns because 200M tokens are reserved which gets transferred to pancakeswap when this meme rush token graduates.
Click to expand GraphQL query ```graphql query MyQuery { EVM(dataset: combined, network: bsc) { Balances( where: {Balance: {Address: {is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b"}}, Currency: {SmartContract: {is: "0x44442202ff27ee2297c128d0c1ae43a0fbb35701"}}} orderBy: { descending: Balance_Amount } ) { Currency { Name } Balance { Address Amount } } } } ```
--- ## Build AI Trading Agents with Bitquery Base Chain Data URL: https://docs.bitquery.io/docs/blockchain/Base/ai-agent-base-data/ Base AI trading agent guide: trending Base tokens by USD volume, a live trade stream, decision logic and setup steps to run the open-source agent. # Build AI Trading Agents with Bitquery Base Chain Data ## Recommended: Trading API feeds for agents (real-time + last ~30 days) For live signals, point your agent at the [**Trading API**](/docs/trading/trading-data-overview) — **USD price, market cap, and supply on every row**, MEV-filtered. The chain-level queries below remain the right tool for **history older than ~30 days** or call/event context. ### Trending Base tokens by USD volume Run it [in the IDE](https://ide.bitquery.io/Trading-API-Trending-Tokens-Base). ```graphql { Trading { Tokens( where: { Interval: {Time: {Duration: {eq: 3600}}} Token: {Network: {is: "Base"}} Block: {Time: {since_relative: {hours_ago: 2}}} Volume: {Usd: {gt: 10000}} } limit: {count: 10} orderBy: {descending: Volume_Usd} ) { Token { Symbol Address Network } Interval { Time { Start Duration } } Volume { Base Usd } Price { Ohlc { Open High Low Close } } Supply { MarketCap FullyDilutedValuationUsd } } } } ``` ### Live Base trade stream Run it [in the IDE](https://ide.bitquery.io/Trading-API-Live-Trades-All-Chains) — scoped here to Base; drop the `Network` filter to stream all 10 chains. ```graphql subscription { Trading { Trades(where: {Pair: {Market: {Network: {is: "Base"}}}}) { Block { Time } Price PriceInUsd AmountsInUsd { Base Quote } Trader { Address } Pair { Token { Symbol } QuoteToken { Symbol } Market { Protocol } } } } } ``` In this section, we will explore how to use Bitquery APIs and real-time streams to build AI-enabled trading agents for the Base blockchain. For **ready-made Bitquery-backed [OpenClaw](https://openclaw.ai/) skills** (installable via [ClawHub](https://clawhub.ai/)—for example real-time BTC, USD charts, Pump.fun, Polymarket, and Solana stablecoin streams), see [bitquery/openclaw-skills-master](https://github.com/bitquery/openclaw-skills-master) and the [ClawHub CLI docs](https://docs.openclaw.ai/tools/clawhub). This page focuses on a **custom** Base trading agent you build with Bitquery APIs directly. ## Your AI Trading Agent's Mission: You are a specialized trading agent operating on the Base blockchain, you will optimize an existing portfolio by analyzing and trading trending tokens using Bitquery data. Your primary goal is to identify profitable tokens in the Base ecosystem, assess wallet balances, and execute calculated swap decisions to enhance portfolio value. ```python prompt = ( f"Analyze the following Base chain token:\n" f"Name: {token_data['name']}\n" f"Symbol: {token_data['symbol']}\n" f"Market Cap: {token_data['market_cap']}\n" f"Liquidity (USD): {token_data['liquidity_usd']}\n" f"Volatility: {token_data['volatility']}\n" f"Top Holder Concentration (%): {token_data['holder_concentration']}\n" f"Current Price: {token_data['current_price']}\n" f"Trading Volume (24h): {token_data['trading_volume']}\n" "\nBased on this data and Base ecosystem considerations, decide whether to 'Buy', 'Sell', 'Hold', or 'Avoid'. Only reply with one word: Buy, Sell, Hold, or Avoid." ) ``` ## Trading Decision Process This is a rough draft of what an AI agent can do using Base chain on-chain and off-chain data. For live DEX prices grouped by theme, browse [DEXrabbit Categories](https://dexrabbit.bitquery.io/categories) — for example [AI Agents](https://dexrabbit.bitquery.io/categories/ai-agents) or [Base Meme Coins](https://dexrabbit.bitquery.io/categories/base-meme-coins). - Use trending data to identify promising Base tokens with potential profit. - For each trending token, retrieve detailed information to evaluate its market cap, liquidity, volatility, and security. - Check the wallet balance to understand the available assets and decide on a safe percentage to invest. - Execute swaps to acquire trending tokens on Base DEXs (Uniswap V3, PancakeSwap), ensuring the chosen amount. - Continuously monitor token performance and adjust holdings to maximize profits. For this you can use Bitquery Real-time Streams to monitor Base token prices, new token creation and other activities with sub-second latency. ## Code Structure and Logic: A Good Starting Point Your code sets up a flexible AI trading agent framework for Base chain, handling: - **backtesting**: historical simulation on Base chain data. - **live mode**: real-time trading/decision making on Base DEXs - **Integration with Claude AI** to guide trading decisions based on Base chain fundamentals - **Base ecosystem analysis** where the AI agent makes data-driven trading decisions using Bitquery Base data. Below is a sample project structure: ``` base_ai_trading_agent/ ├── base_main.py # Entry point for Base agent ├── base_bitquery_utils.py # Bitquery API functions for Base ├── ai_decision.py # Claude AI logic for trade decisions ├── base_config.py # Base chain configuration ├── .env # Store API keys securely └── requirements.txt # Python dependencies ``` ## Video Tutorial ## How to Run the Base Chain AI Agent ### 1. Clone the Repository ```bash git clone https://github.com/Akshat-cs/Base-onchain-aiagent cd Base-onchain-aiagent ``` ### 2. Install Dependencies ```bash pip install -r requirements.txt ``` ### 3. Environment Setup Create a `.env` file in the project root: ```bash # Required API Keys CLAUDE_API_KEY=your_claude_api_key BITQUERY_TOKEN=your-bitquery-token-here WALLET_ADDRESS=your-wallet-address ``` ### 4. Run the Trading Agent ```bash python base_main.py ``` ## Key Bitquery Streams and Queries for Base Trading Agents ### 1. Top Trending Tokens on Base Detect Base tokens with rising popularity and trader activity.
Click to expand GraphQL query ```graphql query TrendingBaseTokens { EVM(network: base, dataset: realtime) { DEXTradeByTokens( limit: { count: 10 } orderBy: { descendingByField: "buyers" } where: { Trade: { Currency: { SmartContract: { notIn: [ "0x4200000000000000000000000000000000000006" "0x0000000000000000000000000000000000000000" ] } } } Block: { Time: { since: "2024-12-01T00:00:00Z" } } } ) { Trade { Currency { Name Symbol SmartContract } } buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) trades: count volume: sum(of: Trade_Side_AmountInUSD) } } } ```
### 2. Token Volatility Analysis on Base Evaluate price stability and trading patterns for Base tokens.
Click to expand GraphQL query ```graphql query BaseTokenVolatility($tokenAddress: String!) { EVM(network: base, dataset: realtime) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $tokenAddress } } Side: { Currency: { SmartContract: { is: "0x4200000000000000000000000000000000000006" } } AmountInUSD: { gt: "100" } } } } ) { volatility: standard_deviation(of: Trade_PriceInUSD) avg_price: average(of: Trade_PriceInUSD) Trade { max_price: PriceInUSD(maximum: Trade_PriceInUSD) min_price: PriceInUSD(minimum: Trade_PriceInUSD) } } } } ```
**Use**: Assess price stability before entering positions on Base tokens. ### 3. Market Cap of a Base Token You can fetch Market Cap of a Base token using the below query.
Click to expand GraphQL query ```graphql query BaseTokenMarketCap($tokenAddress: String!) { EVM(network: base, dataset: realtime) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $tokenAddress } } } } orderBy: { descending: Block_Time } limit: { count: 1 } ) { Trade { PriceInUSD Currency { Name Symbol SmartContract } } } } } ```
**Use**: Focus on Base tokens with strong liquidity to ensure reliable entry and exit points. ### 4. Base Token Supply Analysis (also helps in calculation of marketcap) Get comprehensive supply metrics for Base tokens.
Click to expand GraphQL query ```graphql query BaseTokenSupply($tokenAddress: String!) { EVM(network: base, dataset: combined) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: $tokenAddress } } Success: true } } ) { minted: sum( of: Transfer_Amount if: { Transfer: { Sender: { is: "0x0000000000000000000000000000000000000000" } } } ) burned: sum( of: Transfer_Amount if: { Transfer: { Receiver: { is: "0x0000000000000000000000000000000000000000" } } } ) } } } ```
**Use**: Calculate circulating supply and assess tokenomics for Base tokens. ### 5. Base Token Holders Distribution (Security Check) Check token decentralization on Base to avoid risky, whale-dominated assets. `Holders` ranks a token's holders on a given `date`. For large tokens, set a balance floor (`Balance.Amount ge`) to keep the query fast.
Click to expand GraphQL query ```graphql query BaseHolders($tokenAddress: String!, $date: String!, $floor: String!) { EVM(network: base) { Holders( date: $date orderBy: { descending: Balance_Amount } limit: { count: 50 } where: { Currency: { SmartContract: { is: $tokenAddress } } Balance: { Amount: { ge: $floor } } } ) { Holder { Address } Balance { Amount } Currency { Name Symbol SmartContract } } } } ``` Variables: ```json { "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "date": "2026-09-30", "floor": "1000000" } ```
**Use**: Avoid Base tokens with highly concentrated ownership that may be vulnerable to manipulation. ### 6. Base Wallet Balances Monitoring Review current portfolio composition on Base before making swaps.
Click to expand GraphQL query ```graphql query BaseWalletBalances($walletAddress: String!) { EVM(network: base, dataset: combined) { Balances( where: { Balance: { Address: { is: $walletAddress } } } orderBy: { descending: Balance_Amount } limit: { count: 100 } ) { Balance { Address Amount(selectWhere: { gt: "0" }) } Currency { Name Symbol SmartContract } } } } ```
**Use**: Determine available Base assets and calculate safe investment amounts for token swaps. ### 7. Base DEX Trade Streams for Real-Time Trades Subscribe to continuous streams of Base DEX trades for live market intelligence.
Click to expand GraphQL Stream ```graphql subscription BaseTradesStream { EVM(network: base) { DEXTrades { Block { Time Number } Transaction { Hash } Trade { Buy { Amount PriceInUSD Currency { Symbol SmartContract } Buyer } Sell { Amount PriceInUSD Currency { Symbol SmartContract } Seller } Dex { ProtocolName ProtocolFamily } } } } } ```
**Use**: React instantly to time-sensitive trades on Base DEXs. ## Calculating Trading Indicators for Base You can calculate SMA, EMA, RSI etc with Bitquery Base data. Your AI Agent can reconstruct Base token price charts and calculate: - **SMA 50**: Simple Moving Average over last 50 data points - **SMA 200**: Simple Moving Average over last 200 data points **Detect crossovers**: - SMA 50 crosses above SMA 200 → Consider Buy - SMA 50 crosses below SMA 200 → Consider Sell This logic can be integrated into the AI Trading Loop along with the Base on-chain analysis. ## Building the Base AI Trading Loop Your Base AI Trading Agent combines the above streams as follows: 1. **Fetch Top Trending Base Tokens** to shortlist candidates 2. **For each token**: - Analyze Liquidity, Volatility, and Holders Distribution - Check Supply metrics and tokenomics - Evaluate Base ecosystem fit 3. **Check Base Wallet Balances** to calculate possible investment amount 4. **Use Real-Time Base Trade Streams** to time the market entry 5. **Execute Swaps** on Base DEXs for high-potential tokens (not implemented, you can implement this) 6. **Continuously monitor** Base market data and adjust holdings as needed --- ## Flap.sh API - BSC Launchpad Token Analytics and Trading Data URL: https://docs.bitquery.io/docs/blockchain/BSC/flap-sh/ Flap.sh launchpad on BNB Chain: new token creation, token tax details, latest trades, OHLCV in USD and BNB, and real-time price streams. # Flap.sh API Flap.sh is a token launchpad platform on BNB Smart Chain (BSC) that enables users to create and launch new tokens with unique features including tax tokens and vanity addresses. This comprehensive guide covers how to track, analyze, and monitor Flap.sh tokens using Bitquery's GraphQL APIs. ## Overview Flap.sh provides a decentralized token launchpad where users can create tokens with customizable features. The platform supports standard tokens and tax tokens (v1 and v2), each with distinct contract addresses and token suffix patterns. ### Key Features - **Token Creation Tracking** – Monitor new token launches in real-time - **Tax Token Support** – Track both standard and tax-enabled tokens - **Vanity Addresses** – Tokens with custom suffixes (8888 for standard, 7777 for tax) - **Trading Analytics** – Comprehensive DEX trade data and OHLCV analysis - **Real-Time Streaming** – Live price and trade updates via GraphQL subscriptions ## Contract Addresses ### Core Contracts | Contract Type | Address | Description | |---------------|---------|-------------| | **Launchpad Contract** | `0x1de460f363AF910f51726DEf188F9004276Bf4bc` | Main launchpad contract for token creation | | **Portal Contract** | `0xe2cE6ab80874Fa9Fa2aAE65D277Dd6B8e65C9De0` | Portal contract for token management and events | ### Token Contract Templates | Token Type | Contract Address | Suffix Pattern | |------------|------------------|----------------| | **Tax Token V1** | `0x29e6383F0ce68507b5A72a53c2B118a118332aA8` | `7777` | | **Tax Token V2** | `0xae562c6A05b798499507c6276C6Ed796027807BA` | `7777` | | **Standard Token** | Various | `8888` | ### Documentation Resources - **Official Flap.sh Docs**: [https://docs.flap.sh/flap/](https://docs.flap.sh/flap/) - **Deployed Contract Addresses**: [https://docs.flap.sh/flap/developers/deployed-contract-addresses](https://docs.flap.sh/flap/developers/deployed-contract-addresses) - **ABI Information**: Available on the deployed contract addresses page ## Token Creation Tracking ### New Flap.sh Tokens Created Using Transfers API Track newly created Flap.sh tokens by monitoring transfers from the zero address with token addresses ending in the vanity suffix. **Try it live:** [Latest Flap.sh Token Created](https://ide.bitquery.io/New-Flapsh-Tokens-Created-Using-Transfers-API) ```graphql { EVM(network: bsc) { Transfers( where: {TransactionStatus: {Success: true}, any: [{Transfer: {Currency: {SmartContract: {endsWith: "7777"}}}} {Transfer: {Currency: {SmartContract: {endsWith: "8888"}}}} ], Transfer: {Sender: {is: "0x0000000000000000000000000000000000000000"}}} limit: {count: 100} orderBy: {descending: Block_Time} ) { Transaction { Hash } Transfer { Amount Sender Receiver Currency { Symbol Name SmartContract } } Block { Time Number } } } } ``` **Note:** For standard tokens, change the suffix from `"7777"` to `"8888"` in the query. ### Token Creation Using Events API Monitor token creation events directly from the Flap.sh portal contract for more detailed information. **Try it live:** [Latest Flap.sh Token Created Using Events](https://ide.bitquery.io/Latest-flapsh-token-created-using-events-data_1) ```graphql { EVM(dataset: realtime, network: bsc) { Events( orderBy: { descending: Block_Time } where: { LogHeader: { Address: { is: "0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } Log: { SmartContract: { in: ["0xdda462c04e09abec8b90c879f039762552011d5a"] } Signature: { Name: { in: [ "TokenCreated", "TokenCurveSetV2", "TokenDexSupplyThreshSet", "TokenVersionSet", "TokenQuoteSet", "TokenMigratorSet", "TokenDexPreferenceSet", "FlapTokenTaxSet" ] } } } } ) { Block { Number Time } Transaction { Hash From To Type } Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } LogHeader { Address } Log { Signature { Name Signature } SmartContract } } } } ``` ### Specific Token Creation Details Get detailed information about a specific token's creation and configuration events within a time range. **Try it live:** [Getting Details of Specific Flap.sh Token Creation](https://ide.bitquery.io/Getting-details-of-specific-flapsh-token-creation-using-the-events-api_4) ```graphql { EVM(dataset: combined, network: bsc) { Events( where: { Block: { Date: { since_relative: { days_ago: 5 } } } LogHeader: { Address: { is: "0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } Log: { SmartContract: { in: ["0xdda462c04e09abec8b90c879f039762552011d5a"] } Signature: { Name: { in: [ "TokenCreated", "TokenCurveSetV2", "TokenDexSupplyThreshSet", "TokenVersionSet", "TokenQuoteSet", "TokenMigratorSet", "TokenDexPreferenceSet", "FlapTokenTaxSet" ] } } } Arguments: { includes: { Name: { is: "token" } Value: { Address: { is: "0x7e39a0fff2c6860d30bdd8e1133665b0a4b47777" } } } } } ) { Block { Number Time } Transaction { Hash From To Type } Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Log { Signature { Name Signature } } } } } ``` ### Token Tax Details Retrieve tax configuration details for specific Flap.sh tokens. **Try it live:** [Getting Flap.sh Token Tax Details](https://ide.bitquery.io/Getting-Flapsh-token-tax-details-using-events-api_1) ```graphql { EVM(dataset: combined, network: bsc) { Events( where: { Block: { Date: { since_relative: { days_ago: 5 } } } LogHeader: { Address: { is: "0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } Log: { SmartContract: { in: ["0xdda462c04e09abec8b90c879f039762552011d5a"] } Signature: { Name: { in: [ "TokenCreated", "TokenCurveSetV2", "TokenDexSupplyThreshSet", "TokenVersionSet", "TokenQuoteSet", "TokenMigratorSet", "TokenDexPreferenceSet", "FlapTokenTaxSet" ] } } } Arguments: { includes: { Name: { is: "token" } Value: { Address: { is: "0x7e39a0fff2c6860d30bdd8e1133665b0a4b47777" } } } } Transaction: { Hash: { is: "0x89491e82ed4a8b12408924992cb0c2359e443aed4e6c18eed87b0e7356f49cf9" } } } ) { Block { Number Time } Transaction { Hash From To } Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Log { Signature { Name Signature } } } } } ``` ## Trading Analytics ### Latest Flap.sh Trades Monitor all recent trades across Flap.sh tokens using the DEXTrades API. **Try it live:** [Latest Flap.sh Trades Using DEXTrades API](https://ide.bitquery.io/Latest-Flapsh-trades-using-DEXTrades-API) ```graphql { EVM(dataset: realtime, network: bsc) { DEXTrades( limit: { count: 20 } orderBy: { descending: Block_Time } where: { TransactionStatus: { Success: true } Trade: { Dex: { SmartContract: { is: "0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } } } ) { Block { Time Number } Transaction { Hash From To Gas Cost CostInUSD } Trade { Buy { Amount AmountInUSD Buyer Seller Currency { Decimals Name Symbol SmartContract } Price PriceInUSD } Sell { Amount AmountInUSD Buyer Seller Currency { Name Symbol SmartContract } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` ### Trades for Specific Token Get trading activity for a specific Flap.sh token using DEXTradeByTokens API. **Try it live:** [Latest Flap.sh Trades for a Specific Token](https://ide.bitquery.io/Latest-Flapsh-trades-for-a-specific-token) ```graphql { EVM(dataset: realtime, network: bsc) { DEXTradeByTokens( limit: { count: 20 } orderBy: { descending: Block_Time } where: { TransactionStatus: { Success: true } Trade: { Side: { Currency: { SmartContract: { is: "0x2fd5b2deae6002d924e3ff8b0f438dfac3a97777" } } } Dex: { SmartContract: { is: "0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } } } ) { Block { Time Number } Transaction { Hash From To } Trade { Amount AmountInUSD Price PriceInUSD Buyer Seller Sender Currency { Name Symbol SmartContract } Side { Amount AmountInUSD Type Currency { Name Symbol SmartContract } } Dex { ProtocolName ProtocolFamily } Fees { Amount AmountInUSD Payer Recipient } } } } } ``` ## Price and OHLCV Data ### OHLCV Data in USD Get OHLCV (Open, High, Low, Close, Volume) data for Flap.sh tokens quoted in USD. **Try it live:** [OHLCV Data for Specific Flap.sh Token in USD](https://ide.bitquery.io/OHLCV-data-for-specific-Flapsh-token-in-USD) ```graphql { Trading { Tokens( where: { Token: { Id: { is: "bid:bsc:0x2fd5b2deae6002d924e3ff8b0f438dfac3a97777" } } Interval: { Time: { Duration: { eq: 1 } } } } limit: { count: 100 } orderBy: { descending: Block_Time } ) { Token { Address Id Name Symbol Network } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving WeightedSimpleMoving } } } } } ``` ### OHLCV Data Against BNB Get OHLCV data for Flap.sh tokens paired with BNB. **Try it live:** [OHLCV Data for Specific Flap.sh Token Against BNB](https://ide.bitquery.io/OHLCV-data-for-specific-Flapsh-token-against-BNB) ```graphql { Trading { Pairs( where: { Token: { Id: { is: "bid:bsc:0x2fd5b2deae6002d924e3ff8b0f438dfac3a97777" } } Interval: { Time: { Duration: { eq: 1 } } } } limit: { count: 100 } orderBy: { descending: Block_Time } ) { Token { Address Id Name Symbol Network } QuoteToken { Address Id Name Symbol Network } Market { Program Name } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving WeightedSimpleMoving } } } } } ``` ## Real-Time Streaming ### Stream Latest Prices for Flap.sh Tokens Subscribe to real-time price updates for all Flap.sh tokens. **Try it live:** [Stream for Latest Prices for Flap.sh Tokens](https://ide.bitquery.io/Stream-for-latest-prices-for-Flapsh-tokens) ```graphql subscription { Trading { Pairs( where: { Market: { Id: { is: "bid:bsc:0xe2ce6ab80874fa9fa2aae65d277dd6b8e65c9de0" } } Interval: { Time: { Duration: { eq: 1 } } } } ) { Token { Address Id Name Symbol Network } QuoteToken { Address Id Name Symbol Network } Market { Program Name } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving WeightedSimpleMoving } } } } } ``` ## Token Types and Suffixes ### Understanding Flap.sh Token Types Flap.sh supports multiple token types with distinct characteristics: #### Standard Tokens - **Suffix Pattern**: `8888` - **Description**: Standard ERC-20 compatible tokens without tax mechanisms - **Use Case**: Traditional token launches with no transfer fees #### Tax Tokens - **Suffix Pattern**: `7777` - **Versions**: - **Tax Token V1**: Contract `0x29e6383F0ce68507b5A72a53c2B118a118332aA8` - **Tax Token V2**: Contract `0xae562c6A05b798499507c6276C6Ed796027807BA` - **Description**: Tokens with built-in transfer tax mechanisms - **Use Case**: Revenue-generating tokens with automatic fee collection ### Identifying Token Types You can identify Flap.sh tokens by checking the last 4 characters of their contract address: - Tokens ending in `8888` are standard tokens - Tokens ending in `7777` are tax tokens ## Use Cases ### Token Launch Monitoring - Track new token launches in real-time - Monitor token creation events and configurations - Analyze launch patterns and trends ### Trading Analytics - Monitor trading volume and liquidity - Track price movements and volatility - Analyze trader behavior and patterns ### Tax Token Analysis - Monitor tax token performance - Compare tax token vs standard token metrics - Analyze fee collection and distribution ### Portfolio Tracking - Track holdings across multiple Flap.sh tokens - Monitor portfolio performance in real-time - Calculate P&L for Flap.sh token investments ### Arbitrage Detection - Identify price discrepancies across markets - Monitor cross-DEX arbitrage opportunities - Track flash loan usage on Flap.sh tokens ## Best Practices 1. **Use Real-Time Dataset for Live Data**: Use `dataset: realtime` for current token creation and trading activity 2. **Use Combined Dataset for Historical Analysis**: Use `dataset: combined` for comprehensive historical data 3. **Filter by Token Type**: Use suffix patterns (`7777` or `8888`) to filter by token type 4. **Monitor Portal Contract Events**: Track portal contract events for detailed token configuration changes 5. **Implement Rate Limiting**: Respect API limits when building applications 6. **Cache Frequently Used Data**: Store token metadata locally to reduce API calls ## Related Documentation - [BSC Blockchain API](/docs/blockchain/BSC/) – BNB Smart Chain documentation - [DEX Trades API](/docs/schema/evm/dextrades) – DEX trading data documentation - [Events API](/docs/schema/evm/events) – Smart contract events documentation - [Transfers API](/docs/schema/evm/transfers) – Token transfer tracking - [Trading APIs](/docs/trading/crypto-price-api/) – Price and OHLCV data - [GraphQL Subscriptions](/docs/subscriptions/subscription) – Real-time data streaming ## Support For questions or issues: - [Bitquery Documentation](https://docs.bitquery.io) - [Flap.sh Official Documentation](https://docs.flap.sh/flap/) - [Bitquery IDE](https://ide.bitquery.io) --- ## Four Meme API — BSC Trades, Bonding Curve & Prices URL: https://docs.bitquery.io/docs/blockchain/BSC/four-meme-api/ Four Meme on BSC: get trades, prices, bonding curve progress, PancakeSwap migrations, top traders and top tokens, plus the exchange contract address. # Four Meme API :::note For launch tracking, trades and graduation coverage with plans and trial access, see the [Four.meme API](https://bitquery.io/products/fourmeme-api) product page. ::: :::tip Need real-time Four.meme 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**. Four.meme examples using `Trading.Trades` are also shown in the **"Trader-Focused Trade APIs"** section below. Use the raw chain-level queries on this page when you need **historical Four.meme data older than ~30 days** or call / event context. ::: Bitquery exposes **four.meme (Four Meme)** on **BNB Chain** through GraphQL: **live trades** (`fourmeme_v1`), **TokenCreate** events on the exchange proxy, **bonding curve** math from proxy balances, **migrations** to PancakeSwap, **OHLCV**, **liquidity** events, and **leaderboards**. Use **subscriptions** for real-time streams and **`dataset: combined`** for history. The Four Meme exchange proxy used in examples is **`0x5c952063c7fc8610ffdb798152d69f0b9550762b`** (see below). The sections below are example queries and streams. For other fields, contact [support](https://t.me/Bloxy_info). Need low-latency BSC data? See [Streams](/docs/streams/) and contact us for a trial. For **mempool (pre-confirmation)** Four Meme data, see the dedicated [Four Meme Mempool API](/docs/blockchain/BSC/four-meme-mempool-API/) page. For live DEX prices and 24h volume across Four.meme tokens, see [DEXrabbit's Four.meme category](https://dexrabbit.bitquery.io/categories/four-meme-ecosystem). You may also be interested in: - [Crypto Price API ➤](/docs/trading/crypto-price-api/) - [BSC Pancake Swap APIs ➤](/docs/blockchain/BSC/pancake-swap-api/) - [BSC DEX Trades ➤](/docs/blockchain/BSC/bsc-dextrades/) - [PumpFun API ➤](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) :::note To query or stream data via GraphQL outside the Bitquery IDE, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token](/docs/authorization/how-to-generate/) ::: ## What is the Four Meme exchange contract address on BSC? {#what-is-the-four-meme-exchange-contract-address-on-bsc} The **Four Meme / four.meme exchange proxy** on BNB Chain is: `0x5c952063c7fc8610ffdb798152d69f0b9550762b` Use it in **`Transaction.To`**, **`LogHeader.Address`**, or **`Balance.Address`** filters when you listen for **TokenCreate**, **LiquidityAdded**, or **migration**-related logs. **`DEXTrades`** for the launchpad use **`Dex.ProtocolName: { is: "fourmeme_v1" }`**. --- ### Table of Contents ### 1. Four Meme Trading & Market Data (BSC) - [What is the Four Meme exchange contract address on BSC? ➤](#what-is-the-four-meme-exchange-contract-address-on-bsc) - [How do I get live Four Meme trades using Bitquery? ➤](#subscribe-the-latest-trades-on-four-meme) - [Get Latest Buys and Sells for a Four Meme Token ➤](#get-latest-buys-and-sells-for-a-four-meme-token) - [Get Trade Metrics of a Four Meme Token ➤](#get-trade-metrics-of-a-four-meme-token) - [Get Metadata for a Newly Created Four Meme Token ➤](#metadata-for-a-newly-created-token) - [Get latest price of a Four.meme token ➤](#get-latest-price-of-a-fourmeme-token) - [Get ATH price of a Four Meme Token ➤](#get-ath-price-of-a-four-meme-token) - [Get Price Change Percentage for a Four Meme Token ➤](#get-price-change-percentage-for-a-four-meme-token) - [How do I get Four Meme OHLCV data for a token? ➤](#get-ohlcv-data-of-a-four-meme-token) - [Get Trade Volume and Number of Trades for a Four Meme Token ➤](#get-trade-volume-and-number-of-trades-for-a-four-meme-token) ### 2. Token Lifecycle, Liquidity & Migrations - [How do I get newly created tokens on Four Meme? ➤](#get-newly-created-tokens-on-four-meme) - [How do I stream Four Meme token creation events in real time? ➤](#how-do-i-stream-four-meme-token-creation-events-in-real-time) - [Get Four.Meme Tokens created by a specific Dev ➤](#get-fourmeme-tokens-created-by-a-specific-dev) - [Get Dev Address of a Four.meme token ➤](#get-dev-address-of-a-fourmeme-token) - [Get Dev Token Holding percentage ➤](#get-dev-token-holding-percentage) - [Get Top 10 Holders percentages ➤](#get-top-10-holders-percentages) - [How do I detect Four Meme token migrations to PancakeSwap? ➤](#track-all-four-meme-tokens-that-have-migrated-to-pancakeswap) - [How do I get bonding curve progress for a Four Meme token? ➤](#bonding-curve-progress-api-for-fourmeme-token) - [Get Four Meme Tokens which are above 95% Bonding Curve Progress ➤](#get-four-meme-tokens-which-are-above-95-bonding-curve-progress) - [Get liquidity of a Four Meme token ➤](#get-liquidity-of-a-four-meme-token) - [Track Liquidity Add Events for All Tokens on Four Meme ➤](#track-liquidity-add-events-for-all-tokens-on-four-meme) - [Track Liquidity Add Events for a Token on Four Meme ➤](#track-liquidity-add-events-for-a-token-on-four-meme) - [Check if a Four.meme Token is Phishy ➤](#check-if-a-fourmeme-token-is-phishy) ### 3. Trader Insights - [Monitor trades of traders on Four meme ➤](#monitor-trades-of-traders-on-four-meme) - [Track Latest and Historical Trades of a Four Meme User ➤](#track-latest-and-historical-trades-of-a-four-meme-user) - [Top Buyers for a Token on Four Meme ➤](#top-buyers-for-a-token-on-four-meme) - [Top Traders of a token ➤](#top-traders-of-a-token) ### 4. Top Tokens & Getting Started - [Get Realtime Market Cap and Price of a Four Meme Token ➤](#get-realtime-market-cap-and-price-of-a-four-meme-token) - [Top Tokens by marketcap ➤](#top-tokens-by-marketcap) - [Top Tokens by launch marketcap ➤](#top-tokens-by-launch-marketcap) - [How do I get top tokens by volume on Four Meme? ➤](#top-tokens-by-buys-sells-volume-price-change-buyers-sellers) - [Top Four Meme tokens by realtime market cap (activity filter) ➤](#top-four-meme-tokens-by-realtime-marketcap) - [Top Tokens by liquidity ➤](#top-tokens-by-liquidity) - [Bitquery DEX Data Access Options ➤](#bitquery-dex-data-access-options) - [Getting Started with Bitquery ➤](#getting-started-with-bitquery) ### 5. Frequently asked questions (AEO) - [Four Meme on Bitquery — quick answers ➤](#frequently-asked-questions-four-meme-bitquery) ### 6. Video Tutorials - [Video Tutorial | How to get Bonding Curve Progress of any Four Meme Token ➤](#video-tutorial--how-to-get-bonding-curve-progress-of-any-four-meme-token) - [Video Tutorial | How to track the Four Meme Tokens which are about to Graduate in Realtime ➤](#video-tutorial--how-to-track-the-four-meme-tokens-which-are-about-to-graduate-in-realtime) - [Video Tutorial | How to get Liquidity of a Four Meme Token ➤](#video-tutorial--how-to-get-liquidity-of-a-four-meme-token) - [Video Tutorial | How to get Top Traders of a Four Meme Token on Solana Four Meme DEX ➤](#video-tutorial--how-to-get-top-traders-of-a-four-meme-token-on-solana-four-meme-dex) - [Video Tutorial | How to Get the OHLCV Data of a token on Four Meme DEX ➤](#video-tutorial--how-to-get-the-ohlcv-data-of-a-token-on-four-meme-dex) ### 7. Real World Projects - [Real World Projects with Four Meme API ➤](#real-world-projects-with-four-meme-api) ## Bitquery DEX Data Access Options - **GraphQL APIs**: Query historical and real-time EVM data with flexible filtering and aggregation - **Real-time Streams**: Subscribe to live EVM blockchain events via WebSocket subscriptions - **Cloud Solutions**: Access EVM data through AWS, GCP, and Snowflake integrations - **Kafka Streams**: High-throughput data streaming for enterprise applications ## Getting Started with Bitquery: - [Learning Track](/docs/start/learning-path/): Learning track to get started with Bitquery GraphQL APIs and streams. - [BSC DEX Trades](/docs/blockchain/BSC/bsc-dextrades/): Real time DEX Trading data via examples. - [BSC Uniswap APIs](/docs/blockchain/BSC/bsc-uniswap-api/): Uniswap Trades on BSC network with the help of examples. - [BSC Pancake Swap APIs](/docs/blockchain/BSC/pancake-swap-api/): Pancake swap Trades on BSC network with the help of examples. - [Trade APIs](/docs/trading/crypto-price-api/examples/): Multi-chain Trade API Examples. ## How do I detect Four Meme token migrations to PancakeSwap? {#track-all-four-meme-tokens-that-have-migrated-to-pancakeswap} This query tracks four meme token migrations to Pancakeswap in realtime by monitoring transactions sent to the Four Meme factory address (`0x5c952063c7fc8610ffdb798152d69f0b9550762b`) and filtering for `PairCreated` and `PoolCreated` events. These events are emitted when a token graduates from Four Meme and migrates to Pancakeswap. Test it [here](https://ide.bitquery.io/four-meme-migration-to-pancakeswap).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { Events( where: { Log: { Signature: { Name: { in: ["PairCreated"] } } } Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } } ) { Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } } } Transaction { Hash } } } } ```
## Check if a four meme token has migrated or not {#check-if-a-four-meme-token-has-migrated-or-not} Below query will only show response if a the mentioned four meme tokens have migrated to Pancakeswap. Note: Please use a `Block{Date}` filter to minimize the data processing and hence the query processing time and get fast responses. Try the query [here](https://ide.bitquery.io/if-token-migrated-from-four-meme-or-not_4).
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { DEXTradeByTokens( where: {Block: {Date: {since: "2025-10-10"}}, Trade: {Dex: {OwnerAddress: {in: ["0xca143ce32fe78f1f7019d7d551a6402fc5350c73"]}}, Currency: {SmartContract: {in: ["0xfe9936abb3c0659733ff0d03cf41d17b04c84444", "0x9cb5ae8ec79c72bd70b415efb7ff936e707f4444"]}}}} ) { count Trade { Currency { SmartContract } } } } } ```
## How do I get bonding curve progress for a Four Meme token? {#bonding-curve-progress-api-for-fourmeme-token} Below query will give you amount of `left tokens` put it in the below given simplied formulae and you will get Bonding Curve progress for the token. ### Bonding Curve Progress Formula - **Formula**: BondingCurveProgress = 100 - ((leftTokens \* 100) / initialRealTokenReserves) Where: - leftTokens = realTokenReserves - reservedTokens - initialRealTokenReserves = totalSupply - reservedTokens - **Definitions**: - `initialRealTokenReserves` = `totalSupply` - `reservedTokens` - `totalSupply`: 1,000,000,000 (Four meme Token) - `reservedTokens`: 200,000,000 - Therefore, `initialRealTokenReserves`: 800,000,000 - `leftTokens` = `realTokenReserves` - `reservedTokens` - `realTokenReserves`: Token balance at the market address. :::note **Simplified Formula**: BondingCurveProgress = 100 - (((balance - 200000000) \* 100) / 800000000) ::: ### Additional Notes - **Balance Retrieval**: - The `balance` is the four meme token balance at this Four Meme: Proxy address (0x5c952063c7fc8610FFDB798152D69F0B9550762b). - Use this query to fetch the balance:
Click to expand GraphQL query ```graphql query MyQuery($token: String) { EVM(network: bsc) { Balances( where: { Balance: { Address: { is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b" } } Currency: { SmartContract: { is: $token } } } ) { Currency { Name Symbol } Balance { Amount } } } } ```
Click to expand Query Varibles (Paste this in variables section on IDE) ```json { "token": "0x13378bcbbc386eea99f09bc716f2c80979484444" } ```
## Get Four Meme Tokens which are above 95% Bonding Curve Progress Using the above Bonding Curve formula, we can calculate the token balances for the Four Meme Proxy contract (0x5c952063c7fc8610FFDB798152D69F0B9550762b) corresponding to approximately 95% to 100% progress along the bonding curve, that comes out to be `200,000,000` to `240,000,000`. The tokens in the response are arranged in the ascending order of Bonding Curve Percentage, i.e., 95% to 100%.
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { Balances( limit: { count: 100 } where: { Balance: { Address: { is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b" } } } orderBy: { descending: Balance_Amount } ) { Currency { SmartContract Name } Balance { Amount(selectWhere: { ge: "200000000", le: "240000000" }) } } } } ```
## How do I get newly created tokens on Four Meme? {#get-newly-created-tokens-on-four-meme} [Run Query](https://ide.bitquery.io/track-Four-meme-token-creation-using-events) This query retrieves newly created tokens on Four Meme by listening to the `TokenCreate` event. The response provides: **Token Information:** - **creator**: Wallet address of the token creator - **token**: Contract address of the newly created token - **name**: Token name - **symbol**: Token symbol/ticker - **totalSupply**: Total supply **Launch Details:** - **requestId**: Unique identifier for the token creation - **launchTime**: Unix timestamp of when the token launched - **launchFee**: Fee paid
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { Events( where: { Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "TokenCreate" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Log { Signature { Name Signature } } Arguments { Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... 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 } } Name Type } Transaction { Hash To From } } } } ```
### How do I stream Four Meme token creation events in real time? {#how-do-i-stream-four-meme-token-creation-events-in-real-time} Use a **GraphQL subscription** on `EVM(network: bsc)` with the same `TokenCreate` filter as the query above. Each matching log is pushed as it appears. You can start from the same saved query in the IDE and change the operation type to **subscription**: [Token creation (IDE)](https://ide.bitquery.io/track-Four-meme-token-creation-using-events).
Click to expand GraphQL subscription ```graphql subscription { EVM(network: bsc) { Events( where: { Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "TokenCreate" } } } } ) { Log { Signature { Name Signature } } Arguments { Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... 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 } } Name Type } Transaction { Hash To From } } } } ```
You can refer to this [example](/docs/blockchain/BSC/four-meme-api/#subscribe-the-latest-trades-on-four-meme) to track latest trades of a token on other particular DEX's such as Pancake Swap. ## Get Four.Meme Tokens created by a specific Dev This API fetches Four.Meme tokens created by a specific dev on BSC by tracking token minting transfers signed by a particular dev. `Dev Address` here in example is `0x9c75588640605d46b42f2d64c5c2e993de251210`. Use a date filter based on your needs — shorter time ranges mean faster execution and reduced query time. [Run Query](https://ide.bitquery.io/token-created-by-specific-dev)
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { Transfers( where: { Block: { Date: { since: "2025-08-01" } } Transfer: { Sender: { is: "0x0000000000000000000000000000000000000000" } } Transaction: { From: { in: ["0x9c75588640605d46b42f2d64c5c2e993de251210"] } } } ) { Transaction { From To } Transfer { Sender Receiver Amount Currency { Name Symbol SmartContract } } } } } ```
## Get Dev Address of a Four.meme token Fetches the developer address that created a specific Four.Meme token on BSC by tracing the minting transfer (from the zero address) of that token’s smart contract. Use a date filter based on your needs — shorter time ranges make the query execute faster and return results more efficiently. Token Address in this example is 0xd284aa8910fe1dcac70f3e28ddd8cc61dac94444. [Run Query](https://ide.bitquery.io/check-who-created-this-token)
Click to expand GraphQL query ```graphql { EVM(network: bsc, dataset: combined) { Transfers( where: { Block: { Date: { since: "2025-08-01" } } Transfer: { Currency: { SmartContract: { is: "0xd284aa8910fe1dcac70f3e28ddd8cc61dac94444" } } Sender: { is: "0x0000000000000000000000000000000000000000" } } } ) { Transaction { From To } Transfer { Sender Receiver Amount Currency { Name Symbol SmartContract } } } } } ```
## Get Dev Token Holding percentage Calculates what percentage of total token supply is held by the developer address for a specified Four Meme token. [Run Query](https://ide.bitquery.io/dev-holding-percent#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { Address: { is: "0x749ca8e9fcfaf40796e8654ae7624b738c0b9a9d" } Currency: { SmartContract: { is: "0x4dE1486E27237F170Cd92fF1Efb17eF4c2C74444" } } } TransactionStatus: { Success: true } } limit: { count: 1 } orderBy: { descending: Block_Time } ) { TokenBalance { Address Currency { Name Symbol SmartContract } Balance: PostBalance PostBalanceInUSD TotalSupply TotalSupplyInUSD } holding_percentage: calculate( expression: "$TokenBalance_Balance / 10000000" ) } } } ```
## Get Top 10 Holders percentages Calculates the percentage of total supply held by the top 10 holders of a specific Four Meme token on BSC. [Run Query](https://ide.bitquery.io/top-10-holders-percentage#)
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { TransactionBalances( where: { TokenBalance: { Currency: { SmartContract: { is: "0x4dE1486E27237F170Cd92fF1Efb17eF4c2C74444" } } } TransactionStatus: { Success: true } } limit: { count: 10 } orderBy: { descendingByField: "holding_percentage" } ) { TokenBalance { Address Currency { Name Symbol SmartContract } Balance: PostBalance(maximum: Block_Time) } holding_percentage: calculate( expression: "$TokenBalance_Balance / 10000000" ) } } } ```
## How do I get live Four Meme trades using Bitquery? {#subscribe-the-latest-trades-on-four-meme} Using subscriptions you can subscribe to the latest trades on Four Meme as shown in this [example](https://ide.bitquery.io/Latest-trades-on-fourmeme). The subscription returns latest trade info such as buyers and sellers, buy and sell currency details and amount of currency.
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ```
## Get Latest Buys and Sells for a Four Meme Token [This](https://ide.bitquery.io/Latest-buys-and-sells-for-a-four-meme-coin_1) query retrieves the most recent token buy and sell trades of a specific token on Four Meme Exchange.
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc, dataset: combined) { buys: DEXTrades( where: { Trade: { Buy: { Currency: { SmartContract: { is: $currency } } } Dex: { ProtocolName: { is: "fourmeme_v1" } } } } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Amount Buyer Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract } } } } sells: DEXTrades( where: { Trade: { Sell: { Currency: { SmartContract: { is: $currency } } } Success: true Dex: { ProtocolName: { is: "fourmeme_v1" } } } } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Currency { Name Symbol SmartContract } } Sell { Amount Buyer Price PriceInUSD Seller } } } } } ``` ```json { "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40" } ```
You can also check if the token is listed on other DEX using this [example](/docs/blockchain/BSC/bsc-dextrades/#get-all-dexs-where-a-specific-token-is-listed). ## Get Trade Metrics of a Four Meme Token Use the below query to get trade metrics like volume and trades for a token in different time frames, such as `24 hours`, `1 hour` and `5 minutes`. Test it [here](https://ide.bitquery.io/volume-and-trades-for-a-token-in-different-time-frames_3).
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } }, Success: true } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract } } volume_24hr: sum(of: Trade_Side_AmountInUSD) volume_1hr: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) volume_5min: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } } ) trades_24hr: count trades_1hr: count( if: { Block: { Time: { since_relative: { hours_ago: 1 } } } } ) trades_5min: count( if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } } ) } } } ``` ```json { "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40" } ```
## Get latest price of a Four.meme token We launched the [Price Index](/docs/trading/crypto-price-api/) in August 2025, allowing you to track price of any token trading onchain. Here's an example of [tracking Four.meme token prices](https://ide.bitquery.io/latest-token-price-on-four-meme-dex).
Click to expand GraphQL query ```graphql { Trading { Pairs( where: {Price: {IsQuotedInUsd: false}, Market: {Network: {is: "Binance Smart Chain"}, Program: {is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b"}}, Token: {Address: {is: "0x2157de505dfaa51676d6d22c0424551fbeaf4444"}}, Interval: {Time: {Duration: {eq: 60}}}} limit: {count: 1} orderBy: {descending: Block_Time} ) { Market { Address Network Program Protocol ProtocolFamily } Price { Average { ExponentialMoving Mean SimpleMoving WeightedSimpleMoving } Ohlc { Close High Low Open } } Token { Address Name Symbol } QuoteToken { Address Name Symbol } Volume { Base Usd } } } } ```
## Get ATH price of a Four Meme Token Fetches the All-Time High (ATH) price of a specific Four.Meme token on BSC, using the `DEXTradeByTokens` dataset to calculate the 98th percentile of trade prices (approximate ATH). Try the API [here](https://ide.bitquery.io/four-meme---token-ATH-price). **Tune the parameters `level: 0.98` and Date as necessary to filter outliers.**
Click to expand GraphQL query ```graphql query tradingView( $network: evm_network $dataset: dataset_arg_enum $token: String ) { EVM(network: $network, dataset: $dataset) { DEXTradeByTokens( limit: { count: 1 } where: { Block: { Date: { since: "2025-10-10" } } TransactionStatus: { Success: true } Trade: { Side: { Currency: { SmartContract: { is: "0x" } } } Currency: { SmartContract: { is: $token } } } } ) { max: quantile(of: Trade_PriceInUSD, level: 0.98) Block { Time } } } } ``` ```json { "network": "bsc", "token": "0xe59ecb01d56a7f1e66276c1bc885d64c92614444", "dataset": "combined", "local": "EVM", "interval": 60 } ```
## Get Price Change Percentage for a Four Meme Token Use the below query to get the price change in percentage for various time fields including `24 hours`, `1 hour` and `5 minutes`. Try it [here](https://ide.bitquery.io/Percentage-price-change-for-a-token).
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Name Symbol SmartContract } price_24hr: PriceInUSD(minimum: Block_Time) price_1hr: PriceInUSD( if: { Block: { Time: { is_relative: { hours_ago: 1 } } } } ) price_5min: PriceInUSD( if: { Block: { Time: { is_relative: { minutes_ago: 1 } } } } ) current: PriceInUSD } change_24hr: calculate( expression: "( $Trade_current - $Trade_price_24hr ) / $Trade_price_24hr * 100" ) change_1hr: calculate( expression: "( $Trade_current - $Trade_price_1hr ) / $Trade_price_1hr * 100" ) change_5min: calculate( expression: "( $Trade_current - $Trade_price_5min ) / $Trade_price_5min * 100" ) } } } ``` ```json { "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40" } ```
## How do I get Four Meme OHLCV data for a token? {#get-ohlcv-data-of-a-four-meme-token} Use the below query to get four meme token OHLCV data. Test it [here](https://ide.bitquery.io/OHLC-for-a-four-meme-token).
Click to expand GraphQL query ```graphql query tradingView($network: evm_network, $token: String) { EVM(network: $network, dataset: combined) { DEXTradeByTokens( limit: { count: 10 } orderBy: { descendingByField: "Block_Time" } where: { Trade: { Currency: { SmartContract: { is: $token } } PriceAsymmetry: { lt: 0.1 } Dex: { ProtocolName: { is: "fourmeme_v1" } } } } ) { 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) } volumeUSD: sum(of: Trade_Side_AmountInUSD, selectWhere: { gt: "0" }) } } } ``` ```json { "network": "bsc", "token": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40" } ```
## Monitor trades of traders on Four meme You can use our streams to monitor real time trades of a trader on Four Meme, for example run [this stream](https://ide.bitquery.io/monitor-trades-of-a-trader-on-four-meme).
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } Transaction: { From: { is: "0x7db00d1f5b8855d40827f34bb17f95d31990306e" } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ```
You can also get the trade activities of a user on Pancake Swap using our [Pancake Swap](/docs/blockchain/BSC/pancake-swap-api/) APIs. ## Track Four Meme Tokens in 14k to 18k Marketcap Tracks live Four Meme tokens on BSC with a market cap between $14K–$18K, filtered by 14k to 18k Marketcap. Useful for spotting emerging small-cap meme tokens in real time. Try the query [here](https://ide.bitquery.io/Four-meme-tokens-in-14K-to-17K-Marketcap).
Click to expand GraphQL query ```graphql subscription { Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Price: { IsQuotedInUsd: true Average: { Mean: { gt: 0.000014, le: 0.000018 } } } Market: { Protocol: { is: "fourmeme_v1" } Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } } ) { Token { Name Symbol Address } Market { Protocol Program Network Name Address } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } marketcap: calculate(expression: "$Price_Average_Mean * 1000000000") Price { Average { Mean } Ohlc { Close High Low Open } } } } } ```
## Track Latest and Historical Trades of a Four Meme User You can use DEX Trades API with combined dataset to get latest and historic trades of a user. Run [this query](https://ide.bitquery.io/Get-all-trades-of-a-trader-on-four-meme) for example.
Click to expand GraphQL query ```graphql query MyQuery($address: String) { EVM(dataset: combined, network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } Transaction: { From: { is: $address } } } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Sell { Seller Currency { Name Symbol SmartContract } Amount } } Transaction { Hash } } } } ``` ```json { "address": "0x7db00d1f5b8855d40827f34bb17f95d31990306e" } ```
## Top Buyers for a Token on Four Meme [This](https://ide.bitquery.io/Top-buyers-of-a-four-meme-token) query returns top buyers of a particular token on Four Meme, with currency smart contract as `0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40` for this example.
Click to expand GraphQL query ```graphql query MyQuery($currency: String) { EVM(network: bsc, dataset: combined) { DEXTrades( where: { Trade: { Buy: { Currency: { SmartContract: { is: $currency } } } Dex: { ProtocolName: { is: "fourmeme_v1" } } } } limit: { count: 100 } ) { Trade { Buy { Buyer } } trades: count bought: sum(of: Trade_Buy_Amount) } } } ``` ```json { "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40" } ```
## Get Trade Volume and Number of Trades for a Four Meme Token [This](https://ide.bitquery.io/volume-and-trades-for-a-token-in-different-time-frames_1) query returns the traded volume and number of trades for a particular Four Meme token in different time frames, namely 24 hours, 1 hour and 5 minutes.
Click to expand GraphQL query ```graphql query MyQuery( $currency: String $time_24hr_ago: DateTime $time_1hr_ago: DateTime $time_5min_ago: DateTime ) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $currency } } } Block: { Time: { since: $time_24hr_ago } } } ) { Trade { Currency { Name Symbol SmartContract } } volume_24hr: sum(of: Trade_Side_AmountInUSD) volume_1hr: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since: $time_1hr_ago } } } ) volume_5min: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { since: $time_5min_ago } } } ) trades_24hr: count trades_1hr: count(if: { Block: { Time: { since: $time_1hr_ago } } }) trades_5min: count(if: { Block: { Time: { since: $time_5min_ago } } }) } } } ``` ```json { "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40", "time_24hr_ago": "2024-03-23T15:00:00Z", "time_1hr_ago": "2024-03-24T14:00:00Z", "time_5min_ago": "2024-03-24T15:55:00Z" } ```
## Get Realtime Market Cap and Price of a Four Meme Token To get the market cap of a token we need two things, the latest `PriceInUSD` and `total supply` of the token. Total Supply is 1,000,000,000 (1B) for four meme tokens so we just need to get price and multiply it with 1B. [This](https://ide.bitquery.io/Real-Time-Marektcap-and-price-of-a-four-meme-token) query helps with getting the latest USD price of a token and hence its latest Marketcap. ``` Market Cap = Total Supply * PriceInUSD ```
Click to expand GraphQL query ```graphql subscription { Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Price: { IsQuotedInUsd: true } Market: { Protocol: { is: "fourmeme_v1" } Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } Token: { Address: { is: "0xf5bc78c8c762e4003742dacc31f3ba7091be4444" } } } ) { Token { Name Symbol Address } Market { Protocol Program Network Name Address } Block { Date Time Timestamp } Interval { Time { Start Duration End } } Volume { Base Quote Usd } marketcap: calculate(expression: "$Price_Average_Mean * 1000000000") Price { Average { Mean } Ohlc { Close High Low Open } } } } } ```
## Top Tokens by marketcap Below API can be used to get top four meme tokens by marketcap. You can get all the data through us and create a min and max marketcap filter in your application. Try the API [here](https://ide.bitquery.io/top-tokens-by-marketcap-on-fourmeme). ``` Market Cap = Total Supply * PriceInUSD ```
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( limit: { count: 100 } orderBy: { descendingByField: "Marketcap" } where: { TransactionStatus: { Success: true } Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Side: { AmountInUSD: { gt: "20" } Currency: { SmartContract: { in: [ "0x" "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" "0x55d398326f99059fF775485246999027B3197955" "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" "0x17EAfd08994305D8AcE37EfB82F1523177eC70EE" "0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d" ] } } } } } ) { Trade { Currency { Name Symbol SmartContract } PriceInUSD(maximum: Block_Time) Side { Currency { Name Symbol SmartContract } } } Transaction { Hash(maximum: Block_Time) } Marketcap: calculate(expression: "$Trade_PriceInUSD * 1000000000") } } } ```
## Top Tokens by launch marketcap Below API can be used to get top four meme tokens by launch marketcap (marketcap at the time of launching). You can get all the data through us and create a min and max marketcap filter in your application. Try the API [here](https://ide.bitquery.io/top-tokens-by-launch-marketcap-on-fourmeme_1). ``` Market Cap = Total Supply * PriceInUSD ```
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( limit: { count: 100 } orderBy: { descendingByField: "Marketcap" } where: { TransactionStatus: { Success: true } Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Side: { AmountInUSD: { gt: "20" } Currency: { SmartContract: { in: [ "0x" "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" "0x55d398326f99059fF775485246999027B3197955" "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" "0x17EAfd08994305D8AcE37EfB82F1523177eC70EE" "0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d" ] } } } } } ) { Trade { Currency { Name Symbol SmartContract } PriceInUSD(minimum: Block_Time) Side { Currency { Name Symbol SmartContract } } } Transaction { Hash(minimum: Block_Time) } Marketcap: calculate(expression: "$Trade_PriceInUSD * 1000000000") } } } ```
## How do I get top tokens by volume on Four Meme? {#top-tokens-by-buys-sells-volume-price-change-buyers-sellers} Below API can be used to get top Four Meme tokens by **buys, sells, volume, price change, buyers, and sellers** over rolling windows (for example 1h / 24h). You can apply min/max market cap filters in your application on top of this data. Try the API [here](https://ide.bitquery.io/top-tokens-by-price-change-volume-buys-sells-buyers-sellers_1).
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc, dataset: combined) { DEXTradeByTokens( limit: { count: 100 } orderBy: { descendingByField: "buys_1hr" } where: { Block: { Time: { since_relative: { hours_ago: 24 } } } TransactionStatus: { Success: true } Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Side: { Currency: { SmartContract: { in: [ "0x" "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" "0x55d398326f99059fF775485246999027B3197955" "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" "0x17EAfd08994305D8AcE37EfB82F1523177eC70EE" "0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d" ] } } } } } ) { Trade { Currency { Name Symbol SmartContract } price_24hr: Price(minimum: Block_Time) price_1hr: Price( maximum: Block_Time if: { Block: { Time: { till_relative: { hours_ago: 1 } } } } ) price_5min: Price( maximum: Block_Time if: { Block: { Time: { till_relative: { minutes_ago: 5 } } } } ) current: Price(maximum: Block_Time) Side { Currency { Name Symbol SmartContract } } } buyers_24hr: count( distinct: Transaction_From if: { Trade: { Side: { Type: { is: buy } } } } ) sellers_24hr: count( distinct: Transaction_From if: { Trade: { Side: { Type: { is: sell } } } } ) buys_1hr: count( if: { Trade: { Side: { Type: { is: buy } } } Block: { Time: { till_relative: { hours_ago: 1 } } } } ) buys_24hr: count(if: { Trade: { Side: { Type: { is: buy } } } }) sells_1hr: count( if: { Trade: { Side: { Type: { is: sell } } } Block: { Time: { till_relative: { hours_ago: 1 } } } } ) sells_24hr: count(if: { Trade: { Side: { Type: { is: sell } } } }) volume_1hr: sum( of: Trade_Side_AmountInUSD if: { Block: { Time: { till_relative: { hours_ago: 1 } } } } ) volume_24hr: sum(of: Trade_Side_AmountInUSD) change_24hr: calculate( expression: "( $Trade_current - $Trade_price_24hr ) / $Trade_price_24hr * 100" ) change_1hr: calculate( expression: "( $Trade_current - $Trade_price_1hr ) / $Trade_price_1hr * 100" ) change_5min: calculate( expression: "( $Trade_current - $Trade_price_5min ) / $Trade_price_5min * 100" ) } } } ```
## Top Four Meme tokens by realtime market cap (activity filter) {#top-four-meme-tokens-by-realtime-marketcap} This query uses **`dataset: realtime`** and **`DEXTradeByTokens`** ordered by a calculated **marketcap** field, with a minimum **trade size in USD** on the filter. Use it when you want a **live-oriented** leaderboard; for volume / buy-sell breakdowns use the [previous section](#top-tokens-by-buys-sells-volume-price-change-buyers-sellers). Try the API [here](https://ide.bitquery.io/top-tokens-by-launch-marketcap-on-fourmeme_1).
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc, dataset: realtime) { DEXTradeByTokens( limit: { count: 100 } orderBy: { descendingByField: "Marketcap" } where: { TransactionStatus: { Success: true } Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Side: { AmountInUSD: { gt: "20" } Currency: { SmartContract: { in: [ "0x" "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" "0x55d398326f99059fF775485246999027B3197955" "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d" "0x17EAfd08994305D8AcE37EfB82F1523177eC70EE" "0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d" ] } } } } } ) { Trade { Currency { Name Symbol SmartContract } PriceInUSD(minimum: Block_Time) Side { Currency { Name Symbol SmartContract } } } Transaction { Hash(minimum: Block_Time) } Marketcap: calculate(expression: "$Trade_PriceInUSD * 1000000000") } } } ```
## Top Tokens by liquidity Below API can be used to get top four meme tokens by liquidity between 800M and 900M token liquqidity. You can create a min and max liquidity filter in your application using this API.
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { Balances( limit: { count: 100 } where: { Balance: { Address: { is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b" } } } orderBy: { descending: Balance_Amount } ) { Currency { Name Symbol SmartContract } Balance { Amount(selectWhere: { gt: "800000000", le: "900000000" }) } } } } ```
## Track Liquidity Add Events for All Tokens on Four Meme This query tracks all liquidity addition events on the Four Meme Exchange. It listens for `LiquidityAdded` events emitted from the four meme exchange's smart contract (0x5c952063c7fc8610ffdb798152d69f0b9550762b) You can run the query [here](https://ide.bitquery.io/Liquidity-Added-to-specific-tokens-on-Four-meme)
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { Events( limit: {count: 20} where: {LogHeader: {Address: {is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b"}}, Log: {Signature: {Name: {is: "LiquidityAdded"}}}} ) { Block { Time Number Hash } Receipt { ContractAddress } Topics { Hash } TransactionStatus { Success } LogHeader { Address Index Data } Transaction { Hash From To } Log { EnterIndex ExitIndex Index LogAfterCallIndex Pc SmartContract Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
## Track Liquidity Add Events for a Token on Four Meme This query tracks liquidity addition events for a specific token on the Four Meme Exchange. It listens for `LiquidityAdded` events emitted from the exchange's smart contract (`0x5c952063c7fc8610ffdb798152d69f0b9550762b`) BNB network In this example, the query monitors liquidity events for a specific token (`0x5a49ce64a1e44f6fce07e9ff38f54dde8a8a0e94`) by filtering the event arguments to only include actions related to this token. You can run the query [here](https://ide.bitquery.io/Liquidity-Added-to-specific-tokens-on-Four-meme)
Click to expand GraphQL query ```graphql { EVM(dataset: realtime, network: bsc) { Events( limit: {count: 20} where: {LogHeader: {Address: {is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b"}}, Log: {Signature: {Name: {is: "LiquidityAdded"}}}, Arguments: {includes: {Name: {is: "token1"}, Value: {Address: {is: "0x5a49ce64a1e44f6fce07e9ff38f54dde8a8a0e94"}}}}} ) { Block { Time Number Hash } Receipt { ContractAddress } Topics { Hash } TransactionStatus { Success } LogHeader { Address Index Data } Transaction { Hash From To } Log { EnterIndex ExitIndex Index LogAfterCallIndex Pc SmartContract Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_Boolean_Value_Arg { bool } } } } } } ```
## Check if a Four.meme Token is Phishy This elaborative API approach uses two queries to detect if a Four Meme token is potentially phishy by analyzing the relationship between token transfers and trades. This approach helps identify tokens where recipients received tokens without purchasing them, which is a common pattern in phishing or airdrop scams. ### How It Works The detection method works by: 1. **First Query**: Get the first transfers of a token to addresses - this provides the timestamp of when each address first received the token. 2. **Second Query**: Check if those addresses ever bought the token and when - pass the address list from the first query as a variable to check their purchase history. 3. **Analysis**: Compare transfer times and trade times in your code: - If an address **never bought** the token, it's suspicious. - If an address's **first buy time is later than the first transfer time**, it indicates the token was received before being purchased, which is a red flag for phishing behavior. Above analysis means someone else transferred the token to them which is phishy because devs often send token to famous KOLs or Influential People in crypto space to misguide traders. We are taking here example of `0x35a7bb282d8caafe71617c9d52ee30f1adfe4444` token, this may or may not be phishy as we are not running the further comparison between timestamps. Here we are just demonstrating that how you can get data from Bitquery and later run basic analysis on it. ### Query 1: Get First Transfers of a Token to Addresses This query retrieves the first transfer of a token to each address, providing the timestamp when each address first received the token. [Run Query](https://ide.bitquery.io/first-transfers-of-a-token_5)
Click to expand GraphQL query ```graphql query MyQuery($token: String) { EVM(network: bsc, dataset: combined) { Transfers( limit: { count: 1000 } orderBy: { ascendingByField: "Block_first_transfer" } where: { TransactionStatus: { Success: true } Transfer: { Receiver: { notIn: [ "0x5c952063c7fc8610ffdb798152d69f0b9550762b" "0x757eba15a64468e6535532fcF093Cef90e226F85" ] } Currency: { SmartContract: { is: $token } } } } ) { Transfer { Receiver } Block { first_transfer: Time(minimum: Block_Time) } total_transferred_amount: sum(of: Transfer_Amount) } } } ``` ```json { "token": "0x35a7bb282d8caafe71617c9d52ee30f1adfe4444" } ```
### Query 2: Get First Buys of an Address List for a Specific Token This query checks if the addresses from Query 1 ever bought the token and when. Pass the address array from Query 1 as a variable to this query. [Run Query](https://ide.bitquery.io/get-first-buys-of-an-address-list-of-a-specific-token_2)
Click to expand GraphQL query ```graphql query MyQuery($token: String!, $buyersList: [String!]) { EVM(network: bsc, dataset: combined) { DEXTradeByTokens( orderBy: { ascendingByField: "Block_first_buy" } where: { Trade: { Currency: { SmartContract: { is: $token } } Dex: { ProtocolFamily: { is: "FourMeme" } } Side: { Type: { is: buy } } Buyer: { in: $buyersList } } TransactionStatus: { Success: true } } ) { Trade { Buyer Currency { Name Symbol SmartContract } Side { Type } } Block { first_buy: Time(minimum: Block_Time) } total_bought_amount: sum(of: Trade_Amount) } } } ``` ```json { "token": "0x35a7BB282d8CAAFe71617c9d52EE30F1adFe4444", "buyersList" : [Pass the Address list you getting in Query 1] } ```
### Implementation Notes - Extract the address list and first transfer timestamps from Query 1 - Pass the address array as a variable to Query 2 - Compare the timestamps for all addresses: - If `firstTransferTime < firstBuyTime` or `firstBuyTime` is null → **Phishy indicator** - If `firstBuyTime <= firstTransferTime` → **Normal behavior** - You can implement this logic in your application code to automatically flag suspicious tokens ## Metadata for a Newly Created Token This query will fetch you trade metrics, such as marketcap, trade volume, token holders and creation time for a newly created Four Meme token on BSC network.
Click to expand GraphQL query ```graphql query MyQuery($token: String!) { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: $token } } } } ) { Block { createdAt: Time(minimum: Block_Time) } volume: sum(of: Trade_Side_AmountInUSD) } } holders: EVM(network: bsc, dataset: combined) { Holders( where: { Currency: { SmartContract: { is: $token } } Balance: { Amount: { gt: "0" } } } ) { count: uniq(of: Holder_Address) } } marketCap: Trading { Pairs( where: { Interval: { Time: { Duration: { eq: 1 } } } Market: { Network: { is: "Binance Smart Chain" } } Volume: { Usd: { gt: 5 } } Token: { Address: { is: $token } } } orderBy: { descending: Interval_Time_Start } limit: { count: 1 } ) { Price { Average { Mean } } marketcap: calculate(expression: "Price_Average_Mean * 1000000000") } } } ```
## Top Traders of a token This query will fetch you top traders of a Four Meme token for the BSC network. You can test the query [here](https://ide.bitquery.io/top-traders-of-a-four-meme-token_1).
Click to expand GraphQL query ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network, dataset: combined) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {ProtocolName: {is: "fourmeme_v1"}}}} ) { Trade { Buyer Dex { OwnerAddress ProtocolFamily ProtocolName } } buyVolume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) sellVolume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "bsc", "token": "0x37e3a59843b056e063780402ef25e12dca394444" } ```
## Get liquidity of a Four Meme token Using below API you can get the liquidity of a four meme token. Subtract `200000000` from the Balance that this query returns because 200M tokens are reserved which gets transferred to pancakeswap when this fourmeme token graduates.
Click to expand GraphQL query ```graphql query MyQuery { EVM(network: bsc) { Balances( where: { Balance: { Address: { is: "0x5c952063c7fc8610FFDB798152D69F0B9550762b" } } Currency: { SmartContract: { is: "0x87c5b3da05b062480b55c2dbf374ccd084f74444" } } } ) { Currency { Name } Balance { Amount } } } } ```
--- ## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply) The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which. ### Get All DEX Trades on FourMeme With Price, Market Cap, and Supply Stream **all FourMeme DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Protocol: FourMeme`** to capture every swap across FourMeme in a single subscription. You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/Get-All-DEX-Trades-on-Four-meme-With-Price-Market-Cap-and-Supply).
Click to expand GraphQL query ```graphql subscription { Trading { Trades( where: { Pair: { Market: { ProtocolFamily: { is: "FourMeme" } } } } ) { 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 } Currency { Symbol Id Name } QuoteCurrency { Id Name Symbol } Token { Address Id IsNative Symbol TokenId Network } QuoteToken { Address Id IsNative Symbol TokenId Network } } Price PriceInUsd } } } ```
### Top Traders by PnL for a Specific FourMeme Token (Last 30 Minutes) Rank traders by **`PnL`** on specific bonding curve: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **curve-specific trader analytics**. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-token_2).
Click to expand GraphQL query ```graphql { Trading { Trades( limit: { count: 10 } orderBy: { descendingByField: "PnL" } where: { Block: { Time: { since_relative: { minutes_ago: 30 } } } Pair: { Token: { Address: { is: "0x1f60df4bf4f08498ee4a111058c99774b81e4444" } } } } ) { 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" } }) } } } ```
--- ## Frequently asked questions (Four Meme + Bitquery) {#frequently-asked-questions-four-meme-bitquery} These mirror common “answer engine” questions. Each item points to the section on **this page** unless noted. | Question | Where it is answered | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | How do I get live Four Meme trades using Bitquery? | [Live trades subscription](#subscribe-the-latest-trades-on-four-meme) (`fourmeme_v1` + `DEXTrades`) | | How do I detect Four Meme token migrations to PancakeSwap? | [Migration subscription](#track-all-four-meme-tokens-that-have-migrated-to-pancakeswap) and [check if migrated](#check-if-a-four-meme-token-has-migrated-or-not) | | How do I get bonding curve progress for a Four Meme token? | [Bonding curve formula + balance query](#bonding-curve-progress-api-for-fourmeme-token) | | What is the Four Meme exchange contract address on BSC? | [Contract address](#what-is-the-four-meme-exchange-contract-address-on-bsc) | | How do I get newly created tokens on Four Meme? | [TokenCreate query](#get-newly-created-tokens-on-four-meme) | | How do I stream Four Meme token creation events in real time? | [TokenCreate subscription](#how-do-i-stream-four-meme-token-creation-events-in-real-time) | | How do I get top tokens by volume on Four Meme? | [Top tokens by volume / activity](#top-tokens-by-buys-sells-volume-price-change-buyers-sellers) and [realtime market cap leaderboard](#top-four-meme-tokens-by-realtime-marketcap) | | Can I monitor Four Meme transactions in the BSC mempool before confirmation? | **Separate guide:** [Four Meme Mempool API](/docs/blockchain/BSC/four-meme-mempool-API/) (not duplicated on this page) | | How do I get Four Meme OHLCV data for a token? | [OHLCV query](#get-ohlcv-data-of-a-four-meme-token) | | Can the API return four.meme token volume changes every second? | **Not documented on this page yet** — add minimum interval, aggregation options, and any rate or streaming limits you want to communicate publicly. | ## Video Tutorial | How to get Bonding Curve Progress of any Four Meme Token ## Video Tutorial | How to track the Four Meme Tokens which are about to Graduate in Realtime ## Video Tutorial | How to get Liquidity of a Four Meme Token ## Video Tutorial | How to get Top Traders of a Four Meme Token on Solana Four Meme DEX ## Video Tutorial | How to Get the OHLCV Data of a token on Four Meme DEX ## Real World Projects with Four Meme API ### Building a Four Meme Dashboard - [Tutorial](https://learnblockchain.cn/article/12532) - [Source Code](https://github.com/Kshitij0O7/four-meme-dashboard) - [Video](https://youtu.be/mwmoZAo7oFE?si=_-4n2fL-lH6la-8i) ### Four Meme Sniper Bot - [Tutorial](/docs/streams/sniper-trade-using-bitquery-kafka-stream/) - [Source Code](https://github.com/Kshitij0O7/evm-sniper) - [Video](https://youtu.be/vgOHgqTJmj0?si=yfUguMWdMtxRJMvg) --- ## Four Meme Mempool API URL: https://docs.bitquery.io/docs/blockchain/BSC/four-meme-mempool-API/ Four Meme Mempool API: watch BNB Chain pending transactions before confirmation with Bitquery GraphQL subscriptions. Built for traders and analytics teams. # Four Meme Mempool API - Real-Time Pre-Confirmation Monitoring :::tip Need real-time Four.meme 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 Four.meme swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Four.meme data older than ~30 days**, raw per-swap detail, or call / event context. ::: Monitor Four Meme memecoin activity in the BSC mempool before transactions are confirmed on-chain. Track pending trades, new token launches, bonding curve progress, and detect MEV opportunities with Bitquery's ultra-low latency Mempool APIs and Kafka Streams. Get ahead of the market by monitoring mempool activity for Four Meme tokens before they hit the blockchain. Perfect for MEV bots, sniper bots, and advanced trading strategies. For live DEX prices and volume after tokens trade on-chain, browse [DEXrabbit's Four.meme category](https://dexrabbit.bitquery.io/categories/four-meme-ecosystem). :::note To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token. Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/) ::: --- ## Table of Contents ### 1. [How Mempool Monitoring Works](#how-mempool-monitoring-works) ### 2. Mempool Trading & Market Data - [Stream Four Meme Trades in Mempool ➤](#stream-four-meme-trades-in-mempool---detect-early) - [Monitor Specific Token Trades in Mempool ➤](#monitor-specific-token-trades-in-mempool) - [Track Large Buys in Mempool ➤](#track-large-buys-in-mempool) - [Track Large Sells in Mempool ➤](#track-large-sells-in-mempool) ### 3. Token Creation & Launches - [Stream Four Meme Token Creation in Mempool ➤](#stream-four-meme-token-creation-in-mempool---be-first) - [Monitor Token Launches with Metadata ➤](#monitor-token-launches-with-metadata) ### 4. Liquidity & Migrations - [Track Liquidity Add Events in Mempool ➤](#track-liquidity-add-events-in-mempool) - [Monitor Token Migrations to PancakeSwap ➤](#monitor-token-migrations-to-pancakeswap-in-mempool) - [Track Bonding Curve Completion in Mempool ➤](#track-bonding-curve-completion-in-mempool) ### 5. Advanced Mempool Strategies - [Monitor Wallet Activity in Mempool ➤](#monitor-wallet-activity-in-mempool) - [Track Smart Money Trades in Mempool ➤](#track-smart-money-trades-in-mempool) - [Detect Potential Rug Pulls in Mempool ➤](#detect-potential-rug-pulls-in-mempool) ### 6. [Kafka Streams for Ultra-Low Latency](#kafka-streams-for-ultra-low-latency) ### 7. [Use Cases & Trading Strategies](#use-cases--trading-strategies) --- ## How Mempool Monitoring Works When a transaction is broadcasted to the BSC network but not yet included in a block, Bitquery captures and processes it through mempool monitoring: - **Transaction Simulation**: The transaction is executed in the EVM using the current pending block context - **Data Extraction**: The system captures the simulated receipt, trace, and event logs - **Real-time Streaming**: Data is made available instantly through GraphQL subscriptions and Kafka streams - **Block Context**: Each batch of simulated transactions includes the block header used as execution context **Why Monitor Mempool?** - **First-mover Advantage**: Detect opportunities before they're confirmed on-chain - **MEV Opportunities**: Identify profitable front-running and back-running opportunities - **Sniper Bots**: Be first to trade newly launched tokens - **Risk Management**: Detect large sells or potential rug pulls before execution - **Market Intelligence**: Monitor smart money and whale activity in real-time :::tip We provide both GraphQL streams (easy to use) and Kafka streams (ultra-low latency) for mempool monitoring. For production MEV and sniper bots, we recommend Kafka streams. Read more: [Kafka Protobuf Streams for EVM ➤](/docs/streams/protobuf/chains/EVM-protobuf/) ::: --- ## Mempool Trading & Market Data ### Stream Four Meme Trades in Mempool - Detect Early Monitor all Four Meme DEX trades in real-time as they appear in the mempool, before they are confirmed on-chain. This allows you to detect trading opportunities early and execute front-run or back-run strategies. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-mempool-trades)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Sell { Seller Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Dex { ProtocolName ProtocolFamily } } Transaction { Hash From To Gas GasPrice } Block { Time } } } } ```
### Monitor Specific Token Trades in Mempool Track pending trades for a specific Four Meme token. Perfect for monitoring price impact before large trades execute. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-specific-token-mempool-trades_3)
Click to expand GraphQL query ```graphql subscription($token: String) { EVM(network: bsc mempool:true) { DEXTrades( where: {Trade:{Dex:{ProtocolFamily:{is:"FourMeme"}}} any:[{Trade:{Buy:{Currency:{SmartContract:{is:$token}}}}},{Trade:{Sell:{Currency:{SmartContract:{is:$token}}}}}]} ) { Block{ Time } Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount Price PriceInUSD } Dex{ ProtocolFamily } Sell { Seller Currency { Name Symbol SmartContract } Amount PriceInUSD } } Transaction { Hash From Gas GasPrice } } } } { "token": "0x444416a582466fdae0f2fcdf0a859675f8ff6e9f" } ```
### Track Large Buys in Mempool Monitor large buy orders in the mempool to detect whale activity and potential price pumps. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-large-buys-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Buy: { AmountInUSD: { gt: "1000" } } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount AmountInUSD Price PriceInUSD } Sell { Currency { Name Symbol } Amount } } Transaction { Hash From Gas GasPrice } Block { Time } } } } ```
### Track Large Sells in Mempool Detect large sell orders before they execute to protect against price dumps. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-large-sells-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Sell: { AmountInUSD: { gt: "1000" } } } } ) { Trade { Buy { Currency { Name Symbol } Amount } Sell { Seller Currency { Name Symbol SmartContract } Amount AmountInUSD Price PriceInUSD } } Transaction { Hash From Gas GasPrice } } } } ```
--- ## Token Creation & Launches ### Stream Four Meme Token Creation in Mempool - Be First Track new Four Meme token creations in the mempool instantly. Be the absolute first to know when a new token is being created, before it's confirmed on-chain. Critical for sniper bots. [Run Stream ➤](https://ide.bitquery.io/track-Four-meme-token-creation-in-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: { Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "TokenCreate" } } } } ) { Log { Signature { Name Signature } } Arguments { Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... 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 } } Name Type } Transaction { Hash To From Gas GasPrice } Block { Time } } } } ```
### Monitor Token Launches with Metadata Get complete token information including name, symbol, and creator details from mempool. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-token-creation-with-metadata-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: { Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "TokenCreate" } } } } ) { Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } Transaction { Hash From } Block { Time } } } } ```
--- ## Liquidity & Migrations ### Track Liquidity Add Events in Mempool Monitor when liquidity is being added to Four Meme tokens before confirmation. Important for detecting graduation events. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-liquidity-add-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: { LogHeader: { Address: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { is: "LiquidityAdded" } } } } ) { Log { Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Integer_Value_Arg { integer } } } Transaction { Hash From } Block { Time } } } } ```
### Monitor Token Migrations to PancakeSwap in Mempool Track when Four Meme tokens are graduating to PancakeSwap before the migration completes. Critical for trading strategies. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-migration-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: { Log: { Signature: { Name: { in: ["PairCreated", "PoolCreated"] } } } Transaction: { To: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } } ) { Log { Signature { Name Signature } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } } } Transaction { Hash From To Gas GasPrice } } } } ```
### Track Bonding Curve Completion in Mempool Monitor tokens that are about to complete their bonding curve (near graduation) in the mempool. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-bonding-curve-completion-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { Events( where: { LogHeader: { Address: { is: "0x5c952063c7fc8610ffdb798152d69f0b9550762b" } } Log: { Signature: { Name: { in: ["LiquidityAdded", "TokenGraduated", "PairCreated"] } } } } ) { Log { Signature { Name } } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } } } Transaction { Hash From } } } } ```
--- ## Advanced Mempool Strategies ### Monitor Wallet Activity in Mempool Track specific wallet addresses (smart money, whales, or known traders) and their pending Four Meme trades. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-wallet-monitoring-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } Transaction: { From: { is: "0x7db00d1f5b8855d40827f34bb17f95d31990306e" } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount AmountInUSD } Sell { Seller Currency { Name Symbol SmartContract } Amount AmountInUSD } } Transaction { Hash From Gas GasPrice } } } } ```
### Track Smart Money Trades in Mempool Monitor multiple smart money wallets simultaneously for their Four Meme trading activity in mempool. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-smart-money-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } } Transaction: { From: { in: [ "0x7db00d1f5b8855d40827f34bb17f95d31990306e" "0x1234567890123456789012345678901234567890" "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd" ] } } } ) { Trade { Buy { Buyer Currency { Name Symbol SmartContract } Amount AmountInUSD } Sell { Currency { Name Symbol } Amount } } Transaction { Hash From } } } } ```
### Detect Potential Rug Pulls in Mempool Monitor for suspicious activity like developers selling large amounts in mempool. [Run Stream ➤](https://ide.bitquery.io/Four-Meme-rug-pull-detection-mempool)
Click to expand GraphQL query ```graphql subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "fourmeme_v1" } } Sell: { AmountInUSD: { gt: "5000" } } } } ) { Trade { Sell { Seller Currency { Name Symbol SmartContract } Amount AmountInUSD } Buy { Currency { Name Symbol } } } Transaction { Hash From Gas GasPrice } Block { Time } } } } ```
--- ## Kafka Streams for Ultra-Low Latency For production-grade applications like MEV bots and sniper bots, we recommend using Kafka streams instead of GraphQL subscriptions. Kafka streams provide: - **Sub-second Latency**: Faster than GraphQL streams - **Higher Throughput**: Handle thousands of transactions per second - **Better Reliability**: Built-in retry and error handling - **Scalability**: Horizontal scaling for high-volume applications **Protobuf Message Format:** ```protobuf message BroadcastedTransactionsMessage { Chain Chain = 1; BlockHeader Header = 2; repeated Transaction Transactions = 3; } ``` ### Benefits for Trading Bots: - **MEV Bots**: Execute front-running and back-running strategies with minimal latency - **Sniper Bots**: Be first to trade newly launched tokens - **Arbitrage Bots**: Detect and execute arbitrage opportunities instantly - **Monitoring Bots**: Track market activity with enterprise-grade reliability **Learn More:** - [Kafka Protobuf Streams Documentation ➤](/docs/streams/kafka-streaming-concepts/) - [Building a Sniper Bot with Kafka ➤](/docs/streams/sniper-trade-using-bitquery-kafka-stream/) - [Contact Us for Kafka Stream Access ➤](https://t.me/Bloxy_info) --- ## Use Cases & Trading Strategies ### Sniper Bot Strategy 1. Monitor token creation events in mempool 2. Analyze token metadata and creator 3. Execute buy immediately after confirmation 4. Set take-profit and stop-loss levels ### Front-Running Strategy 1. Detect large buy orders in mempool 2. Calculate potential price impact 3. Execute buy with higher gas price 4. Sell after original transaction confirms ### Rug Pull Protection 1. Monitor developer wallet activity 2. Detect large sells in mempool 3. Execute sell before rug pull completes 4. Protect your investment ### Smart Money Following 1. Track known profitable wallets 2. Copy their trades in mempool 3. Execute simultaneously or front-run 4. Profit from their market insights ### Graduation Trading 1. Monitor bonding curve progress 2. Detect imminent graduations in mempool 3. Position before PancakeSwap migration 4. Capture migration price pump --- ## Related Resources You may also be interested in: - [Four Meme API Documentation ➤](/docs/blockchain/BSC/four-meme-api/) - [BSC Mempool Stream ➤](/docs/blockchain/BSC/bsc-mempool-stream/) - [BSC DEX Trades API ➤](/docs/blockchain/BSC/bsc-dextrades/) - [Kafka Protobuf Streams ➤](/docs/streams/protobuf/chains/EVM-protobuf/) - [WebSocket Subscriptions ➤](/docs/authorization/websocket/) - [Building a Sniper Bot Tutorial ➤](/docs/streams/sniper-trade-using-bitquery-kafka-stream/) ## Need Help? If you have any questions or need assistance with Four Meme mempool monitoring, reach out to our [Telegram support](https://t.me/Bloxy_info). For enterprise solutions and Kafka stream access, contact our team for a custom plan. --- ## GMX Staking API on Arbitrum URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/gmx-api/ Query GMX staking positions, esGMX rewards, and related on-chain activity on Arbitrum with Bitquery GraphQL APIs. Works with WebSocket live subscriptions. # GMX API This section covers how to retrieve staking information on GMX. GMX is one venue within our [Arbitrum API](https://bitquery.io/blockchains/arbitrum-blockchain-api) coverage — the page lists DEX trades, transfers, NFTs and balances on Arbitrum One. You can read more about the [GMX ecosystem in this blog](https://bitquery.io/blog/gmx). ## Video Tutorial on GMX and esGMX ## New Positions by Trader The following query retrieves new positions created by a specific trader on the GMX DEX ```graphql { EVM(dataset: archive, network: arbitrum) { Events( where: { Log: { SmartContract: { is: "0x489ee077994B6658eAfA855C308275EAd8097C4A" }, Signature: { Name: { is: "IncreasePosition" } } }, Arguments: { includes: { Name: { is: "account" }, Value: { Address: { is: "0x92812499fF2c040f93121Aab684680a6e603C4A7" } } } } } orderBy: { descending: Block_Time } ) { Log { Signature { Name Parsed Signature } } Arguments { Name Type 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 } } } Block { Time } } } } ``` ## Latest Liquidated Positions The following query retrieves the latest liquidated positions on the GMX DEX, providing information on the account, collateral token, index token, position, reserve amount, realised PnL, and mark price. ```graphql { EVM(dataset: archive, network: arbitrum) { Events( where: { Log: { SmartContract: { is: "0x489ee077994B6658eAfA855C308275EAd8097C4A" }, Signature: { Name: { is: "LiquidatePosition" } } } } limit: { count: 100 } orderBy: { descending: Block_Time } ) { Log { Signature { Name Parsed Signature } } Block { Time } Call { Signature { Name } } Transaction { Hash } Arguments { Name Type 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 } } } } } } ``` ## Latest GMX Events You can run the query [here](https://ide.bitquery.io/latest-GMX-Events). The following query retrieves the latest GMX events on the Arbitrum network: ```graphql { EVM(network: arbitrum) { Events( where: { Log: { SmartContract: { is: "0x489ee077994B6658eAfA855C308275EAd8097C4A" } } } orderBy: { descending: Block_Time } limit: { count: 10 } ) { Log { Signature { Name Parsed Signature } } Arguments { Name Type 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 } } } Block { Time } } } } ``` These queries help you explore the latest activities and positions on the GMX protocol. --- ## Minara Launchpad API on Arc: Tokens, Trades and OHLCV URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/minara-launchpad-api/ Track Minara.fun launches on Circle's Arc blockchain. Verify token creators and pools, then query trades, USD prices and OHLCV with Bitquery's Trading cubes. # Minara Launchpad API on Arc: Tokens, Trades and OHLCV Track [Minara.fun](https://minara.fun/) token launches on Arc, Circle's EVM blockchain. Verify each token's launch and creator from on-chain events, then use the Trading cubes for swaps, pool prices and token candles. Use `EVM.Events` for launch records. Trading examples use `Trading.Trades`, `Trading.Pairs` and `Trading.Tokens`, with the Arc network ID `bid:arc`. :::note API access and history Run the saved queries in the Bitquery IDE, or create an [API access token](/docs/authorization/how-to-generate/) for `https://streaming.bitquery.io/graphql`. Streams use `wss://streaming.bitquery.io/graphql` with [WebSocket authorization](/docs/authorization/websocket/). Leave `dataset` unset in these examples. A 24-hour filter does not promise 24 hours of indexed Arc history. Check [data coverage and retention](/docs/graphql/data-coverage-retention/) before requesting older launches. ::: ## Contracts and launch identity Minara's [contract list](https://api.minara.fun/minara-fun/contracts?chainId=5042) and [launch strategy list](https://api.minara.fun/minara-fun/launch-strategies?chainId=5042) publish these Arc addresses. Check the lists for new deployments and retain verified older addresses in your own registry. | Contract | Arc address | | --- | --- | | Liquidity Launcher, launch entry point | `0xb6c6f77ee74af874a183bfd77dd0176d1ac91de6` | | Current InstantLaunchStrategyWithHook | `0x4d3a3f4e1a918845c2038bc064c4d250822b203e` | | Shared UERC20Factory | `0xff99d8f6c994607576eb652edcf12e04a7ebfbf6` | | Minara fee hook | `0xb6a65950534f061618b4ae102fbcbb8541a8e0cc` | | Uniswap v4 PoolManager | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | The fee hook emits `PoolRegistered`, which records the pool ID, token and creator. The token factory is shared; its `TokenCreated` event alone cannot prove that a token came from Minara. A shared PoolManager address also cannot identify one pool. ### Find recent launches Filter by Minara's verified strategy address and its `TokenLaunched` signature. Success and revert checks exclude failed launches. This feed covers the listed strategy; it does not claim every historical Minara deployment. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-latest-launches) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: {Address: {in: ["0x4d3a3f4e1a918845c2038bc064c4d250822b203e"]}, Removed: false} Log: {Signature: {SignatureHash: {is: "3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index Data} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` In the zero-based `Topics` array: - `Topics[0].Hash` is the event signature. - `Topics[1].Hash` is the pool ID. - `Topics[2].Hash` is the token address, padded to 32 bytes. - `Topics[3].Hash` is `finalPositionRecipient`, the LP position recipient. Read the creator from `PoolRegistered`. Take the final 40 hex characters of the token topic and add `0x`. Prefix that address with `bid:arc:` for Trading queries. For `Trading` pool filters, keep all 64 hex characters of the pool topic and add `0x` if absent. Pass that value as `Pool.Id`. ## Verify a token, pool and creator The sample token is `0xa163d7624da3b5d9182c50eab5b8cd247ae861bb`, named Minara. A token's name is user-supplied and does not establish ownership by the platform. | Sample field | Verified value | | --- | --- | | Launch pool ID | `0xd77a1efbc8d143b100cf2496ff970da0a616a6796886e6ba1f45e7d7e09bb150` | | Creator at launch | `0x47ba13f9cc965fc89d7c7fb2f568fe873ad31751` | | Launch transaction | `0xf4bda4c4dc4b8a28f0367abe0587aa2de369e885a8b8ce56e32ebe65df11747b` | ### Read the launch receipt Fetch the four contract/event pairs from the same successful transaction. Compare their values using the checks below. To verify another launch, replace the transaction hash with one returned by the launch feed. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-launch-receipt) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {ascending: LogHeader_Index} where: { Transaction: {Hash: {is: "0xf4bda4c4dc4b8a28f0367abe0587aa2de369e885a8b8ce56e32ebe65df11747b"}} TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: {Removed: false} any: [ {LogHeader: {Address: {in: ["0x4d3a3f4e1a918845c2038bc064c4d250822b203e"]}}, Log: {Signature: {SignatureHash: {is: "3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4"}}}} {LogHeader: {Address: {in: ["0xff99d8f6c994607576eb652edcf12e04a7ebfbf6"]}}, Log: {Signature: {SignatureHash: {is: "4ef8284ecf42d4cd19686572ffd87f630858c82398911e776cb831de35eddbf4"}}}} {LogHeader: {Address: {in: ["0x8366a39cc670b4001a1121b8f6a443a643e40951"]}}, Log: {Signature: {SignatureHash: {is: "dd466e674ea557f56295e2d0218a125ea4b4f0f6f3307b95f85e6110838d6438"}}}} {LogHeader: {Address: {in: ["0xb6a65950534f061618b4ae102fbcbb8541a8e0cc"]}}, Log: {Signature: {SignatureHash: {is: "a5cdccdb5046ff61139bbc5a059c0de074321d78f08066766c498ac1818e7f0e"}}}} ] } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index Data} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` | Event and emitter | Values that must agree | | --- | --- | | `TokenLaunched`, verified strategy | Pool ID in topic 1; token in topic 2; hook in the fifth ABI data word | | `TokenCreated`, shared factory | Token in the last 20 bytes of the first ABI data word | | `Initialize`, PoolManager | Pool ID in topic 1; currencies in topics 2 and 3 include the token; hook in the third ABI data word | | `PoolRegistered`, Minara hook | Same pool ID in topic 1 and token in topic 2; creator in topic 3 | Topic positions in this table are zero-based. For raw `LogHeader.Data`, strip an optional `0x` and split into 64-character hex words. Addresses occupy each word's final 40 hex characters. The query returns candidate events; your application must check that the transaction, token, pool and hook agree. For the sample, all four events match. The LP position recipient is `0x000000000000000000000000000000000000dead`; the creator is the separate address above. Keep Bitquery's `LogHeader.Index` and Arc RPC's `logIndex` as separate fields. Their indexes differed for this sample, while the block hash, event addresses, topics and data matched. Compare those values within the same transaction when checking an RPC receipt. An old receipt may fall outside indexed history. An empty response then calls for a coverage check; it does not disprove the launch. ### Read pool creators and fee terms Filter the fee hook for `PoolRegistered`. These records give the creator at registration. The current creator role can change later; do not treat this feed as a current-owner list. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-pool-registrations) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: {Address: {in: ["0xb6a65950534f061618b4ae102fbcbb8541a8e0cc"]}, Removed: false} Log: {Signature: {SignatureHash: {is: "a5cdccdb5046ff61139bbc5a059c0de074321d78f08066766c498ac1818e7f0e"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index Data} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` `Topics[1].Hash` is the pool ID, `Topics[2].Hash` is the token and `Topics[3].Hash` is the creator. The first two ABI data words are `platformFeeBps` and `creatorFeeBps`. Decode them as unsigned integers; divide by 100 for percent. The sample records 75 and 25 basis points, or 0.75% and 0.25%. These are pool fee terms recorded at launch. They do not measure realized revenue or all fees and taxes a swap may pay. To attribute a launch to the listed strategy, also perform the four-event check. ### Stream new launches Subscribe with the same strategy and event filters. The decoded event name may be empty, so keep the signature and raw topics. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-launch-stream) ```graphql subscription { EVM(network: arc) { Events( where: { TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: {Address: {in: ["0x4d3a3f4e1a918845c2038bc064c4d250822b203e"]}, Removed: false} Log: {Signature: {SignatureHash: {is: "3b3d2bafdcae274a232217e1f80ee4305d3af6aa25c8b14b1681bd68d18042a4"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index Data} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` Save each token ID, pool ID, launch time, transaction hash and log index. Deduplicate Bitquery events by transaction hash and `LogHeader.Index`. Check the receipt to attach a verified creator. Trading subscriptions use fixed token filters. Resubscribe when your token list changes. Keep a checkpoint and query recent events after reconnecting to recover gaps. ## Trading queries The sample token trades on more than one pool. Token-wide turnover can include those other pools; select the pool ID when you need only the Minara launch pool. ### Recent trades for a Minara token Match the token as either `Pair.Token` or `Pair.QuoteToken`. The `Uniswap` family filter covers the observed v3/v4 markets; extend it only when you verify another venue. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-recent-trades) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` `Side` and `PriceInUsd` refer to `Pair.Token`. Reverse Buy/Sell when the token you follow is `Pair.QuoteToken`. `PriceInUsd` is an indexed reference price; the amount ratio gives the executed price. `Pair.Pool.Address` is the shared PoolManager on v4, so also keep `Pair.Pool.Id`. Neither the market address nor PoolManager address proves the token's launchpad. ### Stream token trades Use the same token filters over WebSocket. This stream follows indexed Uniswap trades across the sample token's pools. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-trade-stream) ```graphql subscription { Trading { Trades( where: { Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` For a watchlist, change both token `is` filters to `in` lists. Keep both pair orientations. ### Launch-pool volume, trades and traders Filter by the PoolManager address and the exact v4 pool ID. This sample selects the token as `Pair.Token`, so Buy/Sell refers to Minara token units. It measures only this pool and pair orientation. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-pool-activity) ```graphql query { Trading { Trades( where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: { Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Pool: {Address: {is: "0x8366a39cc670b4001a1121b8f6a443a643e40951"}, Id: {is: "0xd77a1efbc8d143b100cf2496ff970da0a616a6796886e6ba1f45e7d7e09bb150"}} Token: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}} } } ) { Pair {Token {Id Symbol} QuoteToken {Id Symbol} Pool {Address Id}} trades: count transactions: count(distinct: TransactionHeader_Hash) traders: count(distinct: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) buys: count(if: {Side: {is: "Buy"}}) sells: count(if: {Side: {is: "Sell"}}) } } } ``` Sum `AmountsInUsd.Quote` once per trade; adding base and quote USD amounts counts the same swap twice. A transaction may contain several swaps. Trader counts refer to wallet addresses, not people. Turnover is not profit, fee revenue or net inflow. :::caution Exact totals These aggregates count indexed rows. Check the [Trading Trades field notes](/docs/trading/crypto-trades-api/trades-api/#before-you-aggregate-three-things-about-a-trades-row) for duplicate-row limits. For audited totals, fetch the underlying trades and check their identities before summing. ::: ### Latest price from the launch pool Use `Trading.Pairs` for the selected pool's latest one-minute interval. The explicit pool filter keeps this query on the launch pool even if another market becomes the token's top market. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-pool-price) ```graphql query { Trading { Pairs( limit: {count: 1} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}} Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Pool: {Address: {is: "0x8366a39cc670b4001a1121b8f6a443a643e40951"}, Id: {is: "0xd77a1efbc8d143b100cf2496ff970da0a616a6796886e6ba1f45e7d7e09bb150"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} QuoteToken {Id Symbol} Pool {Address Id} Market {Network Protocol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Close}} Volume {Usd} } } } ``` Check `Interval.Time.End` for freshness. A quiet pool can return an old interval or no result within the requested window. ### One-minute token OHLCV candles `Trading.Tokens` combines indexed pools for the token. This returns up to 120 rows of one-minute intervals within the requested window; it is not limited to the launch pool. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-minara-ohlcv-candles) ```graphql query { Trading { Tokens( limit: {count: 120} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xa163d7624da3b5d9182c50eab5b8cd247ae861bb"}, NetworkBid: {is: "bid:arc"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Open High Low Close}} Volume {Base Usd} } } } ``` `Volume.Usd` is quoted USD volume and `Volume.Base` is token units. Missing intervals may be absent, and the current interval can change. Resolve repeated `Token.Id` / `Interval.Time.Start` keys before plotting from oldest to newest; do not sum repeated rows. See the [Tokens field notes](/docs/trading/crypto-price-api/tokens/#field-notes). To stream candles, change `query` to `subscription`, remove `limit`, `orderBy` and the historical `Block.Time` filter, and keep the token and interval filters. ## Next steps - [Arc Launchpads API](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) - [Tolly Launchpad API](/docs/blockchain/arc-mainnet/tolly-launchpad-api/) - [RadarDEX Launchpad API](/docs/blockchain/arc-mainnet/radardex-launchpad-api/) - [Arc Blockchain API](/docs/blockchain/arc-mainnet/) - [Trading Trades API](/docs/trading/crypto-trades-api/trades-api/) - [Minara docs](https://minara.fun/docs) --- ## Optimism API Documentation URL: https://docs.bitquery.io/docs/blockchain/Optimism/ Optimism data API overview: DEX trades and core chain APIs, how Bitquery differs from Optimism RPC, WebSocket and webhook support, and video tutorials. # Optimism API Documentation :::tip Building a trading app or DEX UI on Optimism? For **real-time trades and prices on Optimism** (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 Optimism 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 on Optimism via APIs and Streams. **[Create your account](https://account.bitquery.io/auth/signup)** to get started. If you need help getting data on Optimism, reach out to [support](https://t.me/Bloxy_info). ### What is Optimism API? Bitquery Optimism APIs help you fetch onchain data like trades, transactions, balances, etc using graphQL query. ### What are capabilities of Bitquery Optimism API? Bitquery Optimism 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 Optimism RPC and Bitquery Optimism API? | Optimism RPC | Bitquery Optimism API | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | JSON-RPC endpoint exposing raw Optimism on-chain state and transactions | GraphQL endpoint over pre-indexed, parsed Optimism 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 Optimism 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 Optimism: ```graphql query LatestOptimismTrades { EVM(network: optimism) { 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 - [Optimism Dex Trades](./optimism-dextrades) ## Core Optimism APIs - [Balance API](./optimism-balance-api) - [NFT](./optimism-nft) - [Transfers](./optimism-transfers) ## Videos ### Video Tutorial | Get Trending Optimism Tokens Using Bitquery API ### Video Tutorial | Get Optimism DEX Trades Data Using Bitquery API ### Video Tutorial | Get Top Traders on Optimism Using Bitquery API ### Video Tutorial | Get Latest Trades on Optimism Using Bitquery Subscriptions ## 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/) --- ## Optimism Address Balance API URL: https://docs.bitquery.io/docs/blockchain/Optimism/optimism-balance-api/ Optimism Address Balance API: fetch current and historical Optimism balances with Bitquery GraphQL balance queries. Great for bots, dashboards, and alerts. # Optimism Address Balance API The **Balances** API returns current and historical token balances for an address on Optimism. 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**. | Examples: [All Token Balances](#balance-of-an-address) · [Native ETH (Optimism)](#native-eth-optimism-balance) · [Balance on a Date](#balance-on-a-specific-date) · [Specific Token](#balance-for-a-specific-token) · [Holder Snapshot](#token-holder-snapshot) ## Balance of an Address Returns token balances for a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances. [Run in IDE](https://ide.bitquery.io/Optimism-Balance-of-an-Address) ```graphql query { EVM(network: optimism, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Native ETH (Optimism) Balance Returns the native ETH balance for a wallet on Optimism (not ERC-20 tokens). Filter with `Currency: { Native: true }` instead of a token contract address. [Run in IDE](https://ide.bitquery.io/optimism-native-balances-address) ```graphql query { EVM(network: optimism, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A" } } Currency: { Native: true } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` **Parameters** - `network: optimism`: Optimism mainnet. - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. - `Currency.Native: true`: Native ETH on Optimism only (see [Native ETH (Optimism) Balance](#native-eth-optimism-balance)). **Returned fields** - `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Balance on a Specific Date Use `Block.Date.till` for a point-in-time snapshot. Use `dataset: archive` for historical dates and addresses not recently active. [Run in IDE](https://ide.bitquery.io/optimism-balances-by-date) ```graphql query { EVM(network: optimism, dataset: archive) { Balances( where: { Block: { Date: { till: "2026-05-01" } } Balance: { Address: { is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance for a Specific Token Add a `Currency.SmartContract` filter. Always use the contract address, not the token name. Use `0x` for native ETH on Optimism, or the ERC-20 contract address for a token. [Run in IDE](https://ide.bitquery.io/optimism-balances-specific-token) ```graphql query { EVM(network: optimism, dataset: combined) { Balances( where: { Balance: { Address: { is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A" } } Currency: { SmartContract: { is: "0x23ee2343b892b1bb63503a4fabc840e0e2c6810f" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Token Holder Snapshot The number of unique holders, token supply, and Gini coefficient for the balance amount before a specific timestamp can be derived using the query below. These stats provide a useful holder snapshot for any given time. [Run in IDE](https://ide.bitquery.io/token-holder-snapshot-optimism)
Click to expand GraphQL query ```graphql query { EVM(network: optimism, dataset: archive) { Holders( where: { Currency: { SmartContract: { is: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" } } Balance: { Amount: { gt: "0" } LastChangeTime: { till: "2026-05-20T00:00:00Z" } } Holder: { Address: { not: "0x" } } } ) { Balance { LastChangeTime(maximum: Balance_LastChangeTime) } holders: uniq(of: Holder_Address) supply: sum(of: Balance_Amount) gini(of: Balance_Amount) } } } ```
## 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/optimism-balances-history-address) ```graphql query { EVM(network: optimism, dataset: archive) { Balances( where: { Balance: { Address: { is: "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A" } } Currency: {} } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` --- ## Optimism DEX Trades API: Every Swap on Optimism, Pairs, Traders and Prices URL: https://docs.bitquery.io/docs/blockchain/Optimism/optimism-dextrades/ Optimism DEX data with Bitquery GraphQL: live swaps with trader and USD, which DEXs trade, busiest pairs, top traders, token prices and top tokens. # Optimism DEX Trades API: Every Swap on Optimism, Pairs, Traders and Prices Optimism's DEX trading runs through Velodrome, which makes the most swaps and is indexed as `velodrome_v2` and `velodrome_slipstream` (see the [Velodrome API](/docs/blockchain/Optimism/velodrome-api) and [Slipstream API](/docs/blockchain/Optimism/velodrome-slipstream-api) pages), Uniswap v3 and v4, v2-style pairs, and Balancer. Bitquery indexes all of them into the chain cubes, `DEXTrades` for one row per swap and `DEXTradeByTokens` for one row per swap per token, and into the Trading cube, which adds the trader, USD price, market cap and supply on every row for the last month or so. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. Two Optimism details shape the examples: native USDC is `0x0b2c639c533813f4aa9d7837caf62653d097ff85` and the bridged USDC.e is `0x7f5c764cbc14f9669b88837ca1490cca17c31607`, and a few swaps in thin pools carry absurd USD values, so every USD sum here caps a single trade with `Side: { AmountInUSD: { lt: "10000000" } }`. ## Live swaps with trader and USD The [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api) of the Trading cube, filtered to the Optimism market. Each message is one swap with the side, the trader, both amounts in USD and the token's supply. Paste it into the [IDE](https://ide.bitquery.io) to run. ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Optimism" } } } }) { Block { Time } Side Trader { Address } Amounts { Base Quote } AmountsInUsd { Base Quote } Pair { Currency { Symbol Id } QuoteCurrency { Symbol } Market { Protocol Address } } Supply { MarketCap } } } } ``` ## Which DEXs trade on Optimism Group the last day by protocol. Saved query [here](https://ide.bitquery.io/trending-pairs-on-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Side: { AmountInUSD: { lt: "10000000" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "trades" } limit: { count: 20 } ) { Trade { Dex { ProtocolFamily ProtocolName } } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) traders: uniq(of: Transaction_From) } } } ``` ## The busiest pairs Tokens traded against WETH, USDC or USDC.e over the last day, ranked by USD volume, with distinct buyers and sellers and the latest price. [DEXrabbit](https://dexrabbit.bitquery.io/optimism) shows the same table live. ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Side: { AmountInUSD: { lt: "10000000" } Currency: { SmartContract: { in: [ "0x4200000000000000000000000000000000000006" "0x0b2c639c533813f4aa9d7837caf62653d097ff85" "0x7f5c764cbc14f9669b88837ca1490cca17c31607" ] } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 30 } ) { Trade { Currency { Symbol SmartContract } Side { Currency { Symbol } } } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) price: Trade { PriceInUSD(maximum: Block_Time) } } } } ``` ![Trending pairs on Optimism](/img/dexrabbit/optimism_trending_pairs.png) ## Latest swaps, live The raw `DEXTrades` stream for the chain: pool-side buy and sell with USD on both, the protocol and the transaction. Saved stream [here](https://ide.bitquery.io/Realtime-optimism-dex-trades-websocket). ```graphql subscription { EVM(network: optimism) { DEXTrades { Block { Time } Trade { Dex { ProtocolName SmartContract } Buy { Currency { Symbol } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol } Amount AmountInUSD } } Transaction { Hash From } } } } ``` ## Top traders on Optimism Rank by `Transaction.From` over the last day. Saved query [here](https://ide.bitquery.io/top-traders-on-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Side: { AmountInUSD: { lt: "10000000" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 50 } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) tokens: uniq(of: Trade_Currency_SmartContract) } } } ``` ![Top traders on Optimism](/img/dexrabbit/optimism_top_traders.png) ## Top traders of one pair Fix the token and the quote. The example is WETH against native USDC over the last day; the saved query used WLD/USDC, a quieter pair that needs a week. Saved query [here](https://ide.bitquery.io/top-traders-for-wld-usdc-pair). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x4200000000000000000000000000000000000006" } } Side: { AmountInUSD: { lt: "10000000" } Currency: { SmartContract: { is: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" } } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` ![Top traders for a pair](/img/dexrabbit/optimism_top_pair_traders.png) ## Latest price of a token The newest `DEXTradeByTokens` row for a token carries its price in USD and the quote it traded against; the example is WBTC. For a price in a specific quote, filter the quote under `Side` as well, as in the WETH in USDC.e example. Saved queries: [WBTC in USD](https://ide.bitquery.io/Get-latest-price-of-WBTC-in-USD-on-optimism), [WETH in USDC.e](https://ide.bitquery.io/Price-of-WETH-in-terms-of-USDC-on-Optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x68f180fcCe6836688e9084f035309E29Bf0A2095" } } } } limit: { count: 1 } orderBy: { descending: Block_Time } ) { Block { Time } Trade { PriceInUSD Price Side { Currency { Symbol } } Dex { ProtocolName } } } } } ``` Change `query` to `subscription` and drop `limit` and `orderBy` to stream each new price; WBTC trades often enough on Optimism for that to update every few minutes. ## Top tokens by trades Tokens ranked by number of trades over the last day, with buyers, sellers, pools and volume. Saved query [here](https://ide.bitquery.io/top-tokens-on-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Side: { AmountInUSD: { lt: "10000000" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "trades" } limit: { count: 50 } ) { Trade { Currency { Symbol SmartContract } } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) pools: uniq(of: Trade_Dex_SmartContract) } } } ``` ![Top tokens on Optimism](/img/dexrabbit/optimism_top_tokens.png) ## Related pages - [Optimism API hub](/docs/blockchain/Optimism/) - [Uniswap v4 on Optimism](/docs/blockchain/Optimism/uniswap-v4-api) - [Velodrome API](/docs/blockchain/Optimism/velodrome-api) - [Velodrome Slipstream API](/docs/blockchain/Optimism/velodrome-slipstream-api) - [Optimism transfers API](/docs/blockchain/Optimism/optimism-transfers) - [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api) - [DEXTrades vs DEXTradeByTokens vs Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades) --- ## Optimism NFT API: ERC-721 Transfers, Collections and Owners URL: https://docs.bitquery.io/docs/blockchain/Optimism/optimism-nft/ Query and stream ERC-721 transfers on Optimism with Bitquery GraphQL: latest transfers, one collection or token id, mints, senders and receivers. # Optimism NFT API: ERC-721 Transfers, Collections and Owners NFTs on Optimism are ERC-721 and ERC-1155 tokens, and Bitquery indexes every transfer of them in the `Transfers` cube under `EVM(network: optimism)` with `Currency.Fungible` set to `false`. Each row carries the collection contract, the token id, the sender, the receiver and the transaction, so one cube answers "what NFTs moved on Optimism just now", "who owns token 42 of this collection" and "every transfer of a collection since launch". 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 Optimism The most recent NFT transfers across all collections. Expect liquidity-position NFTs from DEXs such as Velodrome among them; they are ERC-721 tokens too. ```graphql { EVM(network: optimism) { 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 Filter on the collection contract. The example is the Velodrome Slipstream position NFT, a collection that moves every few seconds, so the stream shows rows at once; the saved IDE subscription [here](https://ide.bitquery.io/Transfers-of-a-particular-NFT#) uses another contract. A quiet collection can go hours between transfers, so test a filter as a query first with `limit` and `orderBy` added. ```graphql subscription { EVM(network: optimism) { Transfers( where: { Transfer: { Currency: { Fungible: false SmartContract: { is: "0x416b433906b1b72fa758e166e239c43d68dc6f29" } } } } ) { Block { Hash Number } Transfer { Amount Currency { Name Symbol Native } Sender Receiver } } } } ``` ## Current owner of each token The Holders cube does not carry per-collection balances for NFTs on Optimism, so read ownership from transfers instead: the receiver of a token's latest transfer is its current owner. `limitBy` on the token id keeps one row per token, newest first. Filter `Id` to check one token. ```graphql { EVM(network: optimism) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0x416b433906b1b72fa758e166e239c43d68dc6f29" } } } } orderBy: { descending: Block_Time } limitBy: { by: Transfer_Id, count: 1 } limit: { count: 20 } ) { Block { Time } Transfer { Id Receiver Sender } } } } ``` ## Useful filters - One token: `Id: { is: "42" }` inside `Transfer`. - Mints: `Sender: { is: "0x0000000000000000000000000000000000000000" }`. - One wallet: `Receiver` or `Sender` set to the address. - History: add `dataset: archive` or `combined` to the `EVM` root; without it the query reads the realtime window. ## Related pages - [Optimism API hub](/docs/blockchain/Optimism/) - [Optimism transfers API](/docs/blockchain/Optimism/optimism-transfers) - [Ethereum NFT collection API](/docs/blockchain/Ethereum/nft/nft-collection-api) - [Transfers cube](/docs/cubes/transfers-cube) --- ## Optimism Transfers API: Token and ETH Transfers, Whale Alerts, Backfills URL: https://docs.bitquery.io/docs/blockchain/Optimism/optimism-transfers/ Query and stream Optimism token and ETH transfers with Bitquery GraphQL: large USDT moves, one wallet, NFT transfers and gap-free backfills. # Optimism Transfers API: Token and ETH Transfers, Whale Alerts, Backfills Every ERC-20, ERC-721, ERC-1155 and native ETH transfer on Optimism lands in the `Transfers` cube under `EVM(network: optimism)`, with sender, receiver, amount, USD value where a price exists, the token's contract and symbol, and the transaction that carried it. The same filters run as a query for the latest rows or as a subscription for a live feed, and `dataset: combined` on the root reaches history. 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. ## Large transfers of one token USDT on Optimism, transfers of 10,000 or more in the last day. Saved as a live stream [here](https://ide.bitquery.io/Whale-transfers-of-USDT-on-optimism); the query form below is the same filter with a window and a limit. ```graphql { EVM(network: optimism) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" } } Amount: { ge: "10000" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Amount AmountInUSD Sender Receiver Currency { Symbol Name SmartContract } } Transaction { Hash } } } } ``` For an alert, change `query` to `subscription` and drop `Block`, `limit` and `orderBy`; each qualifying transfer arrives as it is indexed. ## Transfers of one wallet Filter `Sender` or `Receiver`, or both with an `any` block, on the address. Saved stream [here](https://ide.bitquery.io/Sender-is-a-particular-address); a wallet that is idle streams nothing, so run the query form with `dataset: combined` first to see what it has done. ```graphql { EVM(network: optimism, dataset: combined) { Transfers( where: { Transfer: { Sender: { is: "0xEbe80f029b1c02862B9E8a70a7e5317C06F62Cae" } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Amount AmountInUSD Currency { Name SmartContract Native Symbol } Receiver Sender } Transaction { Hash } } } } ``` ## NFT transfers `Currency.Fungible: false` keeps ERC-721 and ERC-1155 rows only; `Id` is the token id and `URI` the metadata link. Saved stream [here](https://ide.bitquery.io/NFT-Token-Transfers-API_1); the [Optimism NFT API](/docs/blockchain/Optimism/optimism-nft) page covers collections and holders. ```graphql { EVM(network: optimism) { Transfers( where: { Transfer: { Currency: { Fungible: false } } } limit: { count: 5 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Currency { Name Symbol SmartContract } Id Sender Receiver } } } } ``` ## Deterministic pagination for backfilling To load transfers into your own index without gaps or repeats, page in a fixed order. The composite `orderBy` over block number, transaction index, call index, log index, transfer index and type positions every transfer uniquely; move `offset` by `count` on each request. A single request can return up to 25,000 rows. This ordering runs on the realtime window; on the `archive` dataset, order by `Block_Number` and page through one block range at a time instead. Saved [here](https://ide.bitquery.io/Reliable-transfer-api). ```graphql { EVM(network: optimism) { Transfers( where: { Transfer: { Success: true } } orderBy: { ascending: [ Block_Number, Transaction_Index, Call_Index, Log_Index, Transfer_Index, Transfer_Type ] } limit: { count: 10, offset: 0 } ) { Block { Time Number } Transaction { Hash From Index } Transfer { Amount AmountInUSD Sender Receiver Index Currency { Symbol Name SmartContract Decimals Native } } Call { Index } Log { LogAfterCallIndex Index } Transfer { Type } } } } ``` Bound each pass with `Block: { Number: { ge: ..., le: ... } }` so the offset stays small per range. ## Related pages - [Optimism API hub](/docs/blockchain/Optimism/) - [Optimism NFT API](/docs/blockchain/Optimism/optimism-nft) - [Transfers cube](/docs/cubes/transfers-cube) - [Data coverage and retention](/docs/graphql/data-coverage-retention) --- ## Optimism Uniswap v4 API: Pools by PoolId, Swaps, Traders and Reserves URL: https://docs.bitquery.io/docs/blockchain/Optimism/uniswap-v4-api/ Uniswap v4 on Optimism with Bitquery GraphQL: the v4 pools of USDC by PoolId, live swaps, the ETH/USDC pool's stats, top traders and reserves. # Optimism Uniswap v4 API: Pools by PoolId, Swaps, Traders and Reserves Uniswap v4 on Optimism is small next to Base or BNB Chain: a few hundred swaps an hour, most of them in ETH/USDC, in the pool that converts between native USDC and the bridged USDC.e, and in OP/USDC. That shapes the queries on this page: windows are a day rather than an hour, and the stream examples pick pools that move. The venue itself works like v4 everywhere: one PoolManager, `0x9a13f98cb987694c9f086b1f5eb990eea8264ec3`, holds every pool; a pool is a `PoolId`, the hash of its tokens, fee, tick spacing and hook; and on raw swap rows the buyer and seller are both the PoolManager, so the trader is `Transaction.From`. 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. The worked token is native USDC, `0x0b2c639c533813f4aa9d7837caf62653d097ff85`, and the worked pool is ETH/USDC, `PoolId 0x51bf4cc5b8d9f7f759e41f572fe2a25bc2aeb42432bf12544a350595e5c8bb43`. ## The v4 pools of USDC on Optimism Group `DEXTradeByTokens` by `PoolId` with USDC in `Currency`. The rows are its pools with the counter token, trade count and USD volume; the ETH pool and the USDC.e pool lead. This is where a `PoolId` for the other queries comes from. Saved query [here](https://ide.bitquery.io/get-virtual-pool-address-for-a-token-on-uniswap-v4-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } Currency: { SmartContract: { is: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "count" } limit: { count: 20 } ) { Trade { PoolId Side { Currency { Symbol SmartContract } } } count volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ``` ## Latest swaps in the ETH/USDC pool Saved query [here](https://ide.bitquery.io/Latest-Trades-for-a-currency-pair-on-optimism). ```graphql { EVM(network: optimism) { DEXTrades( where: { Trade: { PoolId: { is: "0x51bf4cc5b8d9f7f759e41f572fe2a25bc2aeb42432bf12544a350595e5c8bb43" } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Trade { Buy { Currency { Symbol } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Live swaps across all v4 pools on Optimism The protocol filter as a subscription. Messages arrive every few seconds, which is slow enough to watch by eye. Saved stream [here](https://ide.bitquery.io/Real-time-trades-for-uniswap-v4-optimism). ```graphql subscription { EVM(network: optimism) { DEXTrades(where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v4" } } } }) { Block { Time } Trade { PoolId Buy { Currency { Symbol SmartContract } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol SmartContract } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## Daily stats of the pool Trades, distinct buyers and sellers, and USD volume by direction for the token you name. Saved query [here](https://ide.bitquery.io/trade-stats-for-a-token-pair-on-uniswap-v4-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x51bf4cc5b8d9f7f759e41f572fe2a25bc2aeb42432bf12544a350595e5c8bb43" } Currency: { SmartContract: { is: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Symbol } Side { Currency { Symbol } } } trades: count buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) volumeUsd: sum(of: Trade_Side_AmountInUSD) buyVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } }) sellVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } }) } } } ``` ## Top traders of the pool Rank by `Transaction.From`, since the PoolManager appears as buyer and seller on every raw v4 swap. `bought` sums the token the trader received and `sold` the token it paid; `Side.Type` describes the counter-side, which is why the conditions look swapped. On Optimism a handful of bots account for most of the pool's trades. Saved queries: [top buyers](https://ide.bitquery.io/top-buyers-of-a-currency-on-uniswap-v4-optimism), [top sellers](https://ide.bitquery.io/top-sellers-of-a-token-on-uniswap-v4-pool-optimism). ```graphql { EVM(network: optimism) { DEXTradeByTokens( where: { Trade: { PoolId: { is: "0x51bf4cc5b8d9f7f759e41f572fe2a25bc2aeb42432bf12544a350595e5c8bb43" } Currency: { SmartContract: { is: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` ## Reserves of the pool `DEXPoolEvents` gives the reserves the PoolManager holds for the pool after each change, rebuilt from the concentrated positions around the current price and priced in USD. Filter on `PoolId`, or keep the protocol name alone to follow every v4 pool on Optimism. ```graphql { EVM(network: optimism) { DEXPoolEvents( where: { PoolEvent: { Pool: { PoolId: { is: "0x51bf4cc5b8d9f7f759e41f572fe2a25bc2aeb42432bf12544a350595e5c8bb43" } } } } limit: { count: 5 } orderBy: { descending: Block_Time } ) { Block { Time } PoolEvent { Pool { PoolId CurrencyA { Symbol } CurrencyB { Symbol } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } } } } ``` ## Related pages - [Optimism DEX trades API](/docs/blockchain/Optimism/optimism-dextrades) - [Optimism transfers API](/docs/blockchain/Optimism/optimism-transfers) - [Uniswap v4 on Ethereum](/docs/blockchain/Ethereum/dextrades/uniswap-v4-api) - [Uniswap v4 on Base](/docs/blockchain/Base/uniswap-v4-api) - [Uniswap v4 on Arbitrum](/docs/blockchain/Arbitrum/uniswap-v4-api) --- ## PancakeSwap Infinity API on BNB Chain: Swaps, Pools by PoolId, Prices, Traders URL: https://docs.bitquery.io/docs/blockchain/BSC/bsc-pancakeswap-infinity-api/ PancakeSwap Infinity on BNB Chain via Bitquery GraphQL: live swaps with USD, busiest pools by PoolId, a token's price, OHLC, volume and top traders. # PancakeSwap Infinity API on BNB Chain: Swaps, Pools by PoolId, Prices, Traders PancakeSwap Infinity keeps all of its pools inside one manager contract on BNB Chain, `0xa0ffb9c1ce1fe56963b0321b32e7a0302114058b`, the same singleton design as Uniswap v4. In Bitquery's cubes that means the protocol name `pancakeswap_infinity` selects the venue, `Trade.PoolId` selects a pool, and `Dex.SmartContract` is the manager on every row. Infinity is one of the busiest venues on the chain, and stablecoin pairs such as USDT/KII are among its most traded markets. Every example runs in the [IDE](https://ide.bitquery.io) on a free account. The worked token is POWER, `0x9dc44ae5be187eca9e2a67e33f27a4c91cea1223`, and the worked pool is USDT/KII, `PoolId 0xf43fdb854021ddeb41e06ac1d6e5df475197038ba5d3cba147f469a56870cd1b`. Bitquery also indexes PancakeSwap v2 and v3 on BNB Chain; those are on the [PancakeSwap API](/docs/blockchain/BSC/pancake-swap-api/) page. ## Live swaps with USD on every row The Trading cube streams every Infinity swap with the trader, USD amounts and the token's market cap. Saved stream [here](https://ide.bitquery.io/Trading-API-PancakeSwap-Infinity-Trades-BSC). ```graphql subscription { Trading { Trades( where: { Pair: { Market: { Network: { is: "Binance Smart Chain" }, Protocol: { is: "pancakeswap_infinity" } } } } ) { Block { Time } Side Trader { Address } Price PriceInUsd AmountsInUsd { Base Quote } Pair { Currency { Symbol } QuoteCurrency { Symbol } Pool { Id } } Supply { MarketCap } } } } ``` ## Latest swaps on Infinity The chain cube view: what the pool received and paid out, with USD on both sides and the PoolId. Saved query [here](https://ide.bitquery.io/pancakeswap-infinity-trades-on-bsc). ```graphql { EVM(network: bsc) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Trade { PoolId Buy { Currency { Symbol SmartContract } Amount AmountInUSD PriceInUSD } Sell { Currency { Symbol SmartContract } Amount AmountInUSD } } Transaction { From Hash } } } } ``` ## The busiest Infinity pools Group by `PoolId` over the last day. Each row is one pool with the token, the trade count and USD volume; the single-trade USD cap keeps thin-pool outliers out of the sums. ```graphql { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Dex: { ProtocolName: { is: "pancakeswap_infinity" } } Side: { AmountInUSD: { lt: "10000000" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descendingByField: "trades" } limit: { count: 20 } ) { Trade { PoolId Currency { Symbol SmartContract } Side { Currency { Symbol } } } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } ``` ## Price of a token on Infinity The newest `DEXTradeByTokens` row for the token carries its price in the quote and in USD, plus the pool it traded in. Saved query [here](https://ide.bitquery.io/Get-Latest-Price-of-a-token-on-PancakeSwap-Infinity_1). ```graphql { EVM(network: bsc) { DEXTradeByTokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Trade: { Currency: { SmartContract: { is: "0x9dc44ae5be187eca9e2a67e33f27a4c91cea1223" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } } ) { Block { Time } Trade { Price PriceInUSD PoolId Currency { Symbol Name SmartContract Decimals } Side { Currency { Symbol } } } } } } ``` The same row answers the metadata question, so the saved [token metadata](https://ide.bitquery.io/get-metadata-for-bsc-pancakeswap-infnity-token) query is this one with the price fields removed. ## Hourly OHLC in USD One-hour candles for the last day. `PriceAsymmetry` below 0.1 drops trades whose two sides disagree on price, which cleans candles on thin pools. Saved query [here](https://ide.bitquery.io/OHLC-on-bsc-pancakeswap-infinity). ```graphql { EVM(network: bsc) { DEXTradeByTokens( orderBy: { descendingByField: "Block_testfield" } where: { Trade: { Currency: { SmartContract: { is: "0x9dc44ae5be187eca9e2a67e33f27a4c91cea1223" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } PriceAsymmetry: { lt: 0.1 } } Block: { Time: { since_relative: { hours_ago: 24 } } } } limit: { count: 24 } ) { Block { testfield: Time(interval: { in: hours, count: 1 }) } volume: sum(of: Trade_Amount) Trade { high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) } count } } } ``` ## Volume, bought and sold Totals for the token over a day. `Side.Type` describes the counter-side of each trade, so the token was bought where the side was sold. Saved query [here](https://ide.bitquery.io/trade_volume_bsc_pancakeswap_infinity). ```graphql { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: { SmartContract: { is: "0x9dc44ae5be187eca9e2a67e33f27a4c91cea1223" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { trades: count volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` ## Top traders of a token Rank by `Transaction.From`, the account that sent the swap, since the manager contract appears as buyer and seller on raw Infinity rows. Saved query [here](https://ide.bitquery.io/top-traders-of-a-token-on-pancakeswap_1). ```graphql { EVM(network: bsc) { DEXTradeByTokens( orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } where: { Trade: { Currency: { SmartContract: { is: "0x9dc44ae5be187eca9e2a67e33f27a4c91cea1223" } } Dex: { ProtocolName: { is: "pancakeswap_infinity" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Transaction { From } trades: count volumeUsd: sum(of: Trade_Side_AmountInUSD) bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } }) } } } ``` ## Most bought and most sold tokens on Infinity One query, sorted on `bought` for the buy side; sort on `sold` for the other list. Saved queries: [top bought](https://ide.bitquery.io/top-bought-tokens-on-pancakeswap_infinity_1), [top sold](https://ide.bitquery.io/top-sold-tokens-on-pancake-infinty_1). ```graphql { EVM(network: bsc) { DEXTradeByTokens( orderBy: { descendingByField: "bought" } limit: { count: 20 } where: { Trade: { Dex: { ProtocolName: { is: "pancakeswap_infinity" } } Side: { AmountInUSD: { lt: "10000000" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } ) { Trade { Currency { Symbol SmartContract } } bought: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } }) sold: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } }) trades: count } } } ``` ## Reserves of a pool `DEXPoolEvents` emits the reserves in USD after every change; filter on the `PoolId`. The [BNB Chain liquidity API](/docs/blockchain/BSC/bsc-liquidity-api) has the stream form and the other pool queries. ```graphql { EVM(network: bsc) { DEXPoolEvents( where: { PoolEvent: { Pool: { PoolId: { is: "0xf43fdb854021ddeb41e06ac1d6e5df475197038ba5d3cba147f469a56870cd1b" } } } } limit: { count: 5 } orderBy: { descending: Block_Time } ) { Block { Time } PoolEvent { Pool { CurrencyA { Symbol } CurrencyB { Symbol } } Liquidity { AmountCurrencyA AmountCurrencyAInUSD AmountCurrencyB AmountCurrencyBInUSD } AtoBPrice } } } } ``` ## Related pages - [PancakeSwap API on BNB Chain](/docs/blockchain/BSC/pancake-swap-api/) - [Uniswap v4 on BNB Chain](/docs/blockchain/BSC/uniswap-v4-api) - [BNB Chain liquidity API](/docs/blockchain/BSC/bsc-liquidity-api) - [BNB Chain DEX trades API](/docs/blockchain/BSC/bsc-dextrades) - [Four.meme API](/docs/blockchain/BSC/four-meme-api/) --- ## Polygon (MATIC) API Documentation URL: https://docs.bitquery.io/docs/blockchain/Matic/ Polygon (MATIC) API overview: DEX trades, slippage, liquidity, transfers, balances and NFT data on Polygon, with WebSocket and webhook options and videos. # Polygon (MATIC) API Documentation Discover everything you need to build powerful Polygon (MATIC) applications—from real-time DEX trading analytics, liquidity monitoring, slippage analysis, and token holder insights to NFT tracking and transaction monitoring. This comprehensive guide provides ready-to-use GraphQL APIs, live streaming data, and step-by-step examples for tracking swaps, balances, transfers, liquidity pools, and more across the Polygon ecosystem. Whether you're building trading bots, dashboards, or DeFi analytics tools, find all the Polygon data solutions you need right here. Need help crafting a query or subscription? Message us on [support](https://t.me/Bloxy_info). ## What is the Bitquery Polygon (MATIC) API? :::tip Building a trading app or DEX UI on Polygon (MATIC)? For **real-time trades and prices on Polygon (MATIC)** (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 Polygon (MATIC) data older than ~30 days**, use the chain-level `DEXTrades` / `DEXTradeByTokens` APIs documented below. ::: It's a GraphQL interface over curated, indexed Polygon (MATIC) data. Write concise queries instead of building and maintaining your own indexer. ## What can you build with it? Track wallet portfolios and token holders, monitor DEX price/volume, liquidity events, pool reserves, and slippage data, analyze gas and fees, stream mempool activity, compute KPIs over blocks/transactions, and power dashboards or trading systems with real‑time data. ## How is it different from raw Polygon (MATIC) RPC? | Feature | Polygon (MATIC) RPC | Bitquery Polygon (MATIC) API | | ------------------- | -------------------------------- | -------------------------------------- | | **Data Format** | Raw JSON-RPC responses | Pre-indexed, enriched GraphQL | | **Historical Data** | No built-in history | Full historical data since genesis | | **Analytics** | Manual aggregation required | Built-in joins, aggregations, and KPIs | | **Real-time** | Basic subscription support | Rich streaming with filtering | | **Use Case** | Transaction submission, node ops | Analytics, monitoring, dashboards | | **Infrastructure** | Run your own nodes | Fully managed, auto-scaling | ## WebSockets and Webhooks Most queries can be turned into live streams by switching `query` to `subscription`, and consumed over WebSocket. See examples and code snippets [here](/docs/subscriptions/websockets/). ## DEX Trades - [Polygon (MATIC) Dex Trades](./matic-dextrades) - [Polygon (MATIC) Uniswap API](./matic-uniswap-api) Query and subscribe to on‑chain swaps, OHLCV, liquidity events, pools, and per‑wallet trading activity across major Polygon DEXes. ## Polygon (MATIC) Slippage API - [Polygon (MATIC) Slippage API](./matic-slippage-api) Get slippage and price impact data for Polygon DEX pools. Understand price impact and liquidity depth for token swaps, calculate maximum input amounts at different slippage tolerances, and monitor real-time slippage data across all DEX pools on Polygon. ## Polygon (MATIC) Liquidity API - [Polygon (MATIC) Liquidity API](./matic-liquidity-api) Monitor real-time liquidity changes, track pool reserves, and analyze liquidity depth for token pairs on Polygon DEX pools. Track when liquidity is added or removed, monitor pool health and depth, and analyze liquidity patterns across different pools. ## Transfers - [Polygon (MATIC) Transfers API](./matic-transfers) Follow ERC‑20 token flows and compute supply‑side metrics on Polygon. ## Balances - [Polygon (MATIC) Address Balance API](./matic-balance-api) — token and [native MATIC](./matic-balance-api#native-matic-balance) balances (`EVM.Balances`) Get real‑time and historical balances for addresses and tokens on Polygon. ## NFT - [Polygon (MATIC) NFT API](./matic-nft) Fetch collections, ownership, transfers, trades, and metadata on Polygon. ## Videos ### Polygon (MATIC) API | How to Get Real-time & Historical Matic (Polygon) Data ## 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/) --- ## Polygon (MATIC) Address Balance API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-balance-api/ Query Polygon address balances with the Bitquery Balances cube: token and native POL balances, balances on a given date, and per-token lookups. # Polygon (MATIC) Address Balance API :::tip To rank a token's holders, use the **[Token Holders API](/docs/blockchain/Ethereum/token-holders/token-holder-api)** (`EVM.Holders`). Balance lookups like these are productized in the [Address & Balance API](https://bitquery.io/products/address-apis) — native and token balances, labels and history on 9 core chains. ::: The **Balances** API returns current and historical token balances for an address on Polygon (MATIC). 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**. | Examples: [All Token Balances](#balance-of-an-address) · [Native MATIC](#native-matic-balance) · [Balance on a Date](#balance-on-a-specific-date) · [Specific Token](#balance-for-a-specific-token) ## Balance of an Address Returns token balances for a wallet address. Use `Amount(selectWhere: { gt: "0" })` to exclude zero balances. [Run in IDE](https://ide.bitquery.io/matic-balances-address) ```graphql query { EVM(network: matic, dataset: combined) { Balances( where: { Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Native MATIC Balance Returns the native MATIC balance for a wallet (not ERC-20 tokens). Filter with `Currency: { Native: true }` instead of a token contract address. [Run in IDE](https://ide.bitquery.io/matic-native-balances-address) ```graphql query { EVM(network: matic, dataset: combined) { Balances( where: { Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } Currency: { Native: true } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` **Parameters** - `network: matic`: Polygon mainnet. - `dataset: combined`: Merges realtime and archive data for the latest balance state. - `Balance.Address`: Wallet address to query. - `Currency.Native: true`: Native MATIC only (see [Native MATIC Balance](#native-matic-balance)). **Returned fields** - `Currency.Symbol`, `Currency.SmartContract`: Token metadata. - `Balance.Amount`, `Balance.AmountInUSD`: Token balance and USD value (use `selectWhere` to filter non-zero amounts). ## Balance on a Specific Date Use `Block.Date.till` for a point-in-time snapshot. Use `dataset: archive` for historical dates and addresses not recently active. [Run in IDE](https://ide.bitquery.io/matic-balances-by-date) ```graphql query { EVM(network: matic, dataset: archive) { Balances( where: { Block: { Date: { till: "2026-05-01" } } Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Balance for a Specific Token Add a `Currency.SmartContract` filter. Always use the contract address, not the token name. Use `0x` for native MATIC on Polygon, or the ERC-20 contract address for a token. [Run in IDE](https://ide.bitquery.io/matic-balances-specific-token) ```graphql query { EVM(network: matic, dataset: combined) { Balances( where: { Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } Currency: { SmartContract: { is: "0x" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` ## Token Holder Snapshot The number of unique holders, token supply, and Gini coefficient for the balance amount before a specific timestamp can be derived using the query below. These stats provide a useful holder snapshot for any given time. [Run in IDE](https://ide.bitquery.io/token-holder-snapshot-matic)
Click to expand GraphQL query ```graphql query MyQuery($network: evm_network!, $address: String!) { EVM(network: $network, dataset: archive) { Holders( where: { Currency: {SmartContract: {is: $address}}, Balance: { Amount: {gt: "0"}, LastChangeTime: {till: "2026-05-20T00:00:00Z"} }, Holder: {Address: {not: "0x"}}} ) { Balance { LastChangeTime(maximum: Balance_LastChangeTime) } holders: uniq(of: Holder_Address) supply: sum(of: Balance_Amount) gini(of: Balance_Amount) } } } ``` ```json { "network": "matic", "address": "0x99a57e6c8558bc6689f894e068733adf83c19725" } ```
## 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/matic-balances-history) ```graphql query { EVM(network: matic, dataset: archive) { Balances( where: { Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } Currency: {} } orderBy: { descending: Block_Date } limit: { count: 100 } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD } Block { Date } } } } ``` ## Wallet Balance for a Specific Token on a Date Get a wallet's balance for a specific token with `Balance.Address` and `Currency.SmartContract`. This example uses native MATIC (`SmartContract: "0x"`) with `dataset: combined`. For a balance on a calendar date, use [Balance on a Specific Date](#balance-on-a-specific-date) with `dataset: archive` and `Block.Date.till`. [Run in IDE](https://ide.bitquery.io/matic-wallet-balance-token-at-date) ```graphql query { EVM(network: matic, dataset: combined) { Balances( where: { Balance: { Address: { is: "0x4c569c1e541A19132AC893748E0ad54C7c989FF4" } } Currency: { SmartContract: { is: "0x" } } } ) { Currency { Symbol SmartContract } Balance { Amount(selectWhere: { gt: "0" }) AmountInUSD Address } } } } ``` --- ## Polygon (MATIC) DEX Trades API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-dextrades/ Query Polygon DEX trades with Bitquery: live swap streams, OHLC candles, token prices, top traders, and full history through the archive dataset. # Polygon (MATIC) DEX Trades API :::tip Want structured trades, OHLC and USD on every row? Start with the Trading API The [**Trading API**](/docs/trading/trading-data-overview) is the fastest path to clean Polygon market data. [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, across **10 chains in one API** — filter with `Pair.Market.Network: Matic`. Pre-aggregated OHLC down to one second comes from [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs), so you never have to build candles yourself. Reach for the chain-level queries on this page when you need something the Trading API deliberately does not carry: **history older than the Trading window** (via `dataset: combined` or `archive`), **raw per-swap detail**, pool internals, or **call and event context**. Both are shown below, starting with the Trading API. ::: Polygon (formerly Matic) settles DEX activity across Uniswap v2/v3, QuickSwap, Balancer, SushiSwap and the Polymarket CTF exchange. This page shows how to query and stream that activity with the Bitquery GraphQL API: live swap streams, real-time and historical token prices, OHLC candles, top tokens and traders, and full trade history through the archive dataset. :::note Token naming on Polygon Polygon's native asset was rebranded from MATIC to POL, so the wrapped native token reports as **`WPOL`** (contract `0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270` — unchanged from WMATIC). Bridged Tether reports as **`USDT0`** at `0xc2132d05d31c914a87c6611c10748aeb04b58e8f`. Filter by contract address rather than symbol wherever you can — addresses are stable across rebrands. ::: ## Live DEX swap stream (Polygon) {#crypto-trades-live-stream} [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api): one row per swap, with USD and supply. For Polygon use **`Pair.Market.Network: Matic`**. [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/All-trades-on-Polygon-with-Price-Marketcap-supply).
Click to expand GraphQL query ```graphql subscription { Trading { Trades(where: { Pair: { Market: { Network: { is: "Matic" } } } }) { 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 } } } ```
## OHLC candles for a Polygon token {#ohlc} If you are building a chart, do not aggregate raw swaps yourself. [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) returns ready-made candles: set `Interval.Time.Duration` to the candle width in seconds (`60`, `300`, `3600`, `86400`) and filter the token by address. This example returns five-minute candles for **WPOL** over the last three hours, with volume in both base units and USD. ```graphql { Trading { Tokens( limit: { count: 36 } orderBy: { descending: Block_Time } where: { Token: { Network: { is: "Matic" } Address: { is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" } } Interval: { Time: { Duration: { eq: 300 } } } Block: { Time: { since_relative: { hours_ago: 3 } } } } ) { Interval { Time { Start End Duration } } Token { Symbol Address Network } Currency { Symbol } Price { Ohlc { Open High Low Close } } Volume { Base Usd } } } } ``` Swap `Duration` for the candle size you need, and drop the `Block.Time` filter to walk further back. For pair-level candles — one specific pool rather than the token's aggregated price — use [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) with a `Market.Address` filter. ## Historical Polygon trades (archive dataset) {#historical} The realtime dataset covers a rolling recent window. For anything older, add **`dataset: archive`** (history only) or **`dataset: combined`** (history plus realtime) to the `EVM` selector. This is the main reason to use chain-level `DEXTrades` instead of the Trading API. The query below pulls Polygon swaps from a fixed historical day. Change the `since` / `till` bounds to any range you need. ```graphql { EVM(network: matic, dataset: archive) { DEXTrades( limit: { count: 25 } orderBy: { descending: Block_Time } where: { Block: { Time: { since: "2025-01-01T00:00:00Z", till: "2025-01-02T00:00:00Z" } } } ) { Block { Time Number } Transaction { Hash From } Trade { Dex { ProtocolName ProtocolFamily SmartContract } Buy { Amount Currency { Symbol SmartContract } PriceInUSD Buyer } Sell { Amount Currency { Symbol SmartContract } } } } } } ``` :::caution USD values on thin pools `PriceInUSD` is derived from the trade itself, so it can come back as `0` or wildly off for pools with almost no liquidity. If you need dependable USD, use the Trading API (which carries a vetted price per row) or filter on [`PriceAsymmetry`](/docs/graphql/metrics/priceAsymmetry/) as shown below. ::: ## Latest Polygon DEX trades {#latest-trades} This example uses the chain-specific **DEXTrades** cube via `EVM(network: matic) { DEXTrades }` (pool-side Buy/Sell; see [DEXTrades cube](/docs/cubes/dextrades)). For trader-oriented rows with reliable USD, use the [stream at the top](#crypto-trades-live-stream). Read [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) to understand when to use which cube. You can find the query [here](https://ide.bitquery.io/Realtime-matic-dex-trades-websocket) ```graphql subscription { EVM(network: matic) { 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 { Decimals Fungible HasURI Name ProtocolName SmartContract Symbol } } } } } } ``` ## Real-time price of a token in terms of another {#realtime-price} This subscription streams the price of **WPOL** in terms of **USDC**, including the DEX, market and order details. Filtering both sides pins you to a single trading direction on a specific pair. ```graphql subscription { EVM(network: matic) { DEXTrades( where: { Trade: { Sell: { Currency: { SmartContract: { is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" } } } Buy: { Currency: { SmartContract: { is: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" } } } } } ) { Block { Time } Trade { Buy { Amount Buyer Seller Price_in_terms_of_sell_currency: Price Currency { Name Symbol SmartContract } OrderId } Sell { Amount Buyer Seller Price_in_terms_of_buy_currency: Price Currency { Symbol SmartContract Name } OrderId } Dex { ProtocolFamily ProtocolName SmartContract ProtocolVersion } } } } } ``` To watch one pool rather than every pool for the pair, add a `Trade: { Dex: { SmartContract: { is: "0x..." } } }` filter. ## Latest USD price of a token {#usd-price} This subscription returns the USD price of a token by filtering on the buy-side contract — here **WETH** on Polygon. Read `PriceInUSD` for the USD value. `PriceAsymmetry(selectWhere: {lt: 1})` drops trades whose two legs disagree badly on value, which is the cheapest way to filter out bot noise and broken pools. ```graphql subscription { EVM(network: matic) { DEXTrades( where: { Trade: { Buy: { Currency: { SmartContract: { is: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619" } } } } } ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price PriceInUSD } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } PriceAsymmetry(selectWhere: { lt: 1 }) } } } } ``` ## Top tokens on Polygon by traded volume {#top-tokens} This query ranks Polygon tokens by USD volume over a relative window and returns the price now versus the start of the window, so you can compute a change percentage client-side. Two filters matter more than they look: - **`Currency: { Fungible: true }`** — without it, results are dominated by Polymarket's ERC-1155 outcome tokens, which trade in enormous quantities on Polygon, carry empty symbols, and are almost certainly not what you are ranking. See the [Polymarket API](/docs/examples/polymarket-api/) if they *are* what you want. - **`SmartContract: { notIn: $quotes }`** on the trade side and **`in: $quotes`** on the counter-side — this keeps stablecoins and wrapped majors as *quote* assets instead of letting them top their own leaderboard. Using `since_relative` rather than fixed timestamps means the query stays correct whenever it is run. ```graphql query topTokens($network: evm_network, $quotes: [String!], $min_usd: String) { EVM(network: $network) { DEXTradeByTokens( where: { Block: { Time: { since_relative: { hours_ago: 24 } } } Trade: { Currency: { Fungible: true, SmartContract: { notIn: $quotes } } Side: { Currency: { SmartContract: { in: $quotes } } } } } orderBy: { descendingByField: "usd" } limit: { count: 25 } ) { Trade { Currency { Symbol Name SmartContract } price_now: PriceInUSD(maximum: Block_Number) price_window_start: PriceInUSD(minimum: Block_Number) } usd: sum(of: Trade_Side_AmountInUSD, selectWhere: { ge: $min_usd }) trades: count buyers: uniq(of: Trade_Buyer) sellers: uniq(of: Trade_Seller) dexes: uniq(of: Trade_Dex_OwnerAddress) } } } ``` Variables — the quote list is native USDC, bridged USDC.e, USDT0, DAI, WETH, WPOL and WBTC: ```json { "network": "matic", "quotes": [ "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6" ], "min_usd": "25000" } ``` A heatmap built on this shape of query is live at [dexrabbit.bitquery.io/matic](https://dexrabbit.bitquery.io/matic). ![Top Polygon tokens by volume on DEXrabbit](/img/dexrabbit/matic_toptokens.png) ## Top traders of a token {#top-traders} This query ranks traders of one token by volume, splitting bought and sold amounts and totalling volume in native and USD terms. `since_relative` keeps the window rolling. You can run the query [here](https://ide.bitquery.io/top-traders-of-a-token-on-matic_1) ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: { descendingByField: "volumeUsd" } limit: { count: 100 } where: { Trade: { Currency: { SmartContract: { is: $token } } } Block: { Time: { since_relative: { days_ago: 3 } } } } ) { Trade { Buyer Dex { ProtocolFamily } } 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) } } } ``` ```json { "network": "matic", "token": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" } ``` This query is available as a chart and table on [dexrabbit.bitquery.io/matic](https://dexrabbit.bitquery.io/matic). ![Top Polygon traders on DEXrabbit](/img/dexrabbit/matic_toptraders.png) --- ## More examples ### 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-polygon-pool).
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: "0x5757371414417b8c6caad45baef941abc7d3ab32" } } } } ) { 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" } }) } } } ```
## Related Polygon APIs - [Polygon (MATIC) Address Balance API](/docs/blockchain/Matic/matic-balance-api) — token and native balances - [Polygon (MATIC) Transfers API](/docs/blockchain/Matic/matic-transfers) — ERC-20 and native transfers - [Polymarket API](/docs/examples/polymarket-api/) — prediction market trades and outcome prices on Polygon - [Trading API overview](/docs/trading/trading-data-overview) — structured trades, prices and OHLC across 10 chains --- --- ## Polygon (MATIC) NFT API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-nft/ Polygon (MATIC) NFT API: track Polygon NFT trades, ownership, and metadata with Bitquery GraphQL and streams. Keep queries fast with indexed filters. # Polygon (MATIC) NFT API In this section we'll have a look at some examples using the Matic NFT API. ## Track transfers of an NFT in Realtime This query subscribes you to the real time transfers of a specific non-fungible token (NFT) on the Matic network. You can find the query [here](https://ide.bitquery.io/Real-time-transfer-websocket-for-NFT-token-on-matic) ```graphql subscription { EVM(network: matic) { Transfers( where: { Transfer: { Currency: { Fungible: false SmartContract: { is: "0x4d544035500D7aC1B42329c70eb58E77f8249f0F" } } } } ) { Block { Hash Number } Transfer { Amount Currency { Name Symbol Native } Sender Receiver } } } } ``` --- ## Polygon (Matic) Token Market Cap API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-token-marketcap-api/ Polygon (Matic) Token Market Cap API: stream Polygon market cap, FDV, supply, and price using Bitquery Trading GraphQL APIs. # Polygon (Matic) Token Market Cap API Use Bitquery’s **Trading** API **`Tokens`** cube to stream or query **market cap**, **fully diluted valuation (USD)**, **total supply**, **price** (OHLC and averages), and **volume** for tokens on **Polygon** (network id **`matic`** in the Trading API). Filter with **`matic:`** plus a **lowercase** contract address in **`Token.Id`** / **`Currency.Id`**. For schema details and field meanings, see the **[Tokens cube](/docs/trading/crypto-price-api/tokens)** and **[Supply fields](/docs/trading/crypto-price-api/supply-fields)**. :::note Trading API and EVM addresses On **Polygon** (**`matic`** in Trading), use **lowercase** hex in **`Id`** values (e.g. `matic:0xeb51…`, not mixed-case checksum addresses). ::: ## Related APIs - **[Ethereum Token Market Cap API](/docs/blockchain/Ethereum/token-supply/ethereum-token-marketcap-api)** — **`eth:`** ids - **[BSC Token Market Cap API](/docs/blockchain/BSC/bsc-token-marketcap-api)** — **`bsc:`** ids - **[Base Token Market Cap API](/docs/blockchain/Base/base-token-marketcap-api)** — **`base:`** ids - **[Arbitrum Token Market Cap API](/docs/blockchain/Arbitrum/arbitrum-token-marketcap-api)** — **`arbitrum:`** ids - **[Solana Token Market Cap API](/docs/blockchain/Solana/solana-token-marketcap-api)** — **`solana:`** ids - **[Crypto Price API — Tokens](/docs/trading/crypto-price-api/tokens)** — full `Tokens` cube reference --- ## How do I stream live Polygon (Matic) token market cap, price, and volume? Subscribe to **`Tokens`** where **currency id** includes **`matic`**, with **interval duration** greater than **1** (second). You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/matic-token-marketcap-stream). ```graphql subscription MyQuery { Trading { Tokens( where: { Currency: { Id: { includes: "matic" } } Interval: { Time: { Duration: { gt: 1 } } } } ) { Token { Name Id Address Symbol } Block { Time } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } Price { Average { Mean } Ohlc { Open Low High Close } } Volume { Base BaseAttributedToUsd Quote Usd } } } } ``` --- ## How do I get the latest market cap for a specific token on Polygon? Use **`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, and filter **`Token.Id`** with **`includes`** (or **`includesCaseInsensitive`**) for **`matic:`** + lowercase contract. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/specific-matic-token-latest-marketcap). ```graphql query { Trading { Tokens( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Token: { Id: { includes: "matic:0xeb51d9a39ad5eef215dc0bf39a8821ff804a0f01" } } Interval: { Time: { Duration: { gt: 1 } } } } ) { Token { Name Id Address Symbol } Block { Time } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } Price { Average { Mean } Ohlc { Open Low High Close } } Volume { Base BaseAttributedToUsd Quote Usd } } } } ``` Replace the `includes` value with your token’s **`matic:`** id (lowercase hex). --- ## How do I stream Polygon tokens with market cap above $1 million? Subscribe when **`Token.Id`** matches **Polygon** (**`matic`**) and **`Supply.MarketCap`** **>** **1,000,000** (USD). You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-matic-tokens-with-marketcap-above-1-million). ```graphql subscription { Trading { Tokens( where: { Token: { Id: { includesCaseInsensitive: "matic" } } Interval: { Time: { Duration: { gt: 1 } } } Supply: { MarketCap: { gt: 1000000 } } } ) { Currency { Name Id Symbol } Supply { TotalSupply FullyDilutedValuationUsd MarketCap } } } } ``` :::tip Threshold and interval Tune **`Supply.MarketCap`** and **`Interval.Time.Duration`** for your alerts or dashboards. See **[Tokens cube](/docs/trading/crypto-price-api/tokens)** for more filters. ::: --- ## How do I get top Polygon (Matic) tokens by market cap? This query ranks **Polygon** tokens by **`Supply.MarketCap`**. Set **`Token.Network`** to **Matic** (Polygon’s label in the Trading API). It uses roughly the **last 24 hours**, **1-second** intervals, at least **$1,000** **USD volume**, **`limitBy`** one row per **`Token_Id`**, and up to **50** tokens. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Tokens-by-Market-Cap-on-Polygon_1). ```graphql { Trading { Tokens( limit: { count: 50 } limitBy: { count: 1, by: Token_Id } orderBy: { descending: Supply_MarketCap } where: { Block: { Time: { since_relative: { hours_ago: 24 } } } Interval: { Time: { Duration: { eq: 1 } } } Volume: { Usd: { gt: 1000 } } Token: { Network: { is: "Matic" } } } ) { Currency { Id Name Symbol } Price { Average { Mean(maximum: Block_Time) } } Volume { Base(maximum: Block_Time) Quote(maximum: Block_Time) Usd(maximum: Block_Time) } Token { Network Symbol Address } Supply { MarketCap(maximum: Block_Time) FullyDilutedValuationUsd(maximum: Block_Time) TotalSupply(maximum: Block_Time) } } } } ``` --- ## How do I get top Polygon tokens by market cap change in 1 hour? Uses a **1-hour** OHLC interval (`Duration: { eq: 3600 }`) and orders by **`change_mcap`**: **(close − open) × total supply**. **`Token.Network`** is **Matic**. You can run this query [in the Bitquery IDE](https://ide.bitquery.io/top-Polygon-tokens-by-Market-Cap-Change-1h). ```graphql { Trading { Tokens( limit: { count: 50 } orderBy: { descendingByField: "change_mcap" } where: { Interval: { Time: { Duration: { eq: 3600 } } } Token: { Network: { is: "Matic" } } } ) { Currency { Id Name Symbol } Token { Network Symbol Address } Supply { MarketCap FullyDilutedValuationUsd CirculatingSupply TotalSupply MaxSupply } change_mcap: calculate( expression: "($Price_Ohlc_Close-$Price_Ohlc_Open) * Supply_TotalSupply" ) Price { Ohlc { Open Close } } } } } ``` --- ## Polygon Matic Liquidity API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-liquidity-api/ Polygon Matic Liquidity API: read Polygon pool reserves and liquidity updates via Bitquery GraphQL DEX APIs. Great for bots, dashboards, and alerts. # Matic Liquidity API In this section we will see how to get Matic DEX pool liquidity information using Bitquery API. The liquidity API helps you monitor real-time liquidity changes, track pool reserves, and analyze liquidity depth for token pairs on Matic DEX pools. ## Understanding Liquidity and Pool Reserves Liquidity in DEX pools refers to the amount of tokens available for trading. Pool reserves (the balance of each token in the pool) determine the pool's ability to handle trades without significant price impact. Monitoring liquidity changes helps you: - Track when liquidity is added or removed from pools - Monitor pool health and depth - Identify liquidity events that may affect trading - Analyze liquidity patterns across different pools The DEXPoolEvents API provides real-time information about: - Current liquidity reserves for both tokens in the pool - Spot prices for both swap directions - Pool and token pair information - Transaction details for liquidity-changing events For a comprehensive explanation of how DEX pools work, liquidity calculations, and when pool events are emitted, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/). ## Realtime Liquidity Stream This subscription query returns real-time liquidity data for all DEX pools on Matic. You can monitor liquidity changes, pool reserves, and spot prices as trades and liquidity modifications occur across all pools. You can find the query [here](https://ide.bitquery.io/Realtime-Liquidity-Stream_5#) ```graphql subscription MyQuery { EVM(network: matic) { DEXPoolEvents { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Dex { SmartContract ProtocolName } Liquidity { AmountCurrencyA AmountCurrencyB } Pool { CurrencyA { Name SmartContract Symbol } CurrencyB { Name SmartContract Symbol } PoolId SmartContract } } Transaction { Gas Hash } } } } ``` ## Latest Liquidity Changes of a Specific Pool This query retrieves the latest liquidity events for a specific DEX pool on Matic. Use this to check current pool reserves, spot prices, and recent liquidity changes for a particular token pair. You can find the query [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-a-Specific-Pool_6#) ```graphql query MyQuery { EVM(network: matic) { DEXPoolEvents( limit: { count: 10 } orderBy: { descending: Block_Time } where: { PoolEvent: { Pool: { SmartContract: { is: "0x35afbb9d4dbe49f7579ccfd659ee6854a387faa0" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Dex { SmartContract ProtocolName } Liquidity { AmountCurrencyA AmountCurrencyB } Pool { CurrencyA { Name SmartContract Symbol } CurrencyB { Name SmartContract Symbol } PoolId SmartContract } } Transaction { Gas Hash } } } } ``` ## Realtime Liquidity Stream of a Specific Pool This subscription query monitors real-time liquidity changes for a specific DEX pool on Matic. Use this to track liquidity events, pool reserves, and spot prices for a particular pool as they occur. You can find the query [here](https://ide.bitquery.io/Realtime-Liquidity-Stream-of-a-Specific-Pool_5#) ```graphql subscription MyQuery { EVM(network: matic) { DEXPoolEvents( where: { PoolEvent: { Pool: { SmartContract: { is: "0x35afbb9d4dbe49f7579ccfd659ee6854a387faa0" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Dex { SmartContract ProtocolName } Liquidity { AmountCurrencyA AmountCurrencyB } Pool { CurrencyA { Name SmartContract Symbol } CurrencyB { Name SmartContract Symbol } PoolId SmartContract } } Transaction { Gas Hash } } } } ``` ## Latest Liquidity Changes of Pools in a Specific DEX Protocol - Uniswap V4 This subscription query monitors real-time liquidity changes for all pools in a specific DEX protocol on Matic. Here we have taken example of Uniswap V4. You can find the query [here](https://ide.bitquery.io/Latest-Liquidity-Changes-of-Pools-in-a-Specific-DEX-Protocol---Uniswap-V4_7#) ```graphql subscription MyQuery { EVM(network: matic) { DEXPoolEvents( where: { PoolEvent: { Dex: { ProtocolName: { is: "uniswap_v4" } } } } ) { Block { Time Number } PoolEvent { AtoBPrice BtoAPrice Dex { SmartContract ProtocolName } Liquidity { AmountCurrencyA AmountCurrencyB } Pool { CurrencyA { Name SmartContract Symbol } CurrencyB { Name SmartContract Symbol } PoolId SmartContract } } Transaction { Gas Hash } } } } ``` > **Important Note:** In Uniswap V4, all pools' liquidity is stored in the PoolManager contract, so the DEX smart contract address will be the same for all pairs. Use `PoolId` to differentiate between different pools. The `PoolId` field uniquely identifies each pool within the PoolManager. ## Realtime Liquidity Data via Kafka Streams Liquidity data can also be obtained via Kafka streams for lower latency and better reliability. The Kafka topic for Matic DEX pools is: **`matic.dexpools.proto`** Kafka streams provide the same liquidity data as GraphQL subscriptions but with several advantages: - Lower latency due to shorter data pipeline - Better reliability with persistent connections - Ability to read from latest offset without gaps - Better scalability with multiple consumers For detailed information on how to connect to Kafka streams, subscribe to topics, and parse messages, refer to the [Kafka Streaming Concepts documentation](/docs/streams/kafka-streaming-concepts/). > **Note:** IDE credentials will not work with Kafka Streams. You need separate Kafka credentials. Please contact sales on our official telegram channel or fill out the [form on our website](https://bitquery.io/forms/api). ## Understanding the Response The `DEXPoolEvents` API response contains the following information: - **`PoolEvent`**: Pool event information - **`Liquidity`**: Current pool reserves - `AmountCurrencyA`: Current balance of CurrencyA in the pool (in raw units) - `AmountCurrencyB`: Current balance of CurrencyB in the pool (in raw units) - **`AtoBPrice`**: Current spot price for swapping CurrencyA to CurrencyB - **`BtoAPrice`**: Current spot price for swapping CurrencyB to CurrencyA - **`Pool`**: Pool information - `SmartContract`: Pool contract address - `PoolId`: Unique pool identifier - `CurrencyA`: First token in the pair (name, symbol, smart contract address) - `CurrencyB`: Second token in the pair (name, symbol, smart contract address) - **`Dex`**: DEX protocol information - `SmartContract`: DEX router/factory contract address - `ProtocolName`: Protocol name (e.g., Uniswap V2, Uniswap V3, Uniswap V4) - **`Block`**: Block information when the liquidity event occurred - `Time`: Timestamp of the block - `Number`: Block number - **`Transaction`**: Transaction information - `Hash`: Transaction hash - `Gas`: Gas used for the transaction For more details on when new pool events are emitted and how liquidity is calculated, see the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#when-is-a-new-dexpool-record-emitted-in-the-apis--streams). ## Use Cases ### Real-Time Liquidity Monitoring Use the liquidity API to monitor pool reserves in real-time: - Track when large amounts of liquidity are added or removed - Monitor pool health and detect potential liquidity issues - Alert on significant liquidity changes that may affect trading ### Liquidity Depth Analysis Analyze which pools have sufficient liquidity for your needs: - Compare liquidity reserves across different pools - Identify pools with deep liquidity for large trades - Monitor liquidity trends over time ### Trading Applications #### Pre-Trade Liquidity Checks Before executing large trades, check current pool reserves: - Verify sufficient liquidity exists for your trade size - Monitor liquidity changes that may affect execution - Identify optimal pools with best liquidity depth #### Liquidity Event Detection Track liquidity events that may create trading opportunities: - Detect when new liquidity is added to pools - Monitor liquidity removals that may signal pool abandonment - Identify pools experiencing rapid liquidity growth For more advanced use cases, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#advanced-use-cases-and-processing-patterns). --- ## Polygon Matic Slippage API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-slippage-api/ Polygon Matic Slippage API: measure Polygon DEX price impact and slippage with Bitquery GraphQL pool metrics. Covers archive history and realtime data. # Matic Slippage API In this section we will see how to get Matic DEX pool slippage information using our API. The slippage API helps you understand price impact and liquidity depth for token swaps on Matic DEX pools. ## Understanding Slippage and Price Impact Slippage refers to the difference between the expected price of a trade and the actual execution price. When swapping tokens in a DEX pool, larger trades can move the price due to limited liquidity, resulting in slippage. The DEXPoolSlippages API provides detailed information about: - Maximum input amounts that can be swapped at different slippage tolerances - Minimum output amounts guaranteed at each slippage level - Average execution prices for different trade sizes - Price impact calculations for both swap directions (A to B and B to A) For a comprehensive explanation of how DEX pools work, liquidity calculations, and price tables, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/). ## Realtime Slippage Monitoring This subscription query returns real-time slippage data for all DEX pools on Matic. You can monitor price impact and liquidity depth as trades occur. You can find the query [here](https://ide.bitquery.io/realtime-slippage-on-matic) ```graphql subscription { EVM(network: matic) { DEXPoolSlippages { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` ## Latest Slippage for a Specific Pool This query retrieves the latest slippage data for a specific DEX pool on Matic. Use this to check current liquidity depth and price impact for a particular token pair. You can find the query [here](https://ide.bitquery.io/Latest-slippage-of-a-pool-on-Uniswap-v3) ```graphql query { EVM(network: matic) { DEXPoolSlippages( where: {Price: {Pool: {SmartContract: {is: "0x42161084d0672e1d3f26a9b53e653be2084ff19c"}}}} limit: {count: 10} orderBy: {descending: Block_Time} ) { Price { BtoA { Price MinAmountOut MaxAmountIn } AtoB { Price MinAmountOut MaxAmountIn } Pool { PoolId SmartContract Pair { Decimals SmartContract Name } CurrencyB { Symbol SmartContract Name Decimals } CurrencyA { Symbol SmartContract Name Decimals } } Dex { SmartContract ProtocolVersion ProtocolName ProtocolFamily } SlippageBasisPoints } Block { Time Number } } } } ``` > **Note:** This query can be converted to a subscription to monitor in real-time. Simply replace `query` with `subscription` to receive live updates whenever the pool's liquidity changes. ## Realtime Slippage Data via Kafka Streams Slippage data can also be obtained via Kafka streams for lower latency and better reliability. The Kafka topic for Matic DEX pools is: **`matic.dexpools.proto`** Kafka streams provide the same slippage data as GraphQL subscriptions but with several advantages: - Lower latency due to shorter data pipeline - Better reliability with persistent connections - Ability to read from latest offset without gaps - Better scalability with multiple consumers For detailed information on how to connect to Kafka streams, subscribe to topics, and parse messages, refer to the [Kafka Streaming Concepts documentation](/docs/streams/kafka-streaming-concepts/). > **Note:** IDE credentials will not work with Kafka Streams. You need separate Kafka credentials. Please contact sales on our official telegram channel or fill out the [form on our website](https://bitquery.io/forms/api). ## Understanding the Response The `DEXPoolSlippages` API response contains the following information: - **`Price`**: Price information for swaps at a specific slippage tolerance - **`AtoB`**: Price data for swapping CurrencyA to CurrencyB - `Price`: Average execution price for swaps at this slippage level - `MinAmountOut`: Minimum output amount guaranteed at this slippage level - `MaxAmountIn`: Maximum input amount that can be swapped at this slippage level - **`BtoA`**: Price data for swapping CurrencyB to CurrencyA (same structure as AtoB) - **`SlippageBasisPoints`**: Slippage tolerance in basis points (100 = 1%) - **`Pool`**: Pool information including token pair details - **`Dex`**: DEX protocol information (Uniswap V2, V3, V4, etc.) - **`Block`**: Block information when the slippage data was recorded - `Time`: Timestamp of the block - `Number`: Block number For more details on how slippage is calculated and when new pool records are emitted, see the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#when-is-a-new-dexpool-record-emitted-in-the-apis--streams). ## Use Cases ### Liquidity Depth Analysis Use the slippage API to analyze which pools can handle large trades without significant price impact. By examining `MaxAmountIn` values at different slippage levels, you can: - Identify pools with sufficient liquidity for your trade size - Determine optimal slippage tolerance settings - Estimate price impact before executing trades ### Multi-Pool Price Comparison Compare execution prices across different pools and slippage scenarios to: - Find the best pool for your specific trade size - Understand price differences between DEX protocols - Optimize trade execution strategies ### Trading Applications #### Live Execution Testing Use the slippage API to test and validate trade execution strategies in real-time: - **Pre-trade validation**: Check if your intended trade size can be executed within acceptable slippage bounds before submitting - **Execution simulation**: Calculate expected price impact and minimum output amounts for different trade sizes - **Strategy backtesting**: Monitor historical slippage data to validate trading algorithms and optimize entry/exit points - **Risk assessment**: Evaluate maximum position sizes that can be entered without exceeding your slippage tolerance #### Detecting Liquidity Shocks and Toxic Order Flow The slippage API helps identify temporary price dislocations and liquidity shocks that can be exploited or avoided: - **Flow toxicity detection**: Monitor sudden changes in `MaxAmountIn` values to detect when pools experience large outflows or inflows - **Price impact analysis**: Track how `MinAmountOut` changes relative to `MaxAmountIn` to identify when pools become less liquid - **Mean reversion opportunities**: Identify pools where large swaps have created temporary price dislocations that may revert - **Toxic order flow avoidance**: Use slippage data to avoid entering positions when liquidity is thin or when large trades are likely to move price against you For a practical implementation example of using slippage data for automated trading strategies, including flow toxicity detection and mean-reversion trading, see the [AMM Flow Toxicity Alpha Engine](https://github.com/Divyn/amm-flow-toxicity-alpha-engine) repository. This system demonstrates how to: - Detect large swaps that move price significantly (50-500 basis points) - Verify isolation from trending markets - Execute fade trades against temporary price impacts - Manage positions with dynamic stop losses and take profits based on slippage data For more advanced use cases, refer to the [DEXPools Cube documentation](/docs/cubes/evm-dexpool/#advanced-use-cases-and-processing-patterns). --- ## Polygon Matic Uniswap API URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-uniswap-api/ Polygon Uniswap API: GraphQL examples for v3 trades, top traders, hourly OHLC, 24-hour volume and top tokens, filtered to Uniswap's own factory. Most uniswap_v2 trades on Polygon are QuickSwap. # Matic Uniswap API :::tip Real-time data or the last 30 days? Use the Trading cube For real-time trades and anything from the last 30 days, use the [Trading cube](/docs/trading/trading-data-overview): [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns MEV-filtered swaps with a USD price on every row. Use the `EVM` queries on this page for raw per-swap detail or call and event context. An `EVM` query without a `dataset` argument runs on the realtime dataset, which holds only the last few days; add `dataset: combined` or `dataset: archive` for older history. ::: ## Filter by factory to exclude forks `Trade.Dex.ProtocolName` records which code a pool runs. Forks of v2 and v3 run the same code, so their trades carry the same `uniswap_v2` and `uniswap_v3` labels. In Bitquery's trade data for Polygon on 17 and 18 September 2026, about 89% of transactions labelled `uniswap_v2` went through other factories' pools, most of them QuickSwap's. For `uniswap_v3` it was about one in five. To keep only Uniswap's own pools, filter on the contract that owns them, as every example on this page now does. | Version | Filter field | Address on Polygon | | --- | --- | --- | | v2 | `Trade.Dex.OwnerAddress` | `0x9e5a52f57b3038f1b8eee45f28b3c1967e22799c` | | v3 | `Trade.Dex.OwnerAddress` | `0x1f98431c8ad98523631ae4a59f267346ea31f984` | | v4 | `Trade.Dex.SmartContract` | `0x67366782805870060151383f4bbff9dab53e5cd6` | `OwnerAddress` is the factory that deployed the pool. A v4 pool has no factory: its `OwnerAddress` is the zero address, and the PoolManager is its `SmartContract`. In the Trading cube, filter `Pair.Market.Address` to the v2 or v3 factory, or `Pair.Market.Program` to the v4 PoolManager. Addresses are from the official [deployments list](https://developers.uniswap.org/deployments). The link in each example's description opens an earlier copy saved in the Bitquery IDE, which may still filter by `ProtocolName` or use older conditions and time windows. Use the code on this page when you need Uniswap's own pools only. ## Live Uniswap v3 Trades on Polygon (Trading API, recommended) This subscription streams every Uniswap v3 trade on Polygon in real time with **USD price and USD amounts on every row**, MEV-filtered. Run it [in the IDE](https://ide.bitquery.io/Trading-API-Uniswap-v3-Trades-Matic). ```graphql subscription { Trading { Trades( where: {Pair: {Market: {Network: {is: "Matic"}, Address: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}}} ) { Block { Time } Price PriceInUsd AmountsInUsd { Base Quote } Trader { Address } Pair { Token { Symbol } QuoteToken { Symbol } Market { Protocol } } } } } ``` ## Get Latest Trades on Uniswap v3 The query below returns the [latest DEX trades on MATIC Uniswap v3](https://ide.bitquery.io/uniswap-v3-trades-matic). ```graphql query MyQuery { EVM(dataset: realtime, network: matic) { DEXTrades( where: {Trade: {Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}}} limit: {count: 10} orderBy:{descending:Block_Time} ) { Transaction { From To } Trade { Dex { ProtocolName SmartContract } Buy { Currency { Name } Price Amount } Sell { Amount Currency { Name } Price } } Block { Time } } } } ``` ## Get Top Traders of a token on uniswap v3 This query returns the [top traders of a token](https://ide.bitquery.io/top-traders-of-a-token-on-uniswapv3-matic) on the selected network. It ranks `Transaction.From`, the account that sent each swap, since on a sale `Trade.Buyer` is the pool or a router. `Side.Type` describes the counter-side of each trade, so `bought` sums the rows where `Side.Type` is `sell`. `PriceAsymmetry: {lt: 0.1}` drops trades whose two sides disagree badly on value ([PriceAsymmetry reference](/docs/graphql/metrics/priceAsymmetry/)), which would otherwise inflate the USD totals. ```graphql query topTraders($network: evm_network, $token: String) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: {Trade: {Currency: {SmartContract: {is: $token}}, Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}, PriceAsymmetry: {lt: 0.1}}} ) { Transaction { From } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } } bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}}) sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}}) volume: sum(of: Trade_Amount) volumeUsd: sum(of: Trade_Side_AmountInUSD) } } } { "network": "matic", "token": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" } ``` ## OHLC in USD of a Token This query retrieves [hourly open, high, low and close prices in USD](https://ide.bitquery.io/OHLCV-on-MATIC-uniswap-v3#) for one token traded on Uniswap v3. ```graphql { EVM(network: matic, dataset: realtime) { DEXTradeByTokens( orderBy: {descendingByField: "Block_testfield"} where: {Trade: {Currency: {SmartContract: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}}, PriceAsymmetry: {lt: 0.1}, Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}, Side: {Currency: {SmartContract: {is: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"}}, Type: {is: buy}}}} limit: {count: 10} ) { Block { testfield: Time(interval: {in: hours, count: 1}) } volume: sum(of: Trade_Amount) Trade { high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) open: PriceInUSD(minimum: Block_Number) close: PriceInUSD(maximum: Block_Number) } count } } } ``` ## Get trading volume, buy volume, sell volume of a token This query returns the [traded, buy and sell volume](https://ide.bitquery.io/trade_volume_matic_uniswapv3) of token `0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270` on Uniswap v3 over the last 24 hours. `PriceAsymmetry: {lt: 0.1}` drops mispriced trades, which would otherwise skew the USD sums. ```graphql query MyQuery { EVM(network: matic) { DEXTradeByTokens( where: {Trade: {Currency: {SmartContract: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}}, Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}, PriceAsymmetry: {lt: 0.1}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}} ) { Trade { Currency { Name Symbol SmartContract Decimals } } traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD) sell_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: buy}}}} ) buy_volume_in_usd: sum( of: Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: sell}}}} ) } } } ``` ## Get top bought tokens on uniswap v3 This query returns the [top bought tokens on Uniswap v3](https://ide.bitquery.io/top-bought-tokens-on-matic-uniswap-v3_4). Buys are the rows where `Side.Type`, the counter-side, is `sell`. The `PriceAsymmetry` filter keeps mispriced trades out of the totals. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "buy"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "matic" } ``` ## Get top sold tokens on uniswap v3 This query returns the [top sold tokens on Uniswap v3](https://ide.bitquery.io/top-sold-tokens-on-matic-uniswap-v3). Sales are the rows where `Side.Type`, the counter-side, is `buy`. ```graphql query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "sell"} limit: {count: 100} where: {Trade: {Dex: {OwnerAddress: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}}, PriceAsymmetry: {lt: 0.1}}} ) { Trade { Currency { Symbol Name SmartContract } Dex{ ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) } } } { "network": "matic" } ``` --- ## Polygon Transfers API: Token and POL Transfers, Whale Alerts, Backfills URL: https://docs.bitquery.io/docs/blockchain/Matic/matic-transfers/ Polygon transfers with Bitquery GraphQL: large USDC moves, one wallet's history and live activity, NFT transfers, a Polymarket check, gap-free backfills. # Polygon Transfers API: Token and POL Transfers, Whale Alerts, Backfills Every ERC-20, ERC-721, ERC-1155 and native POL transfer on Polygon is a row in the `Transfers` cube under `EVM(network: matic)`, with sender, receiver, amount, USD value where a price exists, the token, and the transaction. Polygon's volume has its own shape: stablecoin flows, Polymarket's conditional tokens, which are ERC-1155 and show up as NFT transfers, and bridge and distributor contracts that send tens of thousands of transfers an hour. The examples below pick from that. The same filters run as a query for the latest rows or as a subscription for a live feed, and `dataset: combined` on the root reaches history. 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. ## Large USDC transfers Native USDC on Polygon is `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359`. The query form lists transfers of 10,000 or more in the last day; change `query` to `subscription` and drop `Block`, `limit` and `orderBy` for an alert. Saved stream [here](https://ide.bitquery.io/Whale-transfers-of-USDC-on-matic). ```graphql { EVM(network: matic) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" } } Amount: { ge: "10000" } } Block: { Time: { since_relative: { hours_ago: 24 } } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Amount AmountInUSD Sender Receiver Currency { Symbol } } Transaction { Hash } } } } ``` ## Transfers sent by one wallet On the `combined` dataset the query shows a wallet's history even if it has been idle for months. Saved query [here](https://ide.bitquery.io/Sender-is-a-particular-address_2). ```graphql { EVM(network: matic, dataset: combined) { Transfers( where: { Transfer: { Sender: { is: "0x1A8f43e01B78979EB4Ef7feBEC60F32c9A72f58E" } } } limit: { count: 20 } orderBy: { descending: Block_Time } ) { Block { Time } Transfer { Amount AmountInUSD Currency { Symbol SmartContract Native } Receiver } Transaction { Hash } } } } ``` As a stream, pick an address that moves. The one below is a distributor contract that sends thousands of transfers an hour, so messages arrive at once; a personal wallet streams only when it transacts. ```graphql subscription { EVM(network: matic) { Transfers( where: { Transfer: { Sender: { is: "0xe111180000d2663c0091e4f400237545b87b996b" } } } ) { Block { Time } Transfer { Amount Currency { Symbol SmartContract } Receiver } Transaction { Hash } } } } ``` ## NFT transfers, including Polymarket positions `Currency.Fungible: false` keeps ERC-721 and ERC-1155 rows. On Polygon most of them are Polymarket outcome tokens, ERC-1155 positions minted and moved by the conditional tokens contract. Saved stream [here](https://ide.bitquery.io/NFT-Token-Transfers-API_3). ```graphql subscription { EVM(network: matic) { Transfers(where: { Transfer: { Currency: { Fungible: false } } }) { Block { Time } Transfer { Id Amount Sender Receiver Currency { Name SmartContract } } Transaction { Hash } } } } ``` ## Has an address ever used Polymarket Polymarket settles positions through the conditional tokens contract, `0x4d97dCd97eC945f40cF65F87097ACe5EA0476045`. One received transfer of its tokens is enough for a yes, which is cheaper than scanning prediction trades when a yes or no is all you need. Saved query [here](https://ide.bitquery.io/check-if-an-address-interacted-with-polymarket-ever). ```graphql { EVM(dataset: combined, network: matic) { Transfers( limit: { count: 1 } orderBy: { descending: Block_Time } where: { Transfer: { Receiver: { is: "0x0c79f21ec570f5cc0d52d1bc640845faef430ad2" } Currency: { SmartContract: { is: "0x4d97dCd97eC945f40cF65F87097ACe5EA0476045" } } } } ) { Block { Time } Transfer { Id Amount } Transaction { Hash } } } } ``` ## Deterministic pagination for backfilling To load transfers into your own index without gaps or repeats, page in a fixed order: the composite `orderBy` positions every transfer uniquely, and `offset` moves by `count` on each request, up to 25,000 rows per call. This ordering runs on the realtime window; on the `archive` dataset order by `Block_Number` and page one block range at a time. Saved query [here](https://ide.bitquery.io/Reliable-transfer-api). ```graphql { EVM(network: matic) { Transfers( where: { Transfer: { Success: true } } orderBy: { ascending: [ Block_Number Transaction_Index Call_Index Log_Index Transfer_Index Transfer_Type ] } limit: { count: 100, offset: 0 } ) { Block { Number Time } Transaction { Hash Index } Transfer { Amount Sender Receiver Index Type Currency { Symbol SmartContract Native } } Call { Index } Log { Index } } } } ``` ## Related pages - [Polygon API hub](/docs/blockchain/Matic/) - [Polygon DEX trades API](/docs/blockchain/Matic/matic-dextrades) - [Polygon NFT API](/docs/blockchain/Matic/matic-nft) - [Transfers cube](/docs/cubes/transfers-cube) --- ## Polygon Uniswap V4 API URL: https://docs.bitquery.io/docs/blockchain/Matic/uniswap-v4-api/ Polygon Uniswap V4 API: query Polygon Uniswap trades, pools, and prices with Bitquery GraphQL DEX APIs. Copy GraphQL snippets for production apps. # Uniswap V4 API - Track Trader Activities, Token Trades and Market Behavior :::tip Need real-time Uniswap V4 (Polygon) 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 Uniswap V4 (Polygon) swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Uniswap V4 (Polygon) data older than ~30 days**, raw per-swap detail, or call / event context. ::: Uniswap v4 introduces a major shift in protocol architecture. Instead of deploying a separate smart contract for each liquidity pool, Uniswap v4 uses a singleton PoolManager contract that manages all pools internally as structured state. Each pool in Uniswap v4 is uniquely identified by a `PoolId`, which is derived from the pool configuration (token pair, fee, tick spacing, and optional hooks), rather than a dedicated contract address. Using Bitquery's Uniswap v4 APIs, you can track: - DEX trades across all v4 pools - Trades by specific traders - Token-level trade activity - Real-time trade metrics The Uniswap v4 PoolManager contract emits all pool-related events, including pool initialization, swaps, and liquidity modifications, and serves as the single on-chain source of truth for Uniswap v4 activity on Matic. ## Real time Trades on Uniswap V4 [This](https://ide.bitquery.io/Real-time-trades-for-uniswap-v4-matic) subscription allows user to stream trades on Uniswap V4 in real time on Matic. ```graphql subscription { EVM(network: matic) { DEXTrades(where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}}}) { Block{ Time } Trade { PoolId Buy { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD Seller } } Transaction { From To Hash } } } } ``` ## Get All Pool Ids for a Currency Using [this](https://ide.bitquery.io/get-virtual-pool-address-for-a-token-on-uniswap-v4-matic) API we can get all the virtual pool addresses (`PoolId`) for a currency on Matic. ```graphql query MyQuery { EVM(network: matic) { DEXTradeByTokens( where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}, Currency: {SmartContract: {is: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063"}}}} ) { Trade { PoolId } count } } } ``` ## Latest Trades for a Specific Currencies Pair [This](https://ide.bitquery.io/Latest-Trades-for-a-currency-pair-on-matic_1) API endpoint allows us to filter out the latest trades for a specific pair on Matic, using `PoolId` as a filter option. ```graphql { EVM(network: matic) { DEXTrades( orderBy: {descending: Block_Time} limit: {count: 100} where: {Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}, PoolId: {is: "0x23bf8c631d30c092865d2f583f601a7080b7e3f4cb3dcbf29e622a693087a916"}}} ) { Block { Time } Trade { PoolId Buy { Currency { Name Symbol SmartContract Decimals } Amount AmountInUSD Price PriceInUSD Seller } Sell { Currency { Name Symbol SmartContract Decimals } Buyer Amount AmountInUSD Price PriceInUSD } } Transaction { From To Hash } } } } ``` ## Uniswap V4 Pair Trade Stats Using [this](https://ide.bitquery.io/trade-stats-for-a-token-pair-on-uniswap-v4-matic_1) query get pool stats (volume, bought, sold) for a specific Uniswap V4 pool on Matic. ```graphql query pairTopTraders { EVM(network: matic, dataset: realtime) { DEXTradeByTokens( orderBy: { descendingByField: "volumeUsd" } where: { Block:{ Time: {since_relative: {days_ago: 1}} } Trade: { Dex: { ProtocolName: {is: "uniswap_v4"} } PoolId: {is: "0x23bf8c631d30c092865d2f583f601a7080b7e3f4cb3dcbf29e622a693087a916"} } } ) { Trade { Currency{ Name Symbol SmartContract } } 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) } } } ``` ## Top Buyers of a Token on Uniswap V4 [This](https://ide.bitquery.io/top-buyers-of-a-currency-on-uniswap-v4-matic) API returns the top buyers of a token on Uniswap V4 virtual pool on Matic, along with the amount bought in token denominations and USD. ```graphql { EVM(network: matic) { DEXTrades( orderBy: {descendingByField: "bought_in_usd"} limit: {count: 100} where: { Trade: { Dex: {ProtocolName: {is: "uniswap_v4"}}, Buy: {Currency: {SmartContract: {is: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063"}}} PoolId: {is: "0x23bf8c631d30c092865d2f583f601a7080b7e3f4cb3dcbf29e622a693087a916"} } } ) { Trade { Sell { Currency { Name Symbol SmartContract Decimals } Buyer } } bought:sum(of: Trade_Buy_Amount) bought_in_usd:sum(of: Trade_Buy_AmountInUSD) } } } ``` ## Top Sellers of a Token on Uniswap V4 [This](https://ide.bitquery.io/top-sellers-of-a-token-on-uniswap-v4-pool-matic) API returns the top sellers of a token on Uniswap V4 virtual pool on Matic, along with the amount sold in token denominations and USD. ```graphql { EVM(network: matic) { DEXTrades( orderBy: {descendingByField: "sold_in_usd"} limit: {count: 10} where: { Trade: { Dex: {ProtocolName: {is: "uniswap_v4"}}, Sell: {Currency: {SmartContract: {is: "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063"}}} PoolId: {is: "0x23bf8c631d30c092865d2f583f601a7080b7e3f4cb3dcbf29e622a693087a916"} } } ) { Trade { Buy { Currency { Name Symbol SmartContract Decimals } Seller } } sold:sum(of: Trade_Buy_Amount) sold_in_usd:sum(of: Trade_Buy_AmountInUSD) } } } ``` --- ## RadarDEX Launchpad API on Arc: Tokens, Trades and OHLCV URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/radardex-launchpad-api/ Track RadarDEX Classic and Reflection token launches on Circle Arc. Query swaps, traders, USD prices and OHLCV with Bitquery Trading APIs and streams. # RadarDEX Launchpad API on Arc: Tokens, Trades and OHLCV [RadarDEX](https://www.radardex.pro/) offers Classic and Reflection token launches on Arc, Circle's EVM chain. Its launch page describes opening a Uniswap v3 pool when a token is created. Monitor both factories to build a list of RadarDEX launches. RadarDEX's site states that it does not currently have its own token. A token name or symbol cannot prove that it belongs to the platform; match the launch contract and event. Use `EVM.Events` to find launches. All trading examples below use `Trading.Trades`, `Trading.Pairs`, or `Trading.Tokens`. :::note API access Run the saved examples in the Bitquery IDE, or create an [API access token](/docs/authorization/how-to-generate/) for `https://streaming.bitquery.io/graphql`. For streams, use `wss://streaming.bitquery.io/graphql` with [WebSocket authorization](/docs/authorization/websocket/). ::: ## Find the latest RadarDEX token launches Filter by the factory address and the `TokenLaunched` signature. The checks for transaction success and reverted calls exclude failed launches. The 24-hour filter covers only the history currently indexed. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-latest-launches) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: { Address: {in: ["0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a", "0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8"]} Removed: false } Log: {Signature: {SignatureHash: {is: "851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` ## Contracts and token identity | Contract | Arc address | | --- | --- | | RadarDEX Classic | `0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a` | | RadarDEX Reflection | `0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8` | The launch event signature is `851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66`. These contract/event pairs were checked against Arc data on 16 September 2026. Keep older factory addresses in your own registry when you need earlier launches. See the [RadarDEX site](https://www.radardex.pro/) and the [Arc launchpad contract list](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/#verified-launchpad-contracts). The response's `Topics` array uses these positions: - `Topics[0].Hash`: event signature. - `Topics[1].Hash`: token address, padded on the left to 32 bytes. Take the final 40 hex characters of `Topics[1].Hash`, add `0x`, and lowercase the address. To query Trading, prefix the result with `bid:arc:`. For example, SLJ's token ID is `bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483`. These examples use two tokens whose launch events matched the RadarDEX factory: | Sample token | Contract | | --- | --- | | SLJ | `0xa6fe05d5c5beb68aae0496830199f9b36a5d4483` | | ARCG | `0x458f4cf6db2458de50ae1727fc64043af3f39ff9` | They are user-created examples. Replace their addresses with a token returned by the launch query. Save each token's factory, launch time and transaction hash in your application. :::tip Build a launchpad token list The Trading cubes do not attach a RadarDEX launchpad label to each token. Build that list from launch events, then pass the token IDs into Trading queries. For Uniswap v2/v3, `Pair.Market.Address` is the DEX factory and `Pair.Pool.Address` is the pool. For Uniswap v4, `Pair.Market.Address` can be empty and several pools share `Pair.Pool.Address`; include `Pair.Pool.Id` to select one pool. These trading fields do not identify the launchpad that created the token. ::: ## Stream new RadarDEX launches Subscribe with the same factory and signature filters. The decoded event name may be empty; the signature and raw topics still identify the launch. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-launch-stream) ```graphql subscription { EVM(network: arc) { Events( where: { TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: { Address: {in: ["0x4b638c1502a07a8e1a26112ee98f51a3f34bc93a", "0x2d933ce4bde6f3d99540b5d7886b383e59b2b2f8"]} Removed: false } Log: {Signature: {SignatureHash: {is: "851d681a32f0efba577c4a1bd412f74b575764a6b91e499a05a48a23f3821d66"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` Append new token IDs to your application's list. A Trading subscription has fixed filters: resubscribe with the updated list when a new launch arrives. Keep a time checkpoint and query recent events after reconnecting; the HTTP endpoint and WebSocket do not join these steps for you. Deduplicate launch records by transaction hash and log index. ## Recent trades for a RadarDEX token Match the token on either side of the pair. This includes trades where it is the quote asset. The `Uniswap` family filter selects the v2/v3/v4 markets observed for Arc; extend the family filter when you verify another venue. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-recent-trades) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` `Side` is relative to `Pair.Token`. If the selected token is `Pair.QuoteToken`, reverse Buy/Sell when describing that token's direction. `PriceInUsd` also refers to `Pair.Token` and is an indexed reference price; use the amount ratio when you need the executed price. Use `AmountsInUsd.Quote` for quoted USD turnover. Do not add base and quote USD amounts from the same row. One transaction can contain several swaps; use a distinct transaction hash count for transaction totals. ## Stream trades for a RadarDEX token The same token filters work as a Trading subscription. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-trade-stream) ```graphql subscription { Trading { Trades( where: { Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` For several tokens, replace each `is` token filter with an `in` list. Keep both the base-token and quote-token branches. ## Rank a RadarDEX token watchlist by volume This sample ranks SLJ and ARCG over the last 24 hours. It includes only rows where a listed token is `Pair.Token`, so the Buy/Sell counts have a consistent meaning. Extend the list from launch events to cover more tokens. It is not a total for the whole launchpad. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-watchlist-volume) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: { Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Token: {Id: {in: [ "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483" "bid:arc:0x458f4cf6db2458de50ae1727fc64043af3f39ff9" ]}} } } ) { Pair {Token {Id Symbol}} trades: count transactions: count(distinct: TransactionHeader_Hash) traders: count(distinct: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) buys: count(if: {Side: {is: "Buy"}}) sells: count(if: {Side: {is: "Sell"}}) } } } ``` The time filter measures trading during the selected window. It does not restrict token creation time; keep launch timestamps in your own token registry if you need a new-launch cohort. :::caution Counts and volume These server aggregates count the indexed rows. The [Trading Trades field notes](/docs/trading/crypto-trades-api/trades-api/#before-you-aggregate-three-things-about-a-trades-row) describe duplicate rows that can affect exact totals. For audited figures, fetch the underlying rows and check duplicates before summing. Wallet counts refer to addresses, not people. ::: ## Most active traders for a RadarDEX token Rank wallets by quoted USD turnover across both pair orientations. This measures activity, not profit. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-top-traders) ```graphql query { Trading { Trades( limit: {count: 10} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}}}} ] } ) { Trader {Address} trades: count transactions: count(distinct: TransactionHeader_Hash) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest price from the top market Use `Trading.Pairs` with rank 1 to retrieve the token's most recent one-minute price interval from its top market. Inspect `Interval.Time.End`: a quiet token can return an old interval. Rank 1 may return no row when the top market has not traded within the requested window. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-top-market-price) ```graphql query { Trading { Pairs( limit: {count: 1} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}} Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Ranking: {Position: {eq: 1}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} QuoteToken {Id Symbol} Pool {Address Id} Market {Network Protocol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Close}} Ranking {Position Weight} Volume {Usd} } } } ``` For broader token coverage, use the [Tokens cube](/docs/trading/crypto-price-api/tokens/). For a fixed pool's history, use the [Pairs cube](/docs/trading/crypto-price-api/pairs/) with `Pool.Address`; on Uniswap v4, also filter by its non-empty `Pool.Id`. Keep the Arc network filter. ## One-minute OHLCV candles `Trading.Tokens` combines indexed pools for the token. This query returns up to 120 rows for one-minute intervals within the last 24 hours, newest first. Resolve repeated interval rows as noted below, then plot from oldest to newest. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-radardex-ohlcv-candles) ```graphql query { Trading { Tokens( limit: {count: 120} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xa6fe05d5c5beb68aae0496830199f9b36a5d4483"}, NetworkBid: {is: "bid:arc"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Open High Low Close}} Volume {Base Usd} } } } ``` `Volume.Usd` is USD volume and `Volume.Base` is token units. These candles can differ from a single pool's price. Empty intervals may be absent; treat a missing interval as missing data unless your chart has an explicit fill rule. The current interval may still change. Token symbols can arrive after price data, so the same `Token.Id` and `Interval.Time.Start` may appear more than once. Check repeated keys before plotting; do not sum repeated rows or drop conflicting values without a rule. See the [Tokens field notes](/docs/trading/crypto-price-api/tokens/#field-notes). To stream candles, change `query` to `subscription`, remove `limit`, `orderBy`, and the historical `Block.Time` filter, and keep the token and interval filters. ## Related APIs - [Tolly Launchpad API](/docs/blockchain/arc-mainnet/tolly-launchpad-api/) - [Arc Launchpads API](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) - [Arc Blockchain API](/docs/blockchain/arc-mainnet/) - [Trading Trades API](/docs/trading/crypto-trades-api/trades-api/) - [Trading Tokens OHLCV API](/docs/trading/crypto-price-api/tokens/) --- ## Tolly Launchpad API on Arc: Tokens, Trades and OHLCV URL: https://docs.bitquery.io/docs/blockchain/arc-mainnet/tolly-launchpad-api/ Track Tolly token launches on Circle Arc with Bitquery. Use GraphQL and WebSocket APIs for new tokens, Trading cube swaps, USD prices and OHLCV candles. # Tolly Launchpad API on Arc: Tokens, Trades and OHLCV [Tolly](https://tollylabs.com/guide) is a token launchpad on Arc, Circle's EVM chain. Its guide describes launches with USDC liquidity and trading from the first block. Track tokens created by its factory, then follow their trades across indexed markets. Use `EVM.Events` to find launches. All trading examples below use `Trading.Trades`, `Trading.Pairs`, or `Trading.Tokens`. :::note API access Run the saved examples in the Bitquery IDE, or create an [API access token](/docs/authorization/how-to-generate/) for `https://streaming.bitquery.io/graphql`. For streams, use `wss://streaming.bitquery.io/graphql` with [WebSocket authorization](/docs/authorization/websocket/). ::: ## Find the latest Tolly token launches Filter by the factory address and the `TokenCreated` signature. The checks for transaction success and reverted calls exclude failed launches. The 24-hour filter covers only the history currently indexed. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-latest-launches) ```graphql query { EVM(network: arc) { Events( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: { Address: {in: ["0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b"]} Removed: false } Log: {Signature: {SignatureHash: {is: "875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` ## Contracts and token identity | Contract | Arc address | | --- | --- | | Tolly launch factory | `0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b` | The launch event signature is `875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255`. These contract/event pairs were checked against Arc data on 16 September 2026. Keep older factory addresses in your own registry when you need earlier launches. See the [Tolly site](https://tollylabs.com/guide) and the [Arc launchpad contract list](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/#verified-launchpad-contracts). The response's `Topics` array uses these positions: - `Topics[0].Hash`: event signature. - `Topics[1].Hash`: token address, padded on the left to 32 bytes. Take the final 40 hex characters of `Topics[1].Hash`, add `0x`, and lowercase the address. To query Trading, prefix the result with `bid:arc:`. For example, GLOVE's token ID is `bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e`. These examples use two tokens whose launch events matched the Tolly factory: | Sample token | Contract | | --- | --- | | GLOVE | `0xc17c325c02b65e35827ceed47c2ac581f45c251e` | | ARCANGEL | `0xf3729ac6530f9c8e9875728faacc6ca3f374371a` | They are user-created examples. Replace their addresses with a token returned by the launch query. Save each token's factory, launch time and transaction hash in your application. :::tip Build a launchpad token list The Trading cubes do not attach a Tolly launchpad label to each token. Build that list from launch events, then pass the token IDs into Trading queries. For Uniswap v2/v3, `Pair.Market.Address` is the DEX factory and `Pair.Pool.Address` is the pool. For Uniswap v4, `Pair.Market.Address` can be empty and several pools share `Pair.Pool.Address`; include `Pair.Pool.Id` to select one pool. These trading fields do not identify the launchpad that created the token. ::: ## Stream new Tolly launches Subscribe with the same factory and signature filters. The decoded event name may be empty; the signature and raw topics still identify the launch. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-launch-stream) ```graphql subscription { EVM(network: arc) { Events( where: { TransactionStatus: {Success: true} Call: {Success: true, Reverted: false} LogHeader: { Address: {in: ["0xcad7ee36ac193bf2eddb7b3e2736c5bdb8269c8b"]} Removed: false } Log: {Signature: {SignatureHash: {is: "875522b092d9e19a1de359e4bd218090d582fa521c9733889acf1a5ff1941255"}}} } ) { Block {Number Time} Transaction {Hash From} LogHeader {Address Index} Log {Signature {SignatureHash}} Topics {Hash} } } } ``` Append new token IDs to your application's list. A Trading subscription has fixed filters: resubscribe with the updated list when a new launch arrives. Keep a time checkpoint and query recent events after reconnecting; the HTTP endpoint and WebSocket do not join these steps for you. Deduplicate launch records by transaction hash and log index. ## Recent trades for a Tolly token Match the token on either side of the pair. This includes trades where it is the quote asset. The `Uniswap` family filter selects the v2/v3/v4 markets observed for Arc; extend the family filter when you verify another venue. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-recent-trades) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descending: Block_Time} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` `Side` is relative to `Pair.Token`. If the selected token is `Pair.QuoteToken`, reverse Buy/Sell when describing that token's direction. `PriceInUsd` also refers to `Pair.Token` and is an indexed reference price; use the amount ratio when you need the executed price. Use `AmountsInUsd.Quote` for quoted USD turnover. Do not add base and quote USD amounts from the same row. One transaction can contain several swaps; use a distinct transaction hash count for transaction totals. ## Stream trades for a Tolly token The same token filters work as a Trading subscription. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-trade-stream) ```graphql subscription { Trading { Trades( where: { Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} ] } ) { Block {Time} TransactionHeader {Hash Index} Trader {Address} Side Amounts {Base Quote} AmountsInUsd {Quote} PriceInUsd Pair { Token {Id Symbol} QuoteToken {Id Symbol} Market {Network Protocol} Pool {Address Id} } } } } ``` For several tokens, replace each `is` token filter with an `in` list. Keep both the base-token and quote-token branches. ## Rank a Tolly token watchlist by volume This sample ranks GLOVE and ARCANGEL over the last 24 hours. It includes only rows where a listed token is `Pair.Token`, so the Buy/Sell counts have a consistent meaning. Extend the list from launch events to cover more tokens. It is not a total for the whole launchpad. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-watchlist-volume) ```graphql query { Trading { Trades( limit: {count: 20} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: { Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Token: {Id: {in: [ "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e" "bid:arc:0xf3729ac6530f9c8e9875728faacc6ca3f374371a" ]}} } } ) { Pair {Token {Id Symbol}} trades: count transactions: count(distinct: TransactionHeader_Hash) traders: count(distinct: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) buys: count(if: {Side: {is: "Buy"}}) sells: count(if: {Side: {is: "Sell"}}) } } } ``` The time filter measures trading during the selected window. It does not restrict token creation time; keep launch timestamps in your own token registry if you need a new-launch cohort. :::caution Counts and volume These server aggregates count the indexed rows. The [Trading Trades field notes](/docs/trading/crypto-trades-api/trades-api/#before-you-aggregate-three-things-about-a-trades-row) describe duplicate rows that can affect exact totals. For audited figures, fetch the underlying rows and check duplicates before summing. Wallet counts refer to addresses, not people. ::: ## Most active traders for a Tolly token Rank wallets by quoted USD turnover across both pair orientations. This measures activity, not profit. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-top-traders) ```graphql query { Trading { Trades( limit: {count: 10} orderBy: {descendingByField: "volumeUsd"} where: { Block: {Time: {since_relative: {hours_ago: 24}}} Pair: {Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}}} any: [ {Pair: {Token: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} {Pair: {QuoteToken: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}}}} ] } ) { Trader {Address} trades: count transactions: count(distinct: TransactionHeader_Hash) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest price from the top market Use `Trading.Pairs` with rank 1 to retrieve the token's most recent one-minute price interval from its top market. Inspect `Interval.Time.End`: a quiet token can return an old interval. Rank 1 may return no row when the top market has not traded within the requested window. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-top-market-price) ```graphql query { Trading { Pairs( limit: {count: 1} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}} Market: {NetworkBid: {is: "bid:arc"}, ProtocolFamily: {is: "Uniswap"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Ranking: {Position: {eq: 1}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} QuoteToken {Id Symbol} Pool {Address Id} Market {Network Protocol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Close}} Ranking {Position Weight} Volume {Usd} } } } ``` For broader token coverage, use the [Tokens cube](/docs/trading/crypto-price-api/tokens/). For a fixed pool's history, use the [Pairs cube](/docs/trading/crypto-price-api/pairs/) with `Pool.Address`; on Uniswap v4, also filter by its non-empty `Pool.Id`. Keep the Arc network filter. ## One-minute OHLCV candles `Trading.Tokens` combines indexed pools for the token. This query returns up to 120 rows for one-minute intervals within the last 24 hours, newest first. Resolve repeated interval rows as noted below, then plot from oldest to newest. [Run in Bitquery IDE](https://ide.bitquery.io/arc-mainnet-tolly-ohlcv-candles) ```graphql query { Trading { Tokens( limit: {count: 120} orderBy: {descending: Block_Time} where: { Token: {Id: {is: "bid:arc:0xc17c325c02b65e35827ceed47c2ac581f45c251e"}, NetworkBid: {is: "bid:arc"}} Block: {Time: {since_relative: {hours_ago: 24}}} Interval: {Time: {Duration: {eq: 60}}} Price: {IsQuotedInUsd: true} } ) { Token {Id Symbol} Interval {Time {Start End Duration}} Price {IsQuotedInUsd Ohlc {Open High Low Close}} Volume {Base Usd} } } } ``` `Volume.Usd` is USD volume and `Volume.Base` is token units. These candles can differ from a single pool's price. Empty intervals may be absent; treat a missing interval as missing data unless your chart has an explicit fill rule. The current interval may still change. Token symbols can arrive after price data, so the same `Token.Id` and `Interval.Time.Start` may appear more than once. Check repeated keys before plotting; do not sum repeated rows or drop conflicting values without a rule. See the [Tokens field notes](/docs/trading/crypto-price-api/tokens/#field-notes). To stream candles, change `query` to `subscription`, remove `limit`, `orderBy`, and the historical `Block.Time` filter, and keep the token and interval filters. ## Related APIs - [RadarDEX Launchpad API](/docs/blockchain/arc-mainnet/radardex-launchpad-api/) - [Arc Launchpads API](/docs/blockchain/arc-mainnet/arc-mainnet-launchpads-api/) - [Arc Blockchain API](/docs/blockchain/arc-mainnet/) - [Trading Trades API](/docs/trading/crypto-trades-api/trades-api/) - [Trading Tokens OHLCV API](/docs/trading/crypto-price-api/tokens/) --- ## Velodrome API on Optimism: Live Trades, Pools, VELO Price and Traders URL: https://docs.bitquery.io/docs/blockchain/Optimism/velodrome-api/ Velodrome on Optimism with Bitquery GraphQL: live swaps across v2 and Slipstream, top pools by USD volume, VELO price, top traders and swaps of one pool. # Velodrome API on Optimism: Live Trades, Pools, VELO Price and Traders Velodrome is the busiest DEX on Optimism by trade count. Bitquery indexes it as two protocols: `velodrome_v2`, the classic stable and volatile pools, and `velodrome_slipstream`, the concentrated-liquidity pools. Both share `ProtocolFamily` `Velodrome`, so one filter covers the whole DEX. The two behave very differently: v2 has hundreds of pools and a lot of small automated trades, while Slipstream has a few dozen pools that carry nearly all the USD volume. The [Slipstream page](/docs/blockchain/Optimism/velodrome-slipstream-api) goes deeper on those pools. 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. Examples use the [Trading cube](/docs/trading/trading-data-overview), which adds the trader, USD amounts and the pool address on every row for the last month or so; the last example uses the chain-level `DEXTrades` cube. A few swaps in thin pools carry absurd USD values, so every USD sum here caps a single trade with `AmountsInUsd: { Quote: { lt: 10000000 } }`. The VELO token is `0x9560e827af36c94d2ac33a39bce1fe78631088db`. ## Live Velodrome swaps on Optimism One message per swap across both Velodrome protocols: side, trader, both amounts in USD, the pool and the protocol. Saved stream [here](https://ide.bitquery.io/velodrome-live-trades-optimism). ```graphql subscription VelodromeLiveTradesOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } } } ) { Block { Time } Side Trader { Address } Amounts { Base Quote } AmountsInUsd { Base Quote } PriceInUsd Pair { Token { Symbol Address } QuoteToken { Symbol Address } Pool { Address } Market { Protocol } } TransactionHeader { Hash } } } } ``` ## Velodrome v2 vs Slipstream Group the last day by protocol to see the split: trades, unique traders, active pools and USD volume. Saved query [here](https://ide.bitquery.io/velodrome-v2-vs-slipstream-optimism). ```graphql query VelodromeV2VsSlipstreamOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { lt: 10000000 } } } orderBy: { descendingByField: "volumeUsd" } ) { Pair { Market { Protocol } } count traders: uniq(of: Trader_Address) pools: uniq(of: Pair_Pool_Address) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Top Velodrome pools by volume Pools ranked by USD volume over the last day, with the protocol, both tokens, trade count and traders. This is where a pool address for the other queries comes from. Saved query [here](https://ide.bitquery.io/velodrome-top-pools-optimism). ```graphql query VelodromeTopPoolsOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { lt: 10000000 } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Pair { Pool { Address } Market { Protocol } Token { Symbol Address } QuoteToken { Symbol Address } } count traders: uniq(of: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest VELO price The newest VELO trades carry the price in USD, the quote token, the pool and the market cap. Saved query [here](https://ide.bitquery.io/velo-token-price-optimism). ```graphql query VeloTokenPriceOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" } } Token: { Address: { is: "0x9560e827af36c94d2ac33a39bce1fe78631088db" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descending: Block_Time } limit: { count: 10 } ) { Block { Time } Side PriceInUsd Amounts { Base } AmountsInUsd { Quote } Pair { QuoteToken { Symbol } Pool { Address } Market { Protocol } } Supply { MarketCap } } } } ``` ## Top traders on Velodrome Wallets ranked by USD volume over the last day, with the number of pools each one touched. Order by `count` instead to surface the high-frequency bots. Saved query [here](https://ide.bitquery.io/velodrome-top-traders-optimism). ```graphql query VelodromeTopTradersOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { lt: 10000000 } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 25 } ) { Trader { Address } count pools: uniq(of: Pair_Pool_Address) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest swaps of one v2 pool The chain-level `DEXTrades` cube filtered on the protocol and the pool contract, here VELO/WETH `0x58e6433a6903886e440ddf519ecc573c4046a6b2`. Use this cube with `dataset: combined` on the `EVM` root for history older than the Trading cube keeps. Saved query [here](https://ide.bitquery.io/velodrome-v2-pool-swaps-optimism). ```graphql query VelodromeV2PoolSwapsOptimism { EVM(network: optimism) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "velodrome_v2" } SmartContract: { is: "0x58e6433a6903886e440ddf519ecc573c4046a6b2" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descending: Block_Time } limit: { count: 20 } ) { Block { Time } Transaction { Hash From } Trade { Buy { Amount AmountInUSD Currency { Symbol SmartContract } } Sell { Amount AmountInUSD Currency { Symbol SmartContract } } Dex { ProtocolName SmartContract } } } } } ``` ## Related pages - [Velodrome Slipstream API](/docs/blockchain/Optimism/velodrome-slipstream-api) - [Optimism DEX trades API](/docs/blockchain/Optimism/optimism-dextrades) - [Optimism Uniswap v4 API](/docs/blockchain/Optimism/uniswap-v4-api) - [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api) --- ## Velodrome Slipstream API: Concentrated Liquidity Pools, Swaps and Candles on Optimism URL: https://docs.bitquery.io/docs/blockchain/Optimism/velodrome-slipstream-api/ Velodrome Slipstream on Optimism with Bitquery GraphQL: live swaps, top concentrated-liquidity pools, WETH/USDC pool swaps, hourly candles, top traders and whale swaps. # Velodrome Slipstream API: Concentrated Liquidity Pools, Swaps and Candles on Optimism Slipstream is Velodrome's concentrated-liquidity pool type, and on Optimism it is where Velodrome's real volume trades: a few dozen pools, led by WETH/USDC, USDC/USDT, WBTC/USDC and OP/USDC. Bitquery indexes it as protocol `velodrome_slipstream`, inside `ProtocolFamily` `Velodrome`; the [Velodrome page](/docs/blockchain/Optimism/velodrome-api) covers the whole DEX and the v2 pools. Every example runs in the [IDE](https://ide.bitquery.io) and uses the [Trading cube](/docs/trading/trading-data-overview), which carries the trader, USD amounts and the pool address on every row for the last month or so. Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. USD sums cap a single trade with `AmountsInUsd: { Quote: { lt: 10000000 } }` to keep out the rare mispriced swap. The worked pool is WETH/USDC, `0x478946bcd4a5a22b316470f5486fafb928c0ba25`, with WETH `0x4200000000000000000000000000000000000006` and native USDC `0x0b2c639c533813f4aa9d7837caf62653d097ff85`. ## Live Slipstream swaps One message per swap in any Slipstream pool: side, trader, amounts in USD and the pool address. Saved stream [here](https://ide.bitquery.io/velodrome-slipstream-live-trades-optimism). ```graphql subscription SlipstreamLiveTradesOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, Protocol: { is: "velodrome_slipstream" } } } } ) { Block { Time } Side Trader { Address } Amounts { Base Quote } AmountsInUsd { Base Quote } PriceInUsd Pair { Token { Symbol Address } QuoteToken { Symbol Address } Pool { Address } } TransactionHeader { Hash } } } } ``` ## Top Slipstream pools by volume Pools ranked by USD volume over the last day with both tokens, trade count and unique traders. Several pools can exist for the same pair at different fee tiers, so WETH/USDC appears more than once. Saved query [here](https://ide.bitquery.io/velodrome-slipstream-top-pools-optimism). ```graphql query SlipstreamTopPoolsOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, Protocol: { is: "velodrome_slipstream" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { lt: 10000000 } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 20 } ) { Pair { Pool { Address } Token { Symbol Address } QuoteToken { Symbol Address } } count traders: uniq(of: Trader_Address) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Latest swaps in the WETH/USDC pool Filter on `Pair.Pool.Address`. Each row has the side, the trader, the WETH price in USD and the transaction hash. Saved query [here](https://ide.bitquery.io/velodrome-slipstream-weth-usdc-pool-swaps). ```graphql query SlipstreamWethUsdcPoolSwaps { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" } } Pool: { Address: { is: "0x478946bcd4a5a22b316470f5486fafb928c0ba25" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } } orderBy: { descending: Block_Time } limit: { count: 20 } ) { Block { Time } Side Trader { Address } PriceInUsd Amounts { Base Quote } AmountsInUsd { Quote } Pair { Token { Symbol } QuoteToken { Symbol } } TransactionHeader { Hash } } } } ``` ## Hourly candles of the pool The `Pairs` cube gives OHLC and volume per pool. `Duration` is in seconds: 60, 300, 3600 and so on. Saved query [here](https://ide.bitquery.io/velodrome-slipstream-weth-usdc-pool-candles). ```graphql query SlipstreamWethUsdcPoolCandles { Trading { Pairs( where: { Pool: { Address: { is: "0x478946bcd4a5a22b316470f5486fafb928c0ba25" } } Token: { Address: { is: "0x4200000000000000000000000000000000000006" } } Market: { Network: { is: "Optimism" } } Interval: { Time: { Duration: { eq: 3600 } } } Price: { IsQuotedInUsd: true } } orderBy: { descending: Interval_Time_Start } limit: { count: 24 } ) { Interval { Time { Start Duration } } Token { Symbol } QuoteToken { Symbol } Price { Ohlc { Open High Low Close } } Volume { Base Usd } } } } ``` ## Top traders of the pool Wallets ranked by USD volume in the pool over the last day, with buy and sell counts. Fixing `Token` to WETH counts each swap once. Saved query [here](https://ide.bitquery.io/velodrome-slipstream-pool-top-traders). ```graphql query SlipstreamPoolTopTraders { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" } } Pool: { Address: { is: "0x478946bcd4a5a22b316470f5486fafb928c0ba25" } } Token: { Address: { is: "0x4200000000000000000000000000000000000006" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { lt: 10000000 } } } orderBy: { descendingByField: "volumeUsd" } limit: { count: 25 } ) { Trader { Address } count buys: count(if: { Side: { is: "Buy" } }) sells: count(if: { Side: { is: "Sell" } }) volumeUsd: sum(of: AmountsInUsd_Quote) } } } ``` ## Whale swaps on Slipstream Swaps above 50,000 USD across all Slipstream pools in the last day, largest first. Turn it into a stream for a live large-trade alert. Saved query [here](https://ide.bitquery.io/velodrome-slipstream-whale-swaps-optimism). ```graphql query SlipstreamWhaleSwapsOptimism { Trading { Trades( where: { Pair: { Market: { Network: { is: "Optimism" }, Protocol: { is: "velodrome_slipstream" } } } Block: { Time: { since_relative: { hours_ago: 24 } } } AmountsInUsd: { Quote: { gt: 50000, lt: 10000000 } } } orderBy: { descending: AmountsInUsd_Quote } limit: { count: 25 } ) { Block { Time } Side Trader { Address } AmountsInUsd { Quote } Pair { Token { Symbol } QuoteToken { Symbol } Pool { Address } } TransactionHeader { Hash } } } } ``` ## Related pages - [Velodrome API on Optimism](/docs/blockchain/Optimism/velodrome-api) - [Optimism DEX trades API](/docs/blockchain/Optimism/optimism-dextrades) - [Optimism Uniswap v4 API](/docs/blockchain/Optimism/uniswap-v4-api) - [Crypto Price API](/docs/trading/crypto-price-api/) --- ## esGMX (Escrowed) and vGLP (Vested) API URL: https://docs.bitquery.io/docs/blockchain/Arbitrum/esgmx-api/ esGMX and vGLP on Arbitrum: query the latest esGMX transfers and claims, plus vGLP vesting deposits and withdrawals, with ready GraphQL examples. # esGMX (Escrowed) and vGLP (Vested) API When a wallet stakes GMX tokens in the GMX protocol, they are escrowed and earn Escrowed GMX (esGMX) tokens as rewards. "GMX Rewards provide benefits for long-term users of the protocol; these rewards come in the form of Escrowed GMX and Multiplier Points." The GLP pool is where all trades on the platform are settled. Regardless of trading outcomes, GLP holders are rewarded with 70% of platform fees, offering a substantial yield opportunity based on revenue rather than token emissions. This section covers how to retrieve staking information on esGMX and vGLP. ## Latest esGMX Transfers The following query retrieves the latest esGMX transfers on the Arbitrum network: ```graphql { EVM(network: arbitrum) { Events( where: { Log: { SmartContract: { is: "0xf42ae1d54fd613c9bb14810b0588faaa09a426ca" }, Signature: { Name: { is: "Transfer" } } } } orderBy: { descending: Block_Time } limit: { count: 10 } ) { Arguments { Name Type Value { ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } } } Block { Time } Transaction { Hash } } } } ``` ## Latest esGMX Claims By tracking the "claim" smartcontract calls, you can get info on any pending GMX tokens from esGMX that have been vested and converted to GMX tokens. The following query retrieves the latest esGMX claims on the Arbitrum network: [Run the query here](https://ide.bitquery.io/latest-esGMX-Claims) ```graphql { EVM(network: arbitrum, dataset: archive) { Calls( limit: { count: 100 } where: { Call: { To: { is: "0xf42ae1d54fd613c9bb14810b0588faaa09a426ca" }, Signature: { Name: { is: "claim" } } } } orderBy: { descending: Block_Time } ) { Call { Signature { Name } To } Transaction { Hash From Cost Gas To } Block { Time } 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 } } } } } } ``` ## Latest vGLP Withdrawals The following query retrieves the latest vGLP withdrawals on the Arbitrum network: [Run the query here](https://ide.bitquery.io/latest-vGLP-Withdraw-Events) ```graphql { EVM(network: arbitrum, dataset: archive) { Events( where: { Log: { Signature: { Name: { is: "Withdraw" } }, SmartContract: { is: "0xa75287d2f8b217273e7fcd7e86ef07d33972042e" } } } orderBy: { descending: Block_Time } limit: { count: 100 } ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Block { Time } Transaction { Hash } Log { Signature { Name } } } } } ``` ## Latest vGLP Deposits The following query retrieves the latest vGLP deposits on the Arbitrum network: [Run the query here](https://ide.bitquery.io/latest-vGLP-Deposit-Events) ```graphql { EVM(network: arbitrum, dataset: archive) { Events( where: { Log: { Signature: { Name: { is: "Deposit" } }, SmartContract: { is: "0xa75287d2f8b217273e7fcd7e86ef07d33972042e" } } } orderBy: { descending: Block_Time } limit: { count: 100 } ) { Arguments { Name Type Value { ... on EVM_ABI_Integer_Value_Arg { integer } ... on EVM_ABI_Address_Value_Arg { address } ... on EVM_ABI_String_Value_Arg { string } ... on EVM_ABI_Bytes_Value_Arg { hex } ... on EVM_ABI_BigInt_Value_Arg { bigInteger } ... on EVM_ABI_Boolean_Value_Arg { bool } } } Block { Time } Transaction { Hash } Log { Signature { Name } } } } } ```