Delegations On Cosmos

Source: Cosmos

Bounty Question : Let’s explore movement of delegation on Cosmos. When delegators un-stake from one validator and move to another, is there any pattern to where they re-stake? Are users more likely to re-delegate after their validator votes in a way they disagree with? Do they re-align their stake with validators whose values reflect their own? How do validator votes change over the course of a proposal? Share any interesting voting statistics you find. Examine any voting propositions here (example: Prop 82) as a use case to explore these questions.

Overview: Cosmos

The Cosmos ecosystem is a collection of interconnected apps and services built for the future of decentralization. Developers can integrate their blockchains with Cosmos to create an interoperable network of blockchains. Through Cosmos, developers are able to create a network capable of seamlessly transmitting transactions to and from other nodes. By building the “Internet of Blockchains,” creators will retain their own control while also interacting with the broader blockchain ecosystem. As a result, the Cosmos project provides a framework for the harmonious coexistence and development of various blockchains.

Validators : A set of validators secures the Cosmos Hub network, which is based on Tendermint. Votes broadcast by validators contain cryptographic signatures signed by their private key and participate in consensus as full nodes. Besides participating in governance, validators must vote on proposals, and stakes are weighted accordingly. New blocks are committed and revenue is generated for blockchain validation.

Delegators : Choosing validators is the responsibility of delegations in the whole process of sysetm . Participation in governance and monitoring validators’ actions are essential for delegations. Delegators share revenue with their validators, so they also share risks. Holders may delegate ATOM to validators and exchange their revenue for ATOM.

$ATOM

The Cosmos Hub, a proof-of-stake blockchain, is powered by its native ATOM cryptocurrency. According to its founders, Cosmos aims to create an “Internet of blockchains,” which will unite crypto networks through open-source tools that streamline transactions.As a cryptocurrency built on top of the Cosmos platform, Atom (ATOM) is a cryptocurrency that facilitates communication, scaling, and interoperability between independent chains, and it should not be confused with the abandoned project Atomic Coin (ATOM). In contrast to other projects, Cosmos focuses on customizability and interoperability.

There are three layers that make up the Cosmos network:

  1. Application : This application is responsible for the processing of transactions and updating the network’s state as often as possible
  2. Networking : Enables transactions to be communicated between blockchains in a distributed manner.
  3. Consensus : The consensus function helps nodes reach an agreement on what the current state of the system should be.

Approach

It is our goal in this dashboard to explore the movement of delegation over the Cosmos platform. This case examines how the overall delegations, redelegations, and undeletions have been occurring on Cosmos blockchain over the past 6 months. The activities of these delegations are also displayed here based on different metrics. A further analysis of delegation activity is also being conducted for Proposal 82 on Cosmos. As follows,

  • In General, Cosmos Delegation Activity
    • The number of transactions according to their actions on a daily basis
    • The number of transactions based on the actions they take on a weekly basis
    • Percentage , Number Of Transactions According To Their Action For Past 6 Months
    • Daily, Amount Of Tokens By Action
    • Weekly, Amount Of Tokens By Action
    • Percentage, Amount Of Tokens By Action
    • Daily Number Of Validators By Action
    • Percentage, Daily Number Of Validators By Action
  • Analysis of delegation activity: Proposal 82
    • Delegation Activity Between Oct-25 and Nov 19
    • Top 10 Validators Who Saw Net Gain In Tokens Delegated Between Oct-25 and Nov 19
    • Top 10 Validators Who Saw Net Loss In Tokens Delegated Between Oct-25 and Nov 19
    • Top 10 Validators Who Gained Tokens Through Redelegations Around Prop 82
    • Top 10 Validators From Whom Tokens Were Delegated Away Around Prop 82

Note:

  • Here, we considered Delegate, Redelegate, and Undelegate as actions.
  • As well, the data here has been analyzed for the past 6 months.

In General, Cosmos Delegation Activity

In this section, we are analyzing the overall cosmos delegation activity by considering their Number of Events performed by different actions like delegation, redelegation and undelegation for the past 6 months period.

