Class MeedTokenMetricService

java.lang.Object
io.meeds.deeds.service.MeedTokenMetricService

@Component public class MeedTokenMetricService extends Object
  • Constructor Details

    • MeedTokenMetricService

      public MeedTokenMetricService()
  • Method Details

    • getCirculatingSupply

      public BigDecimal getCirculatingSupply()
      Retrieves total circulating Meeds supply by using this formula: - Total supply of Meeds - total Meeds reserves - total locked Meeds
      Returns:
      BigDecimal for most recent computed circulating supply value
    • getTotalSupply

      public BigDecimal getTotalSupply()
      Retrieves total Meeds supply, reading the value of the ERC20.totalSupply() Meeds contract
      Returns:
      BigDecimal for most recent computed total supply value
    • getMarketCapitalization

      public BigDecimal getMarketCapitalization(Currency currency)
      Retrieves Market Capitalization by using this formula: - Circulating Supply of Meeds * Meed USD Token price
      Parameters:
      currency - used Currency for currency prices calculation
      Returns:
      BigDecimal for most recent computed market capitalization value
    • getTotalValueLocked

      public BigDecimal getTotalValueLocked(Currency currency)
      Retrieves Total Locked Value by using this formula: - Total Locked Meed Tokens * Meed USD Token price
      Parameters:
      currency - used Currency for currency prices calculation
      Returns:
      BigDecimal for 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

      public Map<String,BigDecimal> getReserveBalances()
      Returns:
      Map of String and BigDecimal. This will retrieve from Ethereum and Polygon Blockchains a Map of Token balances for each configured reserveBalanceAddress.
    • getLockedBalances

      public Map<String,BigDecimal> getLockedBalances()
      Returns:
      Map of String and BigDecimal. This will retrieve from Ethereum and Polygon Blockchains a Map of Token balances for each configured lockedBalanceAddress.
    • getLastMetric

      public MeedTokenMetric getLastMetric(Currency currency)
      Retrieves the latest Metrics of Meed Token
      Parameters:
      currency - used Currency for currency prices calculation
      Returns:
      MeedTokenMetric representing the Meed Token Metrics