Bitquery | RSS Feed https://bitquery.io Bitquery provide blockchain APIs for Bitcoin, Ethereum and Web3 protocols like Uniswap etc. We also provide blockchain money tracing APIs. Wed, 11 Mar 2026 07:55:08 GMT https://validator.w3.org/feed/docs/rss2.html Feed for Node.js Bitquery | RSS Feed https://bitquery.io/favicon/logo.png https://bitquery.io All rights reserved 2026, Bitquery Inc. <![CDATA[Stop Accepting Default Slippage from Your DEX Router: How Algo Traders Use Real-Time Liquidity Data]]> https://bitquery.io/blog/dex-router-slippage-algo-traders-real-time-liquidity https://bitquery.io/blog/dex-router-slippage-algo-traders-real-time-liquidity Wed, 11 Feb 2026 05:00:00 GMT 2% slippage even though price hit your limit), the bot either splits the order, waits for liquidity to improve, or routes to a different pool/chain. Example: - You want to buy 100,000 USDC worth of WETH when the price reaches 0.00048 WETH/USDC. - Price hits your limit, but the current PoolPriceTable shows the pool can only handle 60,000 USDC at 1% slippage. - Your bot splits the order: executes 60K USDC now at 1% slippage, and queues the remaining 40K to execute when liquidity refreshes or routes it to Base where the pool is deeper. - This prevents your single large order from slipping 5%+ and eating into your profit. By combining price monitoring with live slippage and liquidity data, you turn dumb limit orders into intelligent, liquidity-aware execution strategies. ## Integrating Bitquery streams For a working example of this approach, see the [best-route trader demo application](https://best-route-trader-uniswap.vercel.app/) and its [source code on GitHub](https://github.com/Divyn/best-route-trader-Uniswap). This proof-of-concept demonstrates how to query DEXPool data, compare slippage across multiple pools, and execute trades using the optimal route. Traders can start by polling GraphQL for DEXPools every few seconds or every N blocks, which is often sufficient for slower strategies. For latency‑sensitive bots, Bitquery provides data streams that publish DEXPool updates as they happen, so the internal slippage view tracks pool changes closely. A typical architecture is: ![](/blog/dex-router-slippage-algo-traders-real-time-liquidity/2.png) Figure: Typical trading system architecture using Bitquery DEXPool streams Realized slippage and execution quality can be logged and compared with the predicted slippage tier from PoolPriceTable, allowing strategies to adjust safety margins or pool filters over time. ## Building at Scale For production systems handling high-frequency trading, Bitquery offers Kafka streaming for real-time DEXPool updates. See the [Kafka streaming](https://docs.bitquery.io/docs/streams/kafka-streaming-concepts/) documentation and [sample data format](https://github.com/bitquery/kafka-data-sample/blob/main/evm/eth_dexpools.json) for implementation details. Advanced systems follow this pattern: • Run Bitquery Kafka stream subscribed to the DEXPool topic • Build a local backend to handle the volume of data • Filter and serve only relevant pools and slippage tiers to your strategy engine ### Unlimited Streaming Pricing Bitquery does not limit by amount of data or rate limits. Streams are sold individually and not by bytes of data, which means pricing is scalable whether you monitor 10 pools or 1,000+ pools across multiple chains. Learn more about Bitquery's [unlimited streaming pricing model](https://coincodecap.com/birdeye-so-alternative-why-bitquerys-unlimited-streaming-saves-you-100k-monthly). ## Summary Slippage does not need to be a fixed configuration value or a guess. By consuming Bitquery’s pre‑calculated slippage tables and liquidity snapshots for DEX pools on Ethereum, Base, Arbitrum, BSC and other EVM chains, algo traders can size orders, set slippage tolerance, and choose pools or routes based on live on‑chain conditions. This reduces unnecessary failed trades and over‑slippage, and creates a clear path from raw blockchain data to robust execution logic inside trading systems. Ready to integrate real-time slippage and liquidity data into your trading system? Explore [Bitquery's DEX APIs](https://docs.bitquery.io/docs/category/dex-trades/) or reach out to the team for enterprise solutions.]]> <![CDATA[Using Real-Time Slippage Data to Trade Smart]]> https://bitquery.io/blog/slippage-based-trading-real-time https://bitquery.io/blog/slippage-based-trading-real-time Wed, 07 Jan 2026 05:00:00 GMT = position_block + 3: close_position(position, updated_slippage_data) ``` **Key Considerations:** - **Dynamic Slippage Selection**: Always query fresh DEXPool data before each trade—liquidity changes constantly - **Direction Selection**: Use `Liquidity.AmountCurrencyA` vs `AmountCurrencyB` to determine which direction has more depth - **Trade Size Scaling**: You don't need to copy exact `MaxAmountIn` amounts—scale your trade size up or down based on your risk tolerance. The `MaxAmountIn` values show the upper limit at each slippage level, but you can trade any amount up to that limit - **Block Tracking**: Monitor block numbers to close positions at the right time ### Opening and Closing Positions A complete trading strategy involves both opening and closing positions. Here's how to implement this using DEXPool stream data: **Opening a Position:** 1. **Monitor DEXPool Stream**: Listen for new liquidity events or price changes 2. **Choose Direction**: Select AtoB or BtoA based on liquidity depth and market conditions 3. **Calculate Slippage**: Query the latest `PoolPriceTable` to find the optimal slippage level for your trade size 4. **Execute Swap**: Open the position by executing the swap in your chosen direction 5. **Track Position**: Store the position details including: - Block number when opened - Direction (AtoB or BtoA) - Amount received (for closing calculation) - Token addresses **Closing a Position:** 1. **Monitor Block Numbers**: Check if the target number of blocks has elapsed (e.g., 3-4 blocks) 2. **Query Fresh Slippage Data**: Get updated `PoolPriceTable` for the closing direction (opposite of opening) 3. **Check Token Balance**: Verify you have the tokens received from opening the position 4. **Handle Approvals**: If needed, approve the router to spend your tokens (check existing allowance first) 5. **Calculate Closing Amount**: Use the amount received from opening, or a portion of it 6. **Execute Reverse Swap**: Close the position by swapping in the opposite direction **Important Notes:** - **Opposite Direction**: Always close in the opposite direction of opening. If you opened with BtoA (bought CurrencyB), close with AtoB (sell CurrencyB) - **Fresh Slippage Data**: Always query the latest `PoolPriceTable` before closing—pool conditions change between blocks - **Approval Management**: Check existing token allowances before requesting new approvals to avoid unnecessary transactions - **Block Timing**: Monitor block numbers carefully. Network congestion may cause more blocks to elapse than expected - **Partial Closes**: You can close a portion of your position by using a fraction of the `amount_received` value **Real-World Example:** ``` Opening: BtoA swap (WETH → TOKENA) - Block: 24189478 - In: 0.000100 WETH - Out: 6.537647 TOKENA - Slippage: 10 bps Closing: AtoB swap (TOKENA → WETH) - Block: 24189483 (5 blocks later) - In: 6.537647 TOKENA - Fresh slippage calculated from updated PoolPriceTable - Approval handled automatically - Position closed successfully ``` ### Common Pitfalls and Solutions Based on real trading bot implementations, here are common issues and how to handle them: #### 1. Approval Transaction Timeouts **Problem**: Low gas prices cause approval transactions to timeout after 120+ seconds, leading to "Dropped & Replaced" errors. **Solution**: - Use higher gas prices for approval transactions (they're one-time per token) - Implement approval caching—check if approval exists before requesting new one - Consider using `permit` signatures (EIP-2612) to skip approvals entirely ```python # Check existing allowance before approving current_allowance = token.allowance(wallet, router_address) if current_allowance < amount: # Only approve if needed approve_tx = token.approve(router_address, amount, {'gasPrice': higher_gas}) ``` #### 2. Insufficient Token Balance **Problem**: Strategy tries to trade tokens you don't have (e.g., trying to swap WHALE tokens when you only have WETH). **Solution**: - Always check token balance before attempting swap - Implement balance validation in your trade logic - Consider multi-hop swaps if you need to convert tokens first ```python def validate_balance(token_address, required_amount): balance = token.balanceOf(wallet_address) if balance < required_amount: return False, f"Insufficient balance. Need {required_amount}, have {balance}" return True, None ``` #### 3. Transaction Dropped & Replaced **Problem**: Transactions with low gas get dropped from the mempool and replaced. **Solution**: - Use dynamic gas pricing based on current network conditions - Implement transaction replacement logic - Set appropriate timeouts and retry mechanisms ```python # Get current gas price from network current_gas_price = w3.eth.gas_price # Add 20% buffer to ensure inclusion gas_price = int(current_gas_price * 1.2) tx = contract.function(parameters).buildTransaction({ 'gasPrice': gas_price, 'nonce': w3.eth.get_transaction_count(wallet_address) }) ``` ### Building Your Alpha Strategy The DEXPool stream provides the foundation for building profitable trading strategies: 1. **Liquidity Arbitrage**: Monitor multiple pools for the same pair, execute when price differences exceed gas costs 2. **Liquidity Following**: Copy large liquidity additions/removals, trade in the same direction 3. **Slippage Optimization**: Always use the lowest slippage that fits your trade size to maximize profit margins 4. **Multi-Pool Routing**: Compare `MaxAmountIn` and `Price` across pools to find optimal execution **Example Strategy Flow:** ``` 1. Subscribe to DEXPool Kafka stream 2. Filter for pools with high liquidity changes 3. Analyze PoolPriceTable for both directions (AtoB, BtoA) 4. Choose direction with better liquidity depth 5. Select lowest slippage that accommodates trade size 6. Execute swap with MinAmountOut from price table 7. Monitor position for 3-4 blocks 8. Close position with fresh slippage data 9. Repeat ``` ### Performance Optimization Tips - **Batch Queries**: Query multiple pools simultaneously to compare execution - **Cache Price Tables**: Cache recent PoolPriceTable data to reduce API calls (but always validate freshness) - **Gas Optimization**: Use the minimum slippage needed—every basis point saved is profit - **Error Handling**: Implement robust retry logic for failed transactions - **Monitoring**: Track success rate, average slippage used, and profit margins ## Best Practices ### For Smart Contract Integration 1. **Query immediately before execution**: DEXPool stream updates in real-time, so query right before your transaction to get the freshest data 2. **Account for token decimals**: Remember that all amounts are in raw units—verify using `CurrencyA.Decimals` and `CurrencyB.Decimals` fields 3. **Add a small buffer**: Add 0.1-0.2% to the calculated slippage to account for execution delay 4. **Monitor multiple pools**: Compare execution prices across different pools to find the best route 5. **Handle edge cases**: If your trade exceeds all slippage levels, implement splitting or wait for better liquidity ### For Automated Trading Bots 1. **Balance slippage vs execution speed**: Use lowest slippage that fits your trade, but be aware it may cause delays 2. **Implement approval caching**: Check existing token allowances before requesting new approvals to avoid timeouts 3. **Validate balances before trading**: Always verify you have sufficient token balance before attempting swaps 4. **Use dynamic gas pricing**: Monitor network conditions and adjust gas prices to avoid dropped transactions 5. **Handle protocol limitations**: Filter for supported protocols and implement graceful handling for unsupported ones 6. **Track positions carefully**: Monitor block numbers and implement proper position tracking for multi-block strategies 7. **Implement retry logic**: Handle transaction failures gracefully with exponential backoff 8. **Monitor and log everything**: Track slippage used, success rates, and profit margins to optimize your strategy ## Conclusion Real-time slippage data transforms DEX trading from guesswork into a precise, data-driven process. By leveraging Bitquery's DEXPool stream, you can: - Set optimal slippage tolerances programmatically - Prevent front-running by avoiding unnecessarily high tolerances - Compare execution across multiple pools - Make informed decisions about trade sizing and routing - Build sophisticated trading strategies that adapt to market conditions - Execute copy-trading strategies with dynamic slippage selection - Optimize gas usage and transaction success rates Whether you're building trading bots, executing swaps from smart contracts, or managing liquidity positions, real-time slippage data gives you the edge you need to trade smart. The DEXPool stream provides the foundation for building alpha-generating strategies that respond to market conditions in real-time, balancing execution speed with price guarantees. The key is understanding the trade-offs: lower slippage guarantees better prices but may cause execution delays, while higher slippage ensures faster execution but at worse prices. By dynamically selecting slippage based on real-time pool data, you can optimize for your specific strategy goals. ## Additional Resources - [DEXPools Cube Documentation](https://docs.bitquery.io/docs/cubes/evm-dexpool/) - Complete guide to DEXPool data structure - [Slippage FAQ](https://docs.bitquery.io/docs/API-Blog/slippage-faq-using-dexpool-stream/) - Detailed FAQ on slippage calculation - [Bitquery IDE](https://ide.bitquery.io/) - Query DEXPool data in real-time - [Kafka Data Samples](https://github.com/bitquery/kafka-data-sample/blob/main/evm/eth_dexpools.json) - Sample DEXPool stream data structure ---- *This material is for educational and informational purposes only and is not intended as investment advice. The content reflects the author's personal research and understanding. While specific investments and strategies are mentioned, no endorsement or association with these entities is implied. Readers should conduct their own research and consult with qualified professionals before making any investment decisions. Bitquery is not liable for any losses or damages resulting from the application of this information.* ]]> <![CDATA[Build Solana Bubble Maps with Bitquery: Historical Data with Zero RPC Calls]]> https://bitquery.io/blog/solana-bubblemaps-bitquery-zero-rpc https://bitquery.io/blog/solana-bubblemaps-bitquery-zero-rpc Fri, 31 Oct 2025 05:35:07 GMT [since_date] ``` - currency_address: SPL token mint address to filter transfers by (e.g. USDT or a project token). Use null to fetch native SOL transfers. - receiver_address: The focal address whose inbound transfers form the bubble map neighborhood. - since_date: ISO date (YYYY-MM-DD). Defaults to 2025-09-24 if omitted. Or call Node directly: ``` node scripts/build-bubblemap.js [since_date] ``` Example (USDT → a project wallet since 2025‑09‑24): ``` npm run build:bubblemap -- Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB CapuXNQoDviLvU1PxFiizLgPNQCxrsag1uMeyk6zLVps 2025-09-24 ``` What you get: - The script writes output.html at the repo root and opens it. - output.html contains an embedded dataset and D3 force-directed chart: - Bubble size: node USD volume - Link width: summed USD transferred along that edge - Tooltip: address, node USD, and edge stats ### Adjusting Parameters You can adjust any of the existing parameters to query a larger dataset: - pageSize (default 100): Increase to reduce round trips; decrease if you hit timeouts. - maxPages (default 4): Raises/lowers the total data fetched. - interPageSleepMs and retry/backoff settings: Helpful when rate-limited. - nodes.slice(0, 300) and links.slice(0, 1000): Caps visualization complexity for readability. output.html is a standalone page—no server required. Share it as-is or publish it via GitHub Pages/Netlify. The source index.html is a template during the build. To preview locally with a static server: ``` npm run serve ``` ### Common issues - “Missing BITQUERY_OAuth_token” or 401: Ensure your OAuth token is valid and present in the script. - Timeouts or rate limits: Reduce pageSize, increase timeoutMs, and let retries/backoff work. - Empty map: Double-check currency_address, receiver_address, and since_date are correct and that there is actual activity. ## Beyond Historical Data: Realtime Streaming While Bitquery's GraphQL API excels at historical data queries, you can also access real-time Solana blockchain data through [Bitquery's gRPC Streams](https://docs.bitquery.io/docs/grpc/solana/introduction). These streams deliver parsed, filterable events with sub-second latency, making them ideal for trading applications, bots, and DeFi platforms that need instant transaction notifications. For comprehensive documentation on real-time streaming technologies including WebSocket, Kafka, and CoreCast, visit the [Streams documentation](https://docs.bitquery.io/docs/streams/). ]]> <![CDATA[DEX Data Doesn’t Lie: Who's the Leader in DeFi Trading?]]> https://bitquery.io/blog/dex-activity-bnb-vs-solana-real-trading-myth https://bitquery.io/blog/dex-activity-bnb-vs-solana-real-trading-myth Wed, 02 Jul 2025 10:00:00 GMT Note: The chart uses normalized scores (0 to 1) to fairly compare different metrics like volume, fees, and user activity, so you can easily see which chain performs better in each category, regardless of the original units ## Conclusion The idea that BNB Chain is the undisputed No.1 DEX trading chain doesn’t quite hold up under scrutiny. Yes, BNB’s raw DEX volume is larger, but much of it comes from rapid bot-driven cycles on a handful of tokens. Solana, by contrast, shows far more trades and far more unique traders, indicating broader participation. In other words, Solana seems to be winning the ecosystem engagement contest, even if its total dollars traded lag. In practical terms, if you measure “No.1” by headline volume figures, BNB still looks on top, but automatic pumps inflate that. If you measure by real activity and trader count, Solana leads. The reality is nuanced: both chains are currently hotbeds of speculative token activity. The key takeaway is that high-volume DEX stats can be misleading, and claims like “BNB is No.1” should be taken with a grain of salt. In the end, the data suggests BNB’s lead may be largely an illusion of bots, while Solana’s DeFi scene has more genuine hustle and bustle under the hood. --- _The information provided in this material is published solely for educational and informational purposes. It does not constitute a legal, financial audit, accounting, or investment advice. The article's content is based on the author's own research and, understanding and reasoning. The mention of specific companies, tokens, currencies, groups, or individuals does not imply any endorsement, affiliation, or association with them and is not intended to accuse any person of any crime, violation, or misdemeanor. The reader is strongly advised to conduct their own research and consult with qualified professionals before making any investment decisions. Bitquery shall not be liable for any losses or damages arising from the use of this material._ ]]> <![CDATA[Analyzing Slippage: A Quantitative Study of Pumpfun’s Trading Dynamics]]> https://bitquery.io/blog/analyzing-slippage-pumpfun-trading-dynamics https://bitquery.io/blog/analyzing-slippage-pumpfun-trading-dynamics Tue, 17 Jun 2025 00:00:00 GMT +5000 bps means price deviated by >50% relative to the quoted price. Such extreme losses typically happen in illiquid pools when a trade moves price drastically, or when bots sandwich small trades. These tiny to modest-sized trades (all <$500) suffered catastrophic slippage, indicating severe price impact or possible exploitation. (All 10000 bps slippage cases were due to data glitches with price=0 and are omitted above.) ### Most Stable Tokens Based on the average absolute slippage (mean of |bps|) per token, the four most stable tokens in our dataset were: - moonpig (mean |slippage| ≈ 14.5 bps): Trades in this pool experienced very small price deviations on average. Most slippage events remained within ±50 bps (±0.50%). Such consistency indicates healthy liquidity and balanced trading activity, making Moonpig relatively predictable for traders. - President Vs Elon (mean |slippage| ≈ 17.1 bps): Although there were fewer trades for this token, the observed slippage remained mild. This suggests that even with lower volume, price shifts between consecutive trades were modest. - OFFICIAL MUSK (mean |slippage| ≈ 26.5 bps): Moderate average deviations, generally within ±100 bps. While occasional spikes occurred, they were infrequent, indicating that traders could usually execute without a drastic price impact. - Costco (mean |slippage| ≈ 31.2 bps): Despite a larger number of trades, the pool maintained relatively low slippage overall (around ±0.3% on average). This reflects a balance of supply and demand or sufficient deep liquidity for routine trades. In contrast, tokens like catwifmask exhibited much higher mean absolute slippage (~62 bps) and severe outliers, indicating that trades there often faced large price swings or potential MEV activity. Other tokens (e.g., AMERICA PARTY, THE AMERICA PARTY, Kill Bill) showed average slippage near zero but with occasional spikes, suggesting intermittent liquidity stress or concentrated trading bursts Choosing tokens with low average slippage reduces the likelihood of unexpectedly large execution costs. For tokens like Moonpig or Costco, traders can set tighter slippage tolerances and expect more predictable outcomes. Conversely, high-slippage pools require extra caution: smaller order sizes, higher tolerance for potential price impact, or avoidance unless liquidity improves ![](/blog/analyzing-slippage-pumpfun-trading-dynamics/chart.png) Fig: Mean Absolute Slippage by Token ### Slippage Over Time When slippage is aggregated over time (e.g., averaged per minute), we observe that most time intervals exhibit average slippage close to zero, punctuated by brief spikes. In our 11-minute snapshot: - Stable intervals: During most minutes, the minute-level average slippage hovers around 0 bps. This indicates that for routine trades in stable or liquid pools, price changes between consecutive transactions were minimal. - Spikes aligned with large or illiquid-token trades: Certain minutes showed noticeable positive or negative average slippage, often corresponding to clusters of trades in low-liquidity pools (notably catwifmask). For example, when a sizable trade or a sequence of trades hit a shallow pool, the subsequent trades in that same minute experienced larger deviations, pulling the average slippage for that period away from zero. - Implications for traders: Monitoring slippage trends over time can help identify moments of heightened risk. If you see a recent spike in average slippage for a token, it likely signals that liquidity has been disturbed, perhaps by large orders or MEV activity, and you may want to delay your trade, reduce size, or widen your slippage tolerance cautiously. Over the 11-minute window, slippage trends were mostly calm until two bursts: around 09:51:17–09:51:33 UTC, many catwifmask trades were executed with enormous slippage, pushing the minute-average slippage above +10 bps. For instance, at 09:51, the mean slippage was +18.5 bps (due to the large catwifmask losses). Before and after this, per-minute averages hovered near 0 or slightly negative. Overall, slippage spiked whenever big trades occurred in low-liquidity tokens. ## Token-by-Token Insights catwifmask: By far the most volatile. Median slippage ≈was 0, but it had the highest extremes (both +5000 bps and 1400 bps). A series of catwifmask trades suffered a massive impact, suggesting very low liquidity or targeted attacks. Costco: The largest sample (898 trades) with generally small slippage. Average slippage slightly negative (~–0.7 bps), indicating gains on average (perhaps due to routine small advantageous fills). Outliers reached +988 bps or –1158 bps. THE AMERICA PARTY: Lots of trades (717) with median ≈0. Mean slippage is slightly negative (good). This token had some big swings (±1100 bps), but those were rare. AMERICA PARTY: Fewer trades (70), mostly small, with occasional spikes (max ~+402 bps, min –237 bps). Average close to neutral. KILL BIG BEAUTIFUL BILL: Fairly active (406 trades), median slippage 0, mean about –0.8 bps (slightly favorable). It experienced significant swings (over +1800 bps and –2190 bps), but the typical result was mild. Kill Bill: Moderate activity (193 trades). Mean slippage +0.25 bps (slightly adverse). Volatility was moderate (up to ±900+ bps). moonpig: Few trades (150) but very smooth. Almost all slippages were under ±50 bps, with none above ±200. The average was near zero. OFFICIAL MUSK: Small sample (50 trades). Mean +3.1 bps (somewhat adverse), with moderate extremes (~±130 bps). President Vs Elon: Very few trades (32) but interestingly mean 5.9 bps (on average favorable), with extremes ±60 bps. This suggests occasional nice fills or luck. ## Front-Running Patterns There are hints of MEV-style sandwich trades. For example, around 09:42:55 UTC in the catwifmask pool, a tiny buy (effectively 0 USD) suffered +4711 bps slippage, immediately followed by a moderate buy (≈$72) with –8951 bps slippage (huge gain), and then another similar-size trade with +3682 bps slippage. This pattern, a tiny trade getting drained, a block-level trade getting a far-better-than-quoted price, and a following trade hitting a poor price, is consistent with a classic sandwich attack (bots arbitraging around a target trade). Similarly, at 09:51:17 UTC, four tiny buys preceded a large sell, which took the brunt of the price movement. In both cases, no normal “preceding large trade” explains the slippage; rather, it looks like small trades or bots pushed the price. While our data lacks explicit trader addresses to confirm, these anomalies strongly suggest front-running by bots is affecting some Pumpfun trades. ## Key Findings - Worst slippage trades : The absolute losers (highest slippage) were all catwifmask trades (see table above). They lost on the order of +5000 bps. - Zero slippage count : 406 trades had exactly 0 bps slippage. These likely occurred when liquidity and timing aligned perfectly (or trades were immediately offset). - Negative slippage (favorable trades) : 2,294 trades had negative slippage (the trader got a better price), versus 2,144 with positive slippage, out of 4,844 valid trades. (This minor imbalance mirrors observations that ~33% of trades can get negative slippage, often due to MEV dynamics.) - Most stable tokens : moonpig, President Vs Elon, OFFICIAL MUSK, and Costco had the lowest average slippage (mostly single-digit bps). These tokens showed the least volatility. - Trader consistency : We cannot identify individual wallet addresses or routers from this dataset (no address fields), so we cannot name traders who consistently gained or lost. However, the data does not indicate any one “privileged” address: slippage outcomes seem determined by token liquidity and timing rather than a single repeat winner. Various DEX venues (Pumpfun AMM, LB CLMM, etc.) were used, with no obvious router bias. - Repeated favorable pricing : Likewise, without address or router info, we cannot conclusively say if certain participants repeatedly got better pricing. The fact that many tokens had near-zero median slippage suggests no clear systematic advantage; the large negative-slippage outliers we see are likely opportunistic bot trades, not regular end-users. ## Conclusion Slippage is a fundamental aspect of DeFi trading. Our analysis of Pumpfun DEX trades shows: - Most trades experienced small slippage within ±10 bps. - Approximately equal proportions saw slight gains or losses relative to the quoted price. - Some tokens exhibited stable slippage, while others showed extreme volatility and possible MEV exploitation. - Beginners should prioritize liquidity assessment, proper slippage tolerance, and MEV mitigation for safer trading. Understanding how slippage occurs and learning to interpret slippage metrics empowers traders to navigate decentralized markets more confidently. Always remain vigilant, especially with new or thinly traded tokens, and leverage available tools to reduce adverse outcomes In summary, this Pumpfun trade snapshot shows mostly modest slippage for standard trades, but with dramatic exceptions. Traders should set appropriate slippage tolerances and watch for MEV attacks: as others have noted, “active participants [can] trade against you, and thus you will experience negative slippage”, so vigilance is key when trading new or illiquid tokens. --- _This material is for educational and informational purposes only and is not intended as investment advice. The content reflects the author's personal research and understanding. While specific investments and strategies are mentioned, no endorsement or association with these entities is implied. Readers should conduct their own research and consult with qualified professionals before making any investment decisions. Bitquery is not liable for any losses or damages resulting from the application of this information._ --- Written by Dhimahi ]]> <![CDATA[Real-World Assets Are Changing Global Finance: A Complete Research Deep Dive]]> https://bitquery.io/blog/real-world-assets-changing-global-finance-complete-research https://bitquery.io/blog/real-world-assets-changing-global-finance-complete-research Fri, 06 Jun 2025 10:00:00 GMT <![CDATA[The Need for Real-Time Data on Solana: Latency, Scale, and Fidelity at Stake]]> https://bitquery.io/blog/real-time-data-solana https://bitquery.io/blog/real-time-data-solana Fri, 23 May 2025 10:00:00 GMT “Better be first 99 percent of the time than second 100 percent of the time.” - Donald MacKenzie, in his book Trading at the Speed of Light Solana’s ultra-fast block times have creasted new possibilities for real-time blockchain apps, especially in trading, payments, and gaming. Today, Solana handles around $25 billion in daily spot trading volume, surpassing even Binance, the largest centralised exchange, which does about $15 billion in daily spot volume. Solana is leading the way in building a fast, scalable trading system on the blockchain. In the future, this won’t just be for crypto—it will make it possible to trade stocks, bonds, forex, commodities, and other assets all on-chain. Building this kind of trading system requires advanced infrastructure, similar to what Nasdaq and other global exchanges use, and Low latency is an absolute necessity. To succeed, developers need reliable access to real-time, low-latency on-chain data. In this article, I’ll discuss the main ways to access ultra-low latency data on Solana to support these applications at scale. My focus here is on reading blockchain data; I’ll cover trade execution in a future article. Because Solana’s validators are spread around the world, not in a single location, it’s challenging to deliver real-time information efficiently. Optimizing networks to relay blockchain data quickly is essential for many applications. Let’s look at the different approaches to accessing real-time data on Solana, one by one. ### The Traditional Path: Solana Geyser Plugin Solana offers the Geyser plugin system for developers needing direct access to on-chain events: - Update_account: Triggered on account updates - Update_slot_status: Slot status changes - Notify_transaction: Processed transactions - Notify_block_metadata: Block metadata Yellowstone Geyser Plugin adds a gRPC API for subscribing to updates, getting blockhashes, slot numbers, and more. #### What are the challenges? While powerful, Geyser requires running your own Solana node or validator. This means ongoing infrastructure management, manual scaling, node security, and raw data parsing—tasks that can slow down even the best teams. Filtering options are basic, so you may process much more data than you need, driving up costs and complexity. ### Bitquery: A Powerful Alternative Bitquery offers a powerful real-time streaming system with two easy-to-use interfaces: GraphQL Subscriptions and Kafka. You can learn more about the differences and benefits of each in the [Bitquery documentation](https://docs.bitquery.io/docs/streams/kafka-streaming-concepts/). - No Infra Needed: You don’t need to run your own Solana node. Just use the Bitquery endpoint—no server costs, setup, or upgrades. - Powerful Filtering: Use GraphQL’s expressive filters to get only the data you need (by address, token, program, amount, and more). No more sifting through irrelevant noise. - Pre-Parsed Data: All data is already structured, labelled, and enriched (including USD values for tokens/trades). You save time and can focus on building features, not parsing raw logs. - Supports All Major DEXs: Instantly access DEX trades from PumpFun, Raydium, Orca, and more, with no extra parsing. - Historical + Real-Time: Query past data and stream new events using the same API. - Managed Reliability: Bitquery handles uptime, redundancy, and failover—no late-night pages for you. - Easy Onboarding: Get started in minutes, not weeks. ### Bitquery GraphQL Streams (with Powerful Filtering) Bitquery’s GraphQL subscriptions give you real-time access with less than 2-second latency. Queries are rich and filterable, allowing you to stream only what you need, down to addresses, programs, or amounts. You can test these queries live on the [Bitquery IDE](https://ide.bitquery.io/). Popular Bitquery GraphQL Streams: - Transfers: Real-time token transfers (fungible and NFTs), filterable by address, amount, or specific programs. - Balance Updates: Monitor wallet balances as they change, and see which programs trigger changes. - DEXTrades & DEXTradeByTokens: Full trade history, OHLCV (K-line) data, trader stats, and DEX analytics—covering all major DEXs. - DEXPools: Track liquidity adds, removes, and pool analytics in real time. - Instructions: Stream parsed Solana program instructions—great for custom app monitoring and token launches. - Rewards: Follow staking rewards live as they are distributed. - TokenSupplyUpdates: Watch minting, burning, and supply changes in real time. - Transactions: Get a live feed of all transactions on Solana. - Blocks: Stream every new block as it’s produced. ### Kafka Streams by Bitquery Bitquery’s Kafka streams are a unique product that provides ultra-low latency data directly from blockchain. Here are some key features. Bitquery offers three main [Kafka streams](https://docs.bitquery.io/docs/streams/protobuf/chains/Solana-protobuf/) - solana.dextrades.proto — Includes all trade and liquidity pool change data. - solana.tokens.proto — Covers token transfers, supply changes, and balance updates at both the account and instruction level. - solana.transactions.proto — Delivers detailed data for blocks, transactions, and instructions. ![](/blog/real-time-data-solana/table.png) #### Some differentiators - Geyser provides an entry notification stream for tracking ledger entries in real time. - Bitquery Streams work directly with unconfirmed transactions and do not offer a separate entry notification stream. - Because Bitquery focuses on unconfirmed transactions, it can deliver block data before blocks are closed, often faster than other solutions. - Bitquery Streams include: Real-time instruction and log parsing, and Instruction-level balance updates (showing balance changes from each instruction). Even Geyser does not provide instruction-level balance updates natively. If you’re building on Solana, Bitquery’s streaming solutions are built for developers who demand more—less setup, more speed, and richer data out of the box. With Bitquery GraphQL Subscriptions, you get clean, filtered, and pre-parsed blockchain data in minutes, while Kafka Streams give you ultra-low latency and enterprise-grade scalability for the most demanding real-time apps. Curious to see what next-gen blockchain data feels like? Try Bitquery Streams and experience the technical difference for yourself. Your next Solana project just got a whole lot easier. ]]> <![CDATA[The Illusion of Easy Money: Why Memecoins Always Burn the Retail Investor]]> https://bitquery.io/blog/easy-money-memecoin-retail-investors https://bitquery.io/blog/easy-money-memecoin-retail-investors Fri, 02 May 2025 10:29:00 GMT <![CDATA[10+ Year Dormant Bitcoin Whales Come to Life in 2024]]> https://bitquery.io/blog/dormant-bitcoin-wallets-reactivated-insights-market-impact https://bitquery.io/blog/dormant-bitcoin-wallets-reactivated-insights-market-impact Tue, 07 Jan 2025 00:00:00 GMT 100 BTC) #### 7. Address: [1C4rE41Kox3jZbdJT9yatyh4H2fMxP8qmD](https://explorer.bitquery.io/bitcoin/address/1C4rE41Kox3jZbdJT9yatyh4H2fMxP8qmD?from=2009-01-01&till=2025-01-04) Last Active: January 29, 2009 Reactivated On: September 20, 2024 Transaction ID: [8bee6dbdbc09253ffbe51e35a910ef39428fc2ca05aa39ce0f1adaebbf8f2cfe ](https://explorer.bitquery.io/bitcoin/tx/8bee6dbdbc09253ffbe51e35a910ef39428fc2ca05aa39ce0f1adaebbf8f2cfe)To: [bc1qqhvkehsyr2rlrdvq4udtp8tfj75k6kcnd9n7lq](https://explorer.bitquery.io/bitcoin/address/bc1qqhvkehsyr2rlrdvq4udtp8tfj75k6kcnd9n7lq?from=2009-01-01&till=2025-01-04) – 50 BTC (~$3.19M) Total Received: 50.00001094 BTC ($0.16 at the time of receipt) Total Spent: 50 BTC ($3.19M at the time of transfer) Final Balance: 0.00001094 BTC (~$0.64) **Findings:** This miner wallet reactivated after 15.7 years of dormancy, [transferring 50 BTC (~$3.19M) to a new address while leaving a negligible balance of 0.00001094 BTC (~$0.64)](https://ide.bitquery.io/Query-5). Originally funded on January 29, 2009, shortly after Bitcoin’s creation, with a transaction worth ~$0.16, this wallet's reactivation suggests a possible strategic movement by an early miner. This event underscores the continuing activity of early Bitcoin participants and highlights a significant historical transaction in the crypto space. #### 8. Address: [1CGT3Ywaa2upJfWtUtbXonDPNTfZPWqzmA](https://explorer.bitquery.io/bitcoin/address/1CGT3Ywaa2upJfWtUtbXonDPNTfZPWqzmA?from=2005-12-01&till=2025-01-01) Last Active: February 2, 2009 Reactivated On: September 20, 2024 Transaction ID: [d52f4890ac3f0cf699e3187b08ba6376c4d6efbe53add15bbcc3b96b604ecec7 ](https://explorer.bitquery.io/bitcoin/tx/d52f4890ac3f0cf699e3187b08ba6376c4d6efbe53add15bbcc3b96b604ecec7)To: [bc1qg73nvjspdqe9fuf5pqgys386hjy8c94ntlppus](https://explorer.bitquery.io/bitcoin/address/bc1qg73nvjspdqe9fuf5pqgys386hjy8c94ntlppus?from=2005-12-01&till=2025-01-01) – 50 BTC (~$3.19M) Total Received: 50.00000547 BTC ($0.06 at the time of receipt) Total Spent: 50 BTC ($3.19M at the time of transfer) Final Balance: 0.00000547 BTC (~$0.32) **Findings:** This wallet became active after 15.6 years of dormancy, [transferring 50 BTC (~$3.19M) to a new address](https://ide.bitquery.io/Query-10) and retaining a tiny balance of 0.00000547 BTC (~$0.32). Originally funded on February 2, 2009, just months after Bitcoin’s launch, with a value of ~$0.06, the reactivation may indicate a movement for security, consolidation, or liquidation. This transaction highlights another instance of early Bitcoin holdings being moved in 2024. #### 9. Address: [1FHft3AFk9Zrdhk2HccSb97AgDNDsFhGuV](https://explorer.bitquery.io/bitcoin/address/1FHft3AFk9Zrdhk2HccSb97AgDNDsFhGuV/transactions?from=2010-07-01&till=2025-01-04) Last Active: July 12, 2010 Reactivated On: October 25, 2024 Transaction ID: [86df0c812d1d72d32f1169bdf1216e5d3ed862f7dee91a3b5e77646c185419aa ](https://explorer.bitquery.io/bitcoin/tx/86df0c812d1d72d32f1169bdf1216e5d3ed862f7dee91a3b5e77646c185419aa)To: - [bc1qlmprk86z6djc8e0rshlntchly64au3hpfuzljp](https://explorer.bitquery.io/bitcoin/address/bc1qlmprk86z6djc8e0rshlntchly64au3hpfuzljp?from=2010-07-01&till=2025-01-04): 3 BTC (~$203K) - [bc1qmefm8e6nfwqgfv6mn5hpdvvm489yc80aeux3xf](https://explorer.bitquery.io/bitcoin/address/bc1qmefm8e6nfwqgfv6mn5hpdvvm489yc80aeux3xf?from=2010-07-01&till=2025-01-04): 47 BTC (~$3.18M) Total Received: 50.00000547 BTC ($0.17 at the time of receipt) Total Spent: 50 BTC ($3.39M at the time of transfer) Final Balance: 0.00000547 BTC (~$0.32) **Findings:** Wallet 1FHft3A reactivated after 14.3 years of dormancy, [transferring 50 BTC (~$3.39M) to two new wallets: 3 BTC and 47 BTC](https://ide.bitquery.io/Query-8), retaining a minimal balance of 0.00000547 BTC (~$0.32). This wallet was initially funded on July 12, 2010, with a value of ~$0.17. The sudden movement of funds suggests possible selling, redistribution, or enhanced security measures taken by the wallet holder. #### 10. Address: [18E5d2wQdAfutcXgziHZR71izLRyjSzGSX](https://explorer.bitquery.io/bitcoin/address/18E5d2wQdAfutcXgziHZR71izLRyjSzGSX?from=2005-01-01&till=2025-01-01) Last Active: January 30, 2009 Reactivated On: September 20, 2024 Transaction ID: [6ce746e19b16f84abc6f5344225050a5b16e3d56aac72e0b7bd642c53c13716d ](https://explorer.bitquery.io/bitcoin/tx/6ce746e19b16f84abc6f5344225050a5b16e3d56aac72e0b7bd642c53c13716d)To: [bc1ql8znm2y4zdwnxytvy4cyksdvnd3t6xv5rasun9](https://explorer.bitquery.io/bitcoin/address/bc1ql8znm2y4zdwnxytvy4cyksdvnd3t6xv5rasun9?from=2005-01-01&till=2025-01-01) – 50 BTC (~$3.19M) Total Received: 50.00001094 BTC ($0.31 at the time of receipt) Total Spent: 50 BTC ($3.19M at the time of transfer) Final Balance: 0.00001094 BTC (~$0.64) **Findings:** This wallet, originally funded with 50 BTC (~$0.31) on January 30, 2009, reactivated after 15.6 years of dormancy by transferring 50 BTC (~$3.19M) to a new wallet (bc1ql8zn...) on September 20, 2024, leaving a negligible balance of 0.00001094 BTC (~$0.64). The long period of inactivity and large transfer suggest an early adopter or miner moving funds, possibly for liquidation or enhanced security. This is another significant whale movement in 2024, highlighting the continued activity of early Bitcoin participants. ## Key Insights In 2024, Bitcoin’s blockchain delivered a surprise: several old wallets, inactive for more than a decade, suddenly came to life. These wallets, once forgotten, moved massive amounts of Bitcoin, raising questions about what prompted these reactivations. Originally funded when Bitcoin was worth only a few dollars or even cents, their holdings had grown into millions of dollars, making these events major talking points in the crypto world. Some wallets transferred Bitcoin to new addresses, while others sent large sums to exchanges, possibly signaling sales or redistributions. The reasons behind these moves could include rediscovered keys, ownership changes, or simply long-term holders deciding to cash in after years of waiting. Regardless of the motive, such high-value transfers often draw attention and impact market sentiment. These unexpected wallet reactivations not only highlight Bitcoin’s enduring value but also remind us of the intriguing stories hidden in its early history. Even after 15 years, Bitcoin continues to surprise. --- _Written by Aakash_ ]]> <![CDATA[Tracking NFT Wash Trading on Solana: Techniques and Case Studies]]> https://bitquery.io/blog/how-to-track-nft-wash-trading https://bitquery.io/blog/how-to-track-nft-wash-trading Wed, 11 Dec 2024 08:00:00 GMT <![CDATA[Wash Trading on Solana: Case Studies on Market Manipulation]]> https://bitquery.io/blog/wash-trading-solana-crypto-market-manipulation-detection https://bitquery.io/blog/wash-trading-solana-crypto-market-manipulation-detection Tue, 10 Dec 2024 08:00:00 GMT <![CDATA[Mixers, Tumblers, and DeFi: Tracing Commingled Funds in Crypto]]> https://bitquery.io/blog/mixers-tumblers-defi-tracing-commingled-funds-crypto https://bitquery.io/blog/mixers-tumblers-defi-tracing-commingled-funds-crypto Mon, 18 Nov 2024 08:00:00 GMT <![CDATA[Tracking Commingled Funds Simplified with Bitquery]]> https://bitquery.io/blog/tracking-commingled-funds-simplified-bitquery https://bitquery.io/blog/tracking-commingled-funds-simplified-bitquery Wed, 13 Nov 2024 08:00:00 GMT <![CDATA[Exploring Low-Latency Data Solutions for Crypto Futures Trading]]> https://bitquery.io/blog/exploring-low-latency-data-solutions-crypto-futures-trading https://bitquery.io/blog/exploring-low-latency-data-solutions-crypto-futures-trading Tue, 29 Oct 2024 05:00:00 GMT <![CDATA[Why Real-Time Data Streams are Critical for Bitcoin Payments]]> https://bitquery.io/blog/real-time-data-critical-bitcoin-payments https://bitquery.io/blog/real-time-data-critical-bitcoin-payments Mon, 28 Oct 2024 05:00:00 GMT <![CDATA[How Are Criminals Exploiting Crypto? A Deep Dive Into 2024's Top Crime Typologies]]> https://bitquery.io/blog/criminals-exploiting-crypto-2024-top-crime-typologies https://bitquery.io/blog/criminals-exploiting-crypto-2024-top-crime-typologies Mon, 16 Sep 2024 05:00:00 GMT <![CDATA[Inside Germany's Bitcoin Reserves: What is the Government Holding?]]> https://bitquery.io/blog/inside-germany-bitcoin-reserves-government-holdings https://bitquery.io/blog/inside-germany-bitcoin-reserves-government-holdings Mon, 09 Sep 2024 05:00:00 GMT <![CDATA[Tokenized Real Estate: Transforming How We Invest in Property​]]> https://bitquery.io/blog/tokenized-real-estate-transforming-property-investment https://bitquery.io/blog/tokenized-real-estate-transforming-property-investment Thu, 29 Aug 2024 05:35:07 GMT <![CDATA[Crypto Travel Rule: From Anonymity to Accountability​]]> https://bitquery.io/blog/crypto-travel-rule-from-anonymity-to-accountability https://bitquery.io/blog/crypto-travel-rule-from-anonymity-to-accountability Fri, 23 Aug 2024 05:35:07 GMT <![CDATA[$4 Million Gone in Seconds]]> https://bitquery.io/blog/4-million-gone-in-seconds https://bitquery.io/blog/4-million-gone-in-seconds Thu, 08 Aug 2024 05:00:00 GMT <![CDATA[Understanding Gas Consumption: Analyzing Highly Paid Operations on Ethereum and Other Blockchains]]> https://bitquery.io/blog/gas-consumption-analysis-ethereum-blockchains https://bitquery.io/blog/gas-consumption-analysis-ethereum-blockchains Fri, 02 Aug 2024 05:35:07 GMT <![CDATA[How to Get S&P 500 Onchain Data]]> https://bitquery.io/blog/get-sp500-onchain-data https://bitquery.io/blog/get-sp500-onchain-data Mon, 29 Jul 2024 05:35:07 GMT <![CDATA[Is Hedera Still Active? A Deep Dive into Transaction Metrics, Gas Economics, and Network Activity in 2024]]> https://bitquery.io/blog/hedera-active-2024-transaction-metrics-gas-economics https://bitquery.io/blog/hedera-active-2024-transaction-metrics-gas-economics Mon, 29 Jul 2024 05:35:07 GMT <![CDATA[What Happens When Large SOL Positions Are Liquidated?]]> https://bitquery.io/blog/liquidation-large-sol-positions-risk https://bitquery.io/blog/liquidation-large-sol-positions-risk Tue, 23 Jul 2024 05:35:07 GMT <![CDATA[Real World Asset Tracking on Arbitrum Made Easy]]> https://bitquery.io/blog/real-world-asset-tracking-arbitrum-bitquery-apis https://bitquery.io/blog/real-world-asset-tracking-arbitrum-bitquery-apis Tue, 23 Jul 2024 05:35:07 GMT <![CDATA[Bitcoin ATM Theft: How to Track and Recover Your Stolen Funds]]> https://bitquery.io/blog/track-recover-funds-bitcoin-atm-transactions https://bitquery.io/blog/track-recover-funds-bitcoin-atm-transactions Thu, 18 Jul 2024 05:35:07 GMT <![CDATA[Maximizing Crypto Gains: Using Mempool Data and Bitquery APIs for Token Price Predictions]]> https://bitquery.io/blog/maximizing-crypto-gains-mempool-bitquery-token-price-predictions https://bitquery.io/blog/maximizing-crypto-gains-mempool-bitquery-token-price-predictions Mon, 15 Jul 2024 05:35:07 GMT <![CDATA[The Ultimate Guide to Crypto Wallet Intelligence: Tracing, Analysis, and Compliance]]> https://bitquery.io/blog/ultimate-guide-wallet-intelligence-tracing-analysis-compliance https://bitquery.io/blog/ultimate-guide-wallet-intelligence-tracing-analysis-compliance Mon, 15 Jul 2024 05:35:07 GMT <![CDATA[Announcement of New API Pricing at Bitquery]]> https://bitquery.io/blog/new-pricing-june-2024 https://bitquery.io/blog/new-pricing-june-2024 Thu, 20 Jun 2024 12:42:00 GMT <![CDATA[The Future of Finance: How Syla Uses Bitquery Data for Crypto Tax Solutions]]> https://bitquery.io/blog/syla-bitquery-crypto-tax-solutions https://bitquery.io/blog/syla-bitquery-crypto-tax-solutions Fri, 14 Jun 2024 05:35:07 GMT <![CDATA[Exploring the Symbiotic Relationship Between Meme Coins and Their Native Networks]]> https://bitquery.io/blog/symbiotic-relationship-meme-coins-native-networks https://bitquery.io/blog/symbiotic-relationship-meme-coins-native-networks Fri, 14 Jun 2024 05:35:07 GMT <![CDATA[Identifying, Tracking, and Valuing USDT for Litigation Matters]]> https://bitquery.io/blog/identifying-tracking-valuing-usdt-litigation https://bitquery.io/blog/identifying-tracking-valuing-usdt-litigation Tue, 11 Jun 2024 05:35:07 GMT <![CDATA[How to Audit Blockchain Wallets : A Step-by-step Guide​]]> https://bitquery.io/blog/audit-blockchain-wallets-step-by-step-guide https://bitquery.io/blog/audit-blockchain-wallets-step-by-step-guide Mon, 03 Jun 2024 22:29:00 GMT <![CDATA[Understanding Blockchain Demand: Analyzing TPS and Throughput Needs​]]> https://bitquery.io/blog/understanding-blockchain-demand-tps-throughput-analysis https://bitquery.io/blog/understanding-blockchain-demand-tps-throughput-analysis Mon, 03 Jun 2024 22:29:00 GMT <![CDATA[Comparison of Ethereum, Polygon and Arbitrum Networks using On-chain Analysis of Wrapped Ether (WETH)​]]> https://bitquery.io/blog/weth-holders-ethereum-arbitrum-matic-comparison https://bitquery.io/blog/weth-holders-ethereum-arbitrum-matic-comparison Wed, 22 May 2024 22:29:00 GMT <![CDATA[A Deep Dive into Exchange Whale Ratio with Blockchain Data​]]> https://bitquery.io/blog/deep-dive-exchange-whale-ratio https://bitquery.io/blog/deep-dive-exchange-whale-ratio Tue, 21 May 2024 22:29:00 GMT <![CDATA[Using FATF (Financial Action Task Force) Indicators and Blockchain Data to Detect Money Laundering​]]> https://bitquery.io/blog/fatf-indicators-bitquery-detect-money-laundering https://bitquery.io/blog/fatf-indicators-bitquery-detect-money-laundering Tue, 21 May 2024 22:29:00 GMT <![CDATA[Evaluating Token Success: Holder Patterns and Price Changes Post-Launch]]> https://bitquery.io/blog/token-success-evaluation-holder-patterns-price-changes https://bitquery.io/blog/token-success-evaluation-holder-patterns-price-changes Thu, 16 May 2024 05:35:07 GMT <![CDATA[The Rise and Fall: A Deep Dive into the Phenomenon of Crypto Rug Pulls​]]> https://bitquery.io/blog/crypto-rug-pulls-rise-fall-deep-dive https://bitquery.io/blog/crypto-rug-pulls-rise-fall-deep-dive Mon, 06 May 2024 05:35:07 GMT <![CDATA[Bitcoin Stolen? Here's How You Might Get It Back!]]> https://bitquery.io/blog/recover-stolen-bitcoin-guide https://bitquery.io/blog/recover-stolen-bitcoin-guide Mon, 29 Apr 2024 05:35:07 GMT <![CDATA[The Mechanics of zkEVM: How It Works and Why It Matters]]> https://bitquery.io/blog/zkevm-how-works-why-matters https://bitquery.io/blog/zkevm-how-works-why-matters Wed, 24 Apr 2024 05:35:07 GMT <![CDATA[You Won’t Believe Why Transactions Are Failing on Solana and Base!]]> https://bitquery.io/blog/reasons-transactions-fail-solana-base https://bitquery.io/blog/reasons-transactions-fail-solana-base Fri, 19 Apr 2024 05:35:07 GMT Solana’s failed transactions have recently been the subject of intense debate on Crypto Twitter ( X ). People are comparing Base and Solana regarding TPS (Transactions per second) and transaction success ratio (TSR). Today, we will investigate the reasons why Solana transactions fail, attempting to understand the high rate of transaction failures on this chain. **Note** — We have only taken 17th April (Partial) data for Solana and 15–17 April. **TL;DR** - Solana and base have almost the same transaction success rate, which is around 75–80%. This means every 1 transaction out of 5 is failing on these chains. - Most of the failed transactions are related to DEXs on both chains. - Solana is processing around **200k successful trades per hour**; however, on average per hour, there are **more than 300k failed trades**. - Compared to Solana, Base blockchain is processing, [on average, 90k successful trades per hour and 5k failed trades per hour](https://ide.bitquery.io/BASE-transaction-failure-rate-and-trades-stats_1). ## Digging in Solana Solana has around [75–80% Transaction success rate (TSR)](https://ide.bitquery.io/Solana-transaction-failure-rate), which means around 20–25% of transactions fail daily. We first look at the [program and methods behind these failed transactions](https://ide.bitquery.io/Most-failed-instructions-on-Solana) to understand the reason for the failure. ![](/blog/reasons-transactions-fail-solana-base/instruction.png) As you can see, there are many transactions for which we can’t recognize the method name. However, we can still find them by [understanding which programs have these methods](https://ide.bitquery.io/Most-failed-instructions-on-Solana-where-we-do-not-recognise-method-name). ![](/blog/reasons-transactions-fail-solana-base/program.png) As you can see, the picture is getting more evident, and DEXs and arbitrage bot programs have the most failures. ![](/blog/reasons-transactions-fail-solana-base/charts.png) ### Analysing Swap Method Now, let’s move on to the most obvious DEX failures by digging deeper into transactions where the method name is “swap.” The following image shows the top failure reasons related to the “Swap” method. ![](/blog/reasons-transactions-fail-solana-base/tx_errorcount.png) By digging into the [transactions with these errors](https://ide.bitquery.io/Transaction-example-of-top-error-message_1), we found the following primary reason for errors. - **_Slippage error is caused when the token price changes between the time the transaction is submitted and_** _processed by the blockchain._ For example, a wallet like Phantom has a default [slippage setting of 0.3%](https://help.phantom.app/hc/en-us/articles/5985106844435-Why-did-my-swap-fail). Therefore, if the price of the swap differs by more than 0.3% from the presented price, the swap will fail to prevent you from losing value. Here is an [example of such a transaction](https://solscan.io/tx/3w4spKJyEnckEJfVBCnMyVjXwxHHzwWvt6T5RVfQZQvn6uHudYdWVCeJ2UqGbZWqhvdQHTWucu3bFy8egNm9JYQA) on Jupiter and [another on Raydium](https://solscan.io/tx/3w4spKJyEnckEJfVBCnMyVjXwxHHzwWvt6T5RVfQZQvn6uHudYdWVCeJ2UqGbZWqhvdQHTWucu3bFy8egNm9JYQA). - **Transactions trying to trade before Pool creation is Finalized** are the second most common error when trading bots try to get into the first few trades of a new pool. They see the pool creation transaction and send their trades, but the pool is still not finalized. This throws an “_Amm account owner is not matched with this program_” error. Here is an [example of such a transaction](https://solscan.io/tx/5Ahc68xDc1h7girBCTt4BFRDBLUHLMRYGpjubCr4BFzen8rupjSjg2BxP6z26kS5gxq38ocnJ61pTe3UtXeXGwzr). - **Out-of-Memory Error —** Many transactions fail because of this error. It’s more related to how developers pass data to other programs. Read more about it here; here is an example of such a transaction. However**,** most of these transactions are executed on DEXs. In addition, if we look into the [transfer method errors](https://ide.bitquery.io/Solana-Error-message-in-most-of-Transfer), we see that most of them were caused by the above two reasons. There were also errors related to other DEXs, such as [the Invalid Tick error](https://solscan.io/tx/3GNBboXuCkkURQL3VciRS6hyNyrjtxYH3vQGY9eC2poY8KwWCUPpoeGSCXoyF8rdEJ1SaqUd5YKWiekfjRFbgPNs) for Orca. We also check other processes, such as Rount, CreateAcount, or initializeAccount3. Most errors are caused by trading activity. ## What are the key takeaways from all this analysis? It shows that **these errors are not the problem of Solana but, instead, the developers and applications built on it**. However, this begs the question: if most transactions are trade-related, **how many trades is Solana processing?** Solana is [processing around](https://ide.bitquery.io/Solana-transaction-failure-rate-and-trades-stats_1) **[200k successful trades per hour](https://ide.bitquery.io/Solana-transaction-failure-rate-and-trades-stats_1)**; however, on average per hour, there are **more than 300k failed trades**. The base blockchain’s transaction success rate (TSR) is 77–80%. Note that I have checked only the 15–17 April data to understand the transaction failure stories of these chains. Compared to Solana, Base blockchain is processing, [on average, 90k successful trades per hour and 5k failed trades per hour](https://ide.bitquery.io/BASE-transaction-failure-rate-and-trades-stats_1). Similar to Solana, Looking deeper into [overall transaction failures on the Base blockchain](https://ide.bitquery.io/top-base-blockchain-failure_1), we found that most are related to DEX. ![](/blog/reasons-transactions-fail-solana-base/address_count.png) As you can see, most transactions fail not because of problems in blockchain, but due to the way users and developers send these transactions. ]]> <![CDATA[How to Use Bitquery to Follow the Money in Tornado Cash]]> https://bitquery.io/blog/track-money-tornado-cash-bitquery https://bitquery.io/blog/track-money-tornado-cash-bitquery Thu, 18 Apr 2024 05:35:07 GMT <![CDATA[The Essentials of the Ethereum DeFi Ecosystem]]> https://bitquery.io/blog/understanding-ethereum-defi-ecosystem https://bitquery.io/blog/understanding-ethereum-defi-ecosystem Thu, 18 Apr 2024 05:35:07 GMT <![CDATA[Exploring the Ethereum Liquid Staking Ecosystem: A Detailed Overview]]> https://bitquery.io/blog/ethereum-liquid-staking-ecosystem-overview https://bitquery.io/blog/ethereum-liquid-staking-ecosystem-overview Mon, 15 Apr 2024 05:35:07 GMT <![CDATA[A Deep Dive into Crypto Money Laundering and How Analytics Can Help]]> https://bitquery.io/blog/crypto-money-laundering-advanced-analytics https://bitquery.io/blog/crypto-money-laundering-advanced-analytics Fri, 12 Apr 2024 05:35:07 GMT <![CDATA[Understanding Tokenized US Bonds]]> https://bitquery.io/blog/understanding-tokenized-us-bonds https://bitquery.io/blog/understanding-tokenized-us-bonds Wed, 10 Apr 2024 05:35:07 GMT <![CDATA[The Future of Funds: Analyzing Franklin Templeton's Tokenized Ventures on Polygon]]> https://bitquery.io/blog/decoding-franklin-templeton-tokenized-funds https://bitquery.io/blog/decoding-franklin-templeton-tokenized-funds Tue, 09 Apr 2024 05:35:07 GMT <![CDATA[From Uniswap to SushiSwap: A Deep Dive into Ethereum's DEX Ecosystem]]> https://bitquery.io/blog/uniswap-sushiswap-ethereum-dex-ecosystem-deep-dive https://bitquery.io/blog/uniswap-sushiswap-ethereum-dex-ecosystem-deep-dive Thu, 04 Apr 2024 05:35:07 GMT <![CDATA[How to Find Ethereum Whales and Follow Their Money]]> https://bitquery.io/blog/how-to-find-ethereum-whales-follow-money https://bitquery.io/blog/how-to-find-ethereum-whales-follow-money Thu, 28 Mar 2024 05:35:07 GMT <![CDATA[Understanding Solana: A Comprehensive Exploration of Instructions and its Types]]> https://bitquery.io/blog/inside-solana-instructions-types-exploration https://bitquery.io/blog/inside-solana-instructions-types-exploration Mon, 25 Mar 2024 05:35:07 GMT <![CDATA[UTXO vs. Account-Based Blockchains: A Comparative Analysis]]> https://bitquery.io/blog/utxo-account-based-blockchain https://bitquery.io/blog/utxo-account-based-blockchain Fri, 22 Mar 2024 05:35:07 GMT <![CDATA[Blockchain Data Observability: Bridging the Gap Between Data and Decisions]]> https://bitquery.io/blog/blockchain-data-observability https://bitquery.io/blog/blockchain-data-observability Thu, 21 Mar 2024 05:35:07 GMT <![CDATA[Deep Dive into GMX: Exploring Arbitrum's Leading DeFi Protocol]]> https://bitquery.io/blog/gmx https://bitquery.io/blog/gmx Fri, 08 Mar 2024 22:00:00 GMT <![CDATA[Binance Smart Chain: Bitquery's BSC GraphQL API]]> https://bitquery.io/blog/bsc-api https://bitquery.io/blog/bsc-api Wed, 06 Mar 2024 22:00:00 GMT <![CDATA[ERC vs. SPL Token Standards: A Comparative Analysis]]> https://bitquery.io/blog/erc-vs-spl https://bitquery.io/blog/erc-vs-spl Wed, 06 Mar 2024 22:00:00 GMT <![CDATA[Cosmos API: Access Blockchain Data Seamlessly]]> https://bitquery.io/blog/cosmos-api https://bitquery.io/blog/cosmos-api Tue, 05 Mar 2024 22:00:00 GMT <![CDATA[Blockchain Transaction Simulation: Insights and Applications]]> https://bitquery.io/blog/transaction-simulation https://bitquery.io/blog/transaction-simulation Mon, 04 Mar 2024 22:00:00 GMT <![CDATA[Bid, Win, Own: Understanding the Process of NFT Auctions]]> https://bitquery.io/blog/nft-auction-track https://bitquery.io/blog/nft-auction-track Mon, 04 Mar 2024 06:35:07 GMT <![CDATA[A Comprehensive Guide to the Beacon Chain and How It Works]]> https://bitquery.io/blog/beacon-chain-comprehensive-guide https://bitquery.io/blog/beacon-chain-comprehensive-guide Mon, 04 Mar 2024 05:35:07 GMT <![CDATA[Bitcoin Halving and its imapct​]]> https://bitquery.io/blog/bitcoin-halving https://bitquery.io/blog/bitcoin-halving Tue, 27 Feb 2024 22:29:00 GMT <![CDATA[Does Arbitrum have a Mempool?]]> https://bitquery.io/blog/does-arbitrum-has-mempool https://bitquery.io/blog/does-arbitrum-has-mempool Mon, 26 Feb 2024 22:29:00 GMT <![CDATA[A Comprehensive Guide to UTXO-based Networks]]> https://bitquery.io/blog/utxo-comprehensive-guide https://bitquery.io/blog/utxo-comprehensive-guide Mon, 26 Feb 2024 05:35:07 GMT <![CDATA[Arbitrum NFT APIs - A Comprehensive Guide to Bitquery's Arbitrum NFT APIs​]]> https://bitquery.io/blog/arbitrum-nft-api https://bitquery.io/blog/arbitrum-nft-api Sat, 24 Feb 2024 22:29:00 GMT <![CDATA[A Guide to Bitquery's Litecoin APIs​]]> https://bitquery.io/blog/litecoin-api https://bitquery.io/blog/litecoin-api Sat, 24 Feb 2024 22:29:00 GMT <![CDATA[Understanding ZK Rollups]]> https://bitquery.io/blog/understanding-zk-rollups https://bitquery.io/blog/understanding-zk-rollups Wed, 21 Feb 2024 05:35:07 GMT <![CDATA[Arbitrum DEX APIs - A Comprehensive Guide to Bitquery's Arbitrum DEX APIs​]]> https://bitquery.io/blog/arbitrum-dex-api https://bitquery.io/blog/arbitrum-dex-api Sun, 18 Feb 2024 22:29:00 GMT Time filter, which includes the time. If you want to filter by date, then use Block -> Date. You can also use Block -> Number if you want to filter based on block height. We are setting the seller and buyer to 1inch router 0x1111111254eeb25477b68fb85ed929f73a960582 to get both buys and sells of the ARB token. ``` { EVM(dataset: combined, network: arbitrum) { buyside: DEXTrades( limit: {count: 10} orderBy: {descending: Block_Time} where: {Trade: {Buy: {Currency: {SmartContract: {is: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}}, Seller: {is: "0x1111111254eeb25477b68fb85ed929f73a960582 "}}}, Block: {Time: {since: "2023-03-03T01:00:00Z", till: "2023-03-05T05:15:23Z"}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } } } sellside: DEXTrades( limit: {count: 10} orderBy: {descending: Block_Time} where: {Trade: {Sell: {Currency: {SmartContract: {is: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}}, Buyer: {is: "0x1111111254eeb25477b68fb85ed929f73a960582"}}}, Block: {Time: {since: "2023-03-03T01:00:00Z", till: "2023-03-05T05:15:23Z"}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } } } } } ``` Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/Historical-Token-Trades--Price-API). #### **First X Buyers of a Token** This query retrieves the first X number of buyers for a specific token within the Arbitrum network. Replace the token address of the token you want in the Currency SmartContract field. ```{ EVM(dataset: archive, network: arbitrum) { buyside: DEXTrades( limit: {count: 10} limitBy: {by: Transaction_From, count: 1} orderBy: {ascending: Block_Time} where: {Trade: {Buy: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol } Seller Price } } } } } ``` Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/First-X-Buyers-of-a-Token-arbitrum-network). #### **Get Least Traded Token** The following query gets least traded tokens within a specified time frame on the Ethereum network. By querying the DEX trades and sorting them based on the least number of trades, it provides insights into tokens with minimal trading activity during the designated period. ``` query MyQuery { EVM(dataset: archive, network: arbitrum) { DEXTradeByTokens( limit: {count: 10} where: {Block: {Time: {after: "2023-11-20T00:00:00Z", before: "2023-11-27T00:00:00Z"}}} orderBy: {ascendingByField: "count"} ) { Trade { Currency { Name SmartContract } } count } } } ``` Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/Get-Least-Traded-Token). #### **Token trade from a specific DEX** If you are looking for token trades on a specific arbitrum dex, use the following API as an example. Here we are getting Arbitrum token trades from the Uniswap V3 DEX. To filter all trades from Uniswap V3, we can use the ProtocolName filter and pass the value of "uniswap_v3". This will give us all the trades from Uniswap V3 deployed on Arbitrum. ``` { EVM(dataset: archive, network: arbitrum) { buyside: DEXTrades( limit: {count: 5} orderBy: {descending: Block_Time} where: {Trade: {Buy: {Currency: {SmartContract: {is: "0x912ce59144191c1204e64559fe8253a0e49e6548"}}}, Dex: {ProtocolName: {is: "uniswap_v3"}}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } Dex { ProtocolFamily ProtocolName SmartContract Pair { SmartContract } } } } } } ``` You can also use the factory contract of Uniswap-like protocols in the DEX -> OwnerAddress filter to get trades for that DEX.Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/Token-trade-from-a-specific-DEX). ### Address Trades API ( Arbitrum Mainnet ) #### **Latest Trades for a given address** This GraphQL query retrieves the latest 10 buy-side and sell-side trades from the DEXTrades dataset on the Ethereum network for a specific buyer/seller. ``` { EVM(dataset: combined, network: arbitrum ) { buyside: DEXTrades( limit: {count: 10} orderBy: {descending: Block_Time} where: {Trade: {Buy: {Buyer: {is: "0x1f77dfeb0e6fed1ecf0b41d4c81330df6a6fb167"}}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } } } sellside: DEXTrades( limit: {count: 10} orderBy: {descending: Block_Time} where: {Trade: {Buy: {Seller: {is: "0x1f77dfeb0e6fed1ecf0b41d4c81330df6a6fb167"}}}} ) { Block { Number Time } Transaction { From To Hash } Trade { Buy { Amount Buyer Currency { Name Symbol SmartContract } Seller Price } Sell { Amount Buyer Currency { Name SmartContract Symbol } Seller Price } } } } } ``` Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/Latest-Trades-for-a-given-address). #### **Trades Where the Address is Buyer OR Seller** The below query gives you trades where the specified address is either as a buyer or a seller. This is achieved by utilizing the any filter, which acts as an OR condition to encompass both buyer and seller roles in the results. ``` query MyQuery { EVM(dataset: archive, network: arbitrum) { DEXTrades( where: {any: [{Trade: {Buy: {Buyer: {is: "0x0938C63109801Ee4243a487aB84DFfA2Bba4589e"}}}}, {Trade: {Buy: {Seller: {is: "0x0938C63109801Ee4243a487aB84DFfA2Bba4589e"}}}}]} limit: {count: 10} orderBy: {descending: Block_Time} ) { Trade { Buy { Buyer Amount Currency { Name } } Dex { ProtocolName } Sell { Buyer Price Currency { Name } } } Transaction { Hash } } } } ``` Open the above query on GraphQL IDE using this [link](https://ide.bitquery.io/Trades-Where-the-Address-is-Buyer-OR-Seller). ## Applications Let’s delve into the applications of using Bitquery GraphQL APIs for Arbitrum DEX data and explore how this information can be harnessed effectively. - **Monitoring DEX Activity** - Bitquery’s DEX Trades API provides real-time and historical data on decentralized exchange (DEX) trades within the Arbitrum ecosystem. By querying this API, you can track trading volumes, liquidity changes, and price movements across various DEXs. - Developers and traders can use this data to monitor the health and performance of different DEX protocols. For instance, you can analyze which tokens are most actively traded, identify emerging tokens across arbitrum network on different DEXes, and track liquidity pools’ dynamics. - **Algorithmic Trading Strategies** - Armed with DEX trade data, you can design and optimize algorithmic trading strategies. These strategies can automate buy/sell decisions based on specific conditions, such as price fluctuations, volume spikes, or liquidity imbalances. - By integrating Bitquery’s APIs into your trading bots, you can execute trades on Arbitrum DEXs efficiently. For instance, you might create a strategy that rebalances a portfolio by swapping tokens across different DEXs to maintain desired weightings. - **Market Research and Insights** - Researchers and analysts can leverage Bitquery’s APIs to gain deep insights into the Arbitrum DEX landscape. By querying token transfers, liquidity pools, and historical trade data, you can uncover trends, anomalies, and market behavior. - These insights can inform investment decisions, guide token listings, and provide valuable context for understanding the overall health of the Arbitrum DEX ecosystem. ## Conclusion Bitquery's robust GraphQL APIs open up a treasure of data from Arbitrum's DEX ecosystem. As this layer 2 scaling solution gains traction, analyzing on-chain activity across DEX protocols like Uniswap, Sushiswap, and 1Inch becomes invaluable. By leveraging Bitquery's APIs, developers can build tools to monitor real-time trading, research market dynamics, design algo trading systems, and more. The ability to query historical trades, liquidity pools, smart contract events, and other granular data unlocks new opportunities. As Arbitrum cements itself as a leading layer 2 network, its DEX landscape will continue to evolve. Bitquery provides a flexible data infrastructure to keep up with this innovation. Whether you're an analyst, trader, or builder - these powerful APIs equip you with actionable data to maximize opportunities in DeFi. ## About Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/moneyflow) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world. ]]> <![CDATA[Top 10 Certifications to Learn Crypto Investigation]]> https://bitquery.io/blog/crypto-investigation-courses https://bitquery.io/blog/crypto-investigation-courses Thu, 15 Feb 2024 12:06:00 GMT <![CDATA[Understanding Wallet Classifications from Crypto Whales to Krills]]> https://bitquery.io/blog/understanding-wallet-classifications https://bitquery.io/blog/understanding-wallet-classifications Tue, 13 Feb 2024 05:35:07 GMT 1,000,000 tokens | Very High | Major investors, early adopters, institutions | | **Sharks** | 100,000 - 1,000,000 | High | Significant traders, large investors | | **Dolphins** | 10,000 - 100,000 | Moderate | Active traders, medium investors | | **Seals** | 1,000 - 10,000 | Low-Moderate | Regular investors, early enthusiasts | | **Fish** | 100 - 1,000 | Low | Small investors, retail traders | | **Krill** | 0 - 100 | Minimal | Micro investors, new users | > **Token Value Matters** > > These thresholds are guidelines and should be adjusted based on token economics. A whale holding 1M tokens worth $0.01 each differs significantly from one holding 1M tokens worth $100 each. ## The Significance of Whales Crypto whales—holders with 100,000+ tokens—exert disproportionate influence on market dynamics, price movements, and overall ecosystem health. Understanding whale behavior is essential for any serious market participant. ### How Whales Impact Markets **1. Price Volatility** Whales can trigger significant price movements through large transactions: - **Selling Pressure**: Large sell orders create sharp downward pressure, potentially triggering panic selling - **Buy Walls**: Substantial purchases can rapidly increase prices and spark buying frenzies - **Psychological Impact**: Whale movements often influence retail trader behavior **2. Market Liquidity** Whales play a dual role in market liquidity: - **Positive**: Provide depth to order books, enabling smoother trading - **Market Making**: Large orders allow others to trade without excessive slippage - **Negative**: Sudden liquidity withdrawal increases volatility and spreads - **Concentration Risk**: Over-reliance on few holders creates instability **3. Market Manipulation Risks** Large holders possess tools for market manipulation: - **Wash Trading**: Creating artificial volume through self-trading - **Spoofing**: Placing large orders to manipulate price, then canceling them - **Pump & Dump**: Coordinated buying followed by mass selling - **Accumulation Games**: Suppressing prices to accumulate before major moves **4. Investor Sentiment** Whale activity serves as a market signal: - **Accumulation Phases**: Large buys often indicate confidence in future price appreciation - **Distribution Phases**: Consistent selling may signal upcoming bearish trends - **Smart Money Indicators**: Experienced traders monitor whale wallets for strategic insights - **Confidence Metrics**: Whale holding patterns influence overall market sentiment > **⚠️ Monitor Whale Activity** > > Tracking whale movements provides early warning signals for potential market shifts. Use Bitquery's Token Holder APIs to identify and monitor large holders in real-time. ## Analyzing Token Distribution with Bitquery APIs Now let's explore practical examples using Bitquery's Token Holder APIs to analyze wallet classifications, track distribution patterns, and monitor whale activity across popular tokens. ### Example 1: Categorized Count of USDT Token Holders This query retrieves USDT holder counts across different wallet classifications—whales, sharks, and dolphins—providing insights into token concentration. Run in IDE: [USDT holder distribution by tier](https://ide.bitquery.io/Count-of-token-holders-for-a-token-on-Ethereum)
Click to expand GraphQL query ```graphql { EVM(dataset: archive, network: eth) { TokenHolders( date: "2024-02-01" tokenSmartContract: "0xdAC17F958D2ee523a2206206994597C13D831ec7" where: { Balance: { Amount: { ge: "0" } } } ) { whales: count( distinct: Holder_Address if: { Balance: { Amount: { gt: "1000000" } } } ) sharks: count( distinct: Holder_Address if: { Balance: { Amount: { gt: "100000", le: "1000000" } } } ) dolphins: count( distinct: Holder_Address if: { Balance: { Amount: { gt: "1000", le: "100000" } } } ) } } } ```
**Key Insights:** - **Dolphins (1K-100K tokens)**: Represent the majority with 223,459 holders, indicating healthy retail participation - **Sharks (100K-1M tokens)**: 20,288 holders form the active trading tier - **Whales (>1M tokens)**: Only 3,753 holders, but they control significant supply This distribution pattern suggests relatively healthy decentralization, though whales still maintain considerable influence. ### Example 2: Top Token Holders for MAYC NFT Collection Identify the largest holders of the Mutant Ape Yacht Club (MAYC) NFT collection to understand ownership concentration patterns. Run in IDE: [Top MAYC holders](https://ide.bitquery.io/top-token-holder-for-a-token-using-token-holders-api)
Click to expand GraphQL query ```graphql { EVM(dataset: archive, network: eth) { TokenHolders( date: "2024-02-01" tokenSmartContract: "0x60E4d786628Fea6478F785A6d7e704777c86a7c6" limit: { count: 10 } orderBy: { descending: Balance_Amount } ) { Holder { Address } Balance { Amount } BalanceUpdate { FirstDate LastDate } } } } ```
**Analysis:** - **Concentration Gradient**: Top holder owns 785 tokens while 10th holder owns 55 tokens, showing a natural concentration curve - **Whale Dominance**: Top 10 holders control a significant portion but not overwhelming majority - **Positive Distribution**: Multiple diverse holders indicate healthy decentralization rather than extreme concentration - **Monitoring Opportunity**: Track these addresses over time to identify accumulation or distribution trends ### Example 3: Trending Tokens by Holder Growth Discover which tokens are gaining the most holders, indicating growing community adoption and interest. Run in IDE: [Trending tokens by holder count](https://ide.bitquery.io/Trending_Token_based_on_holders)
Click to expand GraphQL query ```graphql { EVM(network: eth, dataset: combined) { BalanceUpdates( where: { Block: { Date: { since: "2024-02-01" } } BalanceUpdate: { Amount: { gt: "0" } } } orderBy: { descendingByField: "No_Holders" } limit: { count: 10 } ) { No_Holders: count(distinct: BalanceUpdate_Address) Currency { Name Symbol SmartContract } } } } ```
**Insights:** - **Native ETH Dominance**: Highest holder count reflects fundamental network adoption - **Stablecoin Utility**: USDT and USDC rank high, demonstrating their role as trading pairs and value stores - **DeFi Tokens**: Staking tokens (e.g., stETH) show growing DeFi participation - **Ecosystem Projects**: Application-specific tokens indicate active community engagement - **Adoption Metric**: Increasing holder count often precedes price appreciation > **💡 Related Documentation** > > For more token holder query examples, visit our [Token Holder API Guide](https://docs.bitquery.io/docs/blockchain/Ethereum/token-holders/token-holder-api) ## Advanced Token Holder Analysis The Token Holders API provides comprehensive capabilities for analyzing wallet classifications and distribution patterns. Here's how to leverage these powerful features: ### Core Capabilities **1. Holder Counting & Classification** - **Total Holder Count**: Track overall token adoption and network growth - **Categorized Counts**: Segment holders into whales, sharks, dolphins, etc. - **Time-Series Analysis**: Monitor holder growth patterns over time - **New vs. Existing**: Identify fresh entrants versus long-term holders **2. Balance Tracking & Monitoring** - **Historical Balances**: Query any address's token balance at specific dates - **Balance Changes**: Track accumulation or distribution patterns - **Portfolio Analysis**: Monitor multiple tokens across addresses - **Threshold Alerts**: Identify when addresses cross classification boundaries **3. Statistical Measures** The API provides advanced metrics for decentralization analysis: | Metric | Purpose | Use Case | |--------|---------|----------| | **Gini Coefficient** | Wealth inequality (0-1 scale) | Assess distribution fairness | | **Nakamoto Coefficient** | Decentralization threshold | Identify minimum colluding actors needed | | **Theil Index** | Entropy-based inequality | Advanced distribution analysis | | **Average Balance** | Mean holder position | Understand typical holder size | | **Median Balance** | Central tendency | True "middle" holder position | **4. Activity Analysis** - **Transaction Counts**: Track holder trading frequency - **First/Last Activity**: Identify dormant vs. active wallets - **Inflow/Outflow**: Monitor buying and selling patterns - **Liquidation Events**: Detect complete position exits **5. Top Holder Identification** - **Whale Addresses**: Find largest holders by balance - **Influential Stakeholders**: Identify major investors and institutions - **Risk Assessment**: Evaluate concentration risks - **Smart Money Tracking**: Monitor experienced trader movements **6. Advanced Filtering** - **Balance Ranges**: Filter holders within specific token amounts - **Date Ranges**: Analyze holder behavior across time periods - **Multiple Criteria**: Combine filters for sophisticated analysis - **Common Holders**: Find addresses holding multiple specific tokens ## Practical Use Cases Understanding wallet classifications enables powerful applications across the crypto ecosystem: ### For Traders & Investors - **Whale Watching**: Monitor large holder movements for early market signals - **Smart Money Tracking**: Follow successful traders and their strategies - **Risk Assessment**: Evaluate token concentration before investing - **Entry/Exit Timing**: Use distribution changes to optimize trade timing ### For Project Teams - **Community Health**: Monitor holder diversity and growth - **Token Economics**: Validate distribution aligns with tokenomics design - **Vesting Tracking**: Monitor team and investor unlock schedules - **Marketing Insights**: Identify successful holder acquisition strategies ### For Researchers & Analysts - **Decentralization Metrics**: Calculate Gini, Nakamoto, and Theil coefficients - **Market Research**: Compare distribution patterns across projects - **Trend Analysis**: Identify correlation between distribution and price - **Due Diligence**: Assess project legitimacy through holder patterns ### For DeFi Protocols - **Governance Analysis**: Understand voting power distribution - **Risk Management**: Monitor concentration risks in liquidity pools - **Airdrop Planning**: Design fair distribution based on holder tiers - **Incentive Design**: Target specific holder categories with rewards ## Key Takeaways **Token distribution is more important than total holder count** - Understanding who holds tokens and how much reveals true project health **Whales significantly impact markets** - Large holders influence price volatility, liquidity, and sentiment through their trading activity **Classification enables better analysis** - Segmenting holders into tiers (whales, sharks, dolphins, etc.) provides actionable insights **Monitor distribution changes over time** - Tracking holder patterns reveals accumulation, distribution, and trend signals **Bitquery APIs make analysis accessible** - Comprehensive token holder data available through simple GraphQL queries ## Next Steps Ready to start analyzing token distributions? Here's what to do next: 1. **[Try the Token Holder API](https://docs.bitquery.io/docs/blockchain/Ethereum/token-holders/token-holder-api)** - Explore comprehensive examples and queries 2. **[Get Your API Key](https://ide.bitquery.io/)** - Start with free tier access 3. **[Join Our Community](https://t.me/Bloxy_info)** - Connect with other developers and analysts 4. **[Explore More Examples](https://docs.bitquery.io/docs/examples/token-holders/token-holder-api/)** - Advanced use cases and patterns ## Related Resources Expand your knowledge with these related guides: ### Token Holder Analytics - **[Token Holder API Guide](https://docs.bitquery.io/docs/blockchain/Ethereum/token-holders/token-holder-api)** - Complete API reference and examples - **[Balance Updates Cube](https://docs.bitquery.io/docs/cubes/balance-updates-cube)** - Track balance changes over time - **[Token Holders Over Time](https://docs.bitquery.io/docs/examples/token-holders/token-holder-api/)** - Historical analysis patterns ### Distribution Metrics - **[Statistics & Metrics](https://docs.bitquery.io/docs/graphql/metrics/statistics/)** - Gini, Nakamoto, and Theil calculations - **[Calculations](https://docs.bitquery.io/docs/graphql/calculations)** - Custom metric computations - **[Filtering Techniques](https://docs.bitquery.io/docs/graphql/filters)** - Advanced query filtering ### Market Analysis - **[DEX Trades API](https://docs.bitquery.io/docs/blockchain/Ethereum/dextrades/dex-api)** - Analyze trading activity - **[Token Trades APIs](https://docs.bitquery.io/docs/blockchain/Ethereum/dextrades/token-trades-apis)** - Track buy/sell patterns - **[Transfers API](https://docs.bitquery.io/docs/blockchain/Ethereum/transfers/erc20-token-transfer-api)** - Monitor token movements ### Getting Started - **[First Query Guide](https://docs.bitquery.io/docs/start/first-query)** - Learn GraphQL basics - **[API Authentication](https://docs.bitquery.io/docs/authorisation/how-to-generate/)** - Get your API key - **[IDE Features](https://docs.bitquery.io/docs/ide/query)** - Master the query interface ## Support & Community Need help or have questions? - **[Telegram Community](https://t.me/Bloxy_info)** - Get support from our team and community - **[Documentation](https://docs.bitquery.io/)** - Comprehensive guides and references - **[GitHub Examples](https://github.com/bitquery)** - Code samples and integrations - **Email Support**: [email protected] ]]>
<![CDATA[Bitcoin API: Exploring BTC Transfers, Block Rewards, Havling and much more]]> https://bitquery.io/blog/bitcoin-api https://bitquery.io/blog/bitcoin-api Sun, 11 Feb 2024 05:35:07 GMT <![CDATA[Chatting Up a Crypto Storm: The Rise of Telegram Trading Bots]]> https://bitquery.io/blog/telegram-crypto-trading-bots https://bitquery.io/blog/telegram-crypto-trading-bots Fri, 09 Feb 2024 05:35:07 GMT <![CDATA[Blockchain Data Warehousing: Challenges in Storing Blockchain Data]]> https://bitquery.io/blog/blockchain-data-warehousing https://bitquery.io/blog/blockchain-data-warehousing Thu, 08 Feb 2024 05:35:07 GMT <![CDATA[Understanding Tornado Cash - The Appeal of Anonymity]]> https://bitquery.io/blog/tornado-cash https://bitquery.io/blog/tornado-cash Thu, 08 Feb 2024 05:35:07 GMT <![CDATA[Cardano Ecosystem Overview​]]> https://bitquery.io/blog/cardano-ecosystem-overview https://bitquery.io/blog/cardano-ecosystem-overview Sun, 04 Feb 2024 22:29:00 GMT <![CDATA[Opensea vs Blur: Analyzing Top NFT Marketplace]]> https://bitquery.io/blog/opensea-vs-blur https://bitquery.io/blog/opensea-vs-blur Sat, 03 Feb 2024 05:35:07 GMT <![CDATA[Celo API: Transaction, Transfers and much more]]> https://bitquery.io/blog/celo-api https://bitquery.io/blog/celo-api Thu, 01 Feb 2024 05:35:07 GMT
#### **Retrieving specific address data** This API helps you retrieve data of a specific address.  For example, you can use the following [query ](https://ide.bitquery.io/celo-address-details_1)in IDE to get details of a specific address, say,  0xa9ea63861543ddb45bc192520da0439495427364. This gives you the basic details of the selected address. Specify the network as "Celo_mainnet" and the address as applicable. ``` {   ethereum(network: celo_mainnet) {     address(address: {is: "0xa9ea63861543ddb45bc192520da0439495427364"}) {       smartContract {         attributes {           address {             address             annotation           }           name           value           type         }         contractType         protocolType         currency {           decimals           name           symbol           tokenType         }       }       balance       annotation       address     }   } } ```

#### **Retrieving smart contract details of an address** With the Address API, you can also get details of a smart contract address. Just specify the address with the smart contract address as shown in the [query ](https://ide.bitquery.io/celo-smartcotnractaddress-details)below to get the details including balance, contract type, and more. Specify the network as "celo_mainnet" . For example, the smart contract address we have used in this query is 0xefb84935239dacdecf7c5ba76d8de40b077b7b33.  ``` {   ethereum(network: celo_mainnet) {     address(address: {is: "0xefb84935239dacdecf7c5ba76d8de40b077b7b33"}) {       smartContract {         attributes {           name           value           type           address {             address             annotation           }         }         contractType         protocolType         currency {           decimals           name           symbol           tokenType         }       }       balance       annotation       address     }   } } ```

#### **Number of transactions of an address** To check for all the transactions sent or received by an address, use the following [query](https://ide.bitquery.io/celo-transactions-address). For example, this query retrieves data for the address, 0xe93685f3bba03016f02bd1828badd6195988d950 as shown below.  Specify the network as "celo_mainnet" and the address as given below. ``` {   ethereum(network: celo_mainnet) {     transactions(       options: {desc: "block.timestamp.time", limit: 10, offset: 0}       any: [{txTo: {is: "0xe93685f3bba03016f02bd1828badd6195988d950"}}, {txSender: {is: "0xe93685f3bba03016f02bd1828badd6195988d950"}}]     ) {       block {         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }         height       }       success       address: to {         address         annotation       }       gasValue       gas_value_usd: gasValue(in: USD)       gasCurrency {         symbol       }       hash     }   } } ```

#### **Obtaining token balance of an address** You can also use this API to obtain the native token balance of Celo. For example, to find out the token balances of the native token, cGLD (Celo Gold), of an address, say, 0xe93685f3bba03016f02bd1828badd6195988d950, use the following [query](https://ide.bitquery.io/celo-token-balance). Specify the network as "Celo_mainnet" and set the parameter "currency" to cGLD as shown here. ``` query MyQuery {   ethereum(network: celo_mainnet) {     address(address: {is: "0xe93685f3bba03016f02bd1828badd6195988d950"}) {       native_balance: balance       balances(currency: {is: "cGLD"}) {         value         currency {           address           name           symbol         }       }       smartContract {         attributes {           address {             annotation             address           }         }       }     }   } } ``` ### Address Stats API 

#### **Retrieving smart contract statistics** You can obtain statistical data,  such as smart contract calls, transaction days, amount received or sent, count of transactions, and balance by using this API.  For example, let's get all the statistics related to an address, 0xe93685f3bba03016f02bd1828badd6195988d950 by using this [query](https://ide.bitquery.io/celo-address-statistics).  Specify the network as "Celo_mainnet" and the address as shown. ``` {   ethereum (network: celo_mainnet){     addressStats(address: {is: "0xe93685f3bba03016f02bd1828badd6195988d950"}) {       address {         balance         callTxCount         calledTxCount         daysWithReceived         daysWithSent         daysWithTransactions         daysWithTransfers         feeAmount         otherTxCount         receiveAmount         receiveFromCurrencies         receiveTxCount         receiveFromCount         sendAmount         sendToCount         sendToCurrencies         sendTxCount       }     }   } } ``` ### Arguments API

#### **Obtaining arguments of smart contract calls** To obtain arguments of smart contract calls or events, use this query. This [query ](https://ide.bitquery.io/celo-arguments)retrieves all the arguments of the blocks on the Celo chain. Specify the network as "Celo_mainnet" . ``` {   ethereum(network: celo_mainnet) {     arguments(       smartContractEvent: {is: "PairCreated"}       options: {desc: "block.height", limit: 6}     ) {       block {         height       }       argument {         name         type       }     }   } } ``` ### Blocks API

#### **Obtaining number of blocks on the Celo chain** We can get data on blocks on the Celo chain with this API. For example, to retrieve the latest 20 blocks on Celo after 1st of October 2023, use this [query](https://ide.bitquery.io/celo-blocks). Specify the network as "Celo_mainnet" and the date as applicable. ``` {   ethereum (network: celo_mainnet){     blocks(       options: {limit: 20, desc: "timestamp.iso8601"}       date: {after: "2023-10-01T00:00:00Z"}     ) {       gasLimit       height       hash       timestamp {         iso8601       }       difficulty       size       reward       uncleCount       transactionCount       totalDifficulty     }   } } ``` To get a specific block's data, simply specify the "height" parameter to the required block ID in the above query.  ### Coinpath API 

#### **Tracking fund movement** To find out the money flow between addresses, use the coinpath API. This will retrieve data related to the amount transacted, number of transactions, amount sent or received, sender and receivers. For example, to obtain the fund movement of this address, 0xccbfd3e39bf646c8eee2dfd1ae59896701526a31, since the beginning of January 2024, use this [query](https://ide.bitquery.io/celo-coinpath). Specify the network as "Celo_mainnet" , address, and the dates as applicable. ``` query ($network: EthereumNetwork!, $address: String!, $inboundDepth: Int!, $outboundDepth: Int!, $limit: Int!, $currency: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     inbound: coinpath(       initialAddress: {is: $address}       currency: {is: $currency}       depth: {lteq: $inboundDepth}       options: {direction: inbound, asc: "depth", desc: "amount", limitBy: {each: "depth", limit: $limit}}       date: {since: $from, till: $till}     ) {       sender {         address         annotation         smartContract {           contractType           currency {             symbol             name           }         }       }       receiver {         address         annotation         smartContract {           contractType           currency {             symbol             name           }         }       }       amount       currency {         symbol       }       depth       count     }     outbound: coinpath(       initialAddress: {is: $address}       currency: {is: $currency}       depth: {lteq: $outboundDepth}       options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: $limit}}       date: {since: $from, till: $till}     ) {       sender {         address         annotation         smartContract {           contractType           currency {             symbol             name           }         }       }       receiver {         address         annotation         smartContract {           contractType           currency {             symbol             name           }         }       }       amount       currency {         symbol       }       depth       count     }   } } ``` ### DEX API This API enables you to extract DEX trade information from Ethereum blockchains. 

#### **Retrieving trade data from Celo chain** To obtain the DEX trade data on Celo for the month of January 2024, use this [query](https://ide.bitquery.io/dex-trades1). Specify the network as "Celo_mainnet" and the date as applicable. ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     dexTrades(       options: {desc: ["block.height", "tradeIndex"], limit: $limit, offset: $offset}       time: {since: $from, till: $till}     ) {       block {         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }         height       }       tradeIndex       protocol       exchange {         fullName       }       smartContract {         address {           address           annotation         }       }       buyAmount       buyCurrency {         address         symbol       }       buy_amount_usd: buyAmount(in: USD)       sellAmount       sellCurrency {         address         symbol       }       sell_amount_usd: sellAmount(in: USD)       transaction {         hash       }     }   } } ```

#### **Traded Currencies on Celo** To see all the traded currencies over a period of time, use this API. For example, to see the number of currencies over a period of 1 month (Jan 2024), use this [query](https://ide.bitquery.io/celo-dex-tradedcurrencies). Specify the network as "Celo mainnet" and dates as applicable. ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     dexTrades(       options: {asc: "date.date"}       date: {since: $from, till: $till}       tradeAmountUsd: {}     ) {       date: date {         date(format: $dateFormat)       }       trades: countBigInt       traders: countBigInt(uniq: takers)       contracts: countBigInt(uniq: smart_contracts)       currencies: countBigInt(uniq: buy_currency)       count     }   } } ```

#### **Trades by Protocol on Celo** If you want to know the trades by protocol, say Uniswap or Balancer, use this API to get the data. For example, in this [query](https://ide.bitquery.io/celo-dextrades-protocol), we are retrieving the number of trades by each protocol since the start of the current month. Specify the network as "Celo mainnet" and dates as applicable. ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     dexTrades(options: {asc: "date.date"}, date: {since: $from, till: $till}) {       date: date {         date(format: $dateFormat)       }       protocol       count     }   } } ``` To filter the trades by a specific protocol, such as Uniswap or Balancer, filter the above query using the protocol parameter and specify the protocol as required.  Similarly, you can get trade data on token pairs, trade pairs, and more using the Bitquery explorer and DEX API filters. Learn more [here](https://docs.bitquery.io/v1/docs/Examples/dexTrades/dex-trading-data-api). ### Smart Contracts API The Smart contract API  enables you to get all the smart contract calls made on the Celo network. 

#### **Obtaining list of all smart contract calls on Celo** To obtain all the smart contract calls for the past month on the Avalanche blockchain, use the following [query ](https://ide.bitquery.io/Smart-contract-calls-on-Celo)in IDE. Specify the network as "Celo mainnet" and provide the dates as required for the "since" and the "till" parameter as shown. ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractCalls(       options: {desc: "block.height", limit: $limit, offset: $offset}       date: {since: $from, till: $till}       external: true     ) {       block {         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }         height       }       address: caller {         address         annotation       }       arguments {         argument         value       }       callDepth       smartContract {         address {           address           annotation         }       }       smartContractMethod {         name         signatureHash       }       transaction {         hash       }       count     }   } } ```

#### **Retrieving number of unique smart contract calls on Celo** To obtain unique smart contract calls on the Celo chain during a specific week, use the following [query ](https://ide.bitquery.io/celo-unique-smart-contract-calls)in IDE. Replace the "from" and "till" variables with the dates you want. Replace the variable network with "Celo_mainnet".  ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractCalls(       options: {asc: "date.date"}       date: {since: $from, till: $till}     ) {       date: date {         date(format: $dateFormat)       }       count: countBigInt       contracts: countBigInt(uniq: smart_contracts)       callers: countBigInt(uniq: senders)       methods: countBigInt(uniq: smart_contract_methods)     }   } } ```

#### **Obtaining all calls for a specific smart contract** Similarly, you can query for calls from a specific smart contract. For example, if you want to know all the calls for a smart contact address "0x43d72ff17701b2da814620735c39c620ce0ea4a1", from 1st January to 24 January, use the following [query ](https://ide.bitquery.io/Calls-for-a-specific-celo-smart-contract)in IDE. Specify the network as "Celo mainnet" and dates as applicable. ``` query ($network: EthereumNetwork!, $address: String!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractCalls(       options: {desc: "block.timestamp.time", limit: $limit, offset: $offset}       date: {since: $from, till: $till}       smartContractAddress: {is: $address}     ) {       block {         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }         height       }       smartContractMethod {         name         signatureHash       }       smartContract {         address {           address           annotation         }       }       transaction {         hash       }       external       gasValue       gas_value_usd: gasValue(in: USD)     }   } } ``` Similarly, you can have specific queries for method calls by specific addresses and specific smart contracts. Learn more [here](https://docs.bitquery.io/v1/docs/Examples/smartcontractCalls/smart-contract-calls-api). 

#### **Obtaining top callers of smart contracts** The Smart Contracts API also helps you obtain who the top callers of a smart contract are, which includes the number of calls by each caller, date of the call, and the gas costs incurred.  For example, to find out the top callers of the smart contract, agEUR contract for the past 15 days, build the [query ](https://ide.bitquery.io/Celo-top-smart-contract-calls)as follows in the IDE. Replace the network variable with "Celo_mainnet" and the smart contract address as 0xc16b81af351ba9e64c1a069e3ab18c244a1e3049. Specify the from and to dates as required.  ``` query ($network: EthereumNetwork!, $address: String!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractCalls(       options: {desc: "count", limit: $limit, offset: $offset}       date: {since: $from, till: $till}       caller: {is: $address}     ) {       smartContract {         address {           address           annotation         }         contractType       }       max_date: maximum(of: date)       count       uniq_methods: count(uniq: smart_contract_methods)       gasValue(calculate: average)       gas_value_usd: gasValue(in: USD, calculate: average)     }   } } ``` ### Smart Contract Events API This API returns information on smart contract events.  For example, to obtain all the latest events for a specific smart contract, say 0xc16b81af351ba9e64c1a069e3ab18c244a1e3049, for the past 15 days, use this [query ](https://ide.bitquery.io/celo-smartcontract-event)in IDE. Specify the network as Celo-mainnet and dates as applicable. ``` query ($network: EthereumNetwork!, $address: String!, $limit: Int, $offset: Int, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractEvents(       options: {desc: "count", limit: $limit, offset: $offset}       date: {since: $from, till: $till}       smartContractAddress: {is: $address}     ) {       smartContractEvent {         name         signature         signatureHash       }       count       max_date: maximum(of: date)     }   } } ``` ### Celo Transactions API

#### **Retrieving latest transactions on Celo** To obtain the 10 current transactions on Celo, use this [query](https://ide.bitquery.io/Celo-current-transactions). Specify the network as "Celo_mainnet" and the current date as applicable. ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     transactions(       options: {desc: "block.height", limit: $limit, offset: $offset}       time: {since: $from, till: $till}     ) {       block {         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }         height       }       address: sender {         address         annotation       }       hash       gasValue       gas_value_usd: gasValue(in: USD)     }   } } ```

#### **Gas Spent on Celo Transactions** To view the amount of gas spent by the transactions on Celo, check this [query](https://ide.bitquery.io/Celo-gas-spent). In this example, we are retrieving data on the amount of gas spent in the current month. Specify the network as "Celo_mainnet'' and the dates as applicable. Use the parameters count and gasvalue to obtain the required data.  ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     transactions(options: {asc: "date.date"}, date: {since: $from, till: $till}) {       date: date {         date(format: $dateFormat)       }       count: countBigInt       gasValue     }   } } ```

#### **Top Gas Burners** To see which smart contracts are burning the most gas, build this [query](https://ide.bitquery.io/Celo-top-gas-burners).  This [query ](https://ide.bitquery.io/Celo-top-gas-burners)retrieves top gas burners from 15th January to 25th january 2024. Specify the network as "Celo_mainnet'' and the dates as applicable. Use parameters gasValue and count to calculate the average costs as shown here.  ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     smartContractCalls(       options: {desc: "gasValue", limit: $limit, offset: $offset}       date: {since: $from, till: $till}       external: true     ) {       smartContract {         address {           address           annotation         }       }       gasValue       gas_value_usd: gasValue(in: USD)       average: gasValue(calculate: average)       average_usd: gasValue(in: USD, calculate: average)       count     }   } } ``` You can also determine the gas cost of a specific address by specifying the smart contract address in the above query. ### Transfers API This API helps you get data on token transfers on Celo. You can get data regarding the transferred amount, the currency, unique senders, receivers and more. 

#### **Top Token Transfers on Celo** To see the latest tokens transferred on Celo, use the following query. Specify the network as "Celo_mainnet'' and the dates as applicable. In this [query](https://ide.bitquery.io/Celo-top-token-transfers), we retrieve the token transfers done till date starting from January 2024.  ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     transfers(       options: {desc: "count", limit: $limit, offset: $offset}       amount: {gt: 0}       time: {since: $from, till: $till}     ) {       currency {         symbol         address       }       count       senders: count(uniq: senders)       receivers: count(uniq: receivers)       amount       amount_usd: amount(in: USD)     }   } } ```

#### **Largest transfers on Celo** You can also retrieve data on the maximum amount that was transferred during a specific time period by using this query. For example, to see the highest amount transferred during a month (1st Dec 2023 to 25th Jan 2024), build this [query](https://ide.bitquery.io/Celo-Largest-transfer). Specify the network as Celo_mainnet, currency as "cGLD", dates as required, and use the parameter "max_amount" to determine the highest transfer amount on Celo.  ``` {   ethereum(network: celo_mainnet) {     transfers(       date: {after: "2023-12-01", before: "2024-12-25"}       currency: {is: "cGLD"}       height: {gt: 0}     ) {       max_amount: maximum(of: amount, get: amount)     }   } } ``` You can also use the API to build queries for obtaining transfers to and from addresses. Learn more [here](https://docs.bitquery.io/v1/docs/Examples/Transfers/transfer-api).  ### Token API

#### **List of all tokens traded on Celo** To obtain the current tokens traded on Celo, use this [query](https://ide.bitquery.io/Celo-all-tokens). Specify the network as "Celo_mainnet" and the current date as required. You can get the data on unique receivers and senders, number of transfers and the amount transferred. ``` query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     transfers(       options: {desc: "count", limit: $limit, offset: $offset}       amount: {gt: 0}       time: {since: $from, till: $till}     ) {       currency {         symbol         address       }       count       senders: count(uniq: senders)       receivers: count(uniq: receivers)       amount       amount_usd: amount(in: USD)     }   } } ```

#### **Daily Celo token transfers** To retrieve daily transfers of Celo's native crypto cGLD from January 1st 2024 till date, use the following [query](https://ide.bitquery.io/Celo-daily-token-transfers). Specify the network as "Celo_mainnet" and the dates as required to obtain the number of daily transfers. ``` query ($network: EthereumNetwork!, $token: String!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     transfers(       currency: {is: $token}       height: {gt: 0}       amount: {gt: 0}       date: {since: $from, till: $till}     ) {       date {         date(format: $dateFormat)       }       count: countBigInt       amount     }   } } ```

#### **Daily Celo token pair trades** You can retrieve all trades of token pairs on Celo. For example, to get data on token pairs of cGLD traded during 1st Jan 2024 to 10th Dec 2024, check this [query](https://ide.bitquery.io/Daily-Celo-token-pair-trades_1). Specify the network as "Celo_mainnet" and dates as applicable. Specify the token as "cGLD" to get the required data. ``` query ($network: EthereumNetwork!, $dateFormat: String!, $token: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     dexTrades(       options: {asc: "date.date"}       date: {since: $from, till: $till}       baseCurrency: {is: $token}     ) {       date: date {         date(format: $dateFormat)       }       trades: countBigInt       amount: baseAmount       baseCurrency {         symbol       }       contracts: countBigInt(uniq: smart_contracts)       currencies: countBigInt(uniq: quote_currency)     }   } } ```

#### **Latest token price on Celo** As USD isn't available on blockchains, you can use this API to derive the token price in USD.   For example, to obtain the latest token price of Celo's native currency (cGLD), use the following [query](https://ide.bitquery.io/Celo-token-price). Specify the token address as 0x62b8b11039fcfe5ab0c56e502b1c372a3d2a9c7a (Good dollar token in Celo), which is the base currency and specify the network as Celo_mainnet. Specify the quote currency as "cGLD "to get the price in USD. ``` query get_token_price_in_usd($token: String) {   ethereum(network: celo_mainnet) {     dexTrades(       baseCurrency: {is: $token}       quoteCurrency: {is: "cGLD"}       options: {desc: ["block.height"], limit: 1}     ) {       block {         height         timestamp {           time(format: "%Y-%m-%d %H:%M:%S")         }       }       baseCurrency {         symbol       }       quoteCurrency {         symbol       }       quotePrice       quoteAmountInUSD: quoteAmount(in: USD)       baseAmount       quotePriceInUSD: expression(get: "quoteAmountInUSD / baseAmount")       exchange {         fullNameWithId         address {           address           annotation         }       }     }   } } ``` ### Mining API This API extracts mining information on Celo, including the number of miners, blocks produced by them and so on. 

#### **Obtaining unique miners on Celo** In this example, let's get the data on the number of unique miners on Celo. To do so, build this [query ](https://ide.bitquery.io/Celo-unique-miners)in IDE. Here, we will specify dates to get the number of unique miners on those  days, say 24th January and 25h January. Specify the network as "Celo_mainnet" .  ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     blocks(       options: {asc: "date.date"}       date: {since: $from, till: $till}       height: {gt: 0}     ) {       date: date {         date(format: $dateFormat)       }       count: countBigInt(uniq: miners)       reward       usd: reward(in: USD)       difficulty(calculate: median)     }   } } ```

#### **Distribution of miners** This API also enables you to get data on the number of blocks produced by miners over a period of time.  For example, to get the number of block count distributions of a specific miner address, say, 0x0c01dc28d19f83d0a45223ec844674b96ea086a5 for the past 5 days, use the following [query ](https://ide.bitquery.io/Celo-block-count-miner-distribution)in IDE. Specify the network as "Celo_mainnet" and set the dates to the one you require, say, 20-25 January 2024. ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     blocks(       options: {asc: "date.date"}       date: {since: $from, till: $till}       height: {}       miner: {is: "0x0c01dc28d19f83d0a45223ec844674b96ea086a5"}     ) {       address: miner {         address         annotation       }       date {         date(format: $dateFormat)       }       count       reward     }   } } ```

#### **Number of block rewards** If available, you can also see the rewards per block in USD for a  selected period. For example, to see the block rewards from Dec 2023 till date, use the following [query](https://ide.bitquery.io/celo-block--rewards). Specify the network as "Celo_mainnet", dates as applicable, and the USD parameter as shown here.  ``` query ($network: EthereumNetwork!, $dateFormat: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {   ethereum(network: $network) {     blocks(       options: {asc: "date.date"}       date: {since: $from, till: $till}       height: {}     ) {       date: date {         date(format: $dateFormat)       }       count: countBigInt(uniq: miners)       reward       usd: reward(in: USD)       difficulty(calculate: median)     }   } } ``` Similarly, you can also obtain reward data for a specific block by specifying the height parameter. ## Conclusion As you can see, Celo is a powerful tool that can revolutionize financial services, especially on mobile phones. With its mobile-friendly design, stablecoins, and commitment to accessibility, the Celo API is poised to play a pivotal role in financial inclusion on a global scale. As developers continue to explore its capabilities, the potential for transformative applications and positive impact becomes prominent. Explore and analyze all this and more on Celo through the Bitquery APIs. We've listed key ones in this article to get you started. ## About Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.]]>
<![CDATA[Understanding Different MEV Attacks: Frontrunning, Backrunning and other attacks]]> https://bitquery.io/blog/different-mev-attacks https://bitquery.io/blog/different-mev-attacks Thu, 01 Feb 2024 05:35:07 GMT <![CDATA[Unveiling the Crypto Puzzle: Decoding VC Token Holdings]]> https://bitquery.io/blog/venture-capital-crypto-holdings https://bitquery.io/blog/venture-capital-crypto-holdings Wed, 31 Jan 2024 05:35:07 GMT <![CDATA[How to Perform Smart Contract Vulnerability Scan with Bitquery​]]> https://bitquery.io/blog/smartcontract-threat-scan https://bitquery.io/blog/smartcontract-threat-scan Mon, 29 Jan 2024 12:42:00 GMT <![CDATA[Understanding Optimistic Rollups: Arbitrum, Optimism and Others]]> https://bitquery.io/blog/understanding-optimistic-rollups https://bitquery.io/blog/understanding-optimistic-rollups Wed, 24 Jan 2024 05:35:07 GMT <![CDATA[Unveiling Rug Pull Schemes: A Closer Look at the “OpenAI” $NEA Token]]> https://bitquery.io/blog/nea-openai-rugpull-investigation https://bitquery.io/blog/nea-openai-rugpull-investigation Fri, 19 Jan 2024 12:42:00 GMT <![CDATA[Recovering Scammed Bitcoin: A Step-by-Step Guide​]]> https://bitquery.io/blog/recover-scammed-bitcoin https://bitquery.io/blog/recover-scammed-bitcoin Fri, 12 Jan 2024 12:42:00 GMT <![CDATA[Avalanche APIs: Tap into Smart Contracts, Transactions,Trades, and More]]> https://bitquery.io/blog/avalanche-api https://bitquery.io/blog/avalanche-api Tue, 02 Jan 2024 05:35:07 GMT <![CDATA[Unveiling the Power of Blockchain: Tracking Bitcoin Seized by the US Government​]]> https://bitquery.io/blog/bitcoin-seized-us-government https://bitquery.io/blog/bitcoin-seized-us-government Mon, 25 Dec 2023 05:35:07 GMT <![CDATA[Exploring Latest Liquid Staking Protocol - Diva Staking]]> https://bitquery.io/blog/exploring-new-liquid-staking-protocol https://bitquery.io/blog/exploring-new-liquid-staking-protocol Thu, 21 Dec 2023 11:53:07 GMT 1 ETH to qualify for staking validator eligibility. In Diva’s model, each validator is comprised of 16 Ether deposits made by individual operators in 1 Ether increments, along with an additional 16 Ether deposits dedicated to the LSD token. This strategy significantly expands the network's node count while enhancing security by distributing the workload across 16 operators per validator. Karpatkey, a leading DAO treasury management platform in DeFi, has made a significant contribution to Diva's growth by depositing 305 stETH (approximately $500,000) into its Vampire Attack contracts. Gnosis, another prominent player in the decentralised finance space, has further bolstered Diva's liquidity by depositing 3,011 stETH (equivalent to $4.7 million) into its vampire attack vault. The Diva airdrop has been well-received, garnering attention and support from various members of the Ethereum community. With 40% of $DIVA tokens allocated to DAO reserves, Diva is well-positioned to fuel liquidity mining initiatives, stimulate divETH liquidity, and prepare for an upcoming vampire attack on Lido. Combining all, we see Diva’s TVL jump over 300% over a month and user counts by 250%. ![Graph for TVL of Diva staking protocol](/blog/exploring-new-liquid-staking-protocol/diva-tvl.png) ## **Dominance of stETH in DeFi** When it comes to LSD Dominance by Market Cap, stETH dominates with an impressive 73%. In the broader DeFi space, three major protocols, namely Lido (48.7%), Aave v2 (28%), and Curve (11.3%), collectively hold over 80% of stETH. In contrast, Diva's stETH holding is still below 1%. Including lendings, liquidity pools, and yield protocols, stETH holds 39% circulation in DeFi. The amount of (w)stETH in DeFi has increased steadily over the period. As of November 19, 2023, there is over 2 million (w)stETH in DeFi. The majority of (w)stETH in DeFi is held in liquidity pools. There are over 1.5 million (w)stETH in liquidity pools. This is followed by lendings, with over 400,000 (w)stETH. Other protocols hold the remaining (w)stETH. No doubt it is one of the prime tokens to target. Needless to say, for Diva to keep growing, it needs to solidify its hold within the lending space with its token. ## **How Diva stands against the giant** Based on data from Bitquery data, as of November 2023, there are 17,585.8 stETH held by 700 DIVA depositors, and the top 5 depositors collectively own almost 40% of the [total stake (in Diva Early Stakers stETH Vault)](https://explorer.bitquery.io/ethereum/token/0x1ce8aAfb51e79F6BDc0EF2eBd6fD34b00620f6dB). Moreover, Divascan states the validator's number to be 1040 and the total nodes are 402. Currently, Lido's focus is on stETH, but there's potential for expansion within their ecosystem. Lido has a significant stake, with over 9 million ETH, accounting for 31.86% of all ETH deposits, contributed by 200,122 unique depositors. The growth of lido; unique holders, TVL, and stETH circulating have all been growing at a faster rate to offset the loss to Diva. This growth indicates a notable surge occurring concurrently with Diva receiving stake, revealing that the Total Value Locked (TVL) did not experience a significant negative impact. Both Diva and Lido offer convenient staking options for Ethereum holders. Diva requires no minimum ETH for staking and offers a 90% net staking reward, while Lido requires a minimum of 32 ETH. Diva's 16-node per validator redundancy compares to Lido's 1-node per validator setup. The choice between Diva and Lido depends on individual preferences and risk tolerance. Nonetheless, on top of the total stats, we can also find the daily unique sender users on each platform, which is 5 or less on Diva and 650-800 on Lido. ![Unique Receivers for Diva Early Staker stETH vault](/blog/exploring-new-liquid-staking-protocol/diva-unique-receivers.png) ![Unique Senders for Diva Early Staker stETH vault](/blog/exploring-new-liquid-staking-protocol/diva-unique-senders.png) Although competitors, we can see Diva solely as a loot to Lido. Possibly, in the short term, this might attract more Lido deposits by encouraging stEth purchases, the primary emphasis lies in recognizing that a robust Ethereum network benefits all stakeholders, including Lido. Diva is poised to emerge as a high-performing LSD soon. ## **About Bitquery** [**Bitquery**](https://bitquery.io/?utm_source=blog&utm_campaign=ethereum_staking) is your comprehensive toolkit designed with developers in mind, simplifying blockchain data access. Our products offer practical advantages and flexibility. - **APIs** - [Explore API](https://ide.bitquery.io/streaming?utm_source=blog&utm_campaign=ethereum_staking): Easily retrieve precise real-time and historical data for over 40 blockchains using GraphQL. Seamlessly integrate blockchain data into your applications, making data-driven decisions effortless. - **Coinpath®** - [Try Coinpath](https://bitquery.io/products/coinpath?utm_source=blog&utm_campaign=ethereum_staking): Streamline compliance and crypto investigations by tracing money movements across 40+ blockchains. Gain insights for efficient decision-making. - **Data in Cloud** - [Try Demo Bucket](https://bitquery.io/products/data-on-demand?utm_source=blog&utm_campaign=ethereum_staking): Access indexed blockchain data cost-effectively and at scale for your data pipeline. We currently support Ethereum, BSC, Solana, with more blockchains on the horizon, simplifying your data access. - **Explorer** - [Try Explorer](http://explorer.bitquery.io?utm_source=blog&utm_campaign=ethereum_staking): Discover an intuitive platform for exploring data from 40+ blockchains. Visualize data, generate queries, and integrate effortlessly into your applications. Bitquery empowers developers with straightforward blockchain data tools. If you have questions or need assistance, connect with us on our [Telegram channel](https://t.me/Bloxy_info?utm_source=blog&utm_campaign=ethereum_staking). Stay updated on the latest in cryptocurrency by subscribing to our newsletter below.]]> <![CDATA[Cardano APIs: Staking, Transactions, Blocks, and More]]> https://bitquery.io/blog/cardano-api https://bitquery.io/blog/cardano-api Mon, 18 Dec 2023 11:53:07 GMT <![CDATA[How to Conduct Airdrop Analysis for Free]]> https://bitquery.io/blog/airdrop https://bitquery.io/blog/airdrop Thu, 14 Dec 2023 05:35:07 GMT <![CDATA[How to Avoid Scams & Identify Legit Tokens During Crypto Rally]]> https://bitquery.io/blog/identify-duplicate-tokens-scam-contracts https://bitquery.io/blog/identify-duplicate-tokens-scam-contracts Mon, 04 Dec 2023 05:35:07 GMT 65 Name: BNB Address: 0xb8c77482e45f1f44de1745f52c74426c631bdd52 Symbol: BNB Next time you find an excellent crypto asset for investment, check out their token trading info [here](https://explorer.bitquery.io/ethereum/token/0x0c16a22a66cc354896570be6e914a68317f8b67a?from=2023-11-01&till=2023-11-30) so you don’t regret it later. ### Watch Out for Holder Count The second way you can be wary of a fraudster scheme is by looking at the number of holders for that token. The rule of thumb is to be skeptical if you find a token with a holder’s count <2000. Since it is infeasible (however not impossible) to have more than 2000 fake wallet addresses, the likelihood of manipulating the holder’s count diminishes significantly. ## Fake v/s Real USDT Holders Tether USD (USDT) is at the forefront of stablecoin economies worldwide. A stablecoin is a cryptocurrency whose value is tied to a fiat currency, such as USDT being pegged to the US dollar. It becomes challenging to distinguish the real cryptocurrency among so many counterfeits. [Bitquery Explorer can help determine the volume and distribution of real/fake USDT](https://explorer.bitquery.io/ethereum/token/0xdac17f958d2ee523a2206206994597c13d831ec7/holders?from=2023-11-01&till=2023-11-30) within the Web3 ecosystem. ![Fake USDT](/blog/identify-duplicate-tokens-scam-contracts/usdtFake.png) Comparing the above tables, an investor’s intuition should warn you about [the left USDT token](https://explorer.bitquery.io/ethereum/token/0xa1ccf27fb1902fdf1380c858226e6e6e9ea6ef91/holders?from=2023-11-01&till=2023-11-30) due to the following reasons: 1. Hilarious Name 2. Holder Count < 200 (<<<2000!) That’s a sure sign of a scam right there. Meanwhile, the table on the right belongs to the authenticated USDT token, also representing a vast number of token holders (approx. 5M). Scammers will do anything to convince you that their funny-named token is a real deal to invest in. That’s why a token’s background check is essential before investing in cryptocurrencies. So far, we have understood how trading volume, holder count, and funny name philosophy can alert you about fraud. Now, let’s get a bit technical and improvise our method. ## Read Between the Lines — Smart Contracts Bytecode #### Bytecode We’ll use the same fake USDT token address to initialize a query on [Bitquery IDE that extracts the bytecode for the USDT token](https://ide.bitquery.io/) smart contract. Bytecode is the compiled output stored on the Ethereum network after deploying the smart contracts written in Solidity. It is alphanumeric and cannot be read by humans but only by a computer. Example:- #Bytecode for Fake USDT 0x60806040526004361061011e575f3560e01c8063751039fc………… Many online tools can decompile bytecode to display the smart contract code behind the screen. A blockchain tech-savvy person can deduce multiple vulnerabilities and possible fraud schemes within the smart contract that contract creators keep hidden under the facade of a reputed token. ### Buy This Coin or Bitcoin? Let’s see an example of a potential scam of [fake BTC (Buy This Coin)](https://explorer.bitquery.io/ethereum/token/0x2e031426f3ef1b26b4fe4998346c4a4831c75c91) luring users in hopes of earning a hefty value appreciation profit from real BTC (Bitcoin). Buy This Coin Address: 0x2e031426f3ef1b26b4fe4998346c4a4831c75c91 After extracting the bytecode for fake BTC and studying the code, a few vulnerabilities that flagged it as fraud were found. - Wallets can be blacklisted from being able to transfer, swap or sell this token - Whitelist feature enables unique users to bypass restrictions These two functions can be easily exploited to manipulate the intended purpose of the smart contract. Users can also [find a few smart contract statistics](https://explorer.bitquery.io/ethereum/token/0x2e031426f3ef1b26b4fe4998346c4a4831c75c91/smart_contract?from=2023-11-01&till=2023-11-30) using the Bitquery Explorer without using bytecode. ![Fake BTC](/blog/identify-duplicate-tokens-scam-contracts/BTCFake.png) ## Overview of smart contract stats for fake BTC token This data implies that even if we combine all the given factors, it will still amount to only an insignificant fraction of true BTC. For November 2023, the transaction (Tx) count is less than a hundred. Considering the value of true BTC, it has a significant share in almost all crypto exchange platforms, such that it can never logically explain the above data if it were the real BTC. ## Conclusion Summarizing the main points to remember while looking out for a new crypto asset: - Don’t be fooled by the symbol; it could be a fake - Always [search for an asset’s history](https://explorer.bitquery.io/) before investing - Look out for low volume, high volatility, and low holder count to avoid being scammed - Tech-savvy people can do an in-depth smart contract code check by decompiling the bytecode as given in the article to make sure their funds are secure - Popular tokens = Traps (if left unchecked) *Guest blog written by Sarika*]]> <![CDATA[How to Conduct Blockchain Analysis for Free]]> https://bitquery.io/blog/how-to-conduct-blockchain-analysis-for-free https://bitquery.io/blog/how-to-conduct-blockchain-analysis-for-free Tue, 21 Nov 2023 05:35:07 GMT <![CDATA[Understanding Wealth Distribution with Gini and Nakamoto Coefficients]]> https://bitquery.io/blog/wealth-distribution-in-token-economy https://bitquery.io/blog/wealth-distribution-in-token-economy Thu, 16 Nov 2023 11:38:00 GMT <![CDATA[Beneath Aave V3 Data with Bitquery APIs​]]> https://bitquery.io/blog/aave-data https://bitquery.io/blog/aave-data Wed, 08 Nov 2023 12:29:00 GMT <![CDATA[Comparative Analysis of Ethereum Layer-2 Solutions: Arbitrum & Polygon]]> https://bitquery.io/blog/comparative-analysis-of-ethereum-l2s https://bitquery.io/blog/comparative-analysis-of-ethereum-l2s Wed, 01 Nov 2023 09:30:00 GMT <![CDATA[USDC vs USDT: Analyzing On-Chain Activities with the Token Holders API]]> https://bitquery.io/blog/usdc-vs-usdt-analyzing-on-chain-activities-using-token-holders-api https://bitquery.io/blog/usdc-vs-usdt-analyzing-on-chain-activities-using-token-holders-api Thu, 26 Oct 2023 14:30:00 GMT <![CDATA[Arbitrum Ecosystem: A Comprehensive Look Using the Bitquery API​]]> https://bitquery.io/blog/arbitrum-ecosystem-analysis https://bitquery.io/blog/arbitrum-ecosystem-analysis Tue, 24 Oct 2023 22:29:00 GMT <![CDATA[Top Ethereum Mempool Data Providers]]> https://bitquery.io/blog/mempool-data-providers https://bitquery.io/blog/mempool-data-providers Mon, 25 Sep 2023 22:29:00 GMT Eden network is a multichain infrastructure where it aims for minimizing negative effects of MEV on blockchain network. Along with building this infrastructure, they have introduced a Ethereum mempool streaming service. It is currently in the alpha. ![Eden Network](/blog/mempool-data-providers/edennetwork.png) **Features**: - **Mempool Streaming Service**: Service that allows MEV searchers and block builders to get access to Ethereum mempool data for spotting MEV opportunities and build blocks quickly. - **Available for Blockchain Network**: Mempool streaming service is available for Ethereum mainnet. **Also Read: [Top SushiSwap APIs](https://bitquery.io/blog/top-sushiswap-apis)** **Limitation with using Mempool data providers** One limitation here is that you become reliant on a service provider, similar to relying on an RPC provider in the first method. However, most Mempool data providers strive to offer reliable services, making this a better option for the majority of users. ## **Importance of Choosing Right Data Provider** When selecting a data provider for accessing Mempool data, your choice should be guided by various data criteria and your specific needs. Here are the factors to take into account during your selection process: - **Data Accuracy**: Mempool data is dynamic, making data accuracy crucial. Outdated data can significantly impact your operational performance. - **Data Delay**: Mempool data is often time-sensitive, with limited time for reaction. Therefore, minimal data delay is essential when choosing a data provider. - **Reliability and Uptime**: Select a provider with a proven track record of reliability and minimal downtime to ensure uninterrupted access to mempool data. - **Support Documentation**: A comprehensive service documentation with a wide range of examples is valuable when making your choice. - **API and Integration Support**: Your data provider choice should align with your integration needs. Providers offer different integration options such as websockets, JSON RPC, or webhooks. Your decision should be based on your application's requirements and capabilities. - **Historical Data**: While the mempool is ever-changing, having support for historical data may still be worth considering for your specific use case. - **Customization and Filtering**: Given the diversity of transactions in the mempool, filtering capabilities are essential. However, it's important to carefully weigh the pros and cons of adding additional filtering layers. While they can enhance application performance, they may also introduce complexity. Your application's design should determine the extent of filtering needed. **Also Read: [How to Track Liquidity for Token Pairs on Uniswap](https://bitquery.io/blog/how-to-track-liquidity-for-token-pair-on-uniswap)** ## **Usecases of Mempool Data** Mempool is a highly dynamic environment with constant activity. Mempool data serves various purposes and offers variety of use cases. Let's explore some of these use cases to better understand the utility of mempool data. 1. **Arbitrage Strategies**: Arbitrage involves profiting from price variations of the same asset across markets. Mempool data is pivotal for real-time arbitrage. Few of many strategies are: - **MEV Bots (Maximal Extractable Value)**: MEV reflects miners' potential profit from transaction order. MEV bots swiftly exploit opportunities, e.g., front-running. For instance, they detect a user's large token buy order, execute a higher-priced purchase ahead of it, and sell to the user for profit. - **Arbitrage Bots**: These bots identify price differences for an asset across exchanges and capitalize on them. Mempool data is crucial. For instance, if Bitcoin's price is lower on Exchange A than B, an arbitrage bot buys on A and sells on B for profit. 2. **Transaction Monitoring and Real-time Insights**: Mempool data allows you to closely monitor a wide range of transactions and keep track of their current status. Additionally, it provides invaluable real-time insights into the network's condition, encompassing transaction volumes, patterns, and trends. 3. **Network Congestion Prediction**: By analyzing mempool data, you can predict possible network congestion and prepare accordingly. Understanding the state of pending transactions in the mempool helps you predict and respond to fluctuations in network activity, improving your operations like batch withdrawals from centralized exchanges or applications like arbitrage bots. ## **Conclusion** In summary, the Ethereum Mempool is an important part of the Ethereum network, facilitating transaction processing. To access Mempool data, you can either query it from your node or use Mempool data providers like Bitquery, BloXroute, RPCFast, Blocknative, or Eden Network. When selecting a provider, take into account elements such as data accuracy, minimal data latency, reliability, documentation availability, integration support, historical data access, and customization options. These factors are essential for enhancing the effective use of Mempool data in various applications, such as transaction monitoring, arbitrage strategies, network congestion prediction, and more. **Also Read: [Arbitrum API - Tokens, NFTs, DEX, Balances & More](https://bitquery.io/blog/arbitrum-api)** ## About Bitquery [Bitquery](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is your comprehensive toolkit designed with developers in mind, simplifying blockchain data access. Our products offer practical advantages and flexibility. - **APIs** - [Explore API](https://ide.bitquery.io/streaming): Easily retrieve precise real-time and historical data for over 40 blockchains using GraphQL. Seamlessly integrate blockchain data into your applications, making data-driven decisions effortless. - **Coinpath®** - [Try Coinpath](https://bitquery.io/products/coinpath?utm_source=blog&utm_medium=about): Streamline compliance and crypto investigations by tracing money movements across 40+ blockchains. Gain insights for efficient decision-making. - **Data in Cloud** - [Try Demo Bucket](https://bitquery.io/products/data-on-demand?utm_source=blog&utm_medium=about): Access indexed blockchain data cost-effectively and at scale for your data pipeline. We currently support Ethereum, BSC, Solana, with more blockchains on the horizon, simplifying your data access. - **Explorer** - [Try Explorer](http://explorer.bitquery.io/): Discover an intuitive platform for exploring data from 40+ blockchains. Visualize data, generate queries, and integrate effortlessly into your applications. Bitquery empowers developers with straightforward blockchain data tools. If you have questions or need assistance, connect with us on our [Telegram channel](https://t.me/Bloxy_info). Stay updated on the latest in cryptocurrency by subscribing to our newsletter below. ]]> <![CDATA[Top SushiSwap APIs - A Comprehensive Guide to DEX Exchanges]]> https://bitquery.io/blog/top-sushiswap-apis https://bitquery.io/blog/top-sushiswap-apis Mon, 25 Sep 2023 05:35:07 GMT <![CDATA[Explore NFT Collections with Bitquery's API]]> https://bitquery.io/blog/nft-collection-api https://bitquery.io/blog/nft-collection-api Fri, 22 Sep 2023 22:29:00 GMT <![CDATA[Exploring NFT Sales with Bitquery NFT API: Insights, Queries, and Real-Time Data]]> https://bitquery.io/blog/nft-sales https://bitquery.io/blog/nft-sales Wed, 20 Sep 2023 22:29:00 GMT <![CDATA[Track Events like NFT Drop, ENS Registration with Bitquery NFT API]]> https://bitquery.io/blog/track-events-like-nft-drop-ens-registration-with-bitquery-nft-apis https://bitquery.io/blog/track-events-like-nft-drop-ens-registration-with-bitquery-nft-apis Mon, 18 Sep 2023 05:35:07 GMT <![CDATA[Arbitrum API - Tokens, NFTs, DEX, Balances & More​]]> https://bitquery.io/blog/arbitrum-api https://bitquery.io/blog/arbitrum-api Thu, 14 Sep 2023 22:29:00 GMT <![CDATA[Google BigQuery Ethereum Dataset: A Comprehensive Tutorial​]]> https://bitquery.io/blog/querying-bigquery-blockchain-dataset https://bitquery.io/blog/querying-bigquery-blockchain-dataset Mon, 11 Sep 2023 12:42:00 GMT TIMESTAMP '2023-09-06 00:00:00'; ``` You'll notice a difference here compared to the previous queries. In the query above, you'll see that the term `hash` is enclosed in backticks (`), and there's also a `block_timestamp` value included. Why is this the case? Well, `hash` happens to be a keyword in BigQuery, so to indicate that `hash` is the name of the column, we enclose it in backticks. Additionally, the `block_timestamp` filter is included to narrow down the data we're retrieving, making it more efficient by filtering through a smaller subset of the table rather than the entire table. This optimization improves the performance of our query. After running this query, you will see the following result: ![https://lh3.googleusercontent.com/uvmA-fLJ-vAnPODCefBmBEFLrQPd2gobBZ0RvUi8Cbqh5hamiYM8BuXfhz-BtB7m0Rjk99a9a17JJoYh8SXloilwABdCI7YUXsiVTC4jNoAySOPzNV07Rc6uVxnPzZ2WnY-YJiXsTOLoCnFPJ7HAHN8](https://lh3.googleusercontent.com/uvmA-fLJ-vAnPODCefBmBEFLrQPd2gobBZ0RvUi8Cbqh5hamiYM8BuXfhz-BtB7m0Rjk99a9a17JJoYh8SXloilwABdCI7YUXsiVTC4jNoAySOPzNV07Rc6uVxnPzZ2WnY-YJiXsTOLoCnFPJ7HAHN8) ### Get latest transaction from an address To get the latest transaction from a specific address, we'll check if either the `from_address` or `to_address` matches the target address and then order the results by the transaction timestamp: ```sql SELECT * FROM `bigquery-public-data.crypto_ethereum.transactions` WHERE (from_address = '0xcda7559bcef42e68f16233b5b8c99c757a5f4697' OR to_address = '0xcda7559bcef42e68f16233b5b8c99c757a5f4697') ORDER BY block_timestamp DESC LIMIT 10; ``` ### Token Transfers The Token Transfers table provides information on [ERC20 transfers](https://explorer.bitquery.io/ethereum/transfers) from the Ethereum blockchain. Along with query table schema via editor, you can also explore the schema in the BigQuery Dashboard using the explorer, which is on the right-hand side. ![https://lh4.googleusercontent.com/AZu9NCzEJtwW3qccLcrvwGc1n7b0lX0_IPwxoawQcXFK977oMHZiWkF6w7A5kg7qJD3HY01pYmbcEaatIXDfvXhMAGCyKwxXCEo-bBQOuhk1uT-DbdI-QlA512TpYbNh_NnEWp04Nbnc--L1DNgcwMY](https://lh4.googleusercontent.com/AZu9NCzEJtwW3qccLcrvwGc1n7b0lX0_IPwxoawQcXFK977oMHZiWkF6w7A5kg7qJD3HY01pYmbcEaatIXDfvXhMAGCyKwxXCEo-bBQOuhk1uT-DbdI-QlA512TpYbNh_NnEWp04Nbnc--L1DNgcwMY) You can explore details of the dataset, ranging from the schema of the table to a preview of the data, among other details. ### Get token transfers of address To get token transfers for a specific address, the query is similar to fetching transactions for an address, but with a change in the queried table from transaction to `token_transfers`: ```sql SELECT * FROM `bigquery-public-data.crypto_ethereum.token_transfers` WHERE (from_address = '0xcda7559bcef42e68f16233b5b8c99c757a5f4697' OR to_address = '0xcda7559bcef42e68f16233b5b8c99c757a5f4697') ORDER BY block_timestamp DESC LIMIT 10; ``` ### Get Latest USDT Transfers To specifically get [USDT transfers](https://explorer.bitquery.io/ethereum/token/0xdac17f958d2ee523a2206206994597c13d831ec7/transfers), we use WHERE clauses and set the `token_address` to “[0xdAC17F958D2ee523a2206206994597C13D831ec7](https://explorer.bitquery.io/ethereum/token/0xdac17f958d2ee523a2206206994597c13d831ec7)”. ```sql SELECT * FROM `bigquery-public-data.crypto_ethereum.token_transfers` WHERE token_address = ‘0xdAC17F958D2ee523a2206206994597C13D831ec7’ AND block_timestamp > TIMESTAMP '2023-09-04 00:00:00' ORDER BY block_timestamp DESC LIMIT 10; ``` We have explored some tables and written queries that show how to query data. However, you can also create more complex queries by combining multiple tables to extract more meaningful insights. Here are some example queries that you can explore: - [What are the 10 most popular Ethereum collectibles (ERC721 contracts), by number of transactions?](https://console.cloud.google.com/bigquery?sq=283459204595:76c4e247fba2463cabc746e19c114cc9) - [What are the 10 most popular Ethereum tokens (ERC20 contracts), by number of transactions?](https://console.cloud.google.com/bigquery?sq=283459204595:ee095bfa957944ee9c7a115268652438) ## Querying Blockchain Data Using Python While you can query data using SQL in the editor, you also have the option to explore the data in a Python notebook. The dashboard provides you with the tool to automatically generate a Python notebook for the query you have executed. To create one, click on "Explore Data" and select the "Explore with Python Notebook" option. ![https://lh5.googleusercontent.com/4E2KvjgQJxXPf0G-hft2hJNpvnSRyAaX-6HUWRJr8aU-1hswc7eUJtkJWBr3k7wtNTAmMVlgGyIBQ3X4z-WWYsuiCesE11qPm8wIf0wCY8NiZCdRPzOUMMe-mlNILWht7jATS0zeusaGNUlBzgLymJs](https://lh5.googleusercontent.com/4E2KvjgQJxXPf0G-hft2hJNpvnSRyAaX-6HUWRJr8aU-1hswc7eUJtkJWBr3k7wtNTAmMVlgGyIBQ3X4z-WWYsuiCesE11qPm8wIf0wCY8NiZCdRPzOUMMe-mlNILWht7jATS0zeusaGNUlBzgLymJs) This will provide you with a ready-made Python Notebook from which you can access data from the BigQuery Ethereum dataset. ## Problems with using BigQuery for Blockchain Data BigQuery makes it easy to access data with its public datasets, which are great for simple applications. But these datasets have some limits, so if you need a wider range of data, you might face problems. If you want data through an API, you'd usually need to build your own systems to handle it. To help with this, Bitquery offers different products for different application needs. Bitquery can give you indexed blockchain data via API, and you can also explore it using [our IDE](https://ide.bitquery.io/streaming). There's another product called "Data in the Cloud," similar to BigQuery's public dataset, which we'll talk about in the next section. Bitquery's data covers transactions, token transfers, DEX trades, block data, smart contract details like calls and events, and more. If you want to explore this data, our IDE uses GraphQL to make it easy, so you [don't need to worry about complex SQL queries](https://bitquery.io/blog/graphql-charts). It even has a query builder, which is helpful if you're not familiar with GraphQL or our API. ## Data in the Cloud by Bitquery Bitquery’s “[Data in the Cloud](https://bitquery.io/products/cloud-products)” product provides an even richer dataset that covers the data BigQuery provides and much more. Datasets provided with the “Data in the Cloud’ product provide comprehensive data coverage for many other things like smart contract calls, events, token transfers (including [ERC20](https://docs.bitquery.io/docs/examples/transfers/erc20-token-transfer-api/), [ERC-721](https://bitquery.io/products/nft-apis), and ERC-1155), [DEX trades](https://bitquery.io/products/dex) for 40+ protocols like Uniswap, Balancer, 1Inch, and many more. In short, if you’re looking for something that provides comprehensive blockchain data via a cloud product, [Data in the Cloud](https://bitquery.io/products/cloud-products) is the solution you’re looking for. Check out [demo datasets](https://aws.amazon.com/marketplace/pp/prodview-oi4sbdu6zro3i?sr=0-1&ref_=beagle&applicationId=AWSMPContessa#dataSets) for the Data in the Cloud. If you want to talk to us, you can contact us [here](https://bitquery.io/forms/api) ## Also Read - [Building Blockchain ETL? Wait! Read this first!](https://bitquery.io/blog/blockchain-etl-challenges) - [Bitquery.io partners with AWS to offer blockchain data through AWS Data Exchange Marketplace](https://bitquery.io/blog/bitquery-aws)]]> <![CDATA[Bitquery NFT Marketplace APIs: How to get NFT Data]]> https://bitquery.io/blog/nft-opensea-blur-marketplace-api https://bitquery.io/blog/nft-opensea-blur-marketplace-api Sat, 09 Sep 2023 05:35:07 GMT <![CDATA[How to Track liquidity for token pairs on Uniswap]]> https://bitquery.io/blog/how-to-track-liquidity-for-token-pair-on-uniswap https://bitquery.io/blog/how-to-track-liquidity-for-token-pair-on-uniswap Tue, 05 Sep 2023 00:30:00 GMT <![CDATA[Uniswap API - Top 10 Essential Uniswap Trading Data APIs]]> https://bitquery.io/blog/top-uniswap-apis https://bitquery.io/blog/top-uniswap-apis Wed, 30 Aug 2023 05:35:07 GMT <![CDATA[Best NFT Market Trackers]]> https://bitquery.io/blog/nft-market-trackers https://bitquery.io/blog/nft-market-trackers Mon, 17 Jul 2023 05:35:07 GMT <![CDATA[BLUR NFT Marketplace API]]> https://bitquery.io/blog/blur-nft-marketplace-api https://bitquery.io/blog/blur-nft-marketplace-api Tue, 11 Jul 2023 00:00:05 GMT You can run the following queries [here](https://streaming.bitquery.io/). ## Latest Trades on Blur BLUR marketplace supports [Seaport protocol](https://opensea.io/blog/articles/introducing-seaport-protocol); we will use it to get the latest Blur trades. In this [query](https://ide.bitquery.io/Latest-10-Trades-on-Blur?utm_source=blog&utm_medium=marketing&utm_content=blur), we get NFT trades on Blur by setting the To address in the transaction to [Blur Marketplace contract](https://explorer.bitquery.io/ethereum/smart_contract/0x39da41747a83aee658334415666f3ef92dd0d541). ``` query MyQuery { EVM { DEXTrades( limit: { offset: 0, count: 10 } orderBy: { descendingByField: "Block_Time" } where: { Trade: { Dex: { ProtocolName: { is: "seaport_v1.4" } } } Transaction: { To: { is: "0x39da41747a83aeE658334415666f3EF92DD0D541" } } } ) { Trade { Dex { ProtocolName } Buy { Price Seller Buyer Currency { HasURI Name Fungible SmartContract } } Sell { Price Amount Currency { Name } Buyer Seller } } Transaction { Hash } Block { Time } } } } ``` ## Most traded NFTs on Blur Marketplace Let’s figure out the most traded NFT on the Blur marketplace. In the following [query](https://ide.bitquery.io/Most-traded-NFT-on-Blur-marketplace), we aggregate based on buyers, sellers, nfts, and trade volume and sorting based on count (Trade count). ``` query MyQuery { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } } } Transaction: { To: { is: "0x39da41747a83aeE658334415666f3EF92DD0D541" } } } orderBy: { descendingByField: "count" } limit: { count: 10 } ) { tradeVol: sum(of: Trade_Buy_Amount) count buyers: count(distinct: Trade_Buy_Buyer) seller: count(distinct: Trade_Buy_Seller) nfts: count(distinct: Trade_Buy_Ids) Trade { Buy { Currency { Name ProtocolName Symbol Fungible SmartContract } } } } } } ``` ## Total buy-sell of an NFT token on BLUR In the following [query](https://ide.bitquery.io/Total-buy-sell-of-an-NFT-token-onBLUR), we are getting total trades, trade volume, buyers, and sellers for [Nakamigos](https://explorer.bitquery.io/ethereum/token/0xd774557b647330c91bf44cfeab205095f7e6c367) NFT token. ``` query MyQuery { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } } Buy: { Currency: { Fungible: false SmartContract: { is: "0xd774557b647330c91bf44cfeab205095f7e6c367" } } } } Transaction: { To: { is: "0x39da41747a83aeE658334415666f3EF92DD0D541" } } } orderBy: { descendingByField: "count" } limit: { count: 10 } ) { tradeVol: sum(of: Trade_Buy_Amount) count buyer: count(distinct: Trade_Buy_Buyer) seller: count(distinct: Trade_Buy_Seller) nfts: count(distinct: Trade_Buy_Ids) Trade { Buy { Currency { Name ProtocolName Symbol Fungible SmartContract } } } } } } ``` ## Top buyers of NFTs on BLUR If we want to know the top buyer on the Blur marketplace, you can use the following query. In this [query](https://ide.bitquery.io/Top-buyers-of-NFTs-onBLUR), we ate aggregating NFTs bought or sold, unique transactions for top 10 buyers, and sorting them based on no. of trades. ``` query MyQuery { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } } Buy: { Currency: { Fungible: false } } } Transaction: { To: { is: "0x39da41747a83aeE658334415666f3EF92DD0D541" } } } orderBy: { descendingByField: "count" } limit: { count: 10 } ) { count uniq_tx: count(distinct: Transaction_Hash) Block { first_date: Time(minimum: Block_Date) last_date: Time(maximum: Block_Date) } nfts: count(distinct: Trade_Buy_Ids) difffernt_nfts: count(distinct: Trade_Buy_Currency_SmartContract) total_money_paid: sum(of: Trade_Sell_Amount) Trade { Buy { Buyer } } } } } ``` ## Specific buyer stats for an NFT on BLUR In the following [query](https://ide.bitquery.io/Specific-buyer-stats-for-an-NFT-onBLUR), we are getting details for a specific address on Blur nft marketplace. We are also getting the first and last trade dates for the address. ``` query MyQuery { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } } Buy: { Currency: { SmartContract: { is: "0xd774557b647330c91bf44cfeab205095f7e6c367" } } Buyer: { is: "0x9ba58eea1ea9abdea25ba83603d54f6d9a01e506" } } } Transaction: { To: { is: "0x39da41747a83aeE658334415666f3EF92DD0D541" } } } orderBy: { descendingByField: "count" } limit: { count: 10 } ) { count uniq_tx: count(distinct: Transaction_Hash) Block { first_date: Time(minimum: Block_Date) last_date: Time(maximum: Block_Date) } nfts: count(distinct: Trade_Buy_Ids) Trade { Buy { Buyer Currency { Name ProtocolName Symbol Fungible SmartContract } } } } } } ``` ## Latest Loans taken on Blur Blur uses the [Blend protocol](https://www.paradigm.xyz/2023/05/blend) to enable NFT loans. We will query Blur’s [Blend smart contract events](https://explorer.bitquery.io/ethereum/smart_contract/0x29469395eaf6f95920e59f858042f0e28d98a20b/events) to get different loans related data. In this [query](https://ide.bitquery.io/Latest-Loans-taken-onBlur), we look for the “LoanOfferTaken” events and set the smart contract to the Blur: [Blend Contract](https://explorer.bitquery.io/ethereum/smart_contract/0x29469395eaf6f95920e59f858042f0e28d98a20b) to get loan events on the marketplace. We are using Logheader to query smart contract events and not Log → smart contract because it’s a [delegated proxy contract](https://medium.com/coinmonks/proxy-pattern-and-upgradeable-smart-contracts-45d68d6f15da). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Latest loans for specific NFT token Now we can filter arguments in smart contract events; in this [API](https://ide.bitquery.io/Latest-loans-for-specific-NFTtoken), we are getting all loans for the [MutantApeYachtClub NFT collection](https://explorer.bitquery.io/ethereum/token/0x60e4d786628fea6478f785a6d7e704777c86a7c6) sorted based on block time on the Blur marketplace. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } Arguments: { includes: [ { Name: { is: "collection" } Value: { Address: { is: "0x60e4d786628fea6478f785a6d7e704777c86a7c6" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { 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 } } } } } } ``` ## Latest Loans for a specific lender Using the same technique of filtering arguments in the following [API](https://ide.bitquery.io/Latest-Loans-for-a-specificlender), we are getting the latest loans for specific lender address. Similarly, you can use this [API](https://ide.bitquery.io/Latest-Loans-for-a-specificborrower-on-Blur-marketplace) to get the lastest loans for specific borrower address. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } Arguments: { includes: [ { Name: { is: "lender" } Value: { Address: { is: "0xfa0e027fcb7ce300879f3729432cd505826eaabc" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { 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 } } } } } } ``` ## Loans above a specific amount on the Blur NFT marketplace If we want to track loans above a specific amount on the Blur marketplace, we can use the following [API](https://ide.bitquery.io/Loans-above-a-specific-amount-on-the-Blur-NFT-marketplace). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } Arguments: { includes: [ { Name: { is: "loanAmount" } Value: { BigInteger: { gt: "3000000000000000000" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { 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 } } } } } } ``` ## Loan history for specific NFT ID Let’s say you want to know the loan history for a specific NFT ID on the Blur marketplace; you can use the following [API](https://ide.bitquery.io/Loan-history-for-specific-NFTID) to get this result. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } Arguments: { includes: [ { Name: { is: "collection" } Value: { Address: { is: "0x49cf6f5d44e70224e2e23fdcdd2c053f30ada28b" } } } { Name: { is: "tokenId" }, Value: { BigInteger: { eq: "2662" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { 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 } } } } } } ``` ## Get loan details for specific LienId Blur’s Blend protocol uses LienID as the primary key throughout to track details of specific loans. We will use [this query](https://ide.bitquery.io/Get-loan-details-for-specificlienId) to track loan details for specific LienID through different events. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "LoanOfferTaken" } } } Arguments: { includes: [ { Name: { is: "lienId" }, Value: { BigInteger: { eq: "40501" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { 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 } } } } } } ``` ## Latest Loan Refinances on Blur Refinance means taking out a new loan to pay off an existing loan. In the case of NFTs, refinance can be used to take out a new loan using an NFT as collateral. In this [query](https://ide.bitquery.io/loan-refinance-on-Blur) will get the latest refinance events. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Refinance" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Loans refinanced by specific Address If you want to track loans refinanced by a specific address on Blur marketplace, use the following [query](https://ide.bitquery.io/Loans-refinanced-by-specificAddress). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Refinance" } } } Arguments: { includes: [ { Name: { is: "newLender" } Value: { Address: { is: "0xaaac34d30d6938787c653aafb922bc20bfa9c512" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## All refinance loans for specific NFT Use the following [query](https://ide.bitquery.io/All-refinance-loans-for-specificNFT-collection) to filter Refinance event arguments to get all refinance loans for specific NFT collection. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Refinance" } } } Arguments: { includes: [ { Name: { is: "collection" } Value: { Address: { is: "0xed5af388653567af2f388e6224dc7c4b3241c544" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Loan Repayments In this [query](https://ide.bitquery.io/Loan-repayment-of-blur-marketplace), we get loan repayment transactions by filtering for “Repay” events and setting the smart contract address to Blur: Blend address. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Repay" } } } Arguments: { includes: [ { Name: { is: "lienId" }, Value: { BigInteger: { eq: "43662" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Loan repayment for specific NFT collection To get loan repayments for specific NFT collections, you can filter “Repay” smart contract event arguments. Check the following [API](https://ide.bitquery.io/loan-repayment-for-specific-NFT-collection) to get the latest loan repayments for specific NFT collections on the Blur marketplace. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Repay" } } } Arguments: { includes: [ { Name: { is: "collection" } Value: { Address: { is: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Auction Events The StartAuction event is emitted when an auction is started for an NFT on the Blur: Blend smart contract. You can find the query [here](https://ide.bitquery.io/Auction-on-blur-marketplace). Similarly, you can also get Auctions for specific Lien ID using this [query](https://ide.bitquery.io/Auctions-for-specific-lienID). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "StartAuction" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## New Auctions for specific NFT Collection Similarly, you can get all the latest actions for specific NFT collections. See the following query in which we are getting the latest auction for [Milady NFT collection](https://explorer.bitquery.io/ethereum/token/0x5af0d9827e0c53e4799bb226655a1de152a425a5) on the Blur marketplace. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "StartAuction" } } } Arguments: { includes: [ { Name: { is: "collection" } Value: { Address: { is: "0x5af0d9827e0c53e4799bb226655a1de152a425a5" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Latest Locked NFTs Buy Trades A locked NFT is an NFT that is temporarily unable to be transferred or sold. It will be sold once the lock period has ended. The price of a locked NFT may be lower than the price of a non-locked NFT because the buyer cannot access the NFT until the lock period has expired. To get locked NFT trades, we filter for the “buylocked” smartcontract event. You can find the query [here](https://ide.bitquery.io/Locked-NFT-bought-on-Blur-marketplace). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "BuyLocked" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Locked NFTs bought by a buyer Using the following [query](https://ide.bitquery.io/Locked-NFTs-bought-by-abuyer), we can also track all the Locked NFTs bought by specific buyers by tracking the [BuyLocked event](https://explorer.bitquery.io/ethereum/smart_contract/0x29469395eaf6f95920e59f858042f0e28d98a20b/events) and filtering it using buyer argument. ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "BuyLocked" } } } Arguments: { includes: [ { Name: { is: "buyer" } Value: { Address: { is: "0x96a7021972646bb05f9b544b13036a4872796fb0" } } } ] } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Get Cancelled Offers To get this data, we filter by the OfferCancelled event emitted when an offer is canceled. You can find the query [here](https://ide.bitquery.io/Latest-Cancelled-offers-on-Blur-NFT-marketplace). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "OfferCancelled" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ``` ## Get Seize Offers When a seizure event occurs, the NFT is typically transferred to the control of the third party who is seizing it. To get this data, we filter transactions by the “seize” event on the Blur: Blend contract. You can get the query [here](https://ide.bitquery.io/Latest-Seized-NFTs-on-Blur-marketplace). ``` { EVM(dataset: combined, network: eth) { Events( where: { LogHeader: { Address: { is: "0x29469395eaf6f95920e59f858042f0e28d98a20b" } } Log: { Signature: { Name: { is: "Seize" } } } } limit: { count: 10 } orderBy: { descending: Block_Time } ) { Block { Number } Transaction { Hash } Log { SmartContract Signature { Name Signature } } Arguments { Name Index 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 } } } } } } ```]]> <![CDATA[Building Blockchain ETL? Wait! Read this first!​]]> https://bitquery.io/blog/blockchain-etl-challenges https://bitquery.io/blog/blockchain-etl-challenges Tue, 20 Jun 2023 05:35:07 GMT <![CDATA[Top NFT Data Sources]]> https://bitquery.io/blog/top-nft-data-sources https://bitquery.io/blog/top-nft-data-sources Tue, 13 Jun 2023 05:35:07 GMT <![CDATA[Top Tron APIs]]> https://bitquery.io/blog/top-tron-apis https://bitquery.io/blog/top-tron-apis Fri, 09 Jun 2023 05:35:07 GMT <![CDATA[Opensea API - Developer Guide for NFT Data]]> https://bitquery.io/blog/opensea-nft-api https://bitquery.io/blog/opensea-nft-api Tue, 06 Jun 2023 05:35:07 GMT To` to the marketplace contract. Additionally, you can use [**this query**](https://ide.bitquery.io/Different-Seaport-related-Contracts) to see who is forwarding the most trades to Opensea. ``` { EVM(dataset: combined, network: eth) { DEXTrades( where: {Trade: {Dex: {ProtocolName: {in: "seaport_v1.4"}}}} limit: {count: 50} limitBy: {by: Transaction_To, count: 1} orderBy: {descendingByField: "count"} ) { Transaction { To } count } } } ``` ## OpenSea API - Most traded NFTs on Opensea We can aggregate trading vol, trade count, buyer, seller, and nfts and sort them based on trade count in the following query to get the [**most traded NFT on OpenSea**](https://ide.bitquery.io/Top-Traded-NFTs-on-Opensea). ``` { EVM(dataset: combined, network: eth) { DEXTrades( where: {Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } } }, Transaction: { To: { is: "0x00000000000000adc04c56bf30ac9d3c0aaf14dc" } } } orderBy: {descendingByField: "count"} limit: {count: 10} ) { tradeVol: sum(of: Trade_Buy_Amount) count buyers: count(distinct: Trade_Buy_Buyer) seller: count(distinct: Trade_Buy_Seller) nfts: count(distinct: Trade_Buy_Ids) Trade { Buy { Currency { Name ProtocolName Symbol Fungible SmartContract } } } } } } ``` In terms of trade count Introducing World App is the most traded NFT with 94634 trades, then Gemesis with 87655 trades, and XTREME PIXELS with 56396 trades ## Opensea API - Total buy sell of an NFT token on Opensea To get the stats for specific NFT, we need to add the [Nakamigos NFT contract address](https://explorer.bitquery.io/ethereum/token/0xd774557b647330c91bf44cfeab205095f7e6c367/nft_smart_contract) in the above query. ## Top buyers of NFTs on Opensea To know who are top buyers of NFTs, we can use the[following query](https://ide.bitquery.io/Top-buyers-of-NFTs-on-Opensea). ``` { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } }, Buy: { Currency: { Fungible: false } } }, Transaction: { To: { is: "0x00000000000000adc04c56bf30ac9d3c0aaf14dc" } } } orderBy: {descendingByField: "count"} limit: {count: 10} ) { count uniq_tx: count(distinct: Transaction_Hash) Block { first_date: Time(minimum: Block_Date) last_date: Time(maximum: Block_Date) } nfts: count(distinct: Trade_Buy_Ids) difffernt_nfts: count(distinct: Trade_Buy_Currency_SmartContract) total_money_paid: sum(of: Trade_Sell_Amount) Trade { Buy { Buyer } } } } } ``` However, if you want to know the top buyers of a specific NFT, then you need to add the Currency’s smart contract address. For example,[in this query](https://ide.bitquery.io/Top-buyers-of-The-Orangez-NFT-on-Opensea), we are getting top buyers of[The Orangez NFT token](https://explorer.bitquery.io/ethereum/token/0xcd76d0cf64bf4a58d898905c5adad5e1e838e0d3/nft_smart_contract). ``` { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } }, Buy: { Currency: { Fungible: false, SmartContract: { is: "0xcd76d0cf64bf4a58d898905c5adad5e1e838e0d3" } } } }, Transaction: { To: { is: "0x00000000000000adc04c56bf30ac9d3c0aaf14dc" } } } orderBy: {descendingByField: "count"} limit: {count: 10} ) { count uniq_tx: count(distinct: Transaction_Hash) Block { first_date: Time(minimum: Block_Date) last_date: Time(maximum: Block_Date) } nfts: count(distinct: Trade_Buy_Ids) difffernt_nfts: count(distinct: Trade_Buy_Currency_SmartContract) total_money_paid: sum(of: Trade_Sell_Amount) Trade { Buy { Buyer } } } } } ``` ## OpenSea NFT API - Specific buyer stats for an NFT on Opensea In this query, we will get specific [buyer stats for a specific NFT on Opensea](https://ide.bitquery.io/Specific-buyer-stats-for-an-NFT-onopensea). ``` { EVM(dataset: combined, network: eth) { DEXTrades( where: { Trade: { Dex: { ProtocolName: { in: "seaport_v1.4" } }, Buy: { Currency: { SmartContract: { is: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d" } }, Buyer: { is: "0x2f9ecaa66e12b6168996a6b80cda9bb142f80dd0" } } }, Transaction: { To: { is: "0x00000000000000adc04c56bf30ac9d3c0aaf14dc" } } } orderBy: {descendingByField: "count"} limit: {count: 10} ) { count uniq_tx: count(distinct: Transaction_Hash) Block { first_date: Time(minimum: Block_Date) last_date: Time(maximum: Block_Date) } nfts: count(distinct: Trade_Buy_Ids) Trade { Buy { Buyer Currency { Name ProtocolName Symbol Fungible SmartContract } } } } } } ``` For example, in the following query, we are getting the first and last transfer, total trade count, and NFTs bought for [0x2f9ecaa66e12b6168996a6b80cda9bb142f80dd0](https://explorer.bitquery.io/ethereum/address/0x2f9ecaa66e12b6168996a6b80cda9bb142f80dd0) address and [BoredApeYachtClub NFT token](https://explorer.bitquery.io/ethereum/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/nft_smart_contract). ## OpenSea API - Latest NFT Trades on Seaport (Seaport API) In the following query, we are getting all[NFT trades for](https://ide.bitquery.io/latest-NFT-trades-on-Ethereum-network)`[Seaport](https://ide.bitquery.io/latest-NFT-trades-on-Ethereum-network)`[protocol](https://ide.bitquery.io/latest-NFT-trades-on-Ethereum-network) (Here, seaport_v1.4 includes all seaport versions). Many marketplaces utilize the Seaport protocol; we can add a Smart contract in Trade → Dex → SmartContract to get a specific marketplace for this protocol. ``` { EVM { DEXTrades( limit: {offset: 0, count: 10} orderBy: {descendingByField: "Block_Time"} where: { Trade: { Dex: { ProtocolName: { is: "seaport_v1.4" } } } } ) { Trade { Dex { ProtocolName } Buy { Price Seller Buyer Currency { HasURI Name Fungible SmartContract } } Sell { Price Amount Currency { Name } Buyer Seller } } Transaction { Hash } Block { Time } } } } ``` ## Opensea APIs - Get the Latest Trades of an Address In this query, we are getting the [latest NFT trades of this address](https://ide.bitquery.io/Get-the-latest-trades-of-an-address). You can change the address according to your requirement. Additionally, if you want to see this address trade for a specific NFT, then add the smart contract of that NFT token in the filter; for example, check this query. ``` { EVM { DEXTrades( limit: {offset: 0, count: 10} orderBy: {descendingByField: "Block_Time"} where: { Trade: { Dex: { ProtocolName: { is: "seaport_v1.4" } }, Sender: { is: "0x47f98fa3a3f8d8a62d99d112ce74e68b8de79f89" } } } ) { Trade { Dex { ProtocolName } Buy { Price Seller Buyer Currency { HasURI Name Fungible SmartContract } } Sell { Price Amount Currency { Name } Buyer Seller } } Transaction { Hash } Block { Time } } } } ``` ## Get Top Traded Tokens Let’s get the [**most traded NFTs on Ethereum**](https://ide.bitquery.io/Top-traded-NFT-tokens-in-a-month) of the month using the following query. If you see we are putting the date from 1st May to 28th May, you can change them accordingly. ``` { EVM(dataset: combined, network: eth) { DEXTrades( orderBy: {descendingByField: "count"} limit: {offset: 0, count: 10} where: { Block: { Date: { since: "2023-05-01", till: "2023-05-28" } }, Trade: { Buy: { Currency: { Fungible: false } }, Sell: { Currency: { Fungible: true } } } } ) { Trade { Buy { Currency { Symbol SmartContract } min_price: Price(minimum: Trade_Buy_Price) max_rice: Price(maximum: Trade_Buy_Price) } Sell { Currency { Symbol SmartContract } } } buy_amount: sum(of: Trade_Buy_Amount) sell_amount: sum(of: Trade_Sell_Amount) count } } } ``` ## Getting Basic properties and stats of an NFT token If you want to get basic properties and stats such as token NFTs, holders, total transfers, and first and last transfers, you can use[API below](https://ide.bitquery.io/Properties-of-an-NFT-Token_1). In this Graphql API, we are getting the LO-Fi PEPE token’s stats. ``` { EVM(dataset: combined, network: eth) { BalanceUpdates( orderBy: {descendingByField: "transfers"} limit: {count: 1} where: { Currency: { SmartContract: { is: "0x0fcbd68251819928c8f6d182fc04be733fa94170" } } } ) { ChainId Currency { Symbol Name SmartContract } transfers: count(if: {BalanceUpdate: {Type: {is: transfer}}}) ids: uniq(of: BalanceUpdate_Id, method: approximate) holders: uniq(of: BalanceUpdate_Address, method: approximate) Block { last: Time(maximum: Block_Time) first: Time(minimum: Block_Time) } } } } ``` ## Popular Orangez  In the [following query](https://ide.bitquery.io/Popular-Token-IDs-for-NFT-Based-on-Transfer-Count_1_1), we are checking the most transferred Orangez; we called them [popular Orangez](https://explorer.bitquery.io/ethereum/token/0xcd76d0cf64bf4a58d898905c5adad5e1e838e0d3/nft_smart_contract). ``` { EVM(dataset: combined, network: eth) { Transfers( orderBy: {descendingByField: "count"} limit: {offset: 0, count: 10} where: { Transfer: { Currency: { SmartContract: { is: "0xcd76d0cf64bf4a58d898905c5adad5e1e838e0d3" } } } } ) { ChainId Transfer { Currency { Symbol SmartContract } Id URI last_receiver: Receiver(maximum: Block_Number) } count receivers: uniq(of: Transfer_Receiver, method: approximate) } } } ``` ## Top Holders of NFT token In the [following API](https://ide.bitquery.io/Top-Holders-of-WokePixels-NFT), we are getting the token holders of the [WokePixels NFT token](https://explorer.bitquery.io/ethereum/token/0xd9156c2ae917cb358cb77707e73a2e05cb3dc553/nft_smart_contract). You can get holders of any NFT just by changing the smart contract address in the query. ``` { EVM(dataset: combined, network: eth) { BalanceUpdates( orderBy: {descendingByField: "balance"} limit: {offset: 0, count: 10} where: { Currency: { SmartContract: { is: "0x0fcbd68251819928c8f6d182fc04be733fa94170" } } } ) { ChainId BalanceUpdate { Address } balance: sum(of: BalanceUpdate_Amount) ids: uniq(of: BalanceUpdate_Id, method: approximate) } } } ``` ## Conclusion To learn, read this article on [NFT APIs](https://community.bitquery.io/t/nft-api-complete-guide/1509/1). Additionally, Sign up on our [GraphQL IDE](https://streaming.bitquery.io/) to get the API key for free. We have recently launched [Streaming API](https://community.bitquery.io/t/bitquery-streaming-apis-live-blockchain-data/1408) to provide live blockchain data. **Also Read** - [The Ultimate Guide to NFT Analytics](https://bitquery.io/blog/the-ultimate-guide-to-nft-analytics) - [How to Track NFT Wash Trading](https://bitquery.io/blog/how-to-track-nft-wash-trading) - [Streaming APIs Help Gather Top Holders on Ethereum](https://bitquery.io/blog/streaming-apis-help-gather-top-holders-on-ethereum) - [[Video] How to track NFT Whales - A tutorial](https://www.youtube.com/watch?v=ZGEmOkLnUBg) ## About Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - [**Coinpath® APIs**](https://bitquery.io/products/coinpath?utm_source=blog) provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - [**Digital Assets API**](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about) provides index information related to all major cryptocurrencies, coins, and tokens. - [**DEX API**](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about) provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below; we will keep you updated with the latest in the cryptocurrency world. ]]> <![CDATA[Bitquery.io Partners with AWS to Offer Blockchain Data through AWS Data Exchange Marketplace​]]> https://bitquery.io/blog/bitquery-aws https://bitquery.io/blog/bitquery-aws Tue, 09 May 2023 05:35:07 GMT "We are elated to partner with AWS and bring our cutting-edge blockchain data products to the AWS Data Exchange Marketplace," said Karakitsos. "This partnership gives us the chance to reach a broader audience. With our products businesses leverage blockchain data to build cool products. It's a game-changer!" AWS customers can now take advantage of Bitquery.io’s blockchain data products by subscribing to them through the AWS Data Exchange Marketplace. Once subscribed, they can access the data through AWS S3 files. This integration will allow businesses to seamlessly incorporate blockchain data into their existing workflows and systems. ### About Bitquery.io: Bitquery.io is a blockchain data company that provides tools and solutions for accessing, analyzing, and visualizing blockchain data. The company’s mission is to democratize blockchain data and give businesses the insights they need to make informed decisions. For more information, visit [www.bitquery.io](https://bitquery.io/) . ### About AWS Data Exchange: AWS Data Exchange is a cloud-based service that makes it easy for millions of AWS customers to securely find, subscribe to, and use third-party data in the cloud. With AWS Data Exchange, customers can easily discover and use data products from various data providers, including category-leading brands and start-ups, in one central location. For more information, visit [https://aws.amazon.com/data-exchange/](https://aws.amazon.com/data-exchange/) .]]> <![CDATA[Blockchain Data Visualization using GraphQL and Gephi​]]> https://bitquery.io/blog/blockchain-data-visualization-using-graphql-and-gephi https://bitquery.io/blog/blockchain-data-visualization-using-graphql-and-gephi Mon, 10 Apr 2023 05:35:07 GMT <![CDATA[Streaming APIs Help Gather Top Holders on Ethereum​]]> https://bitquery.io/blog/streaming-apis-help-gather-top-holders-on-ethereum https://bitquery.io/blog/streaming-apis-help-gather-top-holders-on-ethereum Mon, 10 Apr 2023 05:35:07 GMT <![CDATA[Bitquery Raised $8.5 Million to Build Blockchain Data Infrastructure​]]> https://bitquery.io/blog/bitquery-raised-8-5-million https://bitquery.io/blog/bitquery-raised-8-5-million Tue, 27 Sep 2022 05:35:07 GMT <![CDATA[0x V4 APIs on Ethereum, BSC, and Polygon]]> https://bitquery.io/blog/0x-api https://bitquery.io/blog/0x-api Tue, 16 Nov 2021 05:35:07 GMT <![CDATA[Tron DEX APIs with Bitquery | GraphQL APIs​]]> https://bitquery.io/blog/tron-dex-api https://bitquery.io/blog/tron-dex-api Mon, 25 Oct 2021 05:35:07 GMT <![CDATA[Velas APIs | Querying Velas Blockchain​]]> https://bitquery.io/blog/velas-api https://bitquery.io/blog/velas-api Fri, 08 Oct 2021 05:35:07 GMT If you are looking for Velas APIs, please [sign up on our Blockchain IDE](https://graphql.bitquery.io/ide) and get your API keys. Velas Block ----------- Velas blocks are produced by AI-powered Delegated Proof-of-Stake(AIDPOS) consensus. Till now, the blockchain has produced more than [134955 blocks](https://graphql.bitquery.io/ide/8u6NQKhDYq#). On average, Velas produces ~[20000 blocks per month](https://graphql.bitquery.io/ide/83hr2PEdgV#). If you want to know the latest Velas transactions, you can use [this query](https://graphql.bitquery.io/ide/ayV7b5zSiz#). Velas Transactions ------------------ One of the vital aspects of Velas hybrid design is that it’s built for scalability. Velas has processed more than [131403 transactions](https://graphql.bitquery.io/ide/JbvCbc04ub#), of which more than [35858 were processed in Sept 2021](https://graphql.bitquery.io/ide/J7wuptKRwn#). ![Velas transactions over time](/blog/velas-api/image-9-1024x576.png) Velas transactions over time Velas Gas Analytics ------------------- Velas is built for scalability and business use cases. You can check Velas’s average gas cost per month using this [query](https://graphql.bitquery.io/ide/lu2gU3t0NK). ![Average transaction price on Velas](/blog/velas-api/image-10-1024x576.png) Average transaction price on Velas Velas Transfers --------------- Velas processed [more than 149639 transfers](https://graphql.bitquery.io/ide/86VphEON30) since its launch, in which 35000 transfers were processed in August 2021. A transfer is when any token or native currency get transferred. And a transaction can contain 0 to more than 1 transfer. Velas has more than [17020 unique receivers](https://graphql.bitquery.io/ide/6sACPBiQAf) and 5861 senders. ![Velas Transfers over time](/blog/velas-api/image-11-1024x576.png) Velas Transfers over time Tokens on Velas --------------- At the time of writing this article, there were [40 unique tokens](https://graphql.bitquery.io/ide/0XOkiVucZZ) on Velas. Using this [query](https://graphql.bitquery.io/ide/EeuZ72RxyX), you can check the complete list with some critical data points like total senders, receivers, average transfer value, etc. VLX (the native token of Velas) is the [most transferred currency on the Velas blockchain](https://graphql.bitquery.io/ide/nHVPqpdil8#), with more than 130457 transfers. ![Top Tokens based on transfers on Velas](/blog/velas-api/image-12-1024x576.png) Top Tokens based on transfers on Velas Smart Contracts on Velas ------------------------ Velas also saw massive growth in the smart contract calls; currently, Velas is executing more than [7000 calls per month](https://graphql.bitquery.io/ide/v7GwWMwRk3#). The good part is that these calls come from more than [14K smart contracts](https://graphql.bitquery.io/ide/VznA8J06gE) and [2k unique callers](https://explorer.bitquery.io/velas/calls). ![Smart Contract calls month wise](/blog/velas-api/image-13-1024x576.png) Smart Contract calls month wise Querying Address Details on Velas --------------------------------- Bitquery makes it very easy to query details for a given address such as balance, currency received and sent, transaction etc. We also enabled Money flow APIs on Velas, making it easy to trace any address on the blockchain. For example, if you want to check the balance of an address, you can use the following [query](https://explorer.bitquery.io/velas/address/0xb66054b35a18d6687756faebae70aa5016b6284e). Additionally, use [this query](https://graphql.bitquery.io/ide/oGYyt4WF3f) if you want to know the total currencies sent and received by a given address. ![Inbound / Outbound for a given address](/blog/velas-api/image-14.png) Inbound / Outbound for a given address Tracking on Velas ----------------- Additionally, we have enabled our flagship product [Coinpath®](https://bitquery.io/products/coinpath), the money tracking APIs on Velas, which helps [track money on the blockchain](https://bitquery.io/products/coinpath). For example, check this [visualization](https://explorer.bitquery.io/velas/address/0xb66054b35a18d6687756faebae70aa5016b6284e/graph) and drag and drop address and change setting to get more in-depth transactions related to [this address](https://explorer.bitquery.io/velas/address/0xb66054b35a18d6687756faebae70aa5016b6284e/graph). ![Money Tracking on Velas](/blog/velas-api/image-15-1024x464.png) Money Tracking on Velas Conclusion ---------- While it could be argued that the blockchain arena has since become somewhat oversaturated, there is a lot to like about [Velas](https://velas.com/). While still very early days, its unique consensus mechanism — Artificial Intuition Delegated Proof of Stake, has the potential to solve the ongoing conundrum of scaling a blockchain network to significant heights, without compromising on security and decentralization. If you are looking for Velas APIs, please [sign up on our Blockchain IDE](https://graphql.bitquery.io/ide) and get your API keys. If you are building any application related to Velas, we would be delighted to talk to you; you ping us on our [Telegram channel](https://t.me/Bloxy_info). A**bout** Bitquery ------------------ [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: * **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). * **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. * **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world. ]]> <![CDATA[Klaytn APIs | Querying Klaytn Blockchain​]]> https://bitquery.io/blog/klaytn-api https://bitquery.io/blog/klaytn-api Tue, 05 Oct 2021 05:35:07 GMT <![CDATA[Solana API – Querying Solana Blockchain (2023)​]]> https://bitquery.io/blog/solana-api https://bitquery.io/blog/solana-api Wed, 25 Aug 2021 05:35:07 GMT <![CDATA[Polygon (MATIC) APIs | Transfers, Trades, Tokens & DEX​]]> https://bitquery.io/blog/polygon-matic-api https://bitquery.io/blog/polygon-matic-api Thu, 12 Aug 2021 05:35:07 GMT <![CDATA[Polygon is Coming to Bitquery​]]> https://bitquery.io/blog/bitquery-polygon https://bitquery.io/blog/bitquery-polygon Tue, 06 Jul 2021 05:35:07 GMT <![CDATA[CoinSwap API – Build Charting, Get Latest Trades and Token Price]]> https://bitquery.io/blog/coinswap-api https://bitquery.io/blog/coinswap-api Thu, 03 Jun 2021 05:35:07 GMT <![CDATA[Non-fungible Token APIs (NFT APIs)]]> https://bitquery.io/blog/nft-apis https://bitquery.io/blog/nft-apis Thu, 11 Mar 2021 05:35:07 GMT <![CDATA[Price Index for DEX Tokens]]> https://bitquery.io/blog/dex-price-index https://bitquery.io/blog/dex-price-index Fri, 05 Mar 2021 05:35:07 GMT <![CDATA[How to use GraphQL Alias and Aggregation?]]> https://bitquery.io/blog/graphql-alias-and-aggregation https://bitquery.io/blog/graphql-alias-and-aggregation Wed, 10 Feb 2021 05:35:07 GMT <![CDATA[Forget SQL  –  Introducing GraphQL charting to visualize blockchain data]]> https://bitquery.io/blog/graphql-charts https://bitquery.io/blog/graphql-charts Wed, 10 Feb 2021 05:35:07 GMT <![CDATA[Bitcoin Analysis: Track Bitcoin Transactions and Address]]> https://bitquery.io/blog/bitcoin-analysis https://bitquery.io/blog/bitcoin-analysis Fri, 05 Feb 2021 05:35:07 GMT Let’s call sender **Alice** and recipient **Bob**. To get the address of the recipient (Bob), you need to scroll down on the same page; you will see transaction Outputs. As you know, Bitcoin has UTXOs, meaning every transaction has inputs and outputs. These inputs and outputs work like Cash. You give someone money and may or may not get changed based on the transaction amount. Here, we use heuristics to identify which address is actually the recipient, which you can see labeled as “likely\_not\_change.” ![heuristics](/blog/bitcoin-analysis/1.png) Money Flow Graph ---------------- Now we have the [**recipient’s (Bob) Bitcoin address**](https://explorer.bitquery.io/bitcoin/address/bc1qfqqed76qxqm2epmxlv7ywgjz8k6tk472pj7msn). Therefore, it’s time to check our first money flow Graph. You can access them under the money flow tab on the explorer or use [**this link**](https://explorer.bitquery.io/bitcoin/address/bc1q0uvn8pg7n3zh7kgxn274757f0h0pfpac8j2nsh/graph) to jump on the page directly. ![Money Flow Tab](/blog/bitcoin-analysis/2.png) Money Flow Tab Once you open the tab you will see the following Graph. This Graph shows all the address which sent or received money to the Bob (recipient) at one **Hop**. You can see Alice’s (sender) address here too. ![Alice transaction to Bob](/blog/bitcoin-analysis/3.png) Alice transaction to Bob In one graph, you can see all the sender and recipient to the bob. Isn’t it more convenient?  > If you left-click on any address here, it will open that address in a separate tab on our explorer. The above graph shows all the senders and recipients to Bob at one hop; however, you can also increase the numbers of hops to check more detailed money flow for the addresses linked to Bob. This is helpful when you are trying to track a specific transaction.  For example, if we want to know, who sent money to Alice, you just need to double click on Alice’s icon. ![Alice and Bob transactions](/blog/bitcoin-analysis/4.png) Alice and Bob transactions Here “Depth level” option will increase the number of hops. You can increase it in both directions.  * Inbound — Inbound are incoming transactions * Outbound — Outgoing transactions > Hops are counted based on intermediaries’ wallet addresses involved in the money flow. N Hope will contain N-1 intermediaries. For ex- one hop is a direct transaction from one address to another. 2 hops will contain one intermediary, and so on. These GraphQL are powered by our [Coinpath GraphQL APIs](https://bitquery.io/blog/coinpath-api-get-start)a and you can add also add them to your website as a widget, just click on the “JS” button on the bottom right corner. Sankey ------ Recently we have added another graph to show money flow in one image. This graph is based on the [Sankey diagram](https://en.wikipedia.org/wiki/Sankey_diagram). Let’s check the Sankey graph of Bob. For this, you need to click on the Sankey Radio button on the [**Money Flow page**](https://explorer.bitquery.io/bitcoin/address/bc1qfqqed76qxqm2epmxlv7ywgjz8k6tk472pj7msn/graph). Once you click on the Sankey radio button, you will see the following graph. ![sankey](/blog/bitcoin-analysis/5.png) Here you can see all incoming and outgoing transactions, and the width of the arrow is proportional to the transaction amount. You can increase the hops to see the source and destination of funds in our image. ![heuristics](/blog/bitcoin-analysis/6.png) Isn’t it better than searching addresses and following transactions on standard explorer? So next time when you are following the money on the blockchain, use our Bitquery explorer. Currently, we support 30+ blockchains, and we provide money flow graphs for the blockchains and tokens build atop them. To learn more on investigating a particular token, read our blog post on [investigating the Ethereum address](https://bitquery.io/blog/investigate-ethereum-address). Above Graphs are built for public use and give you a glance at our [Coinpath APIs’ capabilities](https://bitquery.io/blog/coinpath-api-get-start). If you are looking for Coinpath APIs, please [visit this page](https://bitquery.io/products/coinpath). If you have any questions or need help with your blockchain investigation, just hop on our [Telegram channel](https://t.me/Bloxy_info). Also, let us know if you are looking for blockchain data APIs. You might also be interested in: * [Coinpath® – Blockchain Money Flow APIs](https://bitquery.io/products/coinpath) * [How to trace Bitcoin transactions or address?](https://bitquery.io/blog/trace-bitcoin-transaction-and-address) * [Conflux blockchain –  Growth Stats](https://bitquery.io/blog/conflux-blockchain-analytics) * [Comparing DEXs — Ethereum and Binance Smart Chain](https://bitquery.io/blog/ethereum-bsc-dex) * [Conditional Aggregation in GraphQL APIs](https://docs.bitquery.io/v1/docs/query-features/aggregation) * [Building a Blockchain Intelligence System](https://bitquery.io/blog/blockchain-intelligence-system) #### **About** Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: * **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). * **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. * **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.]]> <![CDATA[Conflux blockchain –  Growth Stats]]> https://bitquery.io/blog/conflux-blockchain-analytics https://bitquery.io/blog/conflux-blockchain-analytics Fri, 29 Jan 2021 05:35:07 GMT <![CDATA[Comparing DEXs — Ethereum and Binance Smart Chain]]> https://bitquery.io/blog/ethereum-bsc-dex https://bitquery.io/blog/ethereum-bsc-dex Fri, 15 Jan 2021 05:35:07 GMT <![CDATA[ETH2 API — Beacon chain API data?]]> https://bitquery.io/blog/eth2-api https://bitquery.io/blog/eth2-api Wed, 06 Jan 2021 05:35:07 GMT <![CDATA[Conditional Aggregation in GraphQL APIs]]> https://bitquery.io/blog/conditional-aggreagtion https://bitquery.io/blog/conditional-aggreagtion Wed, 30 Dec 2020 05:35:07 GMT <![CDATA[PancakeSwap API – Real-Time Trades, Volume, Liquidity & Pools]]> https://bitquery.io/blog/pancake-swap-dex-apis https://bitquery.io/blog/pancake-swap-dex-apis Sun, 20 Dec 2020 05:35:07 GMT To call these APIs outside the Bitquery IDE, create an API token first: [How to generate Bitquery API token ➤](https://docs.bitquery.io/docs/authorisation/how-to-generate/). ## PancakeSwap V3 on Ethereum (EVM) **Latest trades** — [Run in IDE](https://ide.bitquery.io/Latest-Trades-on-PancakeSwap-V3-ETH) Live trades on PancakeSwap V3 (Ethereum). Switch `network` to `bsc` to query BSC markets. ``` query LatestTrades { EVM(network: eth) { DEXTradeByTokens( orderBy: {descending: Block_Time} limit: {count: 50} where: { TransactionStatus: {Success: true} Trade: {Dex: {ProtocolName: {is: "pancake_swap_v3"}}} Block: {Time: {since: "2025-06-17T09:50:13Z"}} } ) { Block { Time } Transaction { Hash } Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } AmountInUSD Price Amount Side { Type Currency { Symbol SmartContract Name } AmountInUSD Amount } Currency { Symbol SmartContract Name } } } } } ``` **Top traded pairs on ETH** — [Run in IDE](https://ide.bitquery.io/Top-token-pairs-on-PancakeSwap-v3) Rank pairs by USD volume and fetch recent prices. ``` query pairs($network: evm_network, $market: String!, $eth: String!, $usdc: String!, $usdt: String!, $weth: String!) { EVM(network: $network) { DEXTradeByTokens( where: { TransactionStatus: {Success: true} Block: {Time: {since: "2025-06-17T09:53:37Z"}} Trade: { Success: true Dex: {ProtocolName: {is: $market}} } any: [ {Trade: {Side: {Currency: {SmartContract: {is: $eth}}}}} {Trade: {Side: {Currency: {SmartContract: {is: $usdt}}}, Currency: {SmartContract: {notIn: [$eth]}}}} {Trade: {Side: {Currency: {SmartContract: {is: $usdc}}}, Currency: {SmartContract: {notIn: [$eth, $usdt]}}}} {Trade: {Side: {Currency: {SmartContract: {is: $weth}}}, Currency: {SmartContract: {notIn: [$eth, $usdc, $usdt]}}}} {Trade: {Side: {Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}, Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}} ] } orderBy: {descendingByField: "usd"} limit: {count: 70} ) { Block { Time(maximum: Block_Time, selectWhere: {after: "2025-06-18T08:53:37Z"}) } 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: "2025-06-18T09:43:37Z"}}}) price_1h_ago: PriceInUSD(maximum: Block_Number, if: {Block: {Time: {before: "2025-06-18T08:53:37Z"}}}) price_3h_ago: PriceInUSD(maximum: Block_Number, if: {Block: {Time: {before: "2025-06-18T06:53:37Z"}}}) } 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: "100"}) } } } ``` **Top traders for a token** — [Run in IDE](https://ide.bitquery.io/Top-Traders-of-a-token-on-PancakeSwap-on-ETH) Find the biggest traders for any token on PancakeSwap V3 (example shows USDC on ETH). ``` query topTraders { EVM(network: eth) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: { Trade: { Currency: {SmartContract: {is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}} Dex: {ProtocolName: {is:"pancake_swap_v3"}} } } ) { Trade { Buyer } 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) } } } ``` ## PancakeSwap Infinity on Base **Subscribe to latest trades** — [Run in IDE](https://ide.bitquery.io/pancakeswap-infinity-trades) ``` 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 } } } } ``` **Latest price for a token** — [Run in IDE](https://ide.bitquery.io/Get-Latest-Price-of-a-token-on-PancakeSwap-Infinity) ``` 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} ) { Block { Time } Trade { Price PriceInUSD Amount AmountInUSD Currency { Name Symbol SmartContract } Dex { ProtocolName SmartContract } Side { Amount AmountInUSD Currency { Name Symbol SmartContract } } } } } } ``` **Top traders for a token** — [Run in IDE](https://ide.bitquery.io/top-traders-of-a-token-on-pancakeswap) ``` 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"}} } } ) { Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } Buyer } 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) } } } ``` **OHLC (price candles)** — [Run in IDE](https://ide.bitquery.io/OHLC-on-BASE-pancakeswap-infinity) ``` { 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: {ProtocolName: {is: "pancakeswap_infinity"}} } } 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 } } } ``` **Volume, buy/sell splits** — [Run in IDE](https://ide.bitquery.io/trade_volume_base_pancakeswap_infinity) ``` query MyQuery { EVM(network: base) { DEXTradeByTokens( where: { Trade: { Currency: {SmartContract: {is: "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b"}} Dex: {ProtocolName: {is: "pancakeswap_infinity"}} } TransactionStatus: {Success: true} Block: {Time: {since: "2025-02-12T00:00:00Z"}} } ) { 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}}}}) } } } ``` **Top bought / sold tokens** — [Run in IDE](https://ide.bitquery.io/top-bought-tokens-on-pancakeswap_infinity) Swap `orderBy` between `buy` and `sell` to rank directions. ``` query timeDiagram($network: evm_network) { EVM(network: $network) { DEXTradeByTokens( orderBy: {descendingByField: "buy"} limit: {count: 100} where: {Trade: {Dex: {ProtocolName: {is: "pancakeswap_infinity"}}}} ) { Trade { Currency { Symbol Name SmartContract } Dex { ProtocolName } } buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}}) sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}}) } } } ``` **Token metadata** — [Run in IDE](https://ide.bitquery.io/get-metadata-for-base-pancakeswap-infnity-token) Fetch name, symbol, decimals, and protocol details. ``` query MyQuery { EVM(network: base, dataset: realtime) { DEXTradeByTokens( limit: {count: 1} orderBy: {descending: Block_Time} where: { Trade: { Currency: {SmartContract: {is: "0x22af33fe49fd1fa80c7149773dde5890d3c76f3b"}} Dex: {ProtocolName: {is: "pancakeswap_infinity"}} } } ) { Trade { Currency { Name Symbol SmartContract ProtocolName HasURI Fungible Decimals } } } } } ``` ## PancakeSwap V3 on BSC **Latest trades** — [Run in IDE](https://ide.bitquery.io/Latest-BSC-PancakeSwap-v3-dextrades) ``` { 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 } Transaction { Hash From To Value ValueInUSD } 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 trades (confirmed)** — [Run in IDE](https://ide.bitquery.io/Latest-BSC-PancakeSwap-v3-dextrades---Stream_2) Switch `network: bsc` and keep the same owner filter to get real-time trades. ``` subscription { EVM(network: bsc) { DEXTrades( where: { TransactionStatus: {Success: true} Trade: {Dex: {OwnerAddress: {is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"}}} } ) { Block { Time Number } Transaction { Hash From To Value ValueInUSD } Trade { Buy { Amount AmountInUSD Currency { Symbol } Price PriceInUSD } Sell { Amount AmountInUSD Currency { Symbol } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` **Streaming mempool trades** — [Run in IDE](https://ide.bitquery.io/Mempool---Latest-BSC-PancakeSwap-v3-dextrades---Stream_1) ``` subscription { EVM(network: bsc, mempool: true) { DEXTrades( where: { TransactionStatus: {Success: true} Trade: {Dex: {OwnerAddress: {is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"}}} } ) { Block { Time Number } Transaction { Hash From To Value ValueInUSD } Trade { Buy { Amount AmountInUSD Currency { Symbol } Price PriceInUSD } Sell { Amount AmountInUSD Currency { Symbol } Price PriceInUSD } Dex { ProtocolName SmartContract OwnerAddress } } } } } ``` **Trades for a specific token** — [Run in IDE](https://ide.bitquery.io/BSC-PancakeSwap-v3-Trades-for-a-token) ``` { 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 } Transaction { Hash From To } Trade { Amount AmountInUSD Price PriceInUSD Success Dex { ProtocolName ProtocolFamily } Currency { Name Symbol SmartContract } Side { Amount AmountInUSD Buyer Seller Type Currency { Name Symbol SmartContract } } } } } } ``` **Top traders for a token** — [Run in IDE](https://ide.bitquery.io/top-traders-of-a-token-on-pancakeswap-bsc) ``` { EVM(network: bsc) { DEXTradeByTokens( orderBy: {descendingByField: "volumeUsd"} limit: {count: 100} where: { Trade: { Currency: {SmartContract: {is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"}} Dex: {OwnerAddress: {is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"}} } } ) { Trade { Dex { OwnerAddress ProtocolFamily ProtocolName } Buyer } 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) } } } ``` **Trading volume, buy volume, sell volume** — [Run in IDE](https://ide.bitquery.io/trade_volume_bsc_pancakeswap) ``` query MyQuery { EVM(network: bsc) { DEXTradeByTokens( where: { Trade: { Currency: {SmartContract: {is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"}} Dex: {OwnerAddress: {is: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"}} } TransactionStatus: {Success: true} Block: {Time: {since: "2025-02-12T00:00:00Z"}} } ) { 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}}}}) } } } ``` **Token metadata** — [Run in IDE](https://ide.bitquery.io/get-metadata-pancakeswap) ``` 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 via Trading cube** — [Run in IDE](https://ide.bitquery.io/bsc-pancakeswap-ohlc-using-trading-api) ``` { 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 (24h / 1h / 5m)** — [Run in IDE](https://ide.bitquery.io/Percentage-price-change-for-a-pancake-swap-token) ``` 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") } } } ``` **New pools created** — [Run in IDE](https://ide.bitquery.io/New-pools-created-on-PancakeSwap-v3) ``` { 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 } Transaction { Hash From To } Receipt { ContractAddress } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` **Liquidity add/remove events** — [Run in IDE](https://ide.bitquery.io/Stream---Liqiidity-add-for-all-tokens-on-PancakeSwap-v3) Filter by `Mint` (add) or `Burn` (remove) signatures. ``` 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 } Transaction { Hash From To } LogHeader { Address Data } Arguments { Name Value { ... on EVM_ABI_Address_Value_Arg { address } } } } } } ``` **Latest pool reserves for a pair** — [Run in IDE](https://ide.bitquery.io/Pool-reserves-on-Pancakeswap-v3-pool) ``` { EVM(dataset: combined, network: bsc) { BalanceUpdates( where: { Currency: { SmartContract: {in: ["0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82", "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"]} } BalanceUpdate: {Address: {is: "0xafb2da14056725e3ba3a30dd846b6bbbd7886c56"}} } ) { sum(of: BalanceUpdate_Amount, selectWhere: {gt: "0"}) Currency { Name Symbol SmartContract Decimals } } } } ``` **All pairs for a token** — [Run in IDE](https://ide.bitquery.io/All-pools-of-a-token-on-pancake-swap_2) ``` 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 } } } ``` ## Build charts and dashboards quickly All queries return structured JSON you can drop into charting libraries (TradingView, ECharts, Plotly) or pipe into streams/Kafka for low-latency analytics. Swap `network`, contract addresses, or protocol names to cover additional PancakeSwap markets across chains. ]]> <![CDATA[Building a Blockchain Intelligence System]]> https://bitquery.io/blog/blockchain-intelligence-system https://bitquery.io/blog/blockchain-intelligence-system Fri, 18 Dec 2020 05:35:07 GMT <![CDATA[Querying Conflux Blockchain using GraphQL APIs]]> https://bitquery.io/blog/conflux-blockchain-api https://bitquery.io/blog/conflux-blockchain-api Thu, 03 Dec 2020 05:35:07 GMT <![CDATA[Offline Dashboards | Client only Blockchain data visualization and tools​]]> https://bitquery.io/blog/offline-dashboards https://bitquery.io/blog/offline-dashboards Tue, 24 Nov 2020 05:35:07 GMT <![CDATA[The Complexity of Working with Blockchain Data]]> https://bitquery.io/blog/working-with-blockchain-data https://bitquery.io/blog/working-with-blockchain-data Wed, 18 Nov 2020 05:35:07 GMT <![CDATA[A marriage of Market data with Blockchain data]]> https://bitquery.io/blog/market-data-with-blockchain-data https://bitquery.io/blog/market-data-with-blockchain-data Mon, 16 Nov 2020 05:35:07 GMT <![CDATA[The Graph vs Bitquery – Solving Blockchain Data Problems]]> https://bitquery.io/blog/thegraph-and-bitquery https://bitquery.io/blog/thegraph-and-bitquery Thu, 05 Nov 2020 05:35:07 GMT <![CDATA[Analyzing Decentralized Exchange using Bitquery Blockchain Explorer]]> https://bitquery.io/blog/dex-blockchain-explorer https://bitquery.io/blog/dex-blockchain-explorer Wed, 28 Oct 2020 05:35:07 GMT <![CDATA[ETH2.0 Analytical Explorer, Widgets, and GraphQL APIs]]> https://bitquery.io/blog/eth2-explorer-api-widgets https://bitquery.io/blog/eth2-explorer-api-widgets Mon, 19 Oct 2020 05:35:07 GMT <![CDATA[Ethereum DEX GraphQL APIs with Examples]]> https://bitquery.io/blog/ethereum-dex-graphql-api https://bitquery.io/blog/ethereum-dex-graphql-api Fri, 16 Oct 2020 05:35:07 GMT <![CDATA[How to use GraphQL with Python, Javascript, and Ruby]]> https://bitquery.io/blog/graphql-with-python-javascript-and-ruby https://bitquery.io/blog/graphql-with-python-javascript-and-ruby Thu, 15 Oct 2020 05:35:07 GMT res.json()) .then(console.log) .catch(console.error); ``` ### GraphQL Javascript(NodeJS) Libraries The following are the most popular javascript libraries for GraphQL. - [GraphQL.js](https://github.com/graphql/graphql-js) — The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. - [graphql-request](https://www.npmjs.com/package/graphql-request) — Minimal GraphQL client supporting Node and browsers for scripts or simple apps. - [Apollo client](https://www.npmjs.com/package/@apollo/client) — Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to build UI components that fetch data via GraphQL easily. ## GraphQL APIs using Ruby Ruby is also one of the most simple programming languages. The following example shows how to call a GraphQL API using ruby. ``` require 'net/http' require 'uri' require 'json' uri = URI.parse("https://graphql.bitquery.io/") header = {'Content-Type': 'application/json'; 'X-API-KEY': 'YOUR API KEY'} query = "{ bitcoin { blocks { count } } }" # Create the HTTP objects http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri, header) request.body = {query: query}.to_json # Send the request response = http.request(request) puts "Body: #{response.body}" ``` ### GraphQL Ruby Libraries You can use the libraries below to use GraphQL with ruby. - [graphql-ruby](https://github.com/rmosolgo/graphql-ruby) — Ruby implementation of Facebook’s GraphQL. - [graphql-client](https://github.com/github/graphql-client) — A Ruby library for declaring, composing, and executing GraphQL queries. - [graphql-batch](https://github.com/Shopify/graphql-batch) — A query batching executor for the graphql gem. - [agoo](https://github.com/ohler55/agoo) — Ruby web server that implements Facebook’s GraphQL. - [GQLi](https://github.com/contentful-labs/gqli.rb) — A GraphQL client and DSL. Allowing to write queries in native Ruby. ## Additional Resources To see the examples of other programming languages, check the official [website of GraphQL](https://graphql.org/code/). In addition, to learn more about more GraphQL tools and libraries, check [Awesome GraphQL](https://github.com/chentsulin/awesome-graphql). If you have any questions or need help with your blockchain investigation, just hop on our [Telegram channel](https://t.me/Bloxy_info). Also, let us know if you are looking for blockchain data APIs. You might also be interested in: - [Create your first Blockchain GraphQL query](https://bitquery.io/blog/blockchain-graphql-query) - [API to get Ethereum Smart Contract Events](https://bitquery.io/blog/ethereum-events-api) - [Why GraphQL is better for blockchain data APIs](https://bitquery.io/blog/blockchain-graphql) - [APIs to get Latest Uniswap Pair Listing](https://bitquery.io/blog/uniswap-pool-api) - [Simple rest APIs to get Uniswap data (DEX Data APIs)](https://bitquery.io/blog/dex-data-apis) - [API to Get Ethereum Token Balance](https://bitquery.io/blog/ethereum-token-api) - [Simple API To Get Ethereum Supply And Data](https://bitquery.io/blog/get-ethereum-total-supply) - [How to investigate an Ethereum address?](https://bitquery.io/blog/investigate-ethereum-address) - [Bitcoin Taproot](https://blog.coincodecap.com/bitcoin-taproot) –  A Technical Explanation - [Who is actually using Ethereum?](https://bitquery.io/blog/who-is-actually-using-ethereum) - [How to get newly created Ethereum Tokens?](https://bitquery.io/blog/newly-created-ethereum-token) - [Querying Binance Smart Chain (BSC)](https://bitquery.io/blog/binance-smart-chain-api) #### **About** Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.]]> <![CDATA[How is StableXswap using Bitquery?]]> https://bitquery.io/blog/stablexswap https://bitquery.io/blog/stablexswap Thu, 15 Oct 2020 05:35:07 GMT <![CDATA[How to investigate an Ethereum address?]]> https://bitquery.io/blog/investigate-ethereum-address https://bitquery.io/blog/investigate-ethereum-address Tue, 13 Oct 2020 05:35:07 GMT <![CDATA[Create your first Blockchain GraphQL query]]> https://bitquery.io/blog/blockchain-graphql-query https://bitquery.io/blog/blockchain-graphql-query Fri, 09 Oct 2020 05:35:07 GMT <![CDATA[Binance Smart Chain API | BNB Chain Indexing (BSC API)]]> https://bitquery.io/blog/binance-smart-chain-api https://bitquery.io/blog/binance-smart-chain-api Wed, 07 Oct 2020 05:35:07 GMT <![CDATA[How to Get Newly Created Ethereum Tokens?]]> https://bitquery.io/blog/newly-created-ethereum-token https://bitquery.io/blog/newly-created-ethereum-token Tue, 06 Oct 2020 05:35:07 GMT <![CDATA[API to get Ethereum Smart Contract Events]]> https://bitquery.io/blog/ethereum-events-api https://bitquery.io/blog/ethereum-events-api Mon, 05 Oct 2020 05:35:07 GMT <![CDATA[Eating blockchain data using GraphQL spoon]]> https://bitquery.io/blog/blockchain-graphql https://bitquery.io/blog/blockchain-graphql Mon, 28 Sep 2020 05:35:07 GMT <![CDATA[Crypto Regulations in Major Jurisdictions]]> https://bitquery.io/blog/crypto-regulations-in-major-countries https://bitquery.io/blog/crypto-regulations-in-major-countries Mon, 28 Sep 2020 05:35:07 GMT <![CDATA[Who is actually using Ethereum? (September)]]> https://bitquery.io/blog/who-is-actually-using-ethereum https://bitquery.io/blog/who-is-actually-using-ethereum Mon, 28 Sep 2020 05:35:07 GMT <![CDATA[An Overview of Markets in Crypto-assets (MiCA)]]> https://bitquery.io/blog/markets-in-crypto-assets-mica https://bitquery.io/blog/markets-in-crypto-assets-mica Mon, 21 Sep 2020 05:35:07 GMT <![CDATA[Uniswap API: Get Pools Data, Tokens and Create Charts]]> https://bitquery.io/blog/uniswap-pool-api https://bitquery.io/blog/uniswap-pool-api Mon, 14 Sep 2020 05:35:07 GMT <![CDATA[Simple rest APIs to get Uniswap data (DEX Data APIs)]]> https://bitquery.io/blog/dex-data-apis https://bitquery.io/blog/dex-data-apis Fri, 11 Sep 2020 05:35:07 GMT <![CDATA[Single API to Get Ethereum Token Balance]]> https://bitquery.io/blog/ethereum-token-api https://bitquery.io/blog/ethereum-token-api Fri, 11 Sep 2020 05:35:07 GMT <![CDATA[Simple API To Get Ethereum Supply And Data]]> https://bitquery.io/blog/get-ethereum-total-supply https://bitquery.io/blog/get-ethereum-total-supply Fri, 21 Aug 2020 05:35:07 GMT 100 ETH ) transfers to Ethereum genesis address Run the query below to get the transactions sent to the Ethereum genesis address. The results will be in descending order of the transaction amount. ``` { ethereum { transfers( currency: { is: "ETH" } amount: { gt: 100 } options: { desc: "amount" } sender: { not: "0x0000000000000000000000000000000000000000" } receiver: { is: "0x0000000000000000000000000000000000000000" } ) { amount transaction { hash } block { height } sender { address annotation } } } } ``` ## Total Gas spent on Ethereum. Ethereum is an EVM, where any execution cost a fee, which is called Gas. To calculate the total Gas spent on Ethereum, run the query below. ``` { ethereum { transactions { gasValue } } } ``` ## Total uncle blocks, transaction count and block reward [Uncles](https://ethereum.stackexchange.com/questions/34/what-is-an-uncle-ommer-block) are stale blocks that contribute to the security of the main chain but are not considered the canonical “truth” for that particular chain height. In contrast to orphan blocks (which have no parent), uncle blocks are linked to the chain but are not part of the final selection. To get total uncle blocks, total transaction count, and total block rewards, run the following query. ``` { ethereum { blocks { uncleCount transactionCount reward } } } ``` ## Largest Ethereum transfers Run the following query to get the largest Ethereum transactions. As you can see, the query is filtering transactions where more than 1 million ETH is transferred in a single transaction. ``` { ethereum { transfers( currency: { is: "ETH" } options: { desc: "amount", limit: 100 } amount: { gt: 1000000 } sender: { not: "0x0000000000000000000000000000000000000000" } receiver: { not: "0x0000000000000000000000000000000000000000" } ) { amount transaction { hash } sender { address annotation } receiver { address annotation } } } } ``` ## ETH emission and Gas spent for a given block If you want to know how many Eth emitted and Gas spent for a given block, run the following query. In this query, we took block number 51 as an example. ``` { ethereum { transactions(height: { is: 51 }) { gasValue } transfers( height: { is: 51 } currency: { is: "ETH" } sender: { is: "0x0000000000000000000000000000000000000000" } ) { amount } } } ``` ## DAO fork transfers DAO fork created Ethereum and Ethereum classic, therefore, to get the transactions that were included only in Ethereum during the fork, run the query below. ``` { ethereum { transfers( height: { is: 1920000 } currency: { is: "ETH" } options: { desc: "amoun" } receiver: { is: "0xbf4ed7b27f1d666546e30d74d50d173d20bca754" } ) { amount sender { address annotation } } } } ``` ## Ethereum transactions which used most Gas Recently, there were two transactions([Tx1](https://explorer.bitquery.io/ethereum/tx/0xc215b9356db58ce05412439f49a842f8a3abe6c1792ff8f2c3ee425c3501023c), [Tx2](https://explorer.bitquery.io/ethereum/tx/0xca8f8c315c8b6c48cee0675677b786d1babe726773829a588efa500b71cbdb65)) that used 10668 ETH Gas to transfer 350 ETH and 0.55 ETH. Crazy! Right? Most probably, it was a mistake or coding error. To know the Ethereum transactions that spent the largest gas amount, run the following query. ``` { ethereum { transactions( options: { desc: "gasValue", limit: 10 } gasValue: { gt: 100 } ) { gasValue sender { address annotation } hash } } } ``` ## Get Ethereum token balance in a single API (Including NFTs) Run the following query with parameters to get all Ethereum token balance in a single call. However, you need to subtract the sum_out from sum_in to get the actual balance. __balance = sum_in — sum_out__ **Query** ``` query ($network: EthereumNetwork!, $address: String!) { ethereum(network: $network) { transfers(amount: { gt: 0 }, options: { desc: "count_in" }) { sum_in: amount(calculate: sum, receiver: { is: $address }) sum_out: amount(calculate: sum, sender: { is: $address }) count_in: count(receiver: { is: $address }) count_out: count(sender: { is: $address }) currency { symbol } } } } ``` **Parameter** ``` { "network":"ethereum”, "address":"0x2c82E14352e98c931852D9BB5f0760E36942CC3c" } ``` ## Get Ethereum balance only To get only the Ethereum balance of a given address, run the query below. ``` { ethereum { address(address: { is: "0x2c82E14352e98c931852D9BB5f0760E36942CC3c" }) { balance } } } ``` ## [Bitquery](https://bitquery.io/) Ethereum GraphQL APIs Using our GraphQL APIs is similar to querying Ethereum blockchain directly. You can get any data for Ethereum and other blockchains using [Bitquery GraphQL APIs](https://bitquery.io/labs/graphql). If you face any problem with the above queries or looking for any data, ping us on [Telegram](https://t.me/Bloxy_info). **Also Read** - [How to trace Bitcoin transactions or address?](https://bitquery.io/blog/trace-bitcoin-transaction-and-address) - [Blockchain Analytics: Everything you need to know](https://bitquery.io/blog/blockchain-analytics-everything-you-need-to-know) - [Create a WhaleAlert like service in 10 minutes (Crypto Alert)](https://bitquery.io/blog/crypto-alert-service-like-whale-alert) - [gbwhatsapp télécharger](https://gratuitcrack.com/telecharger-gbwhatsapp-apk/) - [Crypto chart widgets for your website (Including WordPress)](https://bitquery.io/blog/crypto-chart-on-your-website-wordpress) - [Coinpath® – Blockchain Money Flow APIs](https://bitquery.io/products/coinpath) - [Best Blockchain Analysis Tools and How They Work?](https://bitquery.io/blog/best-blockchain-analysis-tools-and-software) ]]> <![CDATA[10 Best Blockchain Analysis Tools]]> https://bitquery.io/blog/best-blockchain-analysis-tools-and-software https://bitquery.io/blog/best-blockchain-analysis-tools-and-software Tue, 18 Aug 2020 05:35:07 GMT <![CDATA[Tracing Bitcoin Transactions and Addresses]]> https://bitquery.io/blog/trace-bitcoin-transaction-and-address https://bitquery.io/blog/trace-bitcoin-transaction-and-address Sat, 15 Aug 2020 05:35:07 GMT **Also Read: [How to show blockchain data widget on your website](https://bitquery.io/blog/crypto-chart-on-your-website-wordpress)** ## Bitcoin address classification [Coinpath®](https://bitquery.io/products/coinpath) Bitcoin addresses classification technology provides ways to identify patterns on the blockchains. For example, you can determine if an exchange owns a specific address by looking at the number of transactions it performs every day and the transaction amount. Usually, these patterns create different types of clusters. By analyzing these clusters, you can identify payment services, custodians, and other types of virtual asset service providers. Now, if you are able to identify the crypto service, you can investigate the identity of every address interacting with that crypto service if it has implemented KYC solutions. Tracing Bitcoin transactions through [VASP](https://www.fatf-gafi.org/glossary/u-z/#:~:text=Virtual%20asset%20service%20provider%20means,ii.) is a much easier and the backbone of many crypto compliance solutions. ## Challenges in tracing Bitcoin transactions The bitcoin blockchain is a database of alphanumeric strings and numbers. It does not contain any real-world identity. Therefore, it presents some challenges when it comes to identifying the transactions. - **Self custody and Intermediate wallets** — It is effortless to create thousands of wallets on the bitcoin blockchain and self-custody your funds. As we discussed in our last blog, [cryptocurrency money laundering](https://bitquery.io/blog/cryptocurrency-money-laundering), criminals create intermediate wallets and process funds through these intermediaries to remove the source identity. - **Mixers** — Services like mixers are build to enhance privacy. However, criminals use them to mix funds, which creates problems when tracing bitcoin transactions. - **Unregulated crypto service (VASP)** — Bitcoin is a universal digital currency enabled by a public blockchain, and anyone can create services on top of it. Many countries do not enforce proper KYC/AML laws to crypto services (VASPs). Therefore, criminals process illicit funds through these services and convert them into fiat. ## Use cases of Bitcoin transactions tracing One of the most critical use cases of tracking Bitcoin transactions is in preventing [bitcoin money laundering](https://bitquery.io/blog/cryptocurrency-money-laundering) and identifying criminal activities. Law enforcement authorities all over the world use sophisticated tracing and [blockchain analysis tools](https://bitquery.io/products/coinpath) to prevent money laundering activities. ## User privacy Privacy is a human right established in the [Universal Declaration of Human Rights](https://www.un.org/en/universal-declaration-human-rights/index.html) (article 12). Therefore, preserving the user’s privacy should be the utmost priority for any business and enforcement agencies. In 2019, a [survey](https://medium.com/blockchain-capital-blog/bitcoin-is-a-demographic-mega-trend-data-analysis-160d2f7731e5) revealed that more than 11% of Americans own Bitcoin. Millions of users use cryptocurrencies for commercial purposes every day. Therefore, it is critical that businesses understand the value of user’s privacy when deploying [bitcoin compliance solutions](https://bitquery.io/products/coinpath) and tracing technologies. If you are an individual who is concerned with your economic privacy, you should use proper tools and services when using cryptocurrencies. ## Wrapping up Protecting user privacy and enabling commercial activity is not a zero-sum game. It is critical for cryptocurrency adoption, that law authorities are able to identify criminal activities on the blockchain. Otherwise, we will see sweeping legislation, prohibiting all commercial activities related to cryptocurrencies. However, users in the crypto space are more aware of privacy problems and inventing privacy-focused solutions every day, which makes tracing blockchain transactions an ongoing challenge for law-enforcement agencies worldwide. ## About Coinpath® [Coinpath®](https://bitquery.io/products/coinpath?utm_source=about) APIs provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. If you have any questions about [Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog), ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world. Coinpath® is a Bitquery product. [**Bitquery**](https://bitquery.io?source=blog&utm_medium=about_coinpath) is a set of tools that parse, index, access, search, and use information across blockchain networks in a unified way. ## About Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world. **Also Read** - [Coinpath® – Blockchain Money Flow APIs](https://bitquery.io/products/coinpath) - [Cryptocurrency Money Laundering Explained](https://bitquery.io/blog/cryptocurrency-money-laundering) - [Blockchain Analytics: Everything you need to know](https://bitquery.io/blog/blockchain-analytics-everything-you-need-to-know) - [Visualize Coinpath® results using Gephi](https://bitquery.io/blog/visualize-coinpath-results-using-gephi) - [How to get started with Coinpath® APIs?](https://bitquery.io/blog/coinpath-api-get-start)]]> <![CDATA[Blockchain Analytics: Everything you need to know]]> https://bitquery.io/blog/blockchain-analytics-everything-you-need-to-know https://bitquery.io/blog/blockchain-analytics-everything-you-need-to-know Wed, 12 Aug 2020 05:35:07 GMT <![CDATA[Ethereum Classic 51% Chain Attack July 31, 2020]]> https://bitquery.io/blog/ethereum-classic-51-chain-attack-july-31-2020 https://bitquery.io/blog/ethereum-classic-51-chain-attack-july-31-2020 Fri, 07 Aug 2020 10:06:00 GMT This article is based on excellent [exploration](https://hackmd.io/@cUBb4hAvQciAEPoU2yfrzQ/Skd4X6MZw) by Yaz Khoury, Sam Johnson, Austin Roberts and on on-chain data from [Bitquery.io](https://explorer.bitquery.io/ethclassic) ### What happened Ethereum Classic yesterday experienced a huge ‘[51% attack](https://www.investopedia.com/terms/1/51-attack.asp)’. One miner, [0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e](https://explorer.bitquery.io/ethclassic/address/0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e) generated a series of more than 3500 blocks, as a huge fork from block 10904146 till 10907740. He mined these blocks for many hours and broadcasted them afterward to other miners. As this sequence of the block had more weight than the chain, built by all other miners, they had to accept these blocks, effectively **replacing the blockchain history with attacker’s one**. ### What else happened It appeared, that not all nodes equally processed this event. Nodes based on [Open Ethereum](https://github.com/openethereum/openethereum) ( and we at [Bitquery.io](https://explorer.bitquery.io/ethclassic) among them ) did not do accept attacker series of blocks. This resulted in fork on 2 blockchains depending on **what software installed on nodes**: 1. [Geth](https://github.com/etclabscore/core-geth) and [Hyperledger Besu](https://github.com/hyperledger/besu) — based nodes accepted attacker blocks and selected the longest ( heaviest ) forked chain 2. [Open Ethereum](https://github.com/openethereum/openethereum) — based nodes remained on the “old” forked chain Previously at July [Open Ethereum](https://github.com/openethereum/openethereum) announced that they skip support for ETC, but we did not expect that the software will break in such a weird and unpredictable way. Especially when nobody make any changes to it 🙂 ### What it means for users Some transfers of ETC that happened during 12 hours, starting from 16:30 UTC July, 31, till 3:30 AM August, 1st, are not included in the new blockchain. If anyone transferred money at this time, now it will not appear in her or his wallet. There was a period of time at August, 1st, when there was a number of miners ( probably based on open ethereum ) continuing to mine the ‘old’ chain. Users of that wallets made transfers, and they were not reflected in the main ETC chain. ### What it means for miners Miners probably lost a large amount of ETC mined during the attack. Also some miners spent more hash power, mining blocks on wrong ‘old’ fork after the attack. ### What it means for all of us ‘Proof of work’ blockchains mostly considered more secure than other consensus types. However in the core idea is the probability theory, which can only gives some level of confidence, never reaching 100%: ![Confirmation probability](https://miro.medium.com/max/637/1*reo5SvFym7y2m-9uIbrNQg.png) ### Confirmation probability It starts from 0%, when transaction just happened and not included in blockchain, rapidly raising to ‘almost 100%’ when more blocks are added on top of the block, containing the transaction. Proof of work consensus just helps to raise this curve to 100% very very quickly, as 99.99999 confidence in 6 blocks. Thats why wallets and exchanges have a confidence window of blocks. It is a big mistake to consider the probability numbers and confidence in the predictions. From the high probability you can never derive, that event will never happen, for example, because its probability is very low and it takes an age of universe for this to happen. It just does not work this way, Taleb in his [Black Swan](https://en.wikipedia.org/wiki/The_Black_Swan:_The_Impact_of_the_Highly_Improbable) book shown that in many examples. When you own crypto currency on your wallet, it only means that there is some probability of that, and it never 100%. Today example shown, that no reasonable amount of time can raise confidence to the level, when you can assume that it is actually 100%. Nobody can predict that more than 12 hours of history with all transfers could disappear, but it did. ### Mining Power Attacking miner ([0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e](https://explorer.bitquery.io/ethclassic/address/0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e) ) should have more than 50% of mining power of all miners to make such an attack and sustain it for 12 hours. We observe the raise of price on mining hashrate provider [daggerhashimoto](https://www.nicehash.com/algorithm/daggerhashimoto), during the attack period: ![Mining hashrate price spike in the market](https://miro.medium.com/max/2671/1*FLRcET1TobeWyi2WG6CsMA.png) Mining hashrate price spike in the market The time here is UTC+3, so the spike in the price ( blue line ) starts at the same time as attack, and matches the attack period exactly. It is **all time high** price for hash power at this service! It may be coincidence, but the matching data telling it can be related to ETC attack. The price for the hashrate, bought on this service can be estimated from the numbers shown on graph: 5 BTC / TH / day * 1/2 day * 7 TH= 17.5 BTC Assuming that attacker bought all hash power ( 7 TH / s ). This is in the same order of magnitude as the graph for ETC at [2miners](https://2miners.com/etc-network-hashrate). Attacker spent just 17.5 BTC ( $170K ) to fool all network for 12 hours. The miner, [0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e](https://explorer.bitquery.io/ethclassic/address/0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e) only appeared active since July, 29 and for 3 days generated modest number of blocks, 30 per day: ![Activity of miner, based on bitquery.io data ( non-reorg fork)](https://miro.medium.com/max/1498/1*l8YCQhiIUXE7vQFCU4iu_A.png) Activity of miner, based on [bitquery.io data](https://explorer.bitquery.io/ethclassic/address/0x75d1e5477f1fdaad6e0e3d433ab69b08c482f14e/inflow?from=2020-07-04&till=2020-08-02) ( non-reorg fork) ### On-chain activity during the attack We made a preliminary investigation only based on non re-org’ed data, not including the attacker’s blocks. We were very actually lucky that were running Open ethereum nodes, as of now, we will have the ability to have both forks data and match one against the other. When attacker mined his ‘forked’ blocks he actually was not publishing them, and nobody knew it is happening. Users sent transactions to the chain, and the largest transactions in ETC were: ![Data is from Bitquery.io non-reorg database](https://miro.medium.com/max/1903/1*Bbn73ioOLDgUuX1oKkdSJA.png) Data is from Bitquery.io non-reorg database Some of the transfers from these are included in the forked blockchain, as the largest one. In non-reorg database it is at block [10906346](https://explorer.bitquery.io/ethclassic/block/10906346) and in re-orged it is on block [10907763](https://blockscout.com/etc/mainnet/blocks/10907763) However, not all of these are so lucky. For example, the transfer _0x069db204ea87f62817dff7320d0177815c9a7f56811a3a4be00e0c2d862dda39_ now is not included in the chain, and the balances of addresses ( say, [0x97b2a6ca77e2a0fccd15e082b27cb566ddb31ee4](https://explorer.bitquery.io/ethclassic/address/0x97b2a6ca77e2a0fccd15e082b27cb566ddb31ee4) ) differs in non-reorg’d and re-org’ed chains. This chain of transfers will not appear in org’ed chain: ![money flow](https://miro.medium.com/max/3080/1*QH9Yc43pLHwJWzFF8J7DzQ.png) money flow We are now upgrading our node to geth, and soon will have the data for both chains — re-org’ed and non-reorg, and will be able to match the transactions between them. As we see, there are major differences in these forks, and some addresses may be suspected for double spending. ### Conclusion What happened is a major accident in ETC blockchain. It can be observed in any proof of work blockchain in the future, so any such accident need careful analysis. There are facts showing that the miner did the attack intentionally, buying hash rate power from external sources. Further analysis required to find mismatches on re-orged and non-reorged chains to reveal the possible facts of double spending and other issues. We will be happy to share the data for both databases with all interested parties, doing their analysis and investigation of accident. Please write your query in our [Telegram channel](https://t.me/Bloxy_info). Not all software run by nodes and miners, behave the same. The diversity of versions and software made the accident worse than it could be. Looking for end to end Crypto investigation tool? Explore Coinpath Moneyflow, built for investors and law enforcement agencies. [Check it out here!](https://share.hsforms.com/1r66O41lbSuOElm1REXeptQ3rc4g) **Also Read** - [How Upbit hackers laundered millions using crypto exchanges?](https://bitquery.io/blog/upbit-hack-crypto-money-laundering) - [Coinpath® – Blockchain Money Flow APIs](https://bitquery.io/products/coinpath) #### **About** Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.]]> <![CDATA[Ethereum Classic Attack, 8 August: Catch me if you can]]> https://bitquery.io/blog/ethereum-classic-attack-8-august-catch-me-if-you-can https://bitquery.io/blog/ethereum-classic-attack-8-august-catch-me-if-you-can Fri, 07 Aug 2020 05:35:07 GMT <![CDATA[Cryptocurrency Money Laundering Explained]]> https://bitquery.io/blog/cryptocurrency-money-laundering https://bitquery.io/blog/cryptocurrency-money-laundering Thu, 06 Aug 2020 05:35:07 GMT <![CDATA[Attacker Stole 807K ETC in Ethereum Classic 51% Attack]]> https://bitquery.io/blog/attacker-stole-807k-etc-in-ethereum-classic-51-attack https://bitquery.io/blog/attacker-stole-807k-etc-in-ethereum-classic-51-attack Wed, 05 Aug 2020 05:35:07 GMT <![CDATA[Create a WhaleAlert like service in 10 minutes (Crypto Alert)​]]> https://bitquery.io/blog/crypto-alert-service-like-whale-alert https://bitquery.io/blog/crypto-alert-service-like-whale-alert Sat, 25 Jul 2020 00:03:00 GMT <![CDATA[Conflux Explorer and Money flow]]> https://bitquery.io/blog/conflux-explorer-and-money-flow-bitquery https://bitquery.io/blog/conflux-explorer-and-money-flow-bitquery Thu, 23 Jul 2020 05:35:07 GMT <![CDATA[Bitquery Products Updates July 2020]]> https://bitquery.io/blog/bitquery-products-updates-july-2020 https://bitquery.io/blog/bitquery-products-updates-july-2020 Mon, 20 Jul 2020 18:52:00 GMT B->C - A->D->C Earlier, they were two paths in the API. Now, we aggregated them in one path ABDC, where B and D path segments will be on depth=2. - **New limit and offset Parameter** We added new parameters **limit** and **offset** in paths API. By default, API will return 100 paths in the shortest path order. - **API results in GEXF format** A new format parameter (Graph XML/ GEXF) was added to all Coinpath® APIs. With this, you can [visualize the Coinpath® API results in Gephi](https://bitquery.io/blog/visualize-coinpath-results-using-gephi). The above changes are backward compatible. Users implementing Coinpath® APIs may not require any significant changes. #### **About** Bitquery [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. Our products are: - **[Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog) APIs** provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. Read [this to get started with Coinpath®](https://bitquery.io/blog/coinpath-api-get-start). - **[Digital Assets API](https://bitquery.io/products/digital-assets?utm_source=blog&utm_medium=about)** provides index information related to all major cryptocurrencies, coins, and tokens. - **[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about)** provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, Kyber Network, Airswap, Matching Network, etc. If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world.]]> <![CDATA[How Upbit hackers laundered millions using crypto exchanges?]]> https://bitquery.io/blog/upbit-hack-crypto-money-laundering https://bitquery.io/blog/upbit-hack-crypto-money-laundering Mon, 20 Jul 2020 18:52:00 GMT Upbit hackers’ initial wallet → 6 intermediate wallets →Bity’s wallet (7th hop) With Path’s API data, we have created the following image to visualize how funds moved through intermediate wallets before reaching Bity.com. ![Graph view of hackers laundering funds to Bity.com (created using Gephi)](/blog/upbit-hack-crypto-money-laundering/1_0Q0PH0FvVwtydNJHh8c1AQ.png) Graph view of hackers laundering funds to Bity.com (created using [Gephi](https://gephi.org/)) In addition, we can also get the transactions that hackers sent to bity.com. Notice, date, and the amount of the transactions. All transactions were sent to Bity within 45 minutes and they all are around 60 ETH. ![Transactions received by Bity from upbit hackers' address](/blog/upbit-hack-crypto-money-laundering/1_Uu1bUcTuCRm7o3p_ezkCLw.png) Transactions received by Bity from upbit hackers’ address ### Majority of Upbit funds end up on Exchanges However, when we checked for 12 hops, we found that hackers sent 3,661 ETH to Bity. Besides, hackers also sent the majority of the funds on prominent crypto exchanges. As you can notice in the following image, hackers sent more than 100K ETH to Binance. Besides, they sent money to exchanges like Huobi, Bitmex, Kraken, and Liquid exchange (Check attached data). ![Upbit hackers money flow over 12 hops (Top 20 results)](/blog/upbit-hack-crypto-money-laundering/1_gcb3yh3kNO0rvUMFz98PrQ.png) Upbit hackers money flow over 12 hops (Top 20 results) ### Investigating crypto crimes using Coinpath® APIs We don’t know how much funds Upbit had recovered. However, a significant amount of funds could have been retrieved by real-time monitoring of stolen cryptocurrencies. Exchanges like Binance and Bitmex can freeze funds as soon as they receive a transaction from a suspected wallet. Using Coinpath® APIs you can [stop cryptocurrency money laundering in real-time](https://bitquery.io/blog/twitter-hack-tracking-bitcoin-using-coinpath). Learn more about the Coinpath use cases [here](https://bitquery.io/products/coinpath). #### **About Coinpath®** [Coinpath®](https://bitquery.io/products/coinpath?utm_source=about) APIs provide [blockchain money flow analysis](https://bitquery.io/products/coinpath) for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. If you have any questions about [Coinpath®](https://bitquery.io/products/coinpath?utm_source=blog), ask them on our [Telegram channel](https://t.me/Bloxy_info). Also, subscribe to our newsletter below, we will keep you updated with the latest in the cryptocurrency world. Coinpath® is a Bitquery product. [**Bitquery**](https://bitquery.io/?source=blog&utm_medium=about_coinpath) is a set of tools that parse, index, access, search, and use information across blockchain networks in a unified way. **Also Read** - [Coinpath® — Blockchain Money Flow APIs](https://bitquery.io/products/coinpath) - [FairWin Scam Smart Contract Coinpath Investigation](https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation)]]> <![CDATA[Twitter Hack — Track Bitcoin crimes in real-time using Coinpath®]]> https://bitquery.io/blog/twitter-hack-tracking-bitcoin-using-coinpath https://bitquery.io/blog/twitter-hack-tracking-bitcoin-using-coinpath Fri, 17 Jul 2020 14:41:00 GMT <![CDATA[How to get started with Coinpath® APIs?]]> https://bitquery.io/blog/coinpath-api-get-start https://bitquery.io/blog/coinpath-api-get-start Fri, 17 Jul 2020 09:32:00 GMT <![CDATA[Do not be Fooled by Crypto Quiz Games!]]> https://bitquery.io/blog/crypto-quiz-games-or-scams https://bitquery.io/blog/crypto-quiz-games-or-scams Tue, 14 Jul 2020 12:06:00 GMT **Also Read: [FairWin Scam Smart Contract Coinpath Investigation](https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation)** ### Easy Money There are just 2 transactions in Etherscan at the time of writing: contract creation and set_game() call: ![transactions](https://miro.medium.com/max/1165/1*0uu7i_fZzmqsMMGG0HY5Mg.png) Only 2 transactions shown in [Etherscan](https://etherscan.io/address/0x37c8da5a09a0afdce72371764473d88cc1374f61) The first one is just contract creation, and the second is set_game() call, sending 6 ETH to the contract as well. this one is pretty interesting, as it SHOWS THE ANSWER TO QUIZ IN PLAIN TEXT!!! If you open [Etherscan](https://etherscan.io/tx/0xbc3b60fbbe2efda73b2f1febaec05550362dbcd19d02d83aa9c14948d70d041f):, switch call arguments to UTF-8 representation, you will see: ![input data](https://miro.medium.com/max/686/1*f9lburW_cxgOqFgE2HuRAA.png) Source: [Etherscan](https://etherscan.io/tx/0xbc3b60fbbe2efda73b2f1febaec05550362dbcd19d02d83aa9c14948d70d041f) This is even better shown in Bloxy.info: ![Transaction details](https://miro.medium.com/max/1047/1*IFQ8GunFMz0XR8OdVkJE9g.png) Transaction details source: [Bloxy.info](https://bloxy.info/tx/0xbc3b60fbbe2efda73b2f1febaec05550362dbcd19d02d83aa9c14948d70d041f) So it appears that you already get an answer (“GlovE”) and can easily get 3 ETH from the contract? As you may guess, no. ### Where is the Trap? First, look at Bloxy detailed page of this contract, and you will see something different from Etherscan showing: ![Smart contract calls](https://miro.medium.com/max/509/1*0B_fQwfMEanqKOIZH4tITg.png) Smart contract calls Source: [bloxy.info](https://bloxy.info/address/0x37c8da5a09a0afdce72371764473d88cc1374f61) What? You have more than 2 calls? And more than 2 transactions with smart contract? Yes. Yes. The calls can be internal. When one smart contract calls another smart contract, they will be internal transactions, and they are equally important to see, as they also may change the internal state of the smart contract. The creator of this smart contract looks as a cheater. He used another smart contract ( [0x4a3c2ead2a2ce2051e409ba51b710e4e09163492](https://bloxy.info/address/0x4a3c2ead2a2ce2051e409ba51b710e4e09163492) ) to make internal calls, setting another answer hash, different from the answer, visible in Etherescan. It is done using this transaction: ![Question is the same, answer is not. ](https://miro.medium.com/max/2113/1*J_dBvzgxmE0VZ-i62yS2mA.png) Question is the same, answer is not. Source: [Bloxy.info](https://bloxy.info/tx/0x01fd7a64239ac65f5f49c37a6d010aabe2e013596b9f8ca4bdacc38e7f538bbe) If you carefully look at the smart contract code, especially on the function set_game: **function** _set_game_(string _question,string _response) public payable { **if**(**responseHash**==0x0) { **responseHash** = keccak256(_response); **question** = _question; **questionSender** = msg.**sender**; } } It only sets the answer hash (**responseHash**) IF and ONLY IF it was not set before. The creator of this smart contract used internal smart contract call ( not visible in Etherscan ! ) to change the answer hash. **responseHash** is not intentionally shown as public smart contract variable. However, it can easily be fetched programmatically: >>> web3.eth.getStorageAt( Web3.toChecksumAddress(smart_contract_address),2).hex() **'0xf152950bed091c9854229d3eecb07fae4c84127704751a692c8409543dc02bd3'** As you see, it is equal to what is set in internal transaction, and is NOT equal to the hash of the “GlovE” answer, which is equal to: >>> web3.sha3(**text**=**'GlovE'**) HexBytes(**'0x28a2cf3d43e08c03112de5742b068e23ab3cede00f14059427e6264859fd462c'**) Totally different. If you now look at Etherscan transactions, and will try to answer question, depositing 3 ETH, you will loose them. So what is the right answer? Probably, it does not exist at all. The smart contract has this function: **function** _StopGame_() public payable { require(msg.**sender**==**questionSender**); msg.**sender**.transfer(**this**.balance); } And the contract creator took care how he will use it, by making another internal transaction newQuestioner: ![new Questioner](https://miro.medium.com/max/1152/1*lkFZsWbDuB2oKAcGO-V_8A.png) new Questioner source: [Bloxy.info](https://bloxy.info/tx/0x6cc4a4534d60b4917ddfa30487aac15b5e531f3db1d24f0635ee5b8ae22eecb0) So even if nobody will get the right answer, he will get all deposited money. ### Scam Scheme 1. Scammer creates Contract 2. He calls methods of this new smart contract from another contract ( created by him specially ) to setup the question, answer hash and beneficiary. These calls are **not visible in Etherscan**! 3. Then he calls external transaction (these are **visible in Etherscan**) with the same question and visible ( but wrong ) answer 4. People looking at this transaction and on smart contract code, thinking this is an easy way to get the prize. They try to answer, deposit money and loose them 5. After people deposited some money, scammer then can withdraw it. ### How Many Victims? The list of smart contracts, related to this particular , is quite large. The smart contract 0x4a3c2ead2a2ce2051e409ba51b710e4e09163492 is related to a good number of them: ![https://bloxy.info/address/0x4a3c2ead2a2ce2051e409ba51b710e4e09163492](https://miro.medium.com/max/533/1*tvNRJZ7Dn2Cb-QxGs9cmng.png) Source: [bloxy.info](https://bloxy.info/address/0x4a3c2ead2a2ce2051e409ba51b710e4e09163492) But how to get people involved in the scam? Probably the most evident way is to look of Try() method calls, where money where deposited to answer the quiz. Bloxy shows the statistics of the method usage in all smart contracts by the name or signature. And the most successful are… ![Try method usage in smart contracts.](https://miro.medium.com/max/1017/1*RU4XcKQJgMWD_8VKjd7Yvg.png) Try method usage in smart contracts. Source: [bloxy.info](https://bloxy.info/functions/3853682c) The statistics of how many times the Try(**string _response**) function was called, by months: ![Scam is on the rise](https://miro.medium.com/max/2063/1*Xu24QjfHMZew73R9uXi_Tg.png) Scam is on the rise…Source: [bloxy.info](https://bloxy.info/functions/3853682c) In these calls, there is a fraction of “bait” calls, but there are real ones, where people trying to cheat using the visible answers from Etherscan, and lost their money. ### Conclusions We analyzed the scam example, mostly based on the fact, that Etherscan **does not show the important information** about internal transactions with smart contract. This allows cheater to fool people, who look at external transactions only. To prevent this in future, consider that: 1. Easy money never exists. If you think you can fool somebody, most probable scenario is this is the bait of scammer 2. Pay attention to internal transactions between smart contracts. In good developer hands, they are the powerful tool ( we will hopefully cover this in the future materials about DEX and derivatives ). Bad developers can cheat you with their smart usage. 3. Consider using more information about the smart contract transactions, and Bloxy.info is a great resource for that. Etherscan shows not all transactions, coming to the smart contract. 4. Keep your money in your pocket 🙂]]> <![CDATA[MakerDAO Transactions Illustrated]]> https://bitquery.io/blog/makerdao-transactions-explained https://bitquery.io/blog/makerdao-transactions-explained Tue, 14 Jul 2020 11:26:00 GMT PETH exchange of bad debts ) The MakerDAO protocol is described [here](https://developer.makerdao.com/dai/1/api/vox). We took the text description from this source, but illustrated it by the real example of transactions, using the graphical presentation from [bloxy.info](https://bloxy.info/?utm_source=blog) web site. Every illustration is accompanied by the link to the transaction it shows. You can investigate this particular transaction by clicking the link, or investigate even further, by finding similar transactions on the contract. We believe this material will help to better understand MakerDAO protocol and use it in all possible variety of ways. > **Also Read: [MakerDAO Tokens Explained: DAI, WETH, PETH, SIN, MKR](https://bitquery.io/blog/makerdao-tokens-explained?utm_source=blog)** ### Methods Overview All protocol methods can be categorized in categories, working with different entities: ![MakerDAO Smart Contract methods](https://miro.medium.com/max/1011/1*ogbKqosPjqQP0bheSwT-5g.png) MakerDAO Smart Contract methods They describes what in general you can do with MakerDAO system: 1. Deposit / withdraw your Ether ( PETH Pool ) 2. Control your CDP’s ( Collateral positions ) and get a loan (in DAI) from them. This effectively controls the total supply of DAI. 3. Liquidate debts in DAI/PETH ### Join Collateral Pool Join the collateral pool by depositing `ETH` in exchange for `PETH` (pooled ether). - The amount should be specified in units of `PETH`. - ETH will be debited from the caller at the join price (`ask`) ![Join Collateral Pool](https://miro.medium.com/max/916/1*hl1Q_66w1aFnbxH0HGo_eA.png) [source](https://bloxy.info/tx/0x68802029f7dd70895f1c773082f049b71d325581000d23ccbebdd4530ce444ff) ### Exit Collateral Pool Withdraw collateral by returning `PETH` to the vault in exchange for the proportional amount of `ETH`. - The amount should be specified in units of `ETH`. - PETH will be debited from the caller at the exit price (`bid`) Will return more or less `ETH` tokens for each `PETH` than at `join` depending whether the system made a profit or loss over the lifetime of the collateral deposited to the pool. ![Exit Collateral Pool](https://miro.medium.com/max/822/1*fc1Hg34r72cIj2BYum0PzA.png) [source](https://bloxy.info/tx/0xde0045b4e2386612396e3113b82f37928a980785516806f1ab4a49cb0d78cd00) ### Open CDP Create an empty CDP and set the caller to be the owner. ![https://bloxy.info/tx/0xaf9814ac29554f2e0c7ccb0ebe87c73a343f43886bb21c10da54bef35d4b0b7b](https://miro.medium.com/max/350/1*L4HIIRFL6RmCxgQhqxPMaQ.png) [source](https://bloxy.info/tx/0xaf9814ac29554f2e0c7ccb0ebe87c73a343f43886bb21c10da54bef35d4b0b7b) ### Give CDP Transfer a CDP to a different owner. (changes `lad`) ![https://bloxy.info/tx/0xef45f2faaa0b908d57131e32e1af856c0b3c0f7e9a68222e05f00c9584cd58fe](https://miro.medium.com/max/564/1*ElgwyGdatusTrP86RZRuBg.png) [source](https://bloxy.info/tx/0xef45f2faaa0b908d57131e32e1af856c0b3c0f7e9a68222e05f00c9584cd58fe) ### Lock CDP Add `PETH` collateral (increases `ink`). ![https://bloxy.info/tx/0x8666e2871274c806b77e3b4046fa41b7a3bc02f120f0ab5f5e4f03f92c6edd39](https://miro.medium.com/max/546/1*0q070Sug3FXqgOYHOTgd5w.png) [source](https://bloxy.info/tx/0x8666e2871274c806b77e3b4046fa41b7a3bc02f120f0ab5f5e4f03f92c6edd39) More complicated case, with ETH initially converted: ![https://bloxy.info/tx/0x7e5858980d985f62342828f2e3018d4cea3012312d991a3eecd78577df149294](https://miro.medium.com/max/734/1*P5v_rEXrr8IVVjqhBtW-Vg.png) [source](https://bloxy.info/tx/0x7e5858980d985f62342828f2e3018d4cea3012312d991a3eecd78577df149294) ### Free CDP Remove `PETH` collateral (decreases `ink`). ![https://bloxy.info/tx/0x95a8e38236ba459ab0ec44bc53a4561c1626e1f08950fb92466d7ae33e4230f8](https://miro.medium.com/max/871/1*5COf6yzxwVYCr-WuQl0A_A.png) [source](https://bloxy.info/tx/0x95a8e38236ba459ab0ec44bc53a4561c1626e1f08950fb92466d7ae33e4230f8) More complicated case, with the conversion back to ETH ![https://bloxy.info/tx/0x714bee5d4c352acfe1edf5b8286ffbab46f54946a24e7c7edd1cacca41a8cfcf](https://miro.medium.com/max/850/1*kPhWH4uqo-FEAZkEr5PW9A.png) [source](https://bloxy.info/tx/0x714bee5d4c352acfe1edf5b8286ffbab46f54946a24e7c7edd1cacca41a8cfcf) ### Draw DAI Issue a specified amount of Dai (increases `art`, `rum`) ![https://bloxy.info/tx/0xa675314e644aea0320c72f3107e6cb5c427a51885999c1e42484ddbdb46ad29b](https://miro.medium.com/max/749/1*0RZaC31n0k_OfZeH1fm9sA.png) [source](https://bloxy.info/tx/0xa675314e644aea0320c72f3107e6cb5c427a51885999c1e42484ddbdb46ad29b) More complicated, with intermediary smart contract sending DAI to the guy ![0xe847cd30af2826e37170ae2c736a0d0f0adc4a7f3b0e32a20f2768440d2c3f10](https://miro.medium.com/max/851/1*jEGNREXTCocKieO4UHhmrw.png) [source](https://bloxy.info/tx/0xe847cd30af2826e37170ae2c736a0d0f0adc4a7f3b0e32a20f2768440d2c3f10) ### Wipe DAI Repay some portion of outstanding Dai debt (decreases `art`, `rum`). ![MakerDAO: Wipe DAI](https://miro.medium.com/max/852/1*6O1LAR-sQDOWcwwUq0EZ6w.png) [source](https://bloxy.info/tx/0x6466f98209f92dc32921988c016a75b9946a9d44f58d2b5eaecf898500cdab84) More complicated case, where DAI exchanged to pay MKR fee. DEX exchange Oasis used for this: ![https://bloxy.info/tx/0xc28febfa30c5233c1f0a69cc8ed0dc1c7c6dfe5809d7e18cf38bba5fb8c161c3](https://miro.medium.com/max/950/1*j4npS3GFQ31bcN5QfM6cFw.png) [source](https://bloxy.info/tx/0xc28febfa30c5233c1f0a69cc8ed0dc1c7c6dfe5809d7e18cf38bba5fb8c161c3) ### Shut CDP Close a CDP. Clear all debt, unlock all collateral and delete the record. Collateral will be used to pay any outstanding debt at market rate. Remaining collateral will be returned to the pool. ![MakerDAO: Shut CDP](https://miro.medium.com/max/622/1*RFTlFksQA_v7Thsl_c57YQ.png) [source](https://bloxy.info/tx/0x41d126cf65e57585b79f5ab178188b30716e9590e540fa4530030cf18d50512d) More complicated case, using Oasis to exchange DAI to MKR: ![https://bloxy.info/tx/0x0cfcad36a457135111f4e0cfb309bc784488d066f527d8e4ab27e87b338da8e5](https://miro.medium.com/max/670/1*3iqYilRjF_yH7pfj3_Vpxw.png) [source](https://bloxy.info/tx/0x0cfcad36a457135111f4e0cfb309bc784488d066f527d8e4ab27e87b338da8e5) Even more complicated, with Uniswap involved: ![https://bloxy.info/tx/0x38eeae65901c6ff749999b83d121d35e49a025c8d57c294f19f3d029137d2841](https://miro.medium.com/max/702/1*UaqsIztjGtvXBlQ2ALgcjQ.png) [source](https://bloxy.info/tx/0x38eeae65901c6ff749999b83d121d35e49a025c8d57c294f19f3d029137d2841) ### Bite CDP Liquidate a vunerable CDP (zeros `art`, decreases `ink`). Unsafe CDPs need to be liquidated. When a `cup` is not `safe`, anyone can perform `bite(cup)`, which takes on all CDP debt and confiscates sufficient collateral to cover this, plus a buffer. This returns the CDP to a safe state (possibly with zero collateral). There are other possible implementations of `bite`, e.g. only taking sufficient collateral to just transition the CDP to safe, but the described implementation is chosen for simplicity. ![MakerDAO : Bite CDP ](https://miro.medium.com/max/1501/1*Lcqiz08TFoO6N1SEycdHLA.png) [source](https://bloxy.info/tx/0xa569c5e31c978aa5f281a584d14ebc0fcbb41de4f69acb8629d16e6f6277f219) More complicated case ![https://bloxy.info/tx/0x627ff7151575daaa93c63e5bf470e58011c71c8893807ad17e1d4a09aeaa21bd](https://miro.medium.com/max/1796/1*Xqu_uNBmGSSoR3NtrAqV0g.png) [source](https://bloxy.info/tx/0x627ff7151575daaa93c63e5bf470e58011c71c8893807ad17e1d4a09aeaa21bd) ### Boom Debt Buy `dai` when the system is in surplus. Can be thought of as buy and burn. Given a net Dai balance, sell the Dai in return for PETH, which is burned. ![MakerDAO Boom Debt](https://miro.medium.com/max/1670/1*JrSFFGl_KkborodG6RgG8w.png) [source](https://bloxy.info/tx/0x50f77fadf3ff0282a160cc4602081737252a906f6661469afb1f2de3ada84a2b) ### Bust Sell `dai` when the system is in deficit. `bust` is really two functions in one: collateral sell off (aka `flip`), and inflate and sell (aka `flop`). When `fog` is non zero it is sold in return for Dai, which is used to cancel out the bad debt, `woe`. If `fog` is zero but the `tap` has a net Sin balance, then PETH is minted and sold in return for Dai, up to the point that the net Sin balance is zero. ![bust](https://miro.medium.com/max/1544/1*8ndKzz4vhdphCgvmVJJevQ.png) [source](https://bloxy.info/tx/0xc69d05644d525a8404b7c93509e8d51f6cedaeb35351368376ff5a0250cbc198) ### Vox Target Price The `vox` provides the Dai _target price_, given in terms of the reference unit, by `par`. For example, `par == 2` with USD as the reference unit implies a target price of 2 USD per Sai. The target price can vary in time, at a rate given by `way`, which is the multiplicative rate of change per second. In Dai 1.0 the sensitivity, `how`, is set to zero. Adjustments to the target price are made by adjusting the rate of change, `way`, directly with `coax`. In future iterations, `how` may be non-zero and `way` adjustments will then follow automatically via the feedback mechanism. The `vox` component is subject to ongoing economic modelling research. ![MarkerDAO: Dai stablecoin](https://miro.medium.com/max/878/1*b7_6xmXYa0111HNvBiWPvQ.png) [source](https://bloxy.info/tx/0x45f816f35b28550e9eec3e876d35247ee1e75dcc6cd215d4ed9c816a31c5dfda) ### Cumbersome Complexity To show an example of a REAL transaction, take a look at this: ![Cumbersome Complexity](https://miro.medium.com/max/1976/1*HmGMYtF3ULvwPdaPyo0nww.png) [source](https://bloxy.info/tx/0xa745b2c9f7621f5a9a3a3cdcc5b321c2e61de0148d88047296a9ddcd642948c5#) Apart from MakerDAO contracts, 3 DEX involved: Oasis, Uniswap and Kyber Network. This transaction orchestrated by smart contract **[SaverProxy](https://bloxy.info/address/0xc19d0f1e2b38aa283e226ca4044766a43aa7b02b).** What it does is withdraws Eth collateral, swaps Eth -> Dai with Kyber, and pays back the debt in Dai ### Further Research Bloxy.info [Dashboard for MakerDAO](https://stat.bloxy.info/superset/dashboard/makerdao/?standalone=true) shows interesting dynamics of the methods usage over time: ![ Dashboard for MakerDAO](https://miro.medium.com/max/2254/1*XaMTF-zNenjoKZ1LRy_Vaw.png) Bloxy.info [Dashboard for MakerDAO](https://stat.bloxy.info/superset/dashboard/makerdao/?standalone=true) As different methods are used by traders for purpose, these dynamics may tell many stories about the important events and behavior in the MakerDAO ecosystem. - [MakerDAO Spike of Popularity](https://bitquery.io/blog/makerdao-spike-of-popularity) - [Bitcoin and Ethereum Balances and its Entropy](https://bitquery.io/blog/bitcoin-and-ethereum-balances-and-its-entropy) - [FairWin Scam Smart Contract Coinpath Investigation](https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation)]]> <![CDATA[Bitcoin and Ethereum Balances and its Entropy​]]> https://bitquery.io/blog/bitcoin-and-ethereum-balances-and-its-entropy https://bitquery.io/blog/bitcoin-and-ethereum-balances-and-its-entropy Mon, 13 Jul 2020 05:35:07 GMT <![CDATA[FairWin Scam Smart Contract Coinpath Investigation​]]> https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation Mon, 13 Jul 2020 05:35:07 GMT <![CDATA[MakerDAO Spike of Popularity​]]> https://bitquery.io/blog/makerdao-spike-of-popularity https://bitquery.io/blog/makerdao-spike-of-popularity Mon, 13 Jul 2020 05:35:07 GMT OPEN -> LOCK -> DRAW** Let’s look at particular addresses in this time frame to confirm this: ![Methods](/blog/makerdao-spike-of-popularity/txn-saiproxy.png) Example of the transaction over SaiProxy. [Source](https://bloxy.info/tx/0x11416ddb18b65212caf2807f8b5a721ed25078d3f3dc7a2c270f5ba3a7de960d) This transaction is doing exactly all operations listed above, through the [proxy smart contract](https://bloxy.info/address/0x526af336d614ade5cc252a407062b8861af998f5). From user perspective, it gets DAI in exchange to Ether for the caller. Internally, it invokes JOIN -> OPEN -> LOCK -> DRAW sequence of SaiTub smart contract. How many people involved? --------------------------- Here is the most interesting part. In one day, more than 27 thousand addresses called Maker DAO ! ![Methods](/blog/makerdao-spike-of-popularity/daily-unique-smart-calls.png) Daily unique smart contract callers ( senders of TX ) Is it a lot? Yes! Lets compare that with auditorium of some other DeFi projects to make sense of it: ![Methods](/blog/makerdao-spike-of-popularity/montly-lending-protocols.png) Monthly unique users of lending protocols So this number appear to be well above all other similar project metrics. This is high even comparing with ALL traders ( makers / takers ) count on all Ethereum DEX'es: ![Methods](/blog/makerdao-spike-of-popularity/dex-traders-count.png) DEX traders counts Source How much money involved? ---------------------------- Not so much… just ~ 327 ETH ( in + out ) in a day : ![Methods](/blog/makerdao-spike-of-popularity/proxy-contract.png) ETH deposited using proxy contract. [Source](https://bloxy.info/address/0x526af336d614ade5cc252a407062b8861af998f5) Average deposited amount ~ 327 / 2 / 28,000 = 0.005 ETH per address. Not so much, around $14.What is more interesting, they all deposited virtually THE SAME amount, around 0.006 ETH : ![Methods](/blog/makerdao-spike-of-popularity/distribution-amounts.png) Distribution of amounts deposited, in ETH Where they come from? ------------------------ There is a strong suspect, that all the activity is caused by Coinbase advertising in [DAI Lesson](https://www.coinbase.com/earn/dai?utm_medium=social&utm_source=twitter&utm_campaign=earn_dai_adv_lessons) that gives 14 USD in DAI token when you pass it. Need not be Sherlock to identify this features * all amounts are the same * many people involved doing the same activity * limited in time and bound to advertising campaign ( it appeared 26 June in Twitter ). * Good news is this allows to get a lot of unique users of MakerDAO technology. Conclusion ------------------ This is a good example, when we found the consequence as event, as anomaly data on-chain, and ultimately get to the reasons of this. Digital marketing probably has the new area of analytics, using the blockchain. This allows to combine the existing tracking capabilities, as Google analytics, with on-chain analytics, as Bloxy.info to measure the efficiency of ad campaigns. It is very easy to measure MAU/DAU metrics, but way more important is to measure the retention of users on specific project, as MakerDAO. Even more important is to get revenue / ROI figures, that can be derived from the blockchain explicitly. We can look in a month if any of these addresses started using DAI / PETH with Maker DAO smart contract and how successfully. We hope some of them will convert to Maker DAO traders. *This article was composed from the data and by analytical tools from [Bloxy.info](https://bloxy.info/) analytical engine. [Bloxy.info](https://bloxy.info/) web site provides a set of tools for analytics, traders, companies and crypto enthusiasts. The tools include APIs, dashboards and search engine, all available on-site, providing accurate data, indexed directly from the blockchain live node. Bloxy mission is to make blockchain more transparent and accessible to people and businesses. Please, make a reference to the source of data when referencing this article.* * [Bitcoin and Ethereum Balances and its Entropy](/blog/bitcoin-and-ethereum-balances-and-its-entropy) * [FairWin Scam Smart Contract Coinpath Investigation](/blog/fairwin-scam-smart-contract-coinpath-investigation)]]> <![CDATA[MakerDAO Tokens Explained: DAI, WETH, PETH, SIN, MKR. Part 1]]> https://bitquery.io/blog/makerdao-tokens-explained https://bitquery.io/blog/makerdao-tokens-explained Mon, 13 Jul 2020 05:35:07 GMT Also read : [MakerDAO Spike of Popularity](/blog/makerdao-spike-of-popularity). Unstable ( "Ether"-like) Tokens ------------------------------- The left side of the diagram shows tokens, related to Ether: ![Ether](/blog/makerdao-tokens-explained/ether.png) Ether [Ether](https://explorer.bitquery.io/ethereum?utm_source=blog&utm_medium=makerdao_explained) itself is not directly used in Maker DAO system. If you have Ether originally ( as most of us ), you have to first convert it to WETH ( Wrapped ETH ) token. ![WETH](/blog/makerdao-tokens-explained/weth.png) Weth [WETH](https://explorer.bitquery.io/ethereum/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2?utm_source=blog&utm_medium=makerdao_explained) is one-to-one reflection of ETH, but as ERC-20 token. In any moment you can change Ether to WETH and back. The downside is that every such transformation requires gas. ![PETH](/blog/makerdao-tokens-explained/peth.png) PETH [PETH](https://explorer.bitquery.io/ethereum/token/0xf53ad2c6851052a81b42133467480961b2321c09?utm_source=blog&utm_medium=makerdao_explained) is short for “Pooled Ether”. When you deposit WETH to Maker DAO, you get back this token. Note, that It is not exactly one-to-one to Ether, it rate is calculated. Stable ( "DAI"-like ) Tokens ---------------------------- ![DAI](/blog/makerdao-tokens-explained/dai.png) DAI [DAI](https://explorer.bitquery.io/ethereum/token/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359?utm_source=blog&utm_medium=makerdao_explained) is MakerDAO stable coin, which is expected to be close enough to 1 US dollar. It is minted for you when you generate a loan with CDP ![SIN](/blog/makerdao-tokens-explained/sin.png) SIN [SIN](https://explorer.bitquery.io/ethereum/token/0x79f6d0f646706e1261acf0b93dcb864f357d4680?utm_source=blog&utm_medium=makerdao_explained) token represent the liquidated debt. It is equal in value to 1 DAI and used instead of DAI in debt clearance process Maker DAO Utility Token ------------------------------- ![WETH](/blog/makerdao-tokens-explained/mkr.png) MKR MKR token used to pay commission fee on closing the debt ( by wipe method ). Smart Contracts ---------------- ![SAI tub](/blog/makerdao-tokens-explained/sai_tub.png) SAI Tub [Sai Tub](https://explorer.bitquery.io/ethereum/smart_contract/0x448a5065aebb8e423f0896e6c5d525c040f59af3?utm_medium=makerdao_explained&utm_source=blog) smart contract stores CDP’s. CDP is your debt in DAI leveraged by PETH. Most operations with Maker DAO done using it. ![SAI Tap](/blog/makerdao-tokens-explained/sai_tap.png) SAI Tap [Sai Tap](https://explorer.bitquery.io/ethereum/smart_contract/0xbda109309f9fafa6dd6a9cb9f1df4085b27ee8ef?utm_medium=makerdao_explained&utm_source=blog) smart contract allows to liquidate the debt and generate the profit from it. Smart Contract Methods ----------------------- Maker DAO smart contracts have a lot of methods, major of them are categorized in the table below ![Maker DAO smart contracts](/blog/makerdao-tokens-explained/maker-dao-smart-contract-methods.png) Maker DAO smart contracts Most of the method operate with the tokens we listed above and with CDP as internal Sai Tub entity. A more detailed description of these methods you can find in [Maker DAO transactions Illustrated article](https://medium.com/coinmonks/maker-dao-transactions-illustrated-691ad2715cf7). Token Usage Pattern --------------------- The material below is created based on the Bloxy.info and Bitquery Token Flow tool and Maker DAO analytical dashboard. *Bloxy.info web site provides a set of tools for analytics, traders, companies, and crypto enthusiasts.* *The tools include APIs, dashboards, and search engine, all available on-site, providing accurate data, indexed directly from the blockchain live node.* *Bloxy's mission is to make blockchain more transparent and accessible to people and businesses.* *Please, make a reference to the source of data when referencing this article.* Our goal was to match the smart contract code and the diagram above with actual token flows and user actions regarding these tokens. We will investigate tokens one by one, from different perspectives, using our tools and analytical approach. And our first token is…. WETH ( Wrapped Ether) ----------------------- WETH is wrapped Ether and can be used instead of Ether where ERC-20 tokens are expected. The first coming to mind is decentralized exchanges (DEX). Typically DEX protocols expect ERC20 tokens as buy/sell-side assets, and they can not work with Ether directly. So you first change your Ether to WETH, exchange it, and later WETH can be changed back to Ether. This token started at December, 2017, the same time as Maker DAO protocol. Note, that the largest holder is Maker DAO smart contract: ![WETH largest holders](/blog/makerdao-tokens-explained/weth-largest-holders.png) WETH largest holders The intersection by owners with other tokens also shows Maker DAO tokens: ![Tokens correlated](/blog/makerdao-tokens-explained/token-correlated.png) Tokens correlated by common holders, Source: [Bitquery](https://explorer.bitquery.io/ethereum/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/holders?utm_source=blog&utm_medium=makerdao_explained) This high WETH balance on SaiTub MaerDAO smart contract appear, as users deposit WETH to Maker DAO’s SaiTub smart contract to create CDPs later. We analyzed the dynamics of this process on the MakerDAO dashboard: ![weth-locked-amount](/blog/makerdao-tokens-explained/weth-locked-amount.png) WETH locked amount, deposits, withdrawals. Source: Bitquery MakerDAO dashboard As seen from this graph, on 10 May, 2019 the locked WETH amount is approx. 2 million ETH ( orange line), while totally minted amount is above 4 million ETH. How many people involved in this activity? The number of traders can be estimated by unique addresses, initiating exit/join transactions on SaiTub smart contract: ![unique-count.png](/blog/makerdao-tokens-explained/unique-count.png) Unique count of addresses, locking and freeing WETH on Maker DAO smart contract. Source: Bitquery Traders behavior is described by how many WETH the lock and free each month: ![lock-weth-amount.png](/blog/makerdao-tokens-explained/lock-weth-amount.png) Monthly free/lock WETH amount. Source: Bitquery Interesting trend that the lock and free amount looks rather symmetrical, before the April 2019, when more people started to withdraw ( free ) WETH from Maker DAO, comparing to deposit ( lock ) it. These are 2 right columns of this diagram. This in turn caused that reduction in WETH balance on Maker DAO. WETH outside Maker DAO? ------------------------ The question is - is it used anywhere except Maker DAO? Answer is yes. First, it is very actively traded on ZeroX and Oasis ( Matching Market ) exchanges, as shown on Bloxy.info WETH trading page. [Token Flow Tool](https://bloxy.info/token_graphs/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) shows major flows of WETH: ![token-flow-tool.png](/blog/makerdao-tokens-explained/token-flow-tool.png) Main WETH flows. Source: [bloxy.info](https://bloxy.info/token_graphs/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2?utm_source=blog&utm_medium=makerdao_explained) As you see, there are several "centers of gravity" for WETH token: * SaiTub from MakerDAI * Oasis, DDEX exchanges * ZeroX (not involved in transfers, so not explicitly shown on this graph) Example of WETH trading by one of the most active traders on DEX is this transaction: ![weth-dai-pair.png](/blog/makerdao-tokens-explained/weth-dai-pair.png) DEX trade between many parties with WETH/DAI pair. Source: [bloxy.info](https://bloxy.info/tx/0xc538725a76c26695c3fae183bea430bfb86449bc9a066288e52716d22b10f009) WETH is traded not just agains DAI, here is the list of top 10 pairs on DEX exchanges: ![top-10-pair](/blog/makerdao-tokens-explained/top-10-pairs.png) Top 10 pairs for WETH on DEX. Source: [bloxy.info DEX API](https://bloxy.info/api_methods) PETH ( Pooled Ether) ----------------------- PETH represents ETH, that you put into Maker DAO smart contract to create DAI debt in the future. It has the rate against WETH, equals to PETH = (WETH balance ) / (Total PETH supply) WETH It is now equal to 1.04, as part of PETH has been burnt due to debt liquidations. This number increased with time as shown on the diagram: ![PETH/WETH](/blog/makerdao-tokens-explained/pooled-ether.png) PETH/WETH rate and profit associated with it. Source: bloxy.info ***The change of PETH/WETH rate generate the APR and profit for the users, who joined the pool and received PETH in exchange to WETH, long time ago. Their summary profit is estimated around 80,000 ETH.*** PETH is not traded on DEX and seems to be used solely inside MakerDAO infrastructure. Token flow below shows, that the major PETH flow goes from traders to Sai Tub smart contract. Part of the flow then goes to SaiTap ( in case of debt liquidation), or to system address ( for burning ): ![peth-token](/blog/makerdao-tokens-explained/peth-token-flow.png) PETH token flow. Source: [Bitquery MoneyFlow tool](https://explorer.bitquery.io/ethereum/token/0xf53ad2c6851052a81b42133467480961b2321c09?utm_source=blog&utm_medium=makerdao_explained) **To be continued!** In part 2 we will talk about the tokens DAI, MKR and SIN !]]> <![CDATA[Analysis of Blockchain Availability Based on Block Lag]]> https://bitquery.io/blog/analysis-of-blockchain-availabilitybased-on-block-lag https://bitquery.io/blog/analysis-of-blockchain-availabilitybased-on-block-lag Mon, 16 Mar 2020 05:35:07 GMT > average(t), average is approximately 14 seconds. It means, that any POW consensys by-design assumes the outages, when the block time due to probabalistic reasons exceed some pre-defined value. On this diagram, the 140 seconds ( 14 sec avg x 10 factor) lies in the middle, showing quite a lot of blocks, which took more time than that to mine. There are also several blocks with the lag exceeding 300 sec ethereum[(ethereum[‘lag’]>300) & (ethereum[‘block’]<15537393)] gives us the blocks with extreme block times: ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-182700.png "Track inbound and outbound NFT transfers ") Good news, that all of them well in the past! ## Ethereum After POS The distribution of the block time in Ethereum After POS ( logarithmic frequency scale ): ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog5-768x366.png "Track inbound and outbound NFT transfers ") Here we see very discrete histogram, with block times of multiples of 6 and 12 seconds. The maximum time is 96 = 12 * 8, minimum is 6 seconds. ## Bitcoin The distribution of the block time in Bitcoin ( logarithmic frequency scale ): ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog2-768x367.png "Track inbound and outbound NFT transfers ") Bitcoin and Ethereum both employ Proof of Work (PoW) for block mining, which contributes to their similar trends towards larger values. Notably, there is a noteworthy negative range of block times. This arises from utilizing the block mining time as a timestamp, rather than the actual time when the block was added to the blockchain. In practice, mining times can be established well before the block’s inclusion in the chain, resulting in a considerable number of blocks with negative time lags. However, these negative lags should not significantly impact the measurement of block lags in the positive range. This is because their distribution declines much more rapidly than that of positive lags. Among the blocks, there are 151 instances where mining took more than 2 hours, with some taking more than 10 hours. ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-183632.png "Track inbound and outbound NFT transfers ") Note that these are all at the very beginning of the network… good times! ## Binance Smart Chain The distribution of the block time in Binance Smart Chain ( logarithmic frequency scale ): ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog3-768x367.png "Track inbound and outbound NFT transfers ") BSC distribution falls pretty fast, and there are no much extremely long block times here. ### Solana The distribution of the block time in Solana ( logarithmic frequency scale ): ![Track inbound and outbound NFT transfers ](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog4-1-768x367.png "Track inbound and outbound NFT transfers ") The hystogram in logarithmic scale looks very smooth and has almost linear slope for a range of 10..120 seconds per block. It can be approximately modeled as of exponential decay: _**Freq ~ A \* exp ( -t \* B )**_ Proof of work requires the guessing of crypto puzzle, which is a random guessing, which must follow the Binomial distribution. We see here the trail of this distribution with t >> average(t), average is approximately 14 seconds. It means, that any POW consensys by-design assumes the outages, when the block time due to probabalistic reasons exceed some pre-defined value. On this diagram, the 140 seconds ( 14 sec avg x 10 factor) lies in the middle, showing quite a lot of blocks, which took more time than that to mine. There are also several blocks with the lag exceeding 300 sec _**ethereum\[(ethereum\[‘lag’\]>300) & (ethereum\[‘block’\]<15537393)\]**_ gives us the blocks with extreme block times: ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-182700.png) Good news, that all of them well in the past! Ethereum After POS ------------------ The distribution of the block time in Ethereum After POS ( logarithmic frequency scale ): ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog5-768x366.png) Here we see very discrete histogram, with block times of multiples of 6 and 12 seconds. The maximum time is 96 = 12 \* 8, minimum is 6 seconds. Bitcoin ------- The distribution of the block time in Bitcoin ( logarithmic frequency scale ): ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog2-768x367.png) Bitcoin and Ethereum both employ Proof of Work (PoW) for block mining, which contributes to their similar trends towards larger values. Notably, there is a noteworthy negative range of block times. This arises from utilizing the block mining time as a timestamp, rather than the actual time when the block was added to the blockchain. In practice, mining times can be established well before the block’s inclusion in the chain, resulting in a considerable number of blocks with negative time lags. However, these negative lags should not significantly impact the measurement of block lags in the positive range. This is because their distribution declines much more rapidly than that of positive lags. Among the blocks, there are 151 instances where mining took more than 2 hours, with some taking more than 10 hours. ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-183632.png) Note that these are all at the very beginning of the network… good times! Binance Smart Chain ------------------- The distribution of the block time in Binance Smart Chain ( logarithmic frequency scale ): ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog3-768x367.png) BSC distribution falls pretty fast, and there are no much extremely long block times here. ### Solana The distribution of the block time in Solana ( logarithmic frequency scale ): ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/alekseyblog4-1-768x367.png) Solana is famous for the very fast block times… and long outages! These are blocks that took over 10 minutes: ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-185132-267x300.png) And you see, they are sometimes close to the whole day (!) when the network effectively stalled. Aggregated Availability Figures ------------------------------- The aggregated figures from the distributions are collected in the following table: ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-191059-768x173.png) ![](/blog/blockchain/analysis-of-blockchain-availabilitybased-on-block-lag/Screenshot-2023-05-17-191112-768x275.png) Binance Smart Chain and Ethereum, particularly after the introduction of Proof of Stake (PoS), are highly favored for their exceptional availability, approaching nearly 100%. This level of availability ensures a high degree of predictability in application performance. On the other hand, Solana, while being one of the fastest networks, exhibits slightly lower availability at 97%. This level of availability is considered inadequate, even for centralized non-redundant systems such as a single-server website. ### Data Sets The data for inter-block lags in seconds versus the block number are quieried from Bitquery datasets for 4 blockchains. They are available in S3 public : [Binance Smart Chain](https://blockchain-time-data.s3.amazonaws.com/bsc_block_time.csv.gz)  [Ethereum Mainnet](https://blockchain-time-data.s3.amazonaws.com/ethereum_block_time.csv.gz)  [Bitcoin](https://blockchain-time-data.s3.amazonaws.com/btc_block_time.csv.gz) [Solana Mainnnet ](https://blockchain-time-data.s3.amazonaws.com/solana_block_time.csv.gz) #### Jupyter Notebook Jupyter notebook is in the [github project](https://github.com/bitquery/blockchain-time.git). To run the code, you will need standard Jupyter labs installation, and download the datasets in data folder inside the prject After that run % jupyter-lab and load notebook BlockhainTimes.ipynb]]> <![CDATA[The Ultimate Guide to NFT Analytics]]> https://bitquery.io/blog/the-ultimate-guide-to-nft-analytics https://bitquery.io/blog/the-ultimate-guide-to-nft-analytics Mon, 16 Mar 2020 05:35:07 GMT <![CDATA[Token Sales Anatomy]]> https://bitquery.io/blog/token-sales-anatomy https://bitquery.io/blog/token-sales-anatomy Mon, 16 Mar 2020 05:35:07 GMT **Also Read: [Do not be Fooled by Crypto Quiz Games!](https://bitquery.io/blog/crypto-quiz-games-or-scams)** ### Basic ICO Mechanics So how it actually happens? In a **decentralized** world, there is no central authority, which sells tokens and ensures the correctness of conditions. Instead, there is a **smart contract**, provisioning the token sales.The simple example of how it actually works is shown on the diagram_:_ ![Basic ICO Mechanics](https://miro.medium.com/max/705/1*lZsfVV17MEQ9V8gftFXZyg.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x0000a869f651ad0d9c4fa9f19fe00c2d9fa14b3319a734983bf22dc3f0cf8923) [StatusCrowdsale](https://bloxy.info/address/0x55d34b686aa8c04921397c5807db9ecedba00a4c) smart contract doing here all the job of selling token to the buyer, exchanging 7 ETH to 70K SNT tokens. The tokens are ‘minted’, similar to the cryptocurrency mining process, from the system (zero) address in the system. Though the smart contract for token sale can be quite complex, , the easy lines of code ensures this process: // calculate how much token to give, based on exchange rate and // amount of ETH transfered ( contained in _toFund variable ) uint256 tokensGenerated = _toFund.mul(exchangeRate);// create ( mint ) new tokens assert(SNT.generateTokens(_th, tokensGenerated));// how tokens are generated function generateTokens(address _owner, uint _amount ) onlyController returns (bool) { ... // Update balances and generate event on transfer tokens from system // (zero) address to token buyer updateValueAtNow(balances[_owner], previousBalanceTo + _amount); Transfer(0, _owner, _amount); } If we even do not know the smart contract source code or logic, we still have a knowledge based on the transaction diagram above, which is built completely from the on-chain data: 1. Smart contract exchanged ETH to SNT token in one transaction 2. The same address (token buyer) sent ETH and got SNT token 3. SNT token originated from zero system address, which in common means it was minted Take a look at another transaction for the same smart contract, happened later: ![transaction](https://miro.medium.com/max/552/1*7ncdw3K4768gaeOIq418QQ.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x5b5511dc93c06734cd4046f69997fb98bcc582f789be5c55c095e082c47566b0) Apparently, now the crowd sale smart contract rules did not allow to accept the ETH sent for token sale, probably because of hard cap approached. However, the ETH were accepted and sent back to the sender. An important conclusion is that **you cant rely on ETH amounts**, sent to contracts, or other addresses, as the base for the ICO funds collected. > **Also Read: [FairWin Scam Smart Contract Coinpath Investigation](https://bitquery.io/blog/fairwin-scam-smart-contract-coinpath-investigation)** There are variations of the scheme, where tokens are pre-mined and sent from a “token wallet”. First, the token wallet receives of the total amount of tokens: ![token wallet](https://miro.medium.com/max/482/1*WOTOqSl936WHHyyDl6rlmA.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0xa9b3ebc3d8e52509425e372a4a0c7eddd435e7559377c26c85da2d1ac8a28138) and after sending token from this wallet ([0x778…](https://bloxy.info/address/0x77856d50941e1b5b29e291b083740e05e800883a)): ![token](https://miro.medium.com/max/679/1*545mVjRRUX_SFaTwI5OP1Q.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x9fd32b40af6a04b02f0254460d0f105ab373c1ef150ef5303bfe00d32025b0c7) Variation of this scheme is when token is sent from the same address, as ETH is transferred to: ![scheme](https://miro.medium.com/max/555/1*JYJ8-6_tIJ-f1vATFO9Q9g.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x645b7756dbb48c83eee984ca57c5d940d9293860fa6781d96abb6e1490a4ad01) … or ETH sent directly to the token contract, as in this example: ![token contract](https://miro.medium.com/max/592/1*0KjO9JlJu-3pfffRdXhQzg.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x3568e210799b4becd0092f6fd95719198458db393109fbfc3a26a0a1a9b92e1a) ### Transaction-Based Analysis Knowing the structure of the ICO transaction, we now can extract the data from the blockchain data. We are selecting the transactions from the blockchain following the criteria: 1. Token buyer initiates the transaction with a smart contract 2. Smart contract sends token back to the token buyer in exchange to ETH There are additional rules, required to filter out some other cases, similar to the ICO, but they are not: 1. no other currencies involved 2. no DEX ( decentralized exchanges) smart contracts involved 3. tokens sender did not receive tokens in exchange to ETH The last point here requires some explanation. As we are blindly looking at blockchain transactions, sometimes is very hard to classify, if the token sales is initial or not. ### Secondary Token Sales Look this example, which is extremely similar to an ICO transaction, except that it is actually not: ![Secondary Token Sales](https://miro.medium.com/max/676/1*1k2mB7kQ8e0CjVrckR6iZw.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0x1521ee8f826c642c802b87dbdbb7a7ee2b517b6398dc2b6b5df4d83d20f22283) The only difference between ICO transaction for GNT token lies **outside** this transaction. Tokens, that are traded by this smart contracts, are on secondary market, they already were bought in ICO process, and now traded again. Somebody created a smart contract to automate this process. The only way to filter out these transactions from calculating token sales values is to track the source of tokens, being sold in this transaction. To do that, we have to analyze the graph of token transfers, which preceded this transaction: ![graph](https://miro.medium.com/max/2007/1*4Hn_p5GU0hSstqYxwJp3bw.png) _Source:_ [_bloxy.info_](https://bloxy.info/graphs/0xaaadd77341055d1eed488f184b165ec0e555f6af) As you clearly see from this diagram, GNT tokens were initially bought on ICO for 11,5k ETH by address [0xaaad](https://bloxy.info/graphs/0xaaadd77341055d1eed488f184b165ec0e555f6af).. , transferred to the [smart contract](https://bloxy.info/address/0xa364b925adab4de983e6770277ee13570b573e3a) of interest, creating own trade, ultimately gaining 16.5k ETH from this secondary sale. Not a bad business! ### Which Scheme is More Popular? Now when we see the most common schemes, we can take statistics over the whole blockchain and summarize the transactions of each one. The resulting shows the number of ICOs and corresponding ETH amounts by years: ![Scheme](https://miro.medium.com/max/895/1*AdFsfrJrnlRpDJ-CmBgChg.png) The leader in popularity is “No minting”, “separate token sale contract”. The least popular combination is token smart contract, accepting ETH, with minting. ### Money Now, Tokens Later ICO Smart contract can accept ETH, register the amount of tokens due to transfer to the buyer, and distribute them later. Example of this mechanics is shown below: ![Money Now, Tokens Later](https://miro.medium.com/max/676/1*jX_hxAkMCQMNbft7isDJVA.png) _Source:_ [_bloxy.info_](https://bloxy.info/tx/0xa11be40bbafa1e71b242bd0d0c543b37270d646479a288b74e9f696654cdd238) Smart contract actually does not transfer any tokens on the contract, just updating the due balances and fire an event: // update circulating supply & the ledger address for the customer **tokenBalanceLedger_[msg.sender] = SafeMath.add(tokenBalanceLedger_[msg.sender], _amountOfTokens);** // Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; //really i know you think you do but you don't int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); payoutsTo_[msg.sender] += _updatedPayouts; // fire event **onTokenPurchase(msg.sender, _incomingEthereum, _amountOfTokens, _referredBy);** _Source:_ [_etherscan_](https://etherscan.io/address/0x51c46c33064a9d7171dbdbfc65c3bf2d2ef688a4#code) This type of ICO contracts typically is a part of token contract. Otherwise it would be hard to bind the separate contract to the token distribution in a clear way. To find the ICOs by this scheme, we have to find multiple ETH transfers to ERC20 tokens smart contracts. The statistics of this kind of ICOs by years are: ![statistics](https://miro.medium.com/max/892/1*_ob6utvvAArtYl2d607CSQ.png) Interesting, that by ICO count this type of mechanism is not as popular, as “in-transaction” sale, but by the collected ETH amount it far exceeds. It can be explained by couple of the very large ICO: [TheDAO](https://bloxy.info/address/0xbb9bc244d798123fde783fcc1c72d3bb8c189413) in 2016 and [EOS](https://bloxy.info/address/0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0) in 2017-2018, which used this scheme. ### Money Now, Tokens Not Sure The last in all senses way of doing ICO is taking money on some wallet, with manual token distribution later. People sending ETH (or other crypto currency) to some designated address, as in this example: ![Money Now, Tokens Not Sure](https://miro.medium.com/max/877/1*BHdPmmcU46EjSIfPFJKYcg.png) Source: [bloxy.info](https://bloxy.info/graphs/0xddfe42ddb9c406b9143d85f294583e0f1c00c223) There is no relation in the blockchain between the future distribution of tokens with the collection of ETH on this address. ### Conclusions 1. It is possible to identify transactions, related to initial token sales (ICO) just looking in the blockchain data; 2. Most of ICOs follow the scheme, where tokens are distributed automatically by the separate “token sale” smart contract, in the same transaction as ETH payment; 3. There are multiple variations of the scheme, where tokens are distributed by minting or by transferring pre-minted tokens, in the same, or separate transaction on blockchain. 4. There are ICOs where the amount, in full or partially, may not be derived from the blockchain data. Most of them do not really use the decentralized nature of the blockchain and can be executed on any other payment mechanism. - [Bitcoin and Ethereum Balances and its Entropy](https://bitquery.io/blog/bitcoin-and-ethereum-balances-and-its-entropy) - [MakerDAO Tokens Explained: DAI, WETH, PETH, SIN, MKR](https://bitquery.io/blog/makerdao-tokens-explained)]]>