Title: Token decentralization on Algorand
Source: https://nodely.io/blog/token-decentralization/
Updated: 2022-07-23T00:00:00.000Z

[

Back to all posts

](https://nodely.io/blog)

![Token decentralization on Algorand](https://nodely.io/_astro/tokens_1.DNB_57Hx_Z1rL66o.webp)

# Token decentralization on Algorand

![Urtho](https://nodely.io/_astro/gndx-astro-avatar_Z1MHJeJ.webp)

Urtho

Jul 23, 2022

[guides](https://nodely.io/categories/guides)

Let’s have some fun and use state-of-the-art methods to measure the decentralization index of various tokens on Algorand.

<a id="decentralization-index"></a>

### Decentralization Index

Blockchain decentralization metrics are a relatively unresearched area with very few published papers.

One of the recent ones called “SoK: Blockchain Decentralization”¹ introduces an index based on the amount of “randomness ”in transaction value. This index can be calculated using formula (1) where P(vi) denotes the transaction weight concerning the total transaction value.

![](https://cdn-images-1.medium.com/max/800/1*V4YgGcZITaHarTV9st45UQ.png)

(1)

Looks scary but is just a sum of 2 to the power of Shannon’s entropy of all transaction values within a chosen time range.

![](https://cdn-images-1.medium.com/max/800/1*KYYNrFohz2G-_8oVAaT64Q.png)

<a id="calculating-the-index-using-sql"></a>

### Calculating the index using SQL

With access to Allo.info SelfService BI calculating entropy and the Decentralization Index for native Algo token is as simple as:

```sql
SELECT
 date(realtime) day                  -- daily bins
 , pow(2,entropy(amount_dec)) H      -- Decentralizaction Index value
 , sum(amount_dec) algos             -- total Algos transacted
 , count() cnt                       -- total transactions of interest
FROM
  mainnet.txn
WHERE
  `type` = 'pay'                     -- only native token transactions
  and amount_dec > 0                 -- only with non zero value transacted
  and realtime >= '2023-01-01'       -- only year 2023
GROUP BY 1                           -- group into daily bins
ORDER BY 1                           -- sort nicely
```

2 seconds and 160M transactions later we get a chart like below.  
The chart has applied 30-day moving average to be in line with the methodology used in the paper.

![](https://cdn-images-1.medium.com/max/800/1*lnf63yX3A_6ljLb5eYC78A.png)

Algorand native token decentralization index in 2023

![](https://cdn-images-1.medium.com/max/800/1*Zzia2yOCZu0Fd_UHf4olRA.gif)

A quick real-time behind-the-scenes chart creation

<a id="decentralization-of-the-native-token-vs"></a>

### Decentralization of the native token vs…

Let’s proceed to the comparison of Algo to the established cross-chain reference token — the [**$COOP token**](https://algonaut.space/coop-coin/).  
Is the “most decentralized” token more decentralized than Algo when comparing using state of art methodology?

To get $COOP decentralization index we tweak the SQL a bit:

```sql
SELECT
 date(realtime) day                  -- daily bins
 , pow(2,entropy(amount_dec)) H      -- Decentralizaction Index value
 , sum(amount_dec) COOP              -- total $COOP transacted
 , count() cnt                       -- total transactions of interest
FROM
  mainnet.txn
WHERE
  asset_id = 796425061               -- filter only $COOP TX
  and `type_ext` = 'asa_transfer'    -- only token transfer TX
  and amount_dec > 0                 -- only with non zero value transacted
GROUP BY 1                           -- group into daily bins
ORDER BY 1                           -- sort nicely
```

Let’s get them both on the same chart and see.

![](https://cdn-images-1.medium.com/max/800/1*_8-NMeyPkwlKmG-Og3npOg.png)

This proves that $COOP is more decentralized than Algo using the latest available research in the field.

Comparing the index of other tokens is left as an exercise for the reader.  
Also, we don’t want to dethrone $COOP by being too rigorous😉

* * *

\[1\]: [Zhang, Luyao, Xinshi Ma, and Yulin Liu. “SoK: Blockchain Decentralization.” _arXiv preprint arXiv:2205.04256_ (2022).](https://arxiv.org/abs/2205.04256)

[#guide](https://nodely.io/tags/guide)[#Algorand](https://nodely.io/tags/Algorand)[#sql](https://nodely.io/tags/sql)[#tokens](https://nodely.io/tags/tokens)[#decentralization](https://nodely.io/tags/decentralization)
