TRX1 Dev Blog #16 (April 2022)

Thor Rune Xchain
6 min readMay 28, 2022

In this episode, we will talk about the price divergence notifications, new NodeOp features, Rune coin supply, new commands, THORNode visualization and the beginning of building a bot for Twitter.

Rune supply

As you know, there are a few types of Rune tokens. They are

  • Native THOR.RUNE
  • ETH.RUNE is an ERC20 token on Ethereum
  • BNB.RUNE is a BEP2 token on Binance Chain

The latter two were needed in the early stages of project development and served as collateral notes. Later, BEP2 Rune labored devotedly in a single-chain version of the ChaosNet. Does anyone remember BEPSwap? The good old days.

By now, the native Rune is already living in its network. And everything we could have dreamed of comes true. However, the old kinds of Runes didn’t disappear. Centralized exchanges do not rush to accept deposits in native Runes.

So, how many coins are there? And how many of them are circulating and how many are locked and where? Are there really exactly half a billion Runes?

There were discussions about this in Discord, and there was no clear answer to the questions.

Back in March I made a script to dynamically calculate the number of coins. Of course, this script was shortly incorporated into the Telegram bot. To see the current distribution you can use /supply command and find “Rune supply” button under the “Metrics” menu.

This code determines the total supply for ERC20, BEP2 and native Runes. For ERC20 and BEP2 asset we subtract from these numbers the amounts of coins ready to be burned. Also, obviously not all native coins circulate. Some are blocked for the team and early investors. And some coins are not yet deployed in reserves. A small number of coins were irretrievably lost due to network fluctuations during challenging and pivotal moments in its history. Therefore, not counting the coins for burning in Asgard, we actually have a little less than 500 millions of Rune in existence. In the image below, you can see a breakdown of the assets and where they are locked.

Rune coins supply breakdown

New commands

Speaking of which, I added three new commands to the Telegram bot.

First of all, /supply is a quick command to get the supply information from the section above.

The /pools command displays the top pools (by APY, by daily volume and by liquidity depth).

And lastly /voting is handy for accessing the current state of Node Mimir voting.

Next time, you just hit the slash and you’ll see these commands hints in the list.

Price divergence notifications

The community has asked me to do this feature many times. At first, I didn’t give this thing a high priority. However, the demands kept rolling in. Finally, the decision was made to tackle this task.

At first, it is going to be a rather simple model. Notifications are sent to the public channel if the price difference exceeds 5% or falls below 2%.

High divergence
And low divergence

Indeed, the price divergence is not something good for THORChain. These notifications will assist users in conducting arbitrage more easily and timely which should lead to the consistency of Rune prices on the multiple exchanges.

And the plan for May is to make price notifications personal and customizable. You will learn more about this in future articles.

NodeOp tools

In April, some changes and new features were made to the NodeOp tools.

For the beginning I added a watchdog timer. What is it for? If unexpectedly the bot loses communication with Midgard and the node, users will be notified so that they can temporarily choose an alternative monitoring tool.

Example of watchdog time activity

Second. Due to certain events, I had to quickly prepare replacements for some unavailable third-party services that were used in the bot. For instance, a subsystem for TCP polling was implemented from scratch. This thing allows the bot to monitor the online status of RPC and Bifrost services of each node by periodically checking the ability to connect to certain ports over TCP. Node operators are able to receive notifications when their nodes go offline and come back.

The same situation occurred with the block height tracker. I had to remake it quickly, too.

I also added an API endpoint to get information about nodes’ IP address, geolocation and ISP. It will come in handy in the future.

Finally, I’m starting to build a foundation for forwarding generic notifications to Slack channels. You will be able to turn them on for your channel in the same web panel (https://settings.thornode.org/), where the settings for node status notifications also reside.

General alerts at Slack

THORNode setup

In order for the bot to have a reliable and highly accessible source of information, it was decided to set up our THORChain full node. This is not a validator, but just a node without a bond, connected to the network. A sufficiently powerful dedicated server was ordered and the software was installed on it according to available guides. It will take the server a few days to synchronize and catch up to the current block height. After testing for stability, I will switch the bot to this node.

Twitter bot

The idea of bringing our notifications to Twitter has been around for months. I’ve applied for a Twitter app developer account more than a few times before, but I’ve always been rejected without any explanation. Their politics are driving me crazy. In the end I borrowed an elevated developer account from my friends and started building the first prototypes of the THORChain monitoring bot for Twitter. The first results of the work will be presented in the next month.

Miscellaneous

  • Fixed behavior of the “Back” button in the “Metrics” menu
  • Added block time to the “Metrics” menu
  • For new Mimirs, the source is now correctly displayed
  • Nginx configuration updated
  • Web panel: fixed a bug with settings loading
  • Improving code reliability and fault tolerance
  • Code refactoring

Links

THORChain Alert channel (English): https://t.me/thorchain_alert

THORChain Alert channel (Russian): https://t.me/thorchain_alert_rus

THOR Infobot: https://t.me/thor_infobot

Source code: https://github.com/tirinox/thorchainmonitorbot

Bonus. Slack app installation link: https://settings.thornode.org/slack/install

THORViz

No-no. I haven’t completely abandoned my experiments in graphical visualization of THORChain network. When there are no urgent tasks, I switch to it again.

In the image below you can see all THORChain nodes, the brighter ones are active, the rest are waiting for activation or are in other statuses.

Demo

In the first versions, there will be the following types of grouping by

  • …node status
  • …software version
  • …cloud provider

These things are already completed. Now I need to refine some things related to glitches on some GPUs.

Then, I’ll add the geolocation on the globe, historical status and other things. It’s going to be fun.

Conclusion

Here are the plans for May:

  • Release the first version of Twitter bot
  • General alerts for Slack
  • Personal price divergence alerts
  • Continue working on THORViz

Please contact me if you want to report issues and bugs in my projects or want to suggest new features.

My Discord handle: Old1#0517

My Telegram handle: https://t.me/account1242

Thank you for reading my report, see you soon!

--

--