MoCEMACalculator
View Source: contracts/MoCEMACalculator.sol
↗ Extends: Governed ↘ Derived Contracts: MoCState
MoCEMACalculator - version: 0.1.12
Contract Members
Constants & Variables
MovingAverageCalculation
Parameters
price
uint256
movingAverage
uint256
Functions
getBitcoinMovingAverage
Arguments
getSmoothingFactor
Arguments
setSmoothingFactor
Arguments
factor
uint256
getGovernorAddress
Arguments
getEmaCalculationBlockSpan
Arguments
setEmaCalculationBlockSpan
Arguments
blockSpan
uint256
Defines how many blocks should pass between BMA calculations*
shouldCalculateEma
Arguments
getLastEmaCalculation
Arguments
initializeMovingAverage
Provides Bitcoin's Price and Moving average. More information of EMA calculation https://en.wikipedia.org/wiki/Exponential_smoothing
Arguments
initialEma
uint256
Initial ema value
smoothFactor
uint256
Weight coefficient for EMA calculation.
emaBlockSpan
uint256
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
Arguments
btcPrice
uint256
Current price.
coefficientComp
Calculates the smoothing factor complement
Arguments
initializeGovernor
Arguments
_governor
address
_doSetSmoothingFactor
Arguments
factor
uint256
Last updated