ASA Dex Degens
Q38. Let's look at DEX wallet behavior with the algorand.swaps table to get an idea of how many swaps wallets are being conducted and see how many ASAs wallets are trading. Chart the distribution of the number of swaps wallets have conducted in 2022(Count the number of swaps a wallet has performed create a distribution of these wallets). Chart the distribution of the number of ASAs a wallet has swapped for (Count the number of assets a wallet swapped for and create a distribution of the number of assets per wallet).
Introduction
Token swaps in DEXes allow for a direct exchange between two tokens and has a series of advantages when compared to exchanging tokens in a CEX: less trading pairs, chained operations through involving crypto-to-fiat exchanges, higher fees and higher volatility as well as Know Your Customer (KYC) processes that make swaps a really attractive option.
This bounty will analyse the distribution of wallet by number of swaps and number of assets swapped from, using the newly curated algorand.swaps
table.
Methodology
I created 5 different queries for this analysis, probably there is a more effective way to generate this data but I have not found the right method yet.
To find the number of swaps per wallet, I used a count(distinct tx_group_id)
aggregating by swapper
, which I identified as the wallets.
For the number of assets swapped analysis, I used a count(distinct swap_from_asset_id)
aggregating by swaper
as well.
In both cases, block_timestamp >= '2022-01-01'
and swap_from_amount >= 0
were used as contraints.
For each distribution, by number of swaps and by number of assets swapped, I created 2 queries:
-
A "Distribution" query where the wallets were aggregated by type with the distributions specified in the Results Section.
-
A "Statistics" query where the
count
of all wallets as well as the sum, the average, the median, max and min of both variables (swaps and assets swapped).
Results
Distribution by number of swaps
The chart below shows the statistics of the wallets by number of swaps. With short over 3M swaps from 53k wallets, the average number of swaps is 56.53 and the median 3. From the data we can assume that most wallets only do a few swaps while a low number of wallets do a very high number,with automated methods.
Distribution by number of assets swapped from
The chart below shows the statistics of the wallets by number of assets swapped from. With short over 241k swaps from 53k wallets, the average number of assets swapped is 4.5 and the median 2. As in the previous section, we can assume that most wallets only swapped a few different assets while a low number of wallets swapped a lot of different assets.
Figures 1 and 2 show the distribution of wallets based on the number of swaps as follows:
- a. One-timer - 1 swap
- b. Swap Fish - 1-10 swaps
- c. Decapod - 10-50 swaps
- d. Elderly - 50-100 swaps
- e. Daily swapper - 100-500 swaps
- f. Addicted to Swap - 500-1000 swaps
- g. Heavily automated - 1000-5000 swaps
- h. Master Bot - >5000 swaps
There are 16k wallets with only one swap and over 24k wallets with between 2 and 10 swaps, amounting both type to over 75% of all wallets. On the other end of the distribution, only 26 wallets have more than 5000 swaps each (less than 0.05%).
Figures 3 and 4 show the distribution of wallets based on the number of assets swapped as follows:
- a. One-coiner - 1 assets
- b. Coin juggler - 1-10 assets
- c. Addicted to Assets - 10-50 assets
- d. Heavily automated - 50-100 assets
- e. Master Bot - >100 assets
Conclusions
Both distributions are heavily skewed towards low number of swaps and assets swapped, with wallets with less than 10 swaps and assets swapped accounting for 75% and 90%. High number of swaps and assets swapped hint at automated wallet aka Bots. These bots have two different strategies, very high swaps per asset on a reduced number of assets or swapping a large number of different assets a very large amount of times, giving medium number of swaps per asset.
Figures 5. and 6. were inspired by user @Kiba on Discord.
Over 24k wallets have swapped only one coin and another 24k swapped up to 10 assets. This both types account for over 90% of all wallets. Big volume wallets with over 100 assets swapped sum up to 141 or 0.26%.
A last query joining both initial aggregations is made using CTE to display wallets above 1000 swaps and their number of swaps, the number of assets and the swaps per asset to try to visualize the two strategies that these high presumably automated wallets use: on one hand, high volume of a small number of assets, on the other hand, high volume of a big number of assets. The swaps/asset axis was set as logarithmic.
Figures 5 and 6 show a visualization of two differentiated strategies of high number of swaps wallets on either a small or a big number of assets:
-
Figure 5 shows number of swaps vs. swaps per asset on a log axis, with the marker size and color as number of assets. Two curves can be identified, the blue points (low number of assets swapped) and red/orange (high number of assets swapped)
-
Figure 6 shows number of assets swapped vs. swaps vs. swaps per asset on a log axis, with color as number of swaps. Marker size was not used here because due to the high number of swaps (up to 300k), the visualization is not so clear. Again, both curves are clearly identifying high vs low number of assets swapped wallet with more than 1000 swaps. Here the visualisation of top left points (swapping 9 assets 5800 times each on average) and top right points (swapped over 350 assets around 800 times each on average) show both strategies very clearly.