Proposal to generalize CPI Oracle & Correct for BEA data revision

Background

The Ampleforth protocol produces AMPL, a decentralized and durable digital currency, much like Bitcoin, but with a Unit of Account. AMPL’s unit is designed to be long-term stable, independent even of the movement of fiat currencies.

To calculate the AMPL price target denominated in dollars, the protocol Policy contract consumes the Personal Consumption Expenditures(PCE) as a measure of prices paid by consumers. There is no particular tie to the PCE as a data source specifically. Meaning, there is no “peg” to CPI, inflation, or PCE. PCE is simply used as one measuring stick to ensure constant unit value of AMPL through time.

When AMPL was launched in July of 2019, the PCE value was 109.195. Later PCE values are compared against this base value to produce a % price inflation since inception. For example:

Last month, a PCE value of 127.177 produced a price target of (127.177 / 109.195) = $1.16

You can view the history of the price feed and protocol operation on the Ampleforth dashboard.

The BEA & Data Revision

PCE data is produced by the Bureau of Economic Analysis and updated monthly. One important aspect of the BEA is it may sometimes revise previously published data. We have seen a number of these revisions over time, but so far they’ve been small and over relatively recent data periods. However, last month there was a comprehensive revision going back to before the Ampleforth protocol was launched 4 years ago.

In addition to any other data changes, all values over this time span were scaled down:

The PCE in July 2019 when AMPL launched was 109.195

The recorded PCE for July 2019 today is now 103.422

This means that the protocol is calculating a price target of (120.550 / 109.195) = $1.10

rather than the more correct (120.550 / 103.422) = $1.16

Proposed Changes

  1. Remove the baseCpi constant from the Ampleforth Policy Contract

  2. Add a more generalized scaling factor into the CPI oracle Medianizer, and have this be configurable through governance
    Essentially, the Policy should not be concerned with how data sources change or evolve. The policy contract will simply consume the dollar-denominated price target directly. These CPI formatting details are better encapsulated within the CPI oracle itself, which is further on the protocol’s periphery. This lets us more easily enshrine the core Policy contract behavior going forward by insulating it from future oracle changes.

  3. Update the new scaling factor to be inline with the revised data

  4. Continue exploring alternative data sources which do not revise past data. This removes the potential impacts of future revisions and reduces the need for governance intervention.

Implementation

The fragments team is currently working on an implementation, but I wanted to post this early to streamline the governance timeline and coordinate community action. The changes are expected to be small and will be published when available.

Regarding #3, There is already an active proposal around including Truflation to the CPI calculation. Perhaps someone from the Truflation team can comment on their revision policies, but to my knowledge they do not revise previously published data.

5 Likes

These are the code changes currently under consideration

4 Likes

Revising past data is a necessary part of being a data provider. Things do change, and in order to use data for accurate predictions, analysts require the most accurate data possible. But this doesn’t work for DeFi.

Analysts are looking for data, but DeFi protocols and web apps tend to just need the latest value. What we’ve done is found a way to make sure that analysts get the most accurate data possible, and devs get the most accurate current value possible.

You may want to consider our Flatcoin Index. It’s a price feed for inflation-proof stablecoins starting with a value of $1 on March 11th, 2023. It is powered by our Truflation US CPI, with 60+ data sources across 18 million items and growing with three price feeds for each item. While one version of the Truflation index does change with historical data updates, the Flatcoin Index does not.

Truflation sources data from a massive pool - 60+ sources, 18 million items (and counting). And we’re growing towards 3 suppliers for each item we track. All handled by our decentralized network of oracles.

2 Likes

Thanks for the context @srust99

Implementation Updates:

An onchain vote is posted here and voting will go live in about 2 days.

3 Likes

All historical data tracked using the truflation flatcoin index does not change. The data is immutable and is logged on the respective blockchain.

From time to time the community may decide to change the algorithms or add new data sets to the calculations. This enhances the calculations, however unlike government data, Truflation doesn’t edit historical data.

5 Likes