Skip to main content

Darknode Stats

How To Reference

The RenVM subgraphs provides a way to query Ren's on-chain activity in a more efficient manner than making direct contract calls. It provides a GraphQL interface that can be used to lookup information about darknodes, assets and mints/burns.

Networks

A RenVM subgraph is available on the following networks:

Querying

In order to query the RenVM subgraphs, you will need a GraphQL library. Some options are:

  1. The playground below
  2. An SDK such as Apollo - see others at https://graphql.org/code/.
  3. A desktop client such as Insomnia or Postman

The subgraphs expose a single POST endpoint that allows you to specify what data to query. A query looks like this:

{
# Get the darknode with the highest BTC balance.
darknodes(first: 1, orderBy: balanceBTC, orderDirection: desc) {
id
operator
registeredAt
balances(where: { symbol: "renBTC" }) {
symbol
amountInUsd
}
}
}

Posting this to the Ethereum Mainnet API url returns:

{
"data": {
"darknodes": [
{
"balances": [
{
"amountInUsd": "7264.59",
"symbol": "renBTC"
}
],
"id": "0x9fec6514e6a83fa21f5da810ff45dc04dda40670",
"operator": "0xd8a0bc22290c42f35dfa010f4233b81a3ae3dd2c",
"registeredAt": "1590525958"
}
]
}
}

Try it now

Submit queries to the Mainnet Ethereum subgraph. The query will be reset when you leave the page.

Click the Docs button in the top-right to explore the schema.