Skip to content

How to add leaderboards to a crypto game

Leaderboards for crypto games

While researching a bunch of web3 games I’ve found that most of them have a leaderboard. Whether you have a fun elaborate gameplay or repetitive grindy mechanics, whether the game has PvP multiplayer or is mostly singleplayer – you need to have a leaderboard in web3. 

Here’s to how and why.

What is a leaderboard for games? 

A leaderboard means you can direct player engagement and create competitive mode. Competitiveness adds replay value. 

In crypto, leaderboards also mean a deflationary tool, a tool to reward players and create loyalty programs, and a way to add utility to your game.

And it just so happens that Moonstream specializes in creating and supporting leaderboards for crypto games. Our tools are open source. There’s more information on how to add a free leaderboard to your game at the end of this post, but first, let’s talk about what leaderboards can do.

What do you need to add a leaderboard?

First you’d need an indexer that tells you what players are doing in your game. If you have a specific mechanic that you want a leaderboard to focus on, you need to be able to track it. 

Moonstream provides an indexer that doesn’t require a specific smart contract language. You can set it up for any smart contract and see how people are interacting with it live. With games running on EVM-based chains and Starknet – you can use Moonstream to track any smart contract activity. 

Actually, with Moonstream you can also track off-chain player activity. Like any actions performed on your game server or even in Discord, X (formerly known as Twitter), or other social media platforms.

Then you’d need to decide which actions you want to link to what scores. For example, building a silo gives players 30 points, attacking another player’s base – 50 points, saying GM on Discord – 5 points, etc.

From experience, we can say that leaderboards can help with token inflation. Say, your $LOVE token used for breeding farm animals is out of control. You set up a leaderboard that is active for a month that gives players points for breeding farm animals. Boom, $LOVE token has a clear utility now and people are actively burning it to rank high on the leaderboard. Reward the most active players at the top, get more engagement and solve token inflation. 

Other elements that you need to think about when setting up a leaderboard:

  • Displaying the scores
  • Distributing the rewards

When you’re using Moonstream Leaderboard API, you can use Moonstream’s frontend to display scores to players. You can also create your own UI with our API running in the background. Some examples:

Moonstream Portal frontend

Moonstream Portal frontend

Crypto Unicorns Fall Event Leaderboard

Crypto Unicorns Fall Event Leaderboard

Crypto Unicorns Leaderboard

Crypto Unicorns Leaderboard

You can show players’ wallet addresses, their usernames, or even make a leaderboard for specific NFTs and not player wallets. Beside scores, you can display the rewards players get.

The latest addition to our leaderboard tool is a Discord bot. It lets players query their scores and look up all active leaderboards in Discord. You can read more about it here.

Reward distribution

Everyone is talking about airdrops and play-to-airdrop right now. Sure, airdrops are awesome when you’re getting them but are they technically that great when you’re doing them? What happens when there’s an error in the middle of the airdrop? How expensive is it to drop rewards to thousands of players?

That is why for reward distribution you can also use Moonstream Drops. It creates a claiming flow where players can come to Moonstream Portal or your own website and see if they have any rewards to claim. If they do – they can initiate a transaction to claim the rewards. 

You can take care of the transaction fees or put it on players. Either way it’s way more efficient, cheap, has less space for potential errors, and rewards proactive players. If there is an error – the claiming transaction just doesn’t go through and it’s easy to spot and fix. 

How to use Moonstream leaderboards?

To start using Moonstream leaderboards, you need to create a free Moonstream account here.

Then watch this two-minute video for instructions.

Basically, if you already have players’ scores in a CSV or JSON format, you can upload them and create a leaderboard. If you want to get that data by using our Leaderboard API, you’d need to get in contact with us to set it up. 

Any leaderboards with under 100 players are free to run. Either way, you can get in touch with us and request a demo. Thank you for reading!