Package io.meeds.deeds.service
Class MeedTokenMetricService
java.lang.Object
io.meeds.deeds.service.MeedTokenMetricService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRetrieves Metrics of Meed Token from Blockchain and other external sources.Retrieves total circulating Meeds supply by using this formula: - Total supply of Meeds - total Meeds reserves - total locked MeedsgetLastMetric(Currency currency) Retrieves the latest Metrics of Meed TokengetMarketCapitalization(Currency currency) Retrieves Market Capitalization by using this formula: - Circulating Supply of Meeds * Meed USD Token priceRetrieves total Meeds supply, reading the value of the ERC20.totalSupply() Meeds contractgetTotalValueLocked(Currency currency) Retrieves Total Locked Value by using this formula: - Total Locked Meed Tokens * Meed USD Token price
-
Constructor Details
-
MeedTokenMetricService
public MeedTokenMetricService()
-
-
Method Details
-
getCirculatingSupply
Retrieves total circulating Meeds supply by using this formula: - Total supply of Meeds - total Meeds reserves - total locked Meeds- Returns:
BigDecimalfor most recent computed circulating supply value
-
getTotalSupply
Retrieves total Meeds supply, reading the value of the ERC20.totalSupply() Meeds contract- Returns:
BigDecimalfor most recent computed total supply value
-
getMarketCapitalization
Retrieves Market Capitalization by using this formula: - Circulating Supply of Meeds * Meed USD Token price- Parameters:
currency- usedCurrencyfor currency prices calculation- Returns:
BigDecimalfor most recent computed market capitalization value
-
getTotalValueLocked
Retrieves Total Locked Value by using this formula: - Total Locked Meed Tokens * Meed USD Token price- Parameters:
currency- usedCurrencyfor currency prices calculation- Returns:
BigDecimalfor most recent computed Total Locked Value value
-
computeTokenMetrics
public void computeTokenMetrics()Retrieves Metrics of Meed Token from Blockchain and other external sources. Once retrieved, it will be saved. The metrics are collected by day, in other terms, there will be only one metric entity collected by a day. -
getReserveBalances
- Returns:
MapofStringandBigDecimal. This will retrieve from Ethereum and Polygon Blockchains a Map of Token balances for each configured reserveBalanceAddress.
-
getLockedBalances
- Returns:
MapofStringandBigDecimal. This will retrieve from Ethereum and Polygon Blockchains a Map of Token balances for each configured lockedBalanceAddress.
-
getLastMetric
Retrieves the latest Metrics of Meed Token- Parameters:
currency- usedCurrencyfor currency prices calculation- Returns:
MeedTokenMetricrepresenting the Meed Token Metrics
-