Was doing this for PNMC, figured I might as well include the functionality in the cli.
Adds two api calls:
get-rich-list which takes count and asset (count default is 100)
get-global-rich-list which takes count (count default is 100)
I separated them because the logic for each is much different. Calculating the global rich list is more expensive than an asset rich list because I'm doing the conversions and sorting after the query. It is theoretically possible to build a query that does the conversions but due to the structure of the table, this was far easier to implement.
The asset-rich list returns a list of the top X addresses, the asset balance, and the pUSD equivalent value. The global list adds up the pUSD equivalent of all assets of that address and only returns the pUSD equivalent sum.
Was doing this for PNMC, figured I might as well include the functionality in the cli.
Adds two api calls:
count
andasset
(count default is 100)count
(count default is 100)I separated them because the logic for each is much different. Calculating the global rich list is more expensive than an asset rich list because I'm doing the conversions and sorting after the query. It is theoretically possible to build a query that does the conversions but due to the structure of the table, this was far easier to implement.
The asset-rich list returns a list of the top X addresses, the asset balance, and the pUSD equivalent value. The global list adds up the pUSD equivalent of all assets of that address and only returns the pUSD equivalent sum.