As we can see in the graph below, delegation events are in increasing trend . The total number of events increased from 328.8K in June 17, 2022 to 723.42K in December 12, 2022. It was observed that the maximum number of Events was 946.81K on December 2, 2022, and the minimum number of Events was 179.93K on June 26, 2022. Compared to normal, the number of events on June 22, 2022, and November 28, 2022, is lower than usual.

From the below graph, we can see a maximum of 2.08K events was observed on November 7, 2022, and a minimum of 124 events was observed on December 7, 2022. In August 13, 2022 and October 3, 2022, the total number of events is lower than usual, and in November 7, 2022 and September 20, 2022, it is higher than usual.

A maximum of 7.45K events was observed on December 8, 2022, and a minimum of 286 events was observed on July 3, 2022. A decrease of 31% from 492 events in June 17, 2022 to 340 events in December 12, 2022 was recorded in total events. The number of undelegated events is downgraded suddenly from Oct 28 2022 to Nov 2022. The number of undelegated events is high in December 8, 2022 to December 4, 2022, but lower in December 1, 2022 and December 9, 2022. In the following months, we may see a sudden rise in the number of undelegated events.

In the graph below, you can see all the events that happen on a daily basis. According to data collected over the last 6 months, 99.8% of events have been delegated. Out of the three Actions, Action Delegate contributes the most (99.77%) to the overall Events. Redelegate has the lowest number of events (61.51K) and delegates have the highest number of events (100.41M). The maximum number of events was 947.75K on December 2, 2022. The number of events increased more than double from 329.48K in June 17, 2022 to 723.9K in December 12, 2022.

Here we can see the weekly number of Events by their action for the past 6 months.

From the below graph, we can see the amount of tokens that have been delegated for the past six months. The maximum amount of $4.8M was observed on August 4, 2022, and the minimum amount of $133.37K was observed on June 25, 2022. There was a more than half decrease in total amount between June 17, 2022 and December 12, 2022. Amounts in August 5, 2022 and October 8, 2022 are lower than usual, while August 4, 2022 and December 3, 2022 are higher than usual

We can see from the graph below that the amount of redelegated tokens increased suddenly on November 7th 2022. The maximum amount of $8.27M was observed on November 7, 2022, while the minimum amount of $6.32K was observed on June 19, 2022. Compared to June 17, 2022, the total amount increased by more than double to $27.85K by December 12, 2022. In addition, we can see that the total amount in June 25, 2022, and June 29, 2022, is lower than normal, while it is higher in November 7, 2022, and June 28, 2022.

Based on the graph below, we can see how many tokens have been undelegated on Cosmos network in the past six months. As you can see, the undelegated amount suddenly increased on October 2022. October 17, 2022 was the date when the maximum amount was $56.97M, while September 7, 2022 was the date when the minimum amount was $22.36K. There was a decrease in the total amount from June 17, 2022 to December 12, 2022. Amounts for October 18, 2022, and September 24, 2022 are lower than normal, while amounts for October 16, 2022, and September 23, 2022 are higher than normal.

It appears that the undelegated amount on Oct 16th and 17th 2022 has increased suddenly. Out of the 3 Actions, Action Undelegate contributes the most to the total Amount (47.79%). (Redelegate) has the lowest total amount at $29.49M, while (Undelegate) has the highest total amount at $127.75M. A maximum amount of $57.33M was observed on October 17, 2022, and a minimum amount of $170.98K was observed on June 25, 2022. Compared with June 17, 2022, the total amount fell by 73% to $623.4K on December 12, 2022. Total Amount higher than normal in October 16, 2022 and November 7, 2022.

In the graph below, we can clearly see how many tokens have been spent in the past six months according to their actions. Out of the three actions over the past 6 months, almost 47% of amount of tokens were generated by undelegated events.

Here from the below graphs we can see the amount of tokens which are generated by different actions for the past 6 months on weekly basis.

