Binance DEX: Trades, Transactions, Transfers and Orders

As you already know Binance DEX is a decentralized exchange created by Binance and powered by the company’s Binance Coin (BNB). It offers lower fees and improved security over centralized exchanges. Using Bitquery’s GraphQL API, we can make certain insightful observations regarding Binance DEX.

Today, we will show some of the interesting metrics of Binance DEX and their APIs to get that data.

Trades

Monthly Trades Volume in Binance DEX

Using the query below, we can find out the trades’ count per month in the Binance DEX network.

{
  binance {
    trades(options: {asc: "date.month"}, date: {since: "2021-01-01", till: null}) {
      date {
        month
        year
      }
      count
    }
  }
}

The above query filters the results in ascending order of months and fetches the data since the starting of the year. Here, the count refers to the number of trades which took place in Binance DEX.

The bar graph below, shows the visualization of the trades volume per month in the year 2021.

Top currencies based on Trade Volume in Binance DEX

Getting insights regarding the numerous currencies the Binance DEX trades have taken place gives you a fair idea about the latest market trends.

Here is how you can query the top currencies based on trade volume in Binance DEX.

{
  binance {
    trades(options: {desc: "count", asc: "quoteCurrency.symbol", limit: 1000}) {
      quoteCurrency {
        symbol
        tokenId
      }
      baseCurrency {
        symbol
        tokenId
      }
      count
    }
  }
}

The above query fetches thequoteCurrency & baseCurrency symbol and token id grouped along with the overall count of trades for that particular pair.

The Pie-Chart below, shows the visualization of the different currencies based on trade volume. Notice that the trade involving BNB & VRAB as the quoteCurrency and baseCurrency respectively has the highest volume.

Top Token Trade Pairs with quoteAmount Median on Binance DEX

In addition to the top currencies involved in Binance DEX trades, to get more meaning to the data, we can query the token trade pairs’ baseAmount & quoteAmount. In addition to that, the query gives us insights about the baseAmount’s median and quoteAmount’s median for that particular token trade pair.

{
  binance {
    trades(options: {desc: "count", limit: 1000}) {
      baseCurrency {
        symbol
        tokenId
      }
      quoteCurrency {
        symbol
        tokenId
      }
      count
      baseAmount
      quoteAmount
      median_baseAmount: baseAmount(calculate: median)
      median_quoteAmount: quoteAmount(calculate: median) 
    }
  }
}

In the above query, apart from the previously queried baseCurrency and quoteCurrency, we have asked for the baseAmount & quoteAmount.

Top buyers and sellers data on Binance DEX

It is vital to have information regarding the buyers and sellers along with theirbaseAmount and quoteAmount. The following query would help in gaining insights in that area

{
  binance {
    trades(
      options: {desc: "block.height", limit: 1000}
      date: {since: "2021-01-01", till: null}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      sellOrderId
      seller {
        address
      }
      buyOrderId
      buyer {
        address
      }
      quoteAmount
      quoteCurrency {
        symbol
        name
      }
      baseAmount
      baseCurrency {
        symbol
        name
      }
      transaction {
        hash
      }
    }
  }
}

The query not only shows the address of the seller & the buyer but also gives insights about the baseAmount, quoteAmount & the transaction hash.

Orders

Binance DEX Orders by Date

The following query gives us insights regarding the daily unique orders in Binance DEX.

{
  binance {
    orders(options: {asc: "date.date"}, date: {since: "2021-01-01", till: "2021-07-27"}) {
      date: date {
        date(format: "%Y-%m-%d")
      }
      count(uniq: orders)
    }
  }
}

The Bar-Graph below shows the Orders by Date in the Binance DEX from the starting of 2021 to this date.

Binance DEX Orders by Currencies

We can query unique orders by their baseCurrency and quoteCurrency to get insights about the different currencies involved in Binance DEX orders. The query below shows us how to do the same.

{
  binance {
    orders(options: {desc: "count", limit: 100}, date: {since: "2021-01-01", till: "2021-07-27"}) {
      quoteCurrency {
        symbol
        tokenId
      }
      baseCurrency {
        symbol
        tokenId
      }
      count(uniq: orders)
    }
  }
}

The Pie-Chart below illustrates the volume of orders by baseCurrency and quoteCurrency pair.

Notice that the highest order count is of the pair BUSD:BNB as illustrated in the Pie-Chart verifying the returned values.

Latest Orders in the Binance DEX

Using the following query, you can find details regarding the latest orders placed and their status in the Binance DEX.

{
  binance {
    orders(options: {desc: "block.height", asc: "quoteCurrency.symbol", limit: 10}, date: {since: "2021-07-27"}) {
      block {
        timestamp {
          time(format: "%Y-%m-%d")
        }
        height
      }
      orderId
      address: orderOwner {
        address
        annotation
      }
      quoteCurrency {
        symbol
        tokenId
      }
      baseCurrency {
        symbol
        tokenId
      }
      quoteAmount
      baseAmount
      orderStatus
      buyOrSell: orderSide 
    }
  }
}

The above query shows the top 10 order details of Binance DEX from 27/07/2021. Details like, the ORDER OWNER, quoteAmount, baseAmount, with their respective currencies, buy/sell status & ORDER STATUS will be returned.

Transactions

Monthly Transaction Count in Binance DEX

The following query shows the transaction count of every month in the Binance DEX.

{
  binance {
    transactions(
      options: {asc: "date.month"}
      date: {since: "2021-01-01", till: null}
    ) {
      date {
        month
        year
      }
      count
    }
  }
}

The below Bar graph is for visualizing the outcome of the above GraphQL query

Binance DEX Transaction Types

The following query displays the various Transaction types in the Binance DEX.

{
  binance {
    transactions(options: {limit: 30}) {
      transactionType
    }
  }
}

Latest Transaction in Binance DEX

The following query shows the latest transactions in the Binance DEX.

{
  binance {
    transactions(options: {desc: "block.height", limit: 10}, date: {since: "2021-07-28", till: null}) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      transactionType
      hash
      transactionSource {
        name
      }
    }
  }
}

Transfers

Latest Transfers by Currencies in Binance DEX

In the following GraphQL query, the latest transfers by currencies is shown.

{
  binance {
    transfers(options: {desc: "count", asc: "currency.symbol", limit: 10}, date: {since: "2021-07-30", till: null}) {
      currency {
        symbol
        tokenId
      }
      count
      senders: count(uniq: senders)
      receivers: count(uniq: receivers)
      from_date: minimum(of: date)
      till_date: maximum(of: date)
      amount
    }
  }
}

The Pie-Chart below is a data representation of the Latest Transfers of different currencies in the Binance DEX.

Monthly Transfers Count in Binance DEX

In the following query, the monthly transfer count is generated.

{
  binance {
    transfers(options: {asc: "date.month"}, date: {since: "2021-01-01", till: null}) {
      date {
        month
        year
      }
      count
    }
  }
}

The above Bar Graph shows the Transfer count per month in the Binance DEX.