Ribbon - EquilibriaCC/Equilibria GitHub Wiki

The Equilibria Protocol will mitigate the issuance and redemption exchange rate manipulation by using Ribbon, a multi-layered price aggregation model that will ensure the XEQ⇌USDE equilibrium price is difficult to manipulate and remains close to its true market value.

The rationale behind this model is to strongly discourage market manipulation attempts by making them too great of a financial burden to execute. To cause any significant shift in the network-determined equilibrium price of XEQ, an attacker will need to invest significant capital for a sustained period of time across an array of exchanges.

Specifically, Ribbon will consist of three price stabilization enforcement layers.

  • Ribbon Green will take in raw exchange data and create a fast volume-weighted price average around it.

  • Ribbon Blue will refine the Ribbon Green data by discounting statistical outliers and physically writing this outlier-removed exchange data into the XEQ blockchain.

  • Ribbon Red will take historical data written into the XEQ blockchain by Ribbon Blue and use it to create a series of longer volume-weighted moving averages which then combine to form the issuance and redemption exchange rate.

Ribbon Green

Ribbon Green represents the initial raw data aggregation and computation stage. Every XEQ block, all available market data for the preceding 20 block period will be collected, and a volume-weighted average will be taken.

A trade data point equals (USD Price * Volume) of the trade, then divided by total volume. All trades during the block will be averaged. An example of three trades in a block is provided below:

In this example, a low-volume manipulation attempt at $4 (60% above spot) was mostly - but not entirely - defeated by the volume-weighted average. Therefore, outliers like this are removed by Ribbon Blue prior to writing market data into the blockchain.

Ribbon Blue

Ribbon Blue will filter Ribbon Green data to remove white noise generated by random market volatility and low-volume market manipulation attempts. This filtered data is then written into the XEQ blockchain. Ribbon Blue will calculate a two standard deviation band around the price and discard all price observations that fall outside of it. For example, if the trade average data point is determined to be $2.5 with a standard deviation of $0.15, all price data points that fall outside of the $2.2 - $2.8 range will be discarded by the system. If a sudden spike in price occurs, the system will disregard it for moving average computation purposes. In the example from the previous page, the $4 trade would have been entirely discarded by Blue before writing the final average into the XEQ blockchain.

The outlier value is discarded entirely and the final value is written into the XEQ blockchain.

Ribbon Red

Ribbon Red is the final processing stage before the network determines an equilibrium price. In this stage, multiple moving averages with different look-back periods are calculated, and their final average is taken. All of these are calculated using the historical Ribbon Blue data that was written into each block of the XEQ blockchain. This final Ribbon Red average is then the equilibrium price the network reaches consensus over, as well as uses when issuing and redeeming either XEQ or USDE during mint and burn.

Initially, Red will use 4 moving averages, with look-back periods of 120, 240, 480 and 960 blocks, capturing a broad spectrum of market trends from slowest to fastest.

* MA1 = 960 blocks = 48h moving average of Ribbon Blue. * MA2 = 480 blocks = 24h moving average of Ribbon Blue. * MA3 = 240 blocks = 12h moving average of Ribbon Blue. * MA4 = 120 blocks = 6h moving average of Ribbon Blue.

The equilibrium price for USDE ⇌ XEQ issuance and redemption is determined as the average of all four moving averages above. By using such long moving averages, Equilibria assures that any exchange rate manipulation attempts for issuance and redemption must be sustained at dominant volume for up to 48 hours.

Bitcoin Ribbon

The Bitcoin Ribbon will ensure that any attacks on a minority of Bitcoin exchanges will not affect the USD pricing of the XEQ/USDE exchange rate. Exchange data is averaged from Coinbase PRO, Gemini, Bitstamp, Binance and BitFinex for each block. The first step is to check if any exchange has diverged from the mean by more than one standard deviation. If an exchange has diverged from the mean then the exchanges price will not be used in the BTC/ USD price. Example below:

Bitcoin Exchange Data: {A: $9472, B: $9472, C: $9483, D: $9467, E: $9000}.

By calculating the standard deviation ($211), exchange E will be discarded as they are below the first standard deviation:

μ($9378) - 1σ($211) = $9167.

The final BTC / USD price will go through a Ribbon Red-like process however the lookback periods are:

* MA1 (10% weight) = 3,360 blocks = ~7d moving average of BTC/USD * MA2 (20% weight) = 480 blocks = ~24h moving average of BTC/USD * MA3 (15% weight) = 240 blocks = ~12h moving average of BTC/USD * MA4 (15% weight) = 60 blocks = ~6h moving average of BTC/USD * MA4 (60% weight) = 20 blocks = ~1h moving average of BTC/USD

Example: The volume-weighted look back periods from Coinbase Pro have values {10178, 10497, 10538, 10602, 10580}. The final Coinbase Pro price is 10,524. Each bitcoin exchange will go through this process and their final price will then be averaged from the rest of the exchanges.

Next