From the graph below, we can see the daily number of validators participating in delegation for the past 6 months. We can see here that the total number of delegated Validators between June 17, 2022 and December 12, 2022 was 29,196. The maximum Validators of 190 were observed on November 28, 2022, while the minimum Validators of 140 were observed on June 19, 2022. A 10% increase from 144 Validators in June 17, 2022 to 159 Validators in December 12, 2022, brought the total number to 159. The increasing trend of validators in delegation actions can be seen here.

It was observed that there were a maximum of 101 Validators on August 12, 2022, and a minimum of 45 Validators on June 19, 2022. Validators who have been redelegated are decreasing between June 2022 and December 2022. A higher number of Validators were registered between August 10, 2022 and September 20, 2022 than usual.

In the below graph, we can see the increasing trend in the number of validators in the case of undelegated actions. The total number of undelegated validators between June 17, 2022 and December 12, 2022 was 16.3K. The maximum number of undelegated validators was 136 on September 9, 2022, and the minimum number was 63 on July 3, 2022. From June 17, 2022 to December 12, 2022, the number of Validators increased by 3%. Undelegated Validators are on the rise. There is a steady percentage of Validators at Undelegate.

The highest contributor to the total Validators is Action Delegate (50.82%) of all three Actions when we compare all validators by their actions. The lowest number of Validators is 11.9K (Redelegate) and the highest number is 29.1K (Delegate). September 9, 2022, saw the maximum Validators of 377, while July 10, 2022, saw the minimum Validators of 264. The total number of Validators increased by 4% from 273 to 284 in December 20, 2022. There was a downward trend in 3 Actions in Validators initially, with Redelegate falling the most at 16.67%.

More than 50% of validators have been performing delegation actions every day for the past 6 months, as shown in the graph below.

In the past six months, there have been 57.5K validators. From the 3 Actions, Action Delegate contributes the most (50.82%) to the total Validators. Validators at the lowest level are 11.9K (Redelegate), while Validators at the highest level are 29.1K (Delegate).

Delegation Activity Analysis: Proposal 82 ( ATOM 2.0: A new vision for Cosmos Hub.)

What is Proposal 82?

In late September, Cosmoverse released the ATOM 2.0 white paper. Cosmos was designed to make ATOM a core collateral within its ecosystem so that it could secure economic scaling. A large mint of ATOM tokens was proposed for the treasury in the first version of the white paper, followed by a drop in ATOM rewards. The community was concerned about the front-loading of ATOM tokens in the first few months, because that would reduce the ATOM inflation rate. Voting went live on Oct. 31 after the proposal was revised to include community suggestions. Members of the community expressed concerns over the lack of clarity and the broad nature of the proposal.

Here we can see more details about this proposal ,

Source : Details

Below is a video that provides more details about Proposal #82 ” ATOM 2.0: A new vision for Cosmos Hub”.

Below is a graph displaying delegation activity from Oct 25 2022 to Nov 19th 2022. The maximum number of tokens that validators have lost and gained on Nov 7th 2022. Out of all validators, Net Tokens contributed 99.83% to 0base.vc Validator. Binance Staking has the lowest Net Tokens Lost of -8.07M and zerobase.vc has the highest Net Tokens Gained of 8.05M. On November 8, 2022, Net Tokens Lost Gained were lower than normal, and on November 7, 2022, they were higher than normal.

If we look at the Top 10 Validators who saw a net gain in the number of tokens delegated between Oct-25 and Nov 19 had 17.41M net tokens. A total of 46.22% of Net Tokens were contributed by the 0base.vc Validator.

If we look at the top 10 Validators who saw a net loss in tokens delegated between Oct-25 and Nov 19 had – 9.65M net tokens. In this case, 83.66 percent of Net loss tokens were contributed by the Binance Staking Validator.

