MinterGateway.updateIndex

MinterGateway.updateIndex()MinterGateway.updateIndex()

  • Calculates and updates minterIndexminterIndex AND earnerIndexearnerIndex to their current values

    • Distributes excess M, claimable by ZERO holders, in Distribution Vault excessM=totalOwedMtotalSupply  of  MToken,  if  totalOwedM>totalSupply  of  MexcessM = totalOwedM - totalSupply\; of\; M Token,\; if\; totalOwedM > totalSupply\; of\;M

    • Calculates and updates minterIndexminterIndex: minterIndexnow=fn(minterIndexminterIndexLastUpdatedlTimestamp,rate,nowminterIndexLastUpdatedTimestamp)minterIndex_{now} =fn(minter_{IndexminterIndexLastUpdatedlTimestamp}, rate, now - minterIndexLastUpdatedTimestamp)

    • Sets latestMinterRate=minterInterestRateModel.getRate()latestMinterRate = minterInterestRateModel.getRate()

    • Sets minterIndexLastUpdatedTimestamp=nowminterIndexLastUpdatedTimestamp = now

    • Calculates and updates earnerIndexearnerIndex : earnerIndexnow=fn(earnerIndexearnerIndexLastUpdatedTimestamp,rate,nowearnerIndexLastUpdatedTimestamp)earnerIndex_{now}=fn( earnerIndex_{earnerIndexLastUpdatedTimestamp}, rate, now - earnerIndexLastUpdatedTimestamp)

    • Sets latestEarnerRate=earnerInterestRateModel.getRate()latestEarnerRate = earnerInterestRateModel.getRate()

    • Sets earnerIndexLastUpdatedlTimestamp=nowearnerIndexLastUpdatedlTimestamp = now

NOTE: index2=index1e(ratetimeElapsed),index2 = index1 * e(rate *timeElapsed), using Pade(4, 4) approximation timeElapsed=nowindexLastUpdatedTimestamptimeElapsed = now - indexLastUpdatedTimestamp, e(x)=(1+x/2+3(x2)/28+x3/84+x4/1680)/(1x/2+3(x2)/28x3/84+x4/1680) e(x) = (1 + x/2 + 3(x^2)/28 + x^3/84 + x^4/1680) / (1 - x/2 + 3(x^2)/28 - x^3/84 + x^4/1680)

Last updated

Copyright 2024 M^0 Foundation