The idea for this project has emerged when I joined TBill liquidity pool and realized the only way to check the LP info was through a desktop PC. It wasn't possible to see the data about the pool on a mobile device while using hardware wallet. After a bit of investigation me and Maxime found out that the official GPool staking page is using open APIs so we've decided to create for the community a dashboard that can be used on any device. Moreover this turned out to be a great opportunity to offer the liquidity providers a more detailed insight into both the LP overall condition as well as their own investment performance. As you can see later in an NFTs chapter, we've also built a so far non-existent overview of all the NFTs related to the LP including all the important sales information together with historical price charts.
The dashboard is split into multiple pages. Each page provides specific information about the liquidity pool. In comparison to the original Staking panel, the dashboard contains multiple brand new indicators and metrics (marked in italic in the description below) and also many graphs for a visual representation of the data.
General information about the TBill liquidity pool.
- Total LP Activated (USD) + chart
- Total Activated TBILL + chart
- Total Activated TFUEL + chart
- Total Rewards + chart
- Number of wallets in LP (wallet distribution based on percentage in LP) + chart
- TBill rebase data (current price, rebase target, positive/negative price)
Information connected to a specific wallet.
- Daily and total rewards + charts
- Tbill and Tfuel amount available in the wallet
- My NFTs
- Total Value Locked (USD)
- Total Activated TBILL
- Total Activated TFUEL
- LP statistics (position/rank, LP percentage, number of days in LP)
- Theta wallet balance (including Theta/TFuel staking)
TBill uses specific NFTs to boost rewards. The NFTs are for sale on opentheta.io (secondary market) which also requires to have a wallet connected. Our dashboard fetches information from OpenTheta APIs about the NFTs that are connected to TBill LP and provides a unique NFT market overview. While on opentheta.io there's only an information about recently sold NFTs, here you can find also:
- Secondary Market Stats
- Number of sold NFTs for each type
- Quantity currently available for sale
- Price for cheapest available NFT (TFuel and USD) per type
- Average prices for next 5 available NFTs per type
- Sales history chart
- Separate chart for each NFT type
How does it work
Tbillstats.io relies on data provided by different sources. We fetch data from GPool.io, OpenTheta.io and ThetaScan.io. Some of the data is fetched with Azure Functions and saved in MSSQL DB so we can provide charts with historical data. Wallet related data is fetched directly from GPool APIs and is not stored (not storing wallet data on our server was one of the initial principles we set at the very beginning of this project).
TBillStats.io technical components
The front end is written C# (.NET 5.0) and uses Razor Pages. There is an API which fetches data from a DB and is also used as a "proxy" to get around Cross-Origin Resource Sharing (CORS) for the API calls outside of the dashboard domain.
We've chosen Azure SQL to store the data mainly because of easy scalability, backup and high availability provided by Azure.
There are several Azure Function set up with timer trigger to regularly fetch data about LP.
- Get LP stats (including total value locked in LP, total rewards distributed, TBill and TFuel USD price).
- Info about each wallet participating in LP. Position/Rank and percentage share.
- Multiplier NFT info from OpenTheta.io. To provide an easy access to sold NFTs and to be able to see which NFTs and at what price are available on the market.
- Fetch info about new NFTs. We are unable to fetch information about each an every NFT at the time it has been minted.
This API is using hardhat.org to get tokenURI for an NFT that is not yet known to our dashboard. When using API from thetascan.io we are able to fetch only a contract and a tokenID for each NFT that is connected to a given wallet. Therefore we've set up a functionality that fetches tokenURI from blockchain using hardhat. The information from tokenURI is then parsed and saved in our database.
We don't store the connection between wallet and NFTs. Only the information about NFT is stored in database, so we can display information like name, multiplied amount and boost percentage. The connection between wallet and NFT is made when user enters wallet on the page.
This way we can ensure that everyone can see their NFTs.
Accomplishments that we're proud of
We are proud of providing a useful service to the community. The dashboard was met with a very positive feedback from the liquidity providers and is being used on a daily basis by a large amount of them. Our work has also been recognized and appreciated by the GPool team.
We have around 2900 unique visitors in total, between 800 and 900 visitors per day and 27000 pages displayed daily on average. These numbers keep rising every day as more people join the liquidity pool.
We quickly reflect any changes to the pool (after the new NFT booster levels were introduced, the dashboard was adapted to it in less than 48 hours) and we're in touch with the community on a daily basis to answer questions and address issues.
What's next for TBillStats.io
The community members are actively participating on the future of the dashboard by suggesting and requesting new features. We keep the list of existing and upcoming features in our GitHub repository.
Apart from keeping up to date with with GPool we would like to:
- Run our own Guardian Node and create a delegated guardian node with 0% fees to help the community
- Take the data from the Guardian Node in order to have our own access to the blockchain
- Grow our development team so we can focus on other projects within Theta ecosystem