Below is a graph showing the top 10 validators who gained tokens through redelegations during Proposal 82. According to this chart, 0base.vc Validator contributed 42.55% of total Gained Tokens. A total of 1K Gained Tokens was achieved by HyperblocksPro, while a total of 8.08M Gained Tokens was achieved by 0base.vc. A maximum Gained Tokens of 16.09M was observed on November 7, 2022. In November 8, 2022, total Gained Tokens are lower than normal while in November 7, 2022, and October 31, 2022, they are higher than normal..

According to this chart, SG-1 and Binance Staking 0base.vc Validator accounted for 78.28% of total lost tokens. In terms of token loss, Stargaze has lost the least tokens at $989.29, while Binance Staking has lost the most tokens at $8.1M. The maximum amount of tokens lost was $8.03M on November 7, 2022. In November 8, 2022, token losses were lower than normal, but higher than normal in November 7, 2022, and October 31, 2022.

Observations

  • According to the above analysis, delegation events are on the rise. The total number of events increased from 328.8K in June 17, 2022 to 723.42K in December 12, 2022.
  • We can see a sudden increase in Relegation events in November 2022 from the above analysis. 
  • The number of undelegated events has been reduced suddenly from October 28 to November 2022. There is a high number of undelegated events from December 8 to December 4, 2022, but a lower number from December 1 to December 9, 2022. We may see an increase in the number of undelegated events in the coming months.
  • During the last 6 months, 99.8% of events have been delegated. The number of events increased more than double from 329.48K in June 17, 2022 to 723.9K in December 12, 2022.
  • We can see from the above analysis that the amount of redelegated tokens increased suddenly on November 7th 2022. On November 7, 2022, an amount of $8.27M was observed as the maximum.
  • There is a sudden increase in the undelegated amount on October 16th and 17th 2022. There are three actions in the total Amount, but Action Undelegate accounts for the most of it (47.79%).
  • Out of the three actions over the past 6 months, almost 47% of tokens were generated by undelegated events.
  • As a result of the above analysis, there were 190 validators on November 28, 2022, indicating an increasing trend in the number of validators in delegation actions.
  • At the time of the September 9, 2022, there were 136 undelegated validators. The number of Validators increased by 3% from June 17, 2022 to December 12, 2022. Additionally, we can say that undelegated validators are on the rise.
  • Over the past six months, there have been 57.5K validators. Among the 3 Actions, Action Delegate accounts for the largest share (50.82%) of Validators. A minimum of 11.9K validators are at the Redelegate level, while a maximum of 29.1K are at the Delegate level.
  • Over 50% of validators have performed delegation actions every day for the past six months, based on the above analysis.
  • The maximum number of tokens lost and gained by validators on November 7th 2022. Based on all validators, Net Tokens contributed 99.83% to 0base.vc Validator. The lowest Net Tokens Lost was recorded by Binance Staking and the highest Net Tokens Gained was recorded by zerobase.vc.
  • According to our analysis, the Top 10 Validators who gained tokens between Oct-25 and Nov 19 had 17.41M net tokens. A total of 46.22% of Net Tokens came from 0base.vc.
  • According to the top 10 Validators who reported a net loss in tokens delegated between Oct-25 and Nov 19, they had – 9.65M net tokens. The Binance Staking Validator contributed 83.66 percent of Net loss tokens in this case.
  • Based on the top 10 validators who gained tokens through redelegations during Proposal 82. 42.55% of the total Gained Tokens came from 0base.vc Validator.
  • This analysis shows that SG-1 and Binance Staking 0base.vc Validator accounted for 78.28% of the total lost tokens. These two validators take the top spot in the list of the Top 10 Validators from whom tokens were delegated away around Prop 82.

Reference Query

1. 

