Staking STBL on AlgoFi
Question 33: Let's look at how much STBL, Algorand's First Stablecoin, has been staked on AlgoFi. Show the stake vs unstake actions over time Show the total number wallets that have staked over time Show the total amount of STBL staked(make sure to account for amounts that have been unstaked.
Methodology
I created one CTE for each operation (stake and unstake), following the hints on the bounty. Each of this CTE has its own structure, explained below, and an additional variable called Operation
with either 'STAKE'
or 'UNSTAKE'
respectively.:
Staking CTE
To identify the staking transactions and retrieve the amount staked, I queried tables algorand.application_call_transaction act
and algorand.asset_transfer_transaction att
, joining them ON act.tx_group_id = att.tx_group_id
Amount staked is defined as att.asset_amount/pow(10,6)
The following constraints were used:
app_id = 482608867
for AlgoFi- decoded note for staking as
'Market: mt'
Unstaking CTE
Here, a different structure needs to be used, since the above structure changing the decodede note to 'Market: rcu'
yields no results.
After some investigation, all the information seems to be available in algorand.application_call_transaction
table, so no join is necessary.
Amount unstaked is defined as -tx_message:dt:itx[0]:txn:aamt/pow(10,6)
.
The following constraints were used:
try_base64_decode_string(tx_message:txn:note::string) = 'Market: rcu'
tx_message:txn:apid = 482608867
Final query
The results of these CTEs are then joined with UNION
and a count of tx_id and sender as well as the sum(amount) are aggregated by date and Operation to distinguish between STAKE and UNSTAKE
Conclusion
Some very interesting patterns can be recognised in staking/unstaking behaviour. I would like to extend this analysis to add price action vs NET STBL from the tables to be able to correlate with net stake which would really answer the question if both variables are correlated, this will be extended in the future.
Net positive peaks correspond with Christmas season, so it might have played a role by getting recommendations to stake STBL amongst family and friends. The net peaks, both positive and negative, are declining in time, hinting at the possibility that STBL staking has lose momentum compared to other stablecoin staking options. Maybe the juicy benefits were already drown and investors look for higher interest somewhere else.
I had some troubles finding the unstaked amount. Fortunately, as for many other issues, the discord community came to the rescue and user @The Laughing Man hinted at the solution. Many thanks to him.
A similar behaviour can be seen on the total amount staked / unstaked but a little more extreme. After the initial peak, reaching 700k staked STBL, there is av ery low volume week from January 10th and 17th in both directions, probably anticipating the unstaking peak which reached 425k on January 21st. Then volume tends to decline.
On the Net graph, the positive peak happened all in 2021 (December 23rd, 30th and 31st with ca. 500k and 300k twice) while the negative peaks happened on 2022 (January 3rd, 21st and February 20th) These peaks are declining in time.
As a comparison, Price Action for STBL has been added as an imagen from LiveCoinWatch but no trends can be identified (surge in price don't correlate very much to spikes in net amount.