Cover Image for Arbitrum Ecosystem: A Comprehensive Look Using the Bitquery API​

Arbitrum Ecosystem: A Comprehensive Look Using the Bitquery API​

Arbitrum
Blockchain
NFTs
Tokens
DEX Trades

Today we will discuss getting all the data from Arbitrum which is a layer-2 solution for Ethereum. You can use Arbitrum chain to do all things you do on Ethereum — use Web3 apps, deploy smart contracts, etc., but your transactions will be cheaper and faster.

Anyone can access the basic analysis without a single line of code through Arbitrum Bitquery Explorer. If you want to learn more about Bitquery Protocol's data capabilities, you can read our article about Opensea API.

Note — We are using Streaming APIs (v2) to get the following data; you can also turn them into WebSocket simply using Graphql Subscription.

You can run the following queries here.

Arbitrum Ecosystem Overview and Growth Trends

Arbitrum TVL

To get the Total Value Locked in Arbitrum Ecosystem,we have to get the value locked in Escrow Smart Contracts on Ethereum, which we can do by getting the smart contract address of the Generic Escrow Contract(For USDC and USDT), DAI Escrow Contract and ETH Escrow Contract and Filter out their token balances, ETH balance accordingly in the query below

    query ($network: EthereumNetwork!) {
  ethereum(network: $network) {
    address(
      address: {in: ["0xcEe284F754E854890e311e3280b767F80797180d", "0x8315177aB297bA92A06054cE80a67Ed4DBd7ed3a", "0xA10c7CE4b876998858b1a9E12b10092229539400"]}
    ) {
      balances(
        currency: {in: ["0xdac17f958d2ee523a2206206994597c13d831ec7", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "0x6B175474E89094C44Da98b954EedeAC495271d0F"]}
      ) {
        value
        currency {
          address
          symbol
          tokenType
        }
      }
      balance(in: USD)
    }
  }
}
{
  "limit": 10,
  "offset": 0,
  "network": "ethereum",
  "address": "0xcEe284F754E854890e311e3280b767F80797180d"
}

The tvl comes around to be 3.5 billion USD aside from the tokens minted inside the chain.

Transaction Volume

To get the transaction Volume we can aggregate the transaction data according to blocks and then aggregate the blocks according to the day in the query below

query ($network: evm_network, $from: String, $till: String) {
EVM(network: $network, dataset: combined) {
 Transactions(
   orderBy: {descending: Block_Date}
   where: {Block: {Date: {till: $till, since: $from}}}
 ) {
   ChainId
   Block {
     Date
   }
   count
 }
}
}
{
"network": "arbitrum",
"from": "2023-10-17",
"till": "2023-10-24",
"dateFormat": "%Y-%m-%d"
}

tx countTransaction Volume growth

Number of Active Users

To get the analysis of Active Users on a daily basis, we can aggregate the Transactions block-wise and aggregating the sender of each transaction as in the query below

    query ($network: evm_network, $from: String, $till: String) {
  EVM(network: $network, dataset: combined) {
    Transactions(where: {Block: {Date: {till: $till, since: $from}}}) {
      ChainId
      Block {
        Date
      }
      senders: uniq(of: Transaction_From)
    }
  }
}


    Parameters

    {
  "network": "arbitrum",
  "from": "2023-10-11",
  "till": "2023-10-18",
  "dateFormat": "%Y-%m-%d"
}

Daily Active Users Over the Past Year on Arbitrum

The Spike seen on the above graph is due to the massive airdrop of ARB token which attracted many peeps from all over different chains to get a piece of pie.

Number of deployed contracts

To get the deployed contracts, we can filter out all the smart contract calls by using Create: True and then aggregating them on a day basis in the query below

query ($network: evm_network) {
  EVM(network: $network, dataset: combined) {
    Calls(where: {Call: {Create: true}}, orderBy: {descendingByField: "Block_Date"}) {
      Block {
        Date
      }
      count
    }
  }
}
{
  "network": "arbitrum"
}

Deployed Contracts on a daily basis

Top DEXs on Arbitrum

To analyze the top DEXs on Arbitrum, a separate database cube exists on bitquery named DEXTrades in which we can aggregate the data based upon the contract of DEX protocol and then get the coins supported and trades on each DEX as in the query below

query ($network: evm_network, $limit: Int!, $offset: Int!, $from: String, $till: String) {
  EVM(dataset: combined, network: $network) {
    DEXTrades(
      limit: {count: $limit, offset: $offset}
      where: {Block: {Date: {since: $from, till: $till}}}
      orderBy: {descending: Trade_Dex_ProtocolName}
    ) {
      ChainId
      currencies: uniq(of: Trade_Buy_Currency_Name)
      contracts: uniq(of: Trade_Dex_SmartContract)
      trades: count
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
          ProtocolVersion
        }
      }
    }
  }
}
{
  "network": "arbitrum",
  "limit": 10,
  "offset": 0,
  "from": "2023-07-12",
  "till": "2023-10-19",
  "dateFormat": "%Y-%m-%d"
}

Top DEX by the number of trades.

To get more interactive graph head onto Bitquery Explorer.

DEX trades on a timely basis

For analyzing the growth of all the DEXs on Arbitrum in a timely manner, we have to aggregate the DEX trades on the basis of the block which is then aggregated on a Daily time period in the query below

query ($network: evm_network, $from: String, $till: String) {
  EVM(dataset: combined, network: $network) {
    DEXTrades(
      where: {Block: {Date: {since: $from, till: $till}}}
      orderBy: {descending: Block_Date}
    ) {
      Block {
        Date
      }
      ChainId
      count
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
          ProtocolVersion
        }
      }
    }
  }
}
{
  "network": "arbitrum",
  "limit": 100,
  "offset": 0,
  "from": "2023-10-17",
  "till": "2023-10-24",
  "dateFormat": "%Y-%m-%d"
}

DEX trade Growth

Top DeFi Protocol on Arbitrum

To get the top DeFi protocols, we have to do a bit of different logic as there are new protocols added to the chain every day in different categories ranging from gaming to perpetual trading and much more.

So to get top protocols we have to get the top transferred tokens in the Arbitrum ecosystem and get the count of their transfers, count of receivers/senders, and the sum amount of tokens transferred to get a gist of top protocols which is done in the query below


query ($network: evm_network, $from: String, $till: String) {
EVM(dataset: combined, network: $network) {
  Transfers(
    limit: {count: 30}
    where: {Block: {Date: {since: $from, till: $till}}}
    orderBy: {descendingByField: "count"}
  ) {
    sum_amount: sum(of: Transfer_Amount)
    count
    receivers: uniq(of: Transfer_Receiver)
    senders: uniq(of: Transfer_Sender)
    Transfer {
      Currency {
        Symbol
        SmartContract
      }
    }
  }
}
}


{
"network": "arbitrum",
"offset": 0,
"from": "2022-10-11",
"till": "2023-10-18",
"dateFormat": "%Y-%m-%d"
}

So from the query above the top protocols come to be GMX(Defi), Realm(Gaming), Stargate(Bridging & Staking), Camelot(Defi), Dopex(Defi), and Radiant(Defi).

Top wallets using Arbitrum

To get the top wallets, we have to aggregate the transfers by the walled contract of the sender in the query below

query ($network: evm_network, $limit: Int!, $offset: Int!) {
 EVM(network: $network, dataset: combined) {
   Transfers(
     limit: {count: $limit, offset: $offset}
     orderBy: {descendingByField: "count"}
   ) {
     ChainId
     count
     Transaction {
       From
     }
     count
   }
 }
}
{
 "network": "arbitrum",
 "limit": 10,
 "offset": 0,
 "till": "2023-10-20",
 "from": "2023-07-01",
 "dateFormat": "%Y-%m-%d"
}


Top wallets on Arbitrum with Top transfer count

Validator Count on Arbitrum

We can count active Validators for each day through the dataset named MinerRewards(Pre-Paris Maxxis!) by aggregating data block-wise on a daily basis in the query below

query ($network: evm_network, $from: String, $till: String) {
EVM(dataset: combined, network: $network) {
 MinerRewards(
   orderBy: {ascending: Block_Date}
   where: {Block: {Date: {since: $from, till: $till}}}
 ) {
   Block {
     Date
   }
   ChainId
   mainers: count(distinct: Block_Coinbase)
 }
}
}
{"network":"arbitrum","limit":10,"offset":0,"from":"2023-10-17","till":"2023-10-24","dateFormat":"%Y-%m-%d"}

Daily Active Developers

We can get the active developers each day by counting unique smart contract deployers each day by aggregating them on a daily basis of Blocks in the query below

query ($network: evm_network) {
EVM(network: $network, dataset: combined) {
 Calls(where: {Call: {Create: true}}, orderBy: {descendingByField: "Block_Date"}) {
   Block {
     Date
   }
   deployers: uniq(of: Call_From)
 }
}
}
 {"network":"arbitrum"}

Top Development Teams on Arbitrum

To get the top developer on Arbitrum, we take the Calls Dataset filter out the contract creation calls, and aggregate them upon the caller field in the query below

query ($network: evm_network, $from: String, $till: String) {
EVM(network: $network, dataset: combined) {
 Calls(
   where: {Call: {Create: true}, Block: {Date: {since: $from, till: $till}}}
   orderBy: {descendingByField: "count"}
 ) {
   Call {
     From
   }
   count
 }
}
}
{
"network": "arbitrum",
"from": "2023-07-01",
"till": "2023-10-20"
}

Some interesting results came out of the above query, the top contracts deployed are of ERC-4337(Account Abstraction) Smart Contract Wallets, and the top abstraction SDK providers are Safe Proxy and ZeroDev. The top teams utilizing the cutting edge tech
are Sports AMM Overtime, Holograph, and Thales AMM.

Apart from the Smart contract wallets, the top hard-working devs are of Timeswap Protocol, Across Protocol, and LogX Protocol.

Another booming category is of wallet providers using account abstraction like Wallet Factory, Ambire Wallet, and BlockTo Wallet.

That is it Folks, As we can see from the maximum of the charts above the maximum activity on Arbitrum Chain was around March as the biggest Airdrop of the year of the biggest L2 at the moment happened on Mar 23 and the volume stable after that till recent times. This is a bit due to the bear market and a bit due to less money coming in the market from retail.

But Builders Gonna Build, go!!

This blog was written by guest author Nitin.

Subscribe to our newsletter

Subscribe and never miss any updates related to our APIs, new developments & latest news etc. Our newsletter is sent once a week on Monday.