Alternative UI for Balancer Pools
The existing interface to explore Balancer pools is limited and doesn't clearly convey the important data that should be highlighted in order to better parse the pools. This project is an attempt to present balancer pools in a clearer more parsable way. It also includes a trending list that is generated by calculating how much liquidity has been added to pools in the last 24 hours. The idea being that a trending list can show which pools are growing quickly and perhaps expose good investment opportunities.
This project is primarily a UI / frontend project built with Vue / Nuxt. The app uses the Balancer subgraph to extract interesting data about pools and asset swaps. The default list of pools is simply ordered by the market cap of the pools combined assets. The trending list is calculated by the following:
Fetching the maximum amount of Swaps (for a single query) in the last 24h, which seems to be 1000 (I guess this is a per query limit, I haven’t paginated to get more at this point).
After fetching, each swap is serialised with totalIn/totalOut values converted to USD and an amountChange in USD is stored.
A list of unique Pool ids from the swaps is generated.
The Pools ids are ordered by amount change and only kept if the change is positive, i.e. totalIn is more than totalOut.
The list is further reduced to the top 10 amountChange pools.
Using the remaining pool ids, a second query is sent to fetch those pools.
The returned pools are re-sorted by the amountChange list.
The result is a trending list ordered by total volume of liquidity provided to the pool within the last 24h.