Celo Mainnet Tokens, Blocks and SmartContract Queries

Celo is a complete stack of new blockchain software, core libraries that run on that blockchain, and end user applications including a Wallet app that communicate with that logic.
You can get insights about Celo Mainnet using Bitquery GraphQL APIs.

Latest blocks in the Celo Mainnet for a particular day

In the following query, the latest blocks along with the height and transactionCount are queried.

{
  ethereum(network: celo_rc1) {
    blocks(
      options: {asc: "timestamp.time", offset: 0}
      date: {since: "2021-08-04", till: null}
    ) {
      timestamp {
        time(format: "%Y-%m-%d %H:%M:%S")
      }
      height
      transactionCount
    }
  }
}

Monthly Volume of a Token in Celo Mainnet

In the following query, the monthly transaction volume in USD along with the count of the active addresses has been queried.

{
  ethereum(network: celo_rc1){
    transactions(
      options: {asc: "date.month"}
      date: {since: "2021-01-01"}
    ){
      txVolUSD: amount(calculate: sum, in: USD)
      count
      activeAddresses: count(uniq: senders)
      date{
        month
        year
      }
    }
  }
}

The Bar Graph below depicts the token volume in USD for every month since the beginning of 2021.

Unique Smart Contracts on the Celo Mainnet

In the following query, the unique smart contract calls in the Celo Mainnet are being queried from the beginning of August 2021.

{
  ethereum(network: celo_rc1){
    smartContractCalls(
      options: {asc: "date.date"}
      date: {since: "2021-08-01"}
    ){
      date{
        date
      }
      count
      contracts: count(uniq: smart_contracts)
    }
  }
}

The below Bar Graph shows the count of Smart contract calls for each day from 1 August 2021 till 4 August 2021.

The below Bar Graph shows the count of Unique Smart Contract Calls for each day from 1 August 2021 to 4 August 2021 (the day this Article was written).

Latest Block Miners in the Celo Mainnet

In the following query, the latest blocks along with the address of the miners and the reward & rewardCurrency are queried.

{
  ethereum(network: celo_rc1) {
    blocks(
      options: {desc: "height", limit: 10}, 
      date: {since: "2021-08-05", till: null}) {
      timestamp {
        time(format: "%Y-%m-%d %H:%M:%S")
      }
      height
      transactionCount
      miner {
        address
      }
      reward
      rewardCurrency {
        symbol
      }
    }
  }
}

Top Celo Mainnet tokens based on Transfer count

There are plenty of tokens deployed in the celo mainnet. In the following query, the top sender and receivers of numerous celo mainnet token currencies are shown along with their amount in USD.

{
  ethereum(network: celo_rc1) {
    transfers(
      options: {limit: 10, desc: "count"}
      date: {since: "2021-08-01", till: null}
    ) {
      currency {
        symbol
        address
      }
      count
      senders: count(uniq: senders)
      receivers: count(uniq: receivers)
      days: count(uniq: dates)
      from_date: minimum(of: date)
      till_date: maximum(of: date)
      amount(in: USD)
    }
  }
}

The Pie Chart below depicts the count of different currencies available in the Celo Mainnet.

Latest Smart Contract Calls in the Celo Mainnet

The following query shows the latest smartcontract calls in the celo mainnet.

{
  ethereum(network: celo_rc1) {
    smartContractCalls(
      options: {desc: "block.height", limit: 10, offset: 0}
      date: {since: "2021-08-01"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      address: caller {
        address
        annotation
      }
      smartContract {
        address {
          address
          annotation
        }
      }
      smartContractMethod {
        name
        signatureHash
      }
      transaction {
        hash
      }
    }
  }
}

Latest Transactions in the Celo Mainnet

In the following query, the latest transactions in the Celo Mainnet are shown. The transactions are filtered out in such a way that the block with the maximum height is shown first in the result. The sender’s address along with the transaction hash and the currency symbol are displayed.

{
  ethereum(network: celo_rc1) {
    transactions(
      options: {desc: "block.height", limit: 10}
      date: {since: "2021-08-10", till: null}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      sender {
        address
      }
      hash
      currency{
        symbol
      }  
    }
  }
}

Smart Contracts burning Maximum gas in the Celo Mainnet

In the following GraphQL query, Smart Contracts with the maximum gas value are shown along with the Smart Contract’s address, the gas value and the average gas value for that particular Smart Contract address along with the count.

{
  ethereum(network: celo_rc1) {
    smartContractCalls(
      options: {desc: "gasValue", limit: 10, offset: 0}
      date: {since: "2021-08-08"}
      external: true
    ) {
      smartContract {
        address {
          address
          annotation
        }
      }
      gasValue
      average: gasValue(calculate: average)
      count
    }
  }
}

The Pie Chart below shows the distribution of Smart Contract Address and their Gas Value burned.