Package foundation.omni
Class DevOmni
java.lang.Object
foundation.omni.DevOmni
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final OmniDivisibleValueTotal number of Dev OMNI (as specified by theall_rewardconstant inomnicore.cpp)static final OmniDivisibleValueAPPROXIMATE Total number of OMNI issued in Crowdsalestatic final InstantUnix timestamp of End of the Exodus Crowd Sale as defined in the Omni Specificationstatic final DurationSeconds-per-year used in Dev OMNI calculations as defined in the Omni Specificationstatic final BigDecimalThe factor 2.0, the inverse of the 0.5 used in the1 - 0.5 ** ycalculation in the Omni Specification -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OmniDivisibleValueomniUnvested(Instant time) Calculate APPROXIMATE unvested amount of Dev OMNIstatic OmniDivisibleValueomniVested(Instant time) Calculate APPROXIMATE vested amount of Dev OMNIstatic BigDecimalpercentUnvested(Instant time) static BigDecimalpercentVested(Instant time) static OmniDivisibleValuetotalOmniTokens(Instant time) static BigDecimalyearsSinceCrowdSale(Instant time)
-
Field Details
-
EXODUS_END_SECS
Unix timestamp of End of the Exodus Crowd Sale as defined in the Omni Specification -
SECONDS_PER_YEAR
Seconds-per-year used in Dev OMNI calculations as defined in the Omni Specification -
VESTING_FACTOR
The factor 2.0, the inverse of the 0.5 used in the1 - 0.5 ** ycalculation in the Omni Specification -
ALL_DEV_OMNI
Total number of Dev OMNI (as specified by theall_rewardconstant inomnicore.cpp) -
CROWDSALE_OMNI
APPROXIMATE Total number of OMNI issued in Crowdsale
-
-
Constructor Details
-
DevOmni
public DevOmni()
-
-
Method Details
-
yearsSinceCrowdSale
- 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
- Parameters:
time- Timestamp- Returns:
- APPROXIMATE percent vested (possibly different from Omni Core calculations due to rounding)
-
percentUnvested
- Parameters:
time- Timestamp- Returns:
- APPROXIMATE percent unvested (possibly different from Omni Core calculations due to rounding)
-
omniVested
Calculate APPROXIMATE vested amount of Dev OMNI- Parameters:
time- Timestamp- Returns:
- Amount of vested OMNI
-
omniUnvested
Calculate APPROXIMATE unvested amount of Dev OMNI- Parameters:
time- Timestamp- Returns:
- Amount of unvested OMNI
-
totalOmniTokens
- Parameters:
time- Timestamp- Returns:
- APPROXIMATE total OMNI tokens at a given block time
-