Class DevOmni

java.lang.Object
foundation.omni.DevOmni

public class DevOmni extends Object
Work-in-progress constants and functions for calculating Dev OMNI.

We use Instant and Duration but do not use other Java Time functions because the Omni Specification provides a specific value for SECONDS_PER_YEAR. This is why the yearsSinceCrowdSale(java.time.Instant) function returns a BigDecimal.

See calculate_and_update_devmsc() in omnicore.cpp

TODO: Verify math versus Omni Core C++ implementation (regtest and/or functional test vs mainnet?)

  • Field Details

    • EXODUS_END_SECS

      public static final Instant EXODUS_END_SECS
      Unix timestamp of End of the Exodus Crowd Sale as defined in the Omni Specification
    • SECONDS_PER_YEAR

      public static final Duration SECONDS_PER_YEAR
      Seconds-per-year used in Dev OMNI calculations as defined in the Omni Specification
    • VESTING_FACTOR

      public static final BigDecimal VESTING_FACTOR
      The factor 2.0, the inverse of the 0.5 used in the 1 - 0.5 ** y calculation in the Omni Specification
    • ALL_DEV_OMNI

      public static final OmniDivisibleValue ALL_DEV_OMNI
      Total number of Dev OMNI (as specified by the all_reward constant in omnicore.cpp)
    • CROWDSALE_OMNI

      public static final OmniDivisibleValue CROWDSALE_OMNI
      APPROXIMATE Total number of OMNI issued in Crowdsale
  • Constructor Details

    • DevOmni

      public DevOmni()
  • Method Details

    • yearsSinceCrowdSale

      public static BigDecimal yearsSinceCrowdSale(Instant time)
      Parameters:
      time - end of time interval (e.g. timestamp of a particular block)
      Returns:
      Fractional years since end-of-Exodus based on system time
    • percentVested

      public static BigDecimal percentVested(Instant time)
      Parameters:
      time - Timestamp
      Returns:
      APPROXIMATE percent vested (possibly different from Omni Core calculations due to rounding)
    • percentUnvested

      public static BigDecimal percentUnvested(Instant time)
      Parameters:
      time - Timestamp
      Returns:
      APPROXIMATE percent unvested (possibly different from Omni Core calculations due to rounding)
    • omniVested

      public static OmniDivisibleValue omniVested(Instant time)
      Calculate APPROXIMATE vested amount of Dev OMNI
      Parameters:
      time - Timestamp
      Returns:
      Amount of vested OMNI
    • omniUnvested

      public static OmniDivisibleValue omniUnvested(Instant time)
      Calculate APPROXIMATE unvested amount of Dev OMNI
      Parameters:
      time - Timestamp
      Returns:
      Amount of unvested OMNI
    • totalOmniTokens

      public static OmniDivisibleValue totalOmniTokens(Instant time)
      Parameters:
      time - Timestamp
      Returns:
      APPROXIMATE total OMNI tokens at a given block time