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 OmniDivisibleValue
Total number of Dev OMNI (as specified by theall_reward
constant inomnicore.cpp
)static final OmniDivisibleValue
APPROXIMATE Total number of OMNI issued in Crowdsalestatic final Instant
Unix timestamp of End of the Exodus Crowd Sale as defined in the Omni Specificationstatic final Duration
Seconds-per-year used in Dev OMNI calculations as defined in the Omni Specificationstatic final BigDecimal
The factor 2.0, the inverse of the 0.5 used in the1 - 0.5 ** y
calculation in the Omni Specification -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OmniDivisibleValue
omniUnvested
(Instant time) Calculate APPROXIMATE unvested amount of Dev OMNIstatic OmniDivisibleValue
omniVested
(Instant time) Calculate APPROXIMATE vested amount of Dev OMNIstatic BigDecimal
percentUnvested
(Instant time) static BigDecimal
percentVested
(Instant time) static OmniDivisibleValue
totalOmniTokens
(Instant time) static BigDecimal
yearsSinceCrowdSale
(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 ** y
calculation in the Omni Specification -
ALL_DEV_OMNI
Total number of Dev OMNI (as specified by theall_reward
constant 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
-