Links

Limiting Upgradeability

An implementation of an Optimistic Approval mechanism

All users, not just governors, should have a say

Through an additional mechanism, end users of the protocol - GYD stablecoin holders - have power over governance regarding how upgradeable the protocol should be. This takes the form of an alternative 'wrapped' form of GYD, boundedGYD.
As implemented in WrappedERC20WithEMA, at any time, a user can choose between holding GYD or the wrapped bGYD and can freely convert between them. Choosing to hold bGYD means voting for limited protocol upgradeability.
When a user converts between GYD and bGYD, a moving average is updated in the bGYD contract. When the moving average exceeds a threshold in addition to the total bGYD supply exceeding another threshold, upgradeability of core Gyroscope contracts through governance becomes more difficult. This takes the form of increased difficulty in action tiering.
The main idea is to let the end-user decide when the system should be more upgradeable and when core infrastructure should be considered more settled based on the market choice of whether to adopt GYD or bGYD. This change of adoption is intentionally difficult (e.g., integrations would have to shift to using bGYD) because early on the DeFi space itself is not settled and any stablecoin will likely need to adapt parameters and structure over time as DeFi itself changes.
Tracking the Moving Average
We track the moving average of the share of bGYD to GYD in terms of an irregularly-spaced exponential moving average (EMA) as follows. Index the points in time where the EMA is updated by
ii
, where
i=0i=0
marks deployment of the contract. Let
tit_i
be the block height at time index
ii
, and let
xi:=bGYD supply/GYD supplyx_i := \text{bGYD supply}/\text{GYD supply}
at the end of block
tit_i
. Let
yiy_i
be the EMA at time index
ii
. We can define the EMA as
y0=0yi=yi1+Ki(xiyi1)if i>0where Ki=1e(titi1)/τ.\begin{align*} y_0 &= 0 \\ y_{i} &= y_{i-1} + K_i \cdot (x_i - y_{i-1}) \quad\text{if $i > 0$} \\ \text{where } K_i &= 1 - e^{-(t_{i} - t_{i-1}) / \tau}. \end{align*}
Here,
τ\tau
is a constant (i.e., a parameter to the contract) that is usually interpreted as the width of a time window. Observe that, if the spacing of the
xix_i
time series was regular, then all the
KiK_i
would be equal, but in our case, this does not hold. The definition of
KiK_i
is motivated by the continuous form of the EMA from signal processing, see here.
Note that we only track the EMA at the previously updated block, not the current block. This is to prevent manipulation of the EMA by, e.g., using a flash loan. The values
xix_i
and
tit_i
in the above formulas therefore refer to the most recently-observed values that are not from the current block; the current-block values are not used to update the current-block EMA, but will only be used in the next block.
The variables in _updateEMA() match the variables from the formulas above as follows:
Math
Code
yi1y_{i-1}
expMovingAverage.value
xix_i
previousWrappedPctOfSupply.value
ti1t_{i-1}
expMovingAverage.blockNb
tit_i
previousWrappedPctOfSupply.blockNb
τ\tau
windowWidth

Optimistic approval

Limiting upgradeability in this way is an application of the idea of Optimistic Approval, a new governance primitive that allows governance changes to be conditional on a timelock and veto process. It is a very flexible mechanism that can be used both to streamline governance processes and to better align incentives among protocol participants, not just in Gyroscope but also in DeFi governance more broadly.
Read our research piece introducing Optimistic Approval here.
Optimistic Approval can help to align incentives among different types of parties: one who possesses governance powers (governors), and another (guardians) who has the power to optionally veto during a timelock period. Ordinarily, guardians do not need to be involved in day-to-day governance, but the veto gives them the ability to block malicious proposals that would deviate from the vision of the protocol.
The Optimistic Approval framework generalizes who has governing powers and who has veto rights during a time delay. Additionally, the mechanism is parameterized by (1) initial timelock duration, (2) guardian voting threshold for increasing timelock duration, and (3) guardian voting threshold for achieving veto.
In this first application to Gyroscope in the form of limiting upgradeability, Optimistic Approval is designed to give protocol users a veto power to stop governance changes that they disagree with. In this case, protocol users fulfil the guardian role of stewarding the protocol vision (e.g., of maintaining stability). The mechanism introduces checks and balances on governors' power. Should governors try to deviate from the shared vision of the protocol, Gyro Dollar holders will be able to exercise optional veto powers during the time delay to stop it. Ordinarily, Gyro Dollar holders will not need to do anything if governance actions are sound. However, if governance actions are contentious, Gyro Dollar holders can exercise the veto to block the action.
Optimistic Approval was initially devised this application as a means to circumvent an impossibility conjecture around secure decentralized governance arising from the models in our Stablecoins 2.0 paper (Conjecture 1).