Bitquery API Integration: On-Chain Data & DEX Monitoring

Bitquery API Integration: On-Chain Data & DEX Monitoring Developers often run into problems when integrating Bitquery: rate limits, schema differences between V1 and V2, real-time complexity. With 5+ years of blockchain data experience, we have developed an approach that eliminates these issues.

Blockchain Development Services

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1310
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1270
  • image_logo-advance_0.webp
    B2B Advance company logo design
    719
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1012
  • image_logo-aider_0.webp
    AIDER company logo development
    955
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1063

Bitquery API Integration: On-Chain Data & DEX Monitoring

Developers often run into problems when integrating Bitquery: rate limits, schema differences between V1 and V2, real-time complexity. With 5+ years of blockchain data experience, we have developed an approach that eliminates these issues. We configure Bitquery to your needs — from monitoring DEX trades to whale tracking — and provide documentation and support. Bitquery indexes over 40 blockchains, including Ethereum, BNB Chain, Polygon, Arbitrum, Solana, and provides data access via GraphQL API. However, each integration requires deep understanding of the data schema, query types, and version specifics. We help you focus on business logic, not API debugging.

What Problems Does Bitquery API Integration Solve?

Bitquery is a GraphQL API on top of indexed data from 40+ blockchains. On paper, it sounds like "just plug in and get data." In practice, you need to understand V1 vs V2, rate limits, proper pagination, and normalization. We handle that.

V1 vs V2: Which to Choose?

Feature V1 (api.bitquery.io) V2 (streaming.bitquery.io, EAP)
Query type Query (HTTP) Query + Subscription (WebSocket)
Real-time No Yes
Networks 40+ ~20, expanding
Status Maintenance mode Active development

For new projects, we recommend V2 if your required networks are supported. If not, we use V1 until migration. V2 is the future: real-time, streaming, WebSocket. If your network is already supported, migrating to V2 reduces data latency from minutes to seconds.

# V2: real-time subscription to new Uniswap V3 swaps subscription { EVM(network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { is: "uniswap_v3" } } } } ) { Block { Time Number } Trade { Buy { Amount Currency { Symbol Address } } Sell { Amount Currency { Symbol Address } } Dex { PoolAddress } } } } } 

How to Query DEX Data?

Monitoring DEX Trading with OHLCV

query DEXOHLCVQuery($since: ISO8601DateTime!, $poolAddress: String!) { EVM(network: eth, dataset: archive) { DEXTradeByTokens( where: { Trade: { Dex: { SmartContract: { is: $poolAddress } } } Block: { Time: { since: $since } } } orderBy: { ascendingByField: "Block_Time" } limit: { count: 1000 } ) { Block { Time(interval: { in: minutes, count: 5 }) } Trade { open: PriceInUSD(minimum: Block_Time) high: PriceInUSD(maximum: Trade_PriceInUSD) low: PriceInUSD(minimum: Trade_PriceInUSD) close: PriceInUSD(maximum: Block_Time) volume: sum(of: Trade_Side_AmountInUSD) } } } } 

Whale Monitoring of Large USDT Transfers

query WhaleTransfers($minAmount: String!) { EVM(network: eth) { Transfers( where: { Transfer: { Currency: { SmartContract: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" } } Amount: { ge: $minAmount } } } limit: { count: 50 } orderBy: { descendingByField: "Block_Time" } ) { Block { Time Number } Transfer { From To Amount Currency { Symbol } } Transaction { Hash } } } } 

Rate Limit Strategies

Bitquery charges queries in points — each query costs points depending on volume. Main constraints: queries per minute and monthly point limit. We apply three techniques:

  • Caching. Historical data (past days trades) cached in Redis or PostgreSQL for 24+ hours. We only query Bitquery for fresh data.
  • Cursor pagination. Queries with limit return up to 1000 records. Use offset or cursor until all data is fetched.
    async function fetchAllTrades(poolAddress: string, since: string) { const allTrades = []; let offset = 0; const limit = 1000; while (true) { const data = await bitquery.request(TRADES_QUERY, { poolAddress, since, limit, offset }); const trades = data.EVM.DEXTradeByTokens; allTrades.push(...trades); if (trades.length < limit) break; offset += limit; await delay(200); // respect rate limit } return allTrades; } 

    Summary of strategies:

    Strategy Description Application
    Caching Store historical data in Redis Past days trades
    Cursor pagination Page through results with limit/offset Bulk large volumes
    Batching Combine queries into one GraphQL request Reduce HTTP round-trips

    Why Use WebSocket for Real-Time?

    V2 supports subscriptions via graphql-ws. Standard Node.js implementation:

    import { createClient } from "graphql-ws"; import WebSocket from "ws"; const client = createClient({ url: "wss://streaming.bitquery.io/eap", webSocketImpl: WebSocket, connectionParams: { headers: { "X-API-KEY": process.env.BITQUERY_API_KEY } }, retryAttempts: Infinity, shouldRetry: () => true, }); const unsubscribe = client.subscribe( { query: SWAP_SUBSCRIPTION }, { next: (data) => processSwap(data.data.EVM.DEXTrades), error: (err) => logger.error("subscription error", err), complete: () => logger.info("subscription completed"), } ); 

    Note: V2 WebSocket requires a separate API key (EAP access) issued on request. V2 WebSocket subscriptions deliver events in 200-500 ms, which is 60x faster than V1 polling (30 second latency). This is critical for monitoring MEV bots and liquidity.

    Limitations of Bitquery

    Bitquery is a managed service, so indexing lags by 1-3 blocks, historical data may have gaps, and support for new networks lags. If your requirements include sub-second SLA, custom events without ABI, or compliance on your own infrastructure, consider alternatives: Dune Analytics for ad-hoc SQL, The Graph for project subgraphs, Goldsky/Envio for high-performance indexing.

    What's Included in Our Integration Service

    We provide a full turnkey cycle:

    1. Requirements analysis and API version selection (V1/V2).
    2. Query schema design (DEX, transfers, NFT).
    3. Implementation with caching, pagination, error handling.
    4. WebSocket subscription setup for real-time.
    5. Documentation for your endpoints and examples.
    6. Launch support and warranty period.

    Order Bitquery API integration and save development time. Contact us to discuss your project. Get a free consultation and preliminary cost estimate.

    Why Choose Us

    5+ years of blockchain development experience, 30+ successful integrations with Bitquery and other APIs. A team of senior engineers who understand the internals of Ethereum, Solana, and L2s. We don't just connect APIs — we build reliable systems that don't fail under load.

    Contact us for a project assessment. Get a free consultation.