hoodrunio / explorer-backend

Backend app for Cosmos ecosystem explorer.
https://backend.testnet.run/
5 stars 1 forks source link

Add c4e inflation and apr #91

Closed Errorist79 closed 1 year ago

Errorist79 commented 1 year ago

Formula: APR = inflation * (totalSupply / stakingPool) * shareParameter

Base URL: https://lcd.c4e.io

Inflation: /c4e/minter/v1beta1/inflation Supply: /cosmos/bank/v1beta1/supply (supply of uc4e) Staking pool: /cosmos/staking/v1beta1/pool (bonded tokens amount)

Share parameter: The share parameter is a value between 0 and 1 that denotes the percentage of total inflation and fees distributed among stakers. To get the share parameter, use this endpoint to get a list of all subdistributors and then find a subdistributor with the name "inflation_and_fee_distributor" in the list. The next step will be to calculate the shareParameter as follows: from the number 1, subtract the burn share of the previously found subdistributor and the sum of all destination shares of this subdistributor.

amorfc commented 1 year ago

https://github.com/testnetrunn/explorer-backend/pull/94