with unbound_txns as (
  
SELECT 
  block_timestamp, 
  tx_id,
 	case msg_type
  		when 'unbond' then 'Undelegate'
  		when 'delegate' then 'Delegate'
  		when 'redelegate' then 'Redelegate'
  end as action,
  case 
  		when  attribute_key in ( 'validator', 'destination_validator')  then attribute_value 
  end as validator_addrs, 
  case 
  		when attribute_key = 'amount' then replace(attribute_value, 'uatom', '') 
  end as amount
FROM cosmos.core.fact_msg_attributes
where block_timestamp >= CURRENT_DATE - 180 -- between '2022-10-30' and '2022-11-14'
  and msg_type IN ('unbond', 'delegate', 'redelegate') and attribute_key in ('validator', 'amount', 'destination_validator')
),
unbound_join as (
	SELECT 
  		utx1.block_timestamp,
  		utx1.tx_id,
  		utx1.action, 
  		utx1.validator_addrs,
  	
  		utx2.amount / 1E6 as amount 
    FROM unbound_txns utx1
    INNER JOIN unbound_txns utx2 USING(tx_id)
  	WHERE utx1.validator_addrs is not null and utx2.amount is not null 
  
),
results as (
  SELECT 
  	date_trunc(day, block_timestamp) as date, 
    	action,
    	count(tx_id) as txns,
    	sum(amount) as amount,
    	count(distinct validator_addrs) as validators
  FROM unbound_join
  GROUP BY date, action 
)
SELECT * FROM results


-- delegate txn : '9A53BF673DD662999471D75E1905E67163693E34849B76F154501D39C74B6E05'
----------------------------
2. 

with unbound_txns as (
  
  SELECT 
    block_timestamp, 
    tx_id,
   	case msg_type
    		when 'unbond' then 'Undelegate'
    		when 'delegate' then 'Delegate'
    		when 'redelegate' then 'Redelegate'
    end as action,
    case 
    		when  attribute_key in ( 'destination_validator')  then attribute_value 
    end as dest_validator_addrs, 
    case 
    		when  attribute_key in ( 'source_validator')  then attribute_value 
    end as src_validator_addrs, 
    case 
    		when attribute_key = 'amount' then replace(attribute_value, 'uatom', '') 
    end as amount
  FROM cosmos.core.fact_msg_attributes
  where block_timestamp   between '2022-10-25' and '2022-11-19'
    and msg_type IN ( 'redelegate') and attribute_key in ('source_validator', 'amount', 'destination_validator')
),
unbound_join as (
	SELECT 
  		utx1.block_timestamp,
  		utx1.tx_id,
  		utx1.dest_validator_addrs,
  		utx2.src_validator_addrs,
  		utx3.amount / 1E6 as amount 
    FROM unbound_txns utx1
    INNER JOIN unbound_txns utx2 USING(tx_id)
  	INNER JOIN unbound_txns utx3 USING(tx_id)
  	WHERE utx1.dest_validator_addrs is not null 
  		and utx2.src_validator_addrs is not null 
  		and utx3.amount is not null 
  
),
with_val_names as (
  	select 
		t1.*,
  		NVL(val1.label, 'Others') as src_validator_name,
  		NVL(val2.label, 'Others') as dest_validator_name
  	from unbound_join t1 
  	LEFT JOIN cosmos.core.fact_validators val1  ON t1.src_validator_addrs = val1.address 
  	LEFT JOIN cosmos.core.fact_validators val2  ON t1.dest_validator_addrs = val2.address 
  
),
gain_loss as (
  SELECT 
  		date_trunc(day, block_timestamp) as date,
    	src_validator_name as validator,
    	sum(amount) as amount_lost,
  		0 as amount_gained
  FROM with_val_names
  GROUP BY date, src_validator_name
  UNION 
  SELECT 
  		date_trunc(day, block_timestamp) as date,
    	dest_validator_name as validator,
    	0 as amount_lost,
  		sum(amount) as amount_gained
  FROM with_val_names
  GROUP BY date, dest_validator_name
)
SELECT 
	date, 
	validator,
	sum(amount_lost) as tokens_lost,
  	sum(amount_gained) as tokens_gained,
  	tokens_gained - tokens_lost as net_tokens
FROM gain_loss
WHERE validator not in ('inactive validator Do NOT delegate')
GROUP BY date, validator
-- delegate txn : '9A53BF673DD662999471D75E1905E67163693E34849B76F154501D39C74B6E05'