Inflation-indexed currencies are the reason for the existence of the Geminon protocol. The initial design of the protocol aimed to create a fourth-generation stablecoin, with a combination of scalability, decentralization, and security superior to existing alternatives, and also resistant to loss of value due to inflation.
Despite its name, Geminon's indexed coins do not track any index, but rather use the predicted value of that index for the next period as a reference value. This detail is important since it allows them to be on the inflation curve, instead of behind the curve.
Another important difference compared to a simple inflation index is that Geminon's indexed coins are programmed so that their value can never fall against their base currency: in cases where deflation occurs, their value remains fixed to that of the base currency instead of following the decline in the inflation rate, so that in global terms a monotonically increasing value curve is obtained, that is, a purely deflationary currency.
The PredictIndex contract implements a time series forecasting system based on the Holt-Winters non-seasonal linear trend model. In its recursive form, the model is given by two equations for the smoothing of the series and the trend:
is the time series,
the smoothed value of the series,
the trend component of the series and
the model parameters. The prediction of the time series
at the instant
is given by the expression:
parameters are obtained by optimization, selecting the pair that gives the minimum prediction error for a period for the analyzed time series.
The target value is the value that the currency should reach on the index prediction date. It is the conversion of the index value into monetary exchange value (expressed in USD). It is obtained by dividing the prediction value by the base value of the index.
This value also expresses the percentage of inflation accumulated from the date of the period used as the base to the present.
The time series of the consumer price index has a monthly periodicity. If the target value were used directly as a reference value for the currency, there would be sudden jumps in its value once a month, coinciding with the publication of the new inflation data. These sudden price jumps, being predictable, would allow temporary arbitrage attacks against the protocol.
To avoid these types of attacks and generate a continuous price change curve, a linear interpolation function is used that generates a continuous ramp between the last target value and the next one:
Indexed tokens incorporate a security mechanism to prevent excessive variations in their target value in a given period. Each time the token's target value is updated, the contract checks that the token's target value is within bounds:
- Lower bound: the lower bound of variation is given by the monotonicity requirement of the price function. The new target value cannot be less than the current reference value of the coin. If the calculated target is lower, the current reference value is taken as the new target, whereby the reference value is temporarily fixed at the current price.
- Upper limit: it is a parameter of the contract, which is established by default at 2% per month. If the new target value represents a variation from the previous target greater than 2%, the limit value is used as the target.
The ERC20Indexed contract, which serves as the basis for Geminon's inflation-indexed coins, implements a backup mechanism that allows the tokens to function autonomously, fulfilling their function of hedging against inflation even if nobody updates the values of the benchmark index through the PredictIndex contract.
In case of a normal update, the monthly variation rate is calculated as:
are the trend and smoothing according to the Holt-Winters model described above. If we define a constant backup variation rate
, in the event that in the following period the values of
are not available, a new variation rate would be calculated according to the expression:
The variation rate calculated in this way slowly converges towards the default value. If the underlying index stops updating permanently, after a sufficient number of periods,
will be obtained. The new target value would be calculated each period recursively using the backup rate of change:
To prevent the backup update from being invoked by taking advantage of the window between the date of publication of the new index data and the update transaction, the PredictIndex contract makes the prediction available for the next two periods, so that it is only considered out of date if two consecutive updates fail. The token contract can start making backup updates only when the second prediction date passes without the index data being updated again, that is, when more than two months go by without updating the values.