# A Beginner's Guide To Exploring Ethereum Mainnet Data

**URL:** https://community.bitquery.io/t/a-beginners-guide-to-exploring-ethereum-mainnet-data/1275
**Category:** GraphQL Tutorials
**Created:** [November 11, 2022, 1:41pm UTC](https://community.bitquery.io/t/a-beginners-guide-to-exploring-ethereum-mainnet-data/1275 "2022-11-11T13:41:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bitquery-support](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bitquery-support](https://community.bitquery.io/u/bitquery-support)
#### Post date: [November 11, 2022, 1:41pm UTC](https://community.bitquery.io/t/a-beginners-guide-to-exploring-ethereum-mainnet-data/1275/1 "2022-11-11T13:41:32Z")

</div>

# A Beginner’s Guide To Exploring Ethereum Mainnet Data

## What is the Bitquery Explorer?

Bitquery Explorer is a visual dashboard that allows users to view a list of different blockchain projects and smart contracts.

To access the project dashboard, follow these steps:

- Go to[https://explorer.bitquery.io/](https://explorer.bitquery.io/) you fill find listed the available explorers for different projects.

- Upon clicking any of them, you’ll be taken to the specific project’s dashboard.

- Under the[Smart Contract Platform Explorers](https://explorer.bitquery.io/platform/smart_contract) Tab you will find the link to open the Ethereum Mainnet.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/f3a3032e59c8bca105b66c2ec319fa7ebe02ee4a.png)

When you open the tab, you will see a list of various sub-tabs, including Blocks, Gas Analytics, Transfers, Protocols, and others. Each focusing on various aspects of the blockchain data.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/13470af3fd029e46e5aaa42484589e5fd53edfc0.png)

You can see the date range for which the data is displayed at the top right of the screen.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/5ca3884e3f1e7f12179589ee9d4e45f9fb3ff0a4.png)

Let’s say you want to explore the data on Gas prices, click on the tab ‘Gas Analytics’

Click on the “Get API” button at the bottom of any graph that you want to understand. This will open a GraphQL IDE tab.

## Analysing Data With the GraphQL IDE

### The IDE

Bitquery has a custom GraphQL online IDE ([GraphQL IDE - Blockchain Data API](https://graphql.bitquery.io/ide) ) that allows you to create a query using the helper tab on the side.

A query is shown below that fetches transaction counts for different protocols with trade amounts greater than 1.5 since yesterday.

```auto

query MyQuery {

  ethereum(network: matic) {

    dexTrades(

      buyAmount: {gt: 1.5}

      any: {date: {after: "2022-10-24"}} #add yesterday's date in after

    ){

      #what data you want to see for the criteria

       protocol

      trades: count

     

    }

  }

  }

The response would look something like this:

# Sample Response

{

  "ethereum": {

    "dexTrades": [

      {

        "protocol": "Balancer Pool Token",

        "trades": 672

      },

      {

        "protocol": "Balancer v2",

        "trades": 50586

      },

      {

        "protocol": "Dodo",

        "trades": 6809

      },

      {

        "protocol": "Mooniswap",

        "trades": 64

      },

      {

        "protocol": "Uniswap",

        "trades": 97

      },

      {

        "protocol": "Uniswap v2",

        "trades": 734936

      },

      {

        "protocol": "Uniswap v3",

        "trades": 674756

      },

      {

        "protocol": "Zerox Exchange v2",

        "trades": 1

      },

      {

        "protocol": "Zerox Exchange v4",

        "trades": 9

      }

    ]

  }

}

```

### 1. Prebuilt Queries

Click on “Get API” button below a chart to view the GraphQL query. You can use these prebuilt queries to modify and create your own.

For example, the below query fetches all transactions on the Ethereum Network between two given dates. Parameters “from” and “till” are used to set the date range.

```auto

query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {

  ethereum(network: $network) {

    blocks(

      options: {desc: "height", limit: $limit, offset: $offset}

      date: {since: $from, till: $till}

    ) {

      timestamp {

        time(format: "%Y-%m-%d %H:%M:%S")

      }

      height

      transactionCount

      address: miner {

        address

      }

      reward

      reward_usd: reward(in: USD)

      rewardCurrency {

        symbol

      }

    }

  }

}

# Parameters

{

  "limit": 10,

  "offset": 0,

  "network": "ethereum",

  "from": "2022-10-31",

  "till": "2022-11-07T23:59:59",

  "dateFormat": "%Y-%m-%d"

}

```

### 2. Exploring Custom Queries by Other Contributors

There is a “Explore” button at the top of the GraphQL IDE. Clicking it will open a community-based space to find and contribute queries.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/8c5b91f372cf80646da4538f33706bfbe5091c7a.png)

## Querying Information on DEX

Trading orders on decentralised exchanges are done without the involvement of any intermediaries thanks to smart contracts. Uniswap, for example, uses two smart contracts: an “Exchange” contract and a “Factory” contract. They are automatic computer programs that perform specific functions when certain conditions are met.

Where does a protocol come into picture?

Protocols are merely predefined rules (properties and methods) that smart contracts must follow in order to be implemented. It is up to the contract to implement the methods in accordance with the protocol.

### 1.Trades Executed on the Ethereum Network

Let’s use a GraphQL to query the Ethereum network for the smart contract information related to trades executed after a particular day. Let us limit it to 10 for now.

```auto

query MyQuery {

  ethereum(network: ethereum) {

    dexTrades(options: {limit: 10, desc: "noOftrades"}, time: {after: "yyyy-mm-dd"}) {

      noOftrades: count

      smartContract {

        contractType

        protocolType

      }

    }

  }

}

Here's how a sample response would look:

{

  "ethereum": {

    "dexTrades": [

      {

        "noOftrades": 9035,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v3"

        }

      },

      {

        "noOftrades": 4300,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v3"

        }

      },

      {

        "noOftrades": 3379,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 2601,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 2381,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Balancer v2"

        }

      },

      {

        "noOftrades": 1529,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 1519,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 1352,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 1276,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      },

      {

        "noOftrades": 1230,

        "smartContract": {

          "contractType": "DEX",

          "protocolType": "Uniswap v2"

        }

      }

    ]

  }

}

```

### 2.Latest Trades of a Specific Currency Pair on a DEX Protocol

Now let’s look at the latest trade for SHIBA INU currency exchanged for ELON. In the buyCurrency and sellCurrency fields we include the ERC20 smart contract addresses for the respective coins. Let’s set the Limit to 1 as an example.

```auto

query MyQuery

{

  ethereum(network: ethereum) {

    dexTrades(options: {limit: 1, desc: ["block.height", "tradeIndex"]},

      buyCurrency: {is: "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"},

      sellCurrency: {is: "0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3"}) {

      block {

        height

      }

     

      tradeIndex

      buyCurrency {

        symbol

        address

      }

      buyAmount

      sellCurrency {

        symbol

        address

      }

      sellAmount

      maker {

        address

        annotation

      }

      taker {

        address

        annotation

      }

      protocol

      smartContract {

        contractType

      }

    }

  }

}

Here's how a sample response would look:

{

  "ethereum": {

    "dexTrades": [

      {

        "block": {

          "height": 15882729

        },

        "tradeIndex": "5",

        "buyCurrency": {

          "symbol": "SHIB",

          "address": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"

        },

        "buyAmount": 8764577.259475216,

        "sellCurrency": {

          "symbol": "ELON",

          "address": "0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3"

        },

        "sellAmount": 225712672.7571007,

        "maker": {

          "address": "0x1111111254fb6c44bac0bed2854e76f90643097d",

          "annotation": null

        },

        "taker": {

          "address": "0xe40bca0dbe12d1fbd601ed26e7deb7b46373db77",

          "annotation": null

        },

        "protocol": "Uniswap v2",

        "smartContract": {

          "contractType": "Token"

        }

      }

    ]

  }

}

```

## Analysing An Address

Navigate to the Ethereum Mainnet dashboard from the explorer.

Under the “Transactions” tab, you will find the sender’s address listed. Let us pick one such address and investigate it.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/3a3b185d91968ffde43cc6245a93aceeb35e8be1.png)

Now click on the “Money Flow” tab to visualize the transfer of one currency from other addresses to the current.

- Using the Detail Level slider, you can adjust the count of inbound flows.

- With the Depth Level “inbound”/“outbound” selector, you can increase or decrease the depth of transfers from/to the current address.

**If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info) or email us at [hello@bitquery.io](mailto:hello@bitquery.io). Don’t forget to subscribe to our newsletter to stay updated on the latest news in the cryptocurrency world.**

## 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://blog.bitquery.io/coinpath-blockchain-money-flow-apis) 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://blog.bitquery.io/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.
