SubQuery Customer Case Study: Moonbeam

SubQuery Network
4 min readFeb 7, 2024

SubQuery is the Universal Web3 data indexing toolkit. SubQuery enables anyone to index, transform, and query blockchain data to power their applications. In this Customer Case Study series, we’ll hone in on how one team uses SubQuery to elevate and enhance their project via the seamless provision of mission-critical data.

INTRODUCTION

Moonbeam is a platform for cross-chain-connected applications that unite assets and functionality from many blockchains.

Moonbeam has introduced the innovative concept of Orbiters in its ecosystem, where a single collator slot efficiently rotates among multiple collator machines. This allows community members to run a collator without the burden of shouldering the entire cost of a dedicated collator slot.

However, the native Orbiters pallet lacked out-of-the-box support from block explorers. This posed challenges in tracking blocks produced by Orbiters, hindering effective issue resolution and impeding users from monitoring their Orbiter’s performance. Two key issues eventually arose:

  1. On-chain blocks were attributed to the Orbiter pool rather than the individual Orbiter.
  2. Orbiters were not expected to continuously produce blocks but only during their turn.

EXECUTIVE SUMMARY

SubQuery’s innovation creates a unified data indexing solution for Moonbeam by introducing a versatile tool capable of querying both EVM logs and Substrate.

HOW MOONBEAM USES SUBQUERY

To solve the issue of its Orbiters, Moonbeam created a SubQuery indexer which kept track of each block produced by the Orbiter pool and assigned it to the proper Orbiter.

‘By using SubQuery Managed Services, we were able to easily share this indexer with the Orbiter community so they could ensure their machine was properly producing blocks, as well as keep track of the rewards they were receiving.

After this, we also started using SubQuery indexers for internal monitoring, allowing us to keep track of specific on-chain extrinsic in situations where we needed more specific filtering than what our block explorers provided.’
-
Sicco Naets, Head of Ecosystem at Moonbeam

PROBLEMS MOONBEAM FACED BEFORE SUBQUERY

Moonbeam is an Ethereum-compatible smart contract platform on the Polkadot network that makes it easy to build natively interoperable applications. This Ethereum compatibility allows developers to deploy existing Solidity smart contracts and dApp frontends to Moonbeam with minimal changes. As a parachain on the Polkadot network, Moonbeam will benefit from the shared security of the Polkadot relay chain and integrations with other chains that are connected to Polkadot.

Before SubQuery, there was no open-source tool that allowed developers to flexibly collect and query data across both Ethereum and Polkadot/Kusama. Without a strong indexing solution, Moonbeam’s innovative Ethereum/Substrate compatibility, which allows smooth interaction between different blockchain networks, loses its effectiveness. This absence would confine decentralised applications (dApps) within Moonbeam to the smart contract layer, restricting their potential reach to users on multiple networks.

“Before SubQuery, we would often have to create our own scripts that would continuously monitor the network for whatever we were tracking. We would often have to decide between doing a quick script that might not be as robust, or spending a lot of time setting up a robust script to index what we wanted. Besides the scripts, we would have to set up the entire infrastructure to run these scripts, and in the case we needed indexing, we would also need to set up the database infrastructure, all of which took effort and time. It was also difficult to give the community access to this indexed information securely, as the scripts were running in our internal network.”
-
Sicco Naets , Head of Ecosystem at Moonbeam

HOW SUBQUERY HELPED MOONBEAM

With SubQuery’s innovation, one tool can now query and filter EVM logs and transactions in addition to Substrate data sources. This partnership with Moonbeam brings a complete and unified data indexing solution for all blockchain data within Moonriver and will greatly benefit Moonriver’s growing application ecosystem. This is evident from the Moonriver-based teams such as Yuser, Solarbeam, Moonbeans,which and Zoombies, that all jumped on board to leverage SubQuery.

“We reduced costs once we started using SubQuery and SubQuery’s Managed Service as we didn’t need to run everything on our infrastructure in the cloud. Our processes also became faster and monitoring is much more robust as we can trust the SubQuery indexer not to miss any events.”
-
Sicco Naets, Head of Ecosystem at Moonbeam

Key Resources

SubQuery Developer documentation: https://university.subquery.network

Moonbeam SubQuery documentation: https://docs.moonbeam.network/builders/integrations/indexers/subquery/

Github Repository for Moonriver EVM SubQuery Starter Project: https://github.com/subquery/tutorials-frontier-evm-starter

Moonriver SubQuery Starter Project: https://explorer.subquery.network/subquery/subquery/moonriver-evm-starter-project

SubQuery Moonbuilders Workshop:https://www.crowdcast.io/e/moonbuilders-ws/register?session=10

Moonbeam Website:https://moonbeam.network/

About SubQuery

SubQuery Network is innovating web3 infrastructure with tools that empower builders to decentralise the future. Our fast, flexible, and open data indexer supercharges dApps on over 150 networks, enabling a user-focused web3 world. Soon, our Data Node will provide breakthroughs in the RPC industry, and deliver decentralisation without compromise. We pioneer the web3 revolution for visionaries and forward-thinkers. We’re not just a company — we’re a movement driving an inclusive and decentralised web3 era. Let’s shape the future of web3, together.

Linktree | Website | Discord | Telegram | Twitter | Blog | Medium | LinkedIn | YouTube

--

--

SubQuery Network

SubQuery is here to help you transform and query the world’s data for a web3.0 future. https://subquery.network/