View Source:
↗ Extends: ↘ Derived Contracts:
MoCEMACalculator - version: 0.1.12
Contract Members
Constants & Variables
uint256 internal bitcoinMovingAverage;
uint256 public smoothingFactor;
uint256 public lastEmaCalculation;
uint256 public emaCalculationBlockSpan;
uint256 public constant PRICE_PRECISION;
uint256 public constant FACTOR_PRECISION;
uint256[50] private upgradeGap;
MovingAverageCalculation
Parameters
Functions
getBitcoinMovingAverage
function getBitcoinMovingAverage() public view
returns(uint256)
Arguments
getSmoothingFactor
function getSmoothingFactor() public view
returns(uint256)
Arguments
setSmoothingFactor
function setSmoothingFactor(uint256 factor) public nonpayable onlyAuthorizedChanger
Arguments
getGovernorAddress
function getGovernorAddress() public view
returns(address)
Arguments
getEmaCalculationBlockSpan
function getEmaCalculationBlockSpan() public view
returns(uint256)
Arguments
setEmaCalculationBlockSpan
function setEmaCalculationBlockSpan(uint256 blockSpan) public nonpayable onlyAuthorizedChanger
Arguments
Defines how many blocks should pass between BMA calculations*
shouldCalculateEma
function shouldCalculateEma() public view
returns(bool)
Arguments
getLastEmaCalculation
function getLastEmaCalculation() public view
returns(uint256)
Arguments
initializeMovingAverage
Provides Bitcoin's Price and Moving average. More information of EMA calculation https://en.wikipedia.org/wiki/Exponential_smoothing
function initializeMovingAverage(uint256 initialEma, uint256 smoothFactor, uint256 emaBlockSpan) internal nonpayable
Arguments
Weight coefficient for EMA calculation.
Block count in a period for EMA calculation
setBitcoinMovingAverage
Calculates a EMA of the price. More information of EMA calculation https://en.wikipedia.org/wiki/Exponential_smoothing
function setBitcoinMovingAverage(uint256 btcPrice) internal nonpayable
Arguments
coefficientComp
Calculates the smoothing factor complement
function coefficientComp() internal view
returns(uint256)
Arguments
initializeGovernor
function initializeGovernor(address _governor) internal nonpayable
Arguments
_doSetSmoothingFactor
function _doSetSmoothingFactor(uint256 factor) private nonpayable
Arguments