Rebase curve upgrade proposal

This is a really interesting idea and I appreciate the amount of thought and effort that went into it. I think you make some excellent points about how the current rebasing system may incentivize fast traders to keep the price away from the target, but I have a few problems with it.

  1. Game theory is nice but it’s too easy to tell “just-so” stories to explain things with game theory when the reality is always more complex. Humans aren’t always rational, and the world exists outside of the game you set up, which can affect the players inside the game. If you look at all of these (3,3) game theory type crypto projects that try to manipulate demand, they all eventually break from their theoretical constraints because human actions never reduce to a simple Prisoner’s Dilemma game.

  2. You are designing this system right now to adjust the trading patterns of fast traders who dominate the price action right now, but AMPL is also designed for long-term holders or contract users, and it’s designed to be future-proof. Introducing even more complexity into AMPL in order to try to control fast traders is potentially just giving them more tools to work with. I suspect that the more complex you make the rebase function, the less accessible it will be to everyone except fast traders. Right now we’re still in the early stages of AMPL and fast traders rule, but it’s an open question whether price and supply will behave the same if mass adoption occurs.

  3. When you start making AMPL’s price self-referential you may introduce complex dynamics that you don’t expect. You could potentially get self-amplifying feedback loops that cause weird oscillations in demand that ultimately serve no purpose. “If it ain’t broke, don’t fix it.” AMPL’s rebasing works. I don’t think any of the other new suggested curves could break it, because they’re just slightly different methods of the same thing. In my opinion this proposal introduces extra dynamics that have the potential to break AMPL.

4 Likes

Hey @Ducc,

Appreciate the criticism, as always. Let me take a stab at addressing your concerns.

  1. Game theory is nice but it’s too easy to tell “just-so” stories to explain things with game theory when the reality is always more complex…they all eventually break from their theoretical constraints…

I’d say that the reason that your run of the mill OHMster (3,3) memes fail is not because game theory is flawed => but rather that it is being applied wrong. I.e. does it make sense to condemn a tool if the user has been using incorrectly? Ironically enough, this is the same logical fallacy people fall victim to when they first see Ampl (i.e. they see the ponzinomics of OHM and they think rebase is inherently a flawed tool) . Here’s my observations of the OHMsters application of game theory:

  • They’ve modelled it as a single stage game, Sometimes, a single stage game is a good model for real life scenario. (i.e. what happens at a Stoplight in the absence of any authority). On the other hand, it is indeed too simple for most Defi Projects.

  • Contrast this to what’s been done here:

    • We’ve used Game Theory to see if it accurately models the existing protocol and verify it with the historical data. If it does, we can say that it’s a useful model, albeit still not perfect. We then see what would need to change in the protocol in order to change the model. Replace Game Theory with any other tool and that’s just how Science & Engineering works. I’m sure you can appreciate this.

    • We’ve not used Game Theory to build a protocol from scratch, like the OHMsters. That is indeed far far more dangerous, since the tail risk stacks up.

  • They fail to include the effect of what their system has on new actors into their protocol. Which is your second point, so I’'ll address it below. If taken into account with OHMsters however, then it should be just (3,3,-6), and it’s clear that the failure in their model is due to not modelling the transition from existing participants to new participants. This is NOT indicative of a failure in game-theory itself as a useful tool for modelling such scenarios.

I’d also ask what are the theoretical constraints you see in the hysteresis model?

  1. You are designing this system right now to adjust the trading patterns of fast traders who dominate the price action right now, but AMPL is also designed for long-term holders or contract users, and it’s designed to be future-proof.

I’m glad you brought this up, because it seems I’ve failed to communicate how this model can easily be applied to slow-traders also.

Let’s assume that Ampl is in it’s price target zone, and let’s say that Player B is a slow-trader. Let us also assume that slow-trader or someone buying for a utility is ok buying Ampl at it’s price target and that there’s a fixed $ amount that they need - like the redbook suggests. Finally, let’s assume that Player A is a fast-trader.

With the current setup, the following happens :

  • Demand comes from slow-traders (i.e. Player B)
  • Fast-traders (Player A) are also buying when there is demand from slow traders.
  • This pushes the protocol into expansion.
  • Player B needs to continue buying (in order to get what they need for their utility), and Player A is along for the ride. This drives the price up even further, and protocol itself tries to compensate by increasing the supply even more. Eventually there’s a disturbance, causing a flip, then a rip.
  • The evidence for this is glaring when you look at what happened in DeFi summer, when there was a rush of demand for the geyser utility. This drove the price up and actually made it harder for slow-traders in the short term. As a result the protocol itself tried to compensate by increasing the supply even more.

With the hysteresis design, fast traders are incentivized to sell whenever there is demand from slow-traders, they act as a price restoring force. This allows slow-traders to fulfill their demand sooner & quicker than with the current design. This design utilizes the energy of fast-term traders in a way that’s ultimately beneficial for everyone involved. This is objectively better.

Aside:
In your simulation, you used an unchanged demand assumption, and others have pointed out its flaws. I would argue that your assumption is valid!.. for when the demand is from a utility! You were biased towards designing around demand via utility, and the criticism was biased towards demand via short-term-speculators. The truth is that we need to accommodate both. The hysteresis design achieves this which much greater efficiency.

  1. When you start making AMPL’s price self-referential you may introduce complex dynamics that you don’t expect. You could potentially get self-amplifying feedback loops that cause weird oscillations in demand that ultimately serve no purpose.

I would urge you to walk thru the scenario described above. It is quite literally the opposite, the sell-pressure during expansion and the buy-pressure during contraction act as a restoring force. If you have a specific example of how that may break with this model, can you please share?

“If it ain’t broke, don’t fix it.” AMPL’s rebasing works…In my opinion this proposal introduces extra dynamics that have the potential to break AMPL.

With regards to whether it’s broken or not, we should again ask ourselves the following. Is the goal for the protocol to:

  1. Eventually reach its price target?
  2. Remain as close as possible to it’s price target for as long as possible?

If you say the goal is the former then I agree with you that it ain’t broke. But my follow up would be to ask why is that beneficial for the protocol? It’s hardly ideal for Ampl utilities. DeFi summer was proof of that. Also consider how that affects utilities’ like Ampl Bonds. Are you more likely to buy an AMPL B-tranche that where :

  • The price will eventually will eventually reach its target (with a large supply delta in the middle) OR
  • The price is much more likely to be around price target over any given period of time, (and less supply volatility as a result)

If the goal is the latter, then I would ask again for a specific example of how the hysteresis design would break the protocol. It’s ultimately still rebasing positively above target, and negatively below target. The only difference is the rate of Change of Rebase wrt to price in relation to the direction the price is heading.

I’d also point out, again, that the market in it’s current state will literally default to preferring 1. instead of 2… The model and historical data both support this.

I don’t think any of the other new suggested curves could break it, because they’re just slightly different methods of the same thing.

I completely agree! I laid out exactly why it appears this way in the Proposed Solutions section. All of the curves proposed ultimately do not change anything (on their own), and they are also hardly different from the linear function at the end. But that’s also their downfall is that they ultimately do not address the original goals being:

  • Ampl as close to it’s price target as much as possible
  • The price remaining in it’s target for as long as possible

The hysteresis design is simply the logic necessary for the protocol to know when to switch between the proposed curves → which ultimately helps achieve the goal.

All in all, I can understand the fear of the unknown. I think that ultimately we should be striving for the most optimal result as a protocol instead of just accepting flaws that we have ideas for fixing. This is how feedback controllers are designed in the real world, by testing different controllers and tuning them. I would not be against starting off with a sigmoid function and then working in the hysteresis logic afterwards, since it is just an extension. This proposal is provided merely as a model for understanding the current market dynamics, while also serving as a framework for where we should be heading towards shall we want to further improve the design.

Since several were not fond of Game theory as a tool of explaining price action, I will instead directly explain why a saturationFlag is critical to minimizing rebase error, using Supply and Demand Curves as well as using Control Theory, which is literally used in the real world to solve problems identical to this.

UNDERSTANDING SUPPLY AND DEMAND W.R.T. REBASE

First we establish that for Ampl, there exists a demand curve which slopes down, like any other asset. And because the cost of producing AMPL’s is low, the supply curve is essentially vertical. This is explained in the Redbook.

When price is neutral we are at Price target PT, and supply does not change when we are within threshold.

In the absence of any real demand via a new utility, etc. Any price action is directed towards moving along the demand curve. I.e. If we go above threshold, we move up along the demand curve. When the protocol observes it’s price information, it increases the supply. This is the rebase.

The market takes time to realize the discrepancy between the current supply and the true supply needed for equilibrium which leads to the price swinging below target to nudge the supply back into place. The rebase serves as an error correction mechanism to bring the price back to it’s target.

UNDERSTANDING DEMAND CURVE SHIFTS

In economic supply & demand theory, we shift the curve when demand changes for any reason other than price. (I.e. launch of a new utility). This means that our equilibrium supply for target price is somewhere much higher than the old equilibrium. This causes a sudden increase in the price when the market realizes the need for a larger supply for equilibrium. (This is the RIP).

Now even though the price is above target, we only rebase proportional to 1/10th of the price delta. So when the market realizes that the supply is still not growing fast enough, the market moves along the demand curve, further increasing the price.

As a result the rebase factor grows, and we get closer to the equilibrium supply faster. The market has determined that its more efficient to pay a higher price in order to get the supply to where it needs to be sooner. You may ask why the price doesn’t go to infinity, and that’s because there’s a price at which the need for getting to destination supply as soon as possible no longer outweighs the short term interest to sell. During Defi Summer this price was ~$4.

Unfortunately, the market takes time to react, so once we do arrive at the equilibrium supply- the price is still elevated, well beyond it’s target level. And by the time the market has realized that supply has been reached, we will still be rebasing positively, well beyond the target supply. This is the error. This is the cause for the FLIP.

Some have brought up why we do not rebase continuously, and now you can imagine, the error would be MUCH larger than if it was once a day. This is because you would be applying the entire rebase from the old equilibrium to the new equilibrium at once, and by the time the market realizes, the error will have grown way too far.

If the market wants to get the supply back to it’s equilibrium levels, the price needs to swing well below target, long enough to nudge the supply back to it’s right spot. Hence the long periods of negative rebase (i.e. the DIP & TRIP)

Therefore if we want to maximize the time Ampl is at it’s target price, we must minimize the error.

SIGMOID FUNCTION

Sigmoid function helps with this. If there is a sudden shift of the demand curve, the market will not pay more than the Saturation price. This is the price at which rebase curve begins to flatten. This is because moving the price higher does not make the rebases go any faster. It will however take longer to get to the target supply. This is fine, because our goal is to minimize the error.

Once we arrive to the target supply, the error will now be much less than if we had a linear function, since the price will not have run away drastically. It shouldn’t be significantly higher than the saturation price.

However there will still be significant error. Note that despite the rebase factor being relatively constant above saturation price, the amount of supply adjustment each day is still accelerating. This is because even though the Rebase factor is constant, the supply adjustment is calculated as RF * Current supply (which is a growing number with each day).

Once again, since the market takes time to react- the error will be growing by the time the equilibrium supply is reached. Also, there’s no evidence that the market will slow down approaching target. If that were the case then we would not have seen a contraction post-Defi-Summer. This is the case in ALL markets. This is why there’s blow-off tops in other crypto assets too. It’s not a coincidence.

This is like trying to stop a truck that’s accelerating up to 100mph into a parking spot accurately. Ultimately there will be error and we will need to contract a significant amount back to the intended supply.

How can we fix this?

The following strategy is often implemented in the real world with PID controllers.

This article explains how AMPL and other protocols use Feedback control.

In this example, you have the following:

1. There’s a drone that you hold, which has a sensor that measure the error between its current height and destination height.
2. You turn on the propellers, but you don’t release the drone until the propellers are spinning at the saturation speed.
3. When you finally release the drone, it flies way higher than it’s intended target because while you were holding it down, integral error signal was accumulating, and keeps accumulating even after passing the target. It then takes a long time to correct and come back down to it’s intended target.
4. The solution is to modify the controller to detect if the signal before and after saturation limit is the same. This lets the controller know if it’s at saturation levels
5. The controller checks if the sign of the error signal and the command signal are opposite signs.
6. If both 4. and 5. are true then the controller’s integrator is turned off.

If we truly want to minimize error, the protocol needs to know that it was operating at saturated prices and that the subsequent price drop is likely reflective of the market taking time to come back to the target price.

This can be implemented by the following:

  • If we set a flag at saturation price, then the protocol can be aware that it is within saturation conditions
  • If the price drops after reaching saturation levels, then it can shut off the rebase
  • We can discuss whether the flag is better to be reset when Ampl:
    • Gets back to target price
    • Comes below saturation price

The argument that this would make the protocol break is akin to saying that integral-wind up correction breaks drones. It’s simply not based on logic or relevant evidence. If anyone sees a problem with this, I would appreciate an example of a specific scenario where this would break.

If we truly wanted to minimize error even further, we can ask ourselves whether it even makes sense for supply adjustments to accelerate when in saturation? Perhaps we have a constant supply adjustment once saturation levels are met? i.e. it’s easier to stop a car that’s moving at a constant speed than one that’s accelerating. In the real world, objects have terminal velocity due to air resistance.

It’s worth noting that these flags are irrelevant to Ampl in the absence of the demand curve shifting. They only come into play when there is a sudden shock in demand. We’ve seen how Ampl performs in those scenarios (i.e. Defi Summer). You might say that AMPL’s not broken because it reached its target price after Defi summer. But if you drive your car too fast into a red light and don’t back-track until you’re already deep into the intersection, that’s far more dangerous.

In all of these examples, it was looking at demand shocks to the upside, but same logic applies to the downside.

Great to see the discussions of the ideas and that many have strong merits and I suspect the final solution will have similarities to those ideas. The proposal is not intended to optimize the performance of the rebase function but to provide a platform for upcoming proposals by having a flexible function that can be used to model most if not all of the ideas discussed here and more. And the proposed parameters are not proposed because they are thought to be optimal but to be very close to the current linear function.

I believe it is most productive to get into optimizing the performance of the rebase function after having the sigmoid function deployed. I chose to not get into my analysis in this thread and post it separately when it finished to not get sidetracked from adding the stepping stone step that allows for more advanced ideas to be implemented. Also it is much safer development practice to separate significant policy changes from code changes.

For now I will include the mental framework that includes goals and aspects/metrics to be improved without getting into the technical breakdown and potential solutions.

The goal is for the supply policy to make changes to supply to match long-term change in demand but not transient price fluctuations, which is equivalent to stating target_price * supply represents sustainable demand while market_cap (price * supply) is affected by short term volatility. e.g., after an expansion cycle and the price gets back to or below one there shouldn’t be a need for a significant contraction (in both amount and time) after if the expansion didn’t overshoot in adding supply. While time at the target on its own doesn’t achieve that goal the most critical metrics are:

  1. Fluctuations of market caps/total supply at the end of expansion and contraction periods, as these measure if contraction and expansion are overshooting the market cap/supply that matches the demand.
  2. Time to get back to the target once diverged.

These should result in more time around target price even if it is not a primary objective.

Which leads me to point out that as much as some behaviors are desirable they shouldn’t be goals in themselves.

  1. Time at/around target which is an easy to achieve goal on its own; by aggressively adjusting supply to get price to target in one go maximizing time at target but causing huge market cap and supply volatility, which doesn’t result in a greatly useful asset.
  2. Symmetry of the function between positive and negative rebases. while symmetry in their effect on that market price is potentially but not necessarily beneficial. The difference of the market behavior in its up and down cycles and reaction to trading AMPL in response to positive and negative rebase has shown not to be symmetric. So while symmetry might prove beneficial it’s not a target in its own right.

Also having bounds to rebase amounts per one rebase action is not necessarily primary to achieve protocol goals above but it is critical to provide predictability for integration with other applications, huge changes in supply in either direction can have adverse effects on collateral management for lending and other applications. While in many cases it is OK to rely on the average behavior, in this case one extreme change can have unrecoverable effects on integrations and applications.

In conclusion I want to point out that this proposal is merely introducing a flexible function into the supply policy that can be configured flexibly to allow for different shapes and allows for configuring positive and negative segments separately with independent limits and slopes for each. And implementation wise it is needed to be able to deploy the behavior that will be settled on. And the current curve configuration is not proposed because it is thought to be the best but to be very close to the current linear function to make it a very safe change to separate code changes from significant economic/behavior changes.

1 Like

Thanks to @G-Yes95 @ducc @kbambridge for getting into the weeds. I didn’t comment particularly on your ideas not to ignore them but to keep focused on the scope of this proposal and Thanks @kbambridge for creating a seperate thread for the discussion of your thoughts. But worth mentioning that I agree with their core goals and observations but I think that these observations can be used in a simpler and more methodical way than the way they are presented. That makes them more vettable, verifiable and adjustable when need be. 1- analyze the market data to identify the shortcomings and metrics 2- quantify the effect of rebase magnitudes 3- deduce the desired supply policy behavior 4- Identify hypotheses that need to be verified before using them 5- find a safe way to verify/test them 6 - Fit a function to the desired behavior. Stay tuned!

The curves in @G-Yes95 and @kbambridge posts can be all fitted to the sigmoid function proposed here by setting the 3 parameters without the need for log or cubic functions. If there is a particular one that you don’t see how it can be modeled by the sigmoid function I can find you the parameters that do so.

3 Likes

Thanks @Naguib. I’m in alignment.

Also my proposal was before the announcement of the Ampl-Stable Coin that follows Ampl’s target price. I believe a lending pool on Aave with an AMPL-Stable largely mitigate the concerns I was trying to address in my proposal, in a much less risky manner too. It will offer a much stronger incentive for free-market actors to help bring AMPL to it’s target price. I think it actually gives us reason to be much less aggressive with the rebase curve upgrade and the parameters we choose.

1 Like

Snapshot vote created!

Just wanted to clarify my position here because I went through a journey of discovery while looking into rebase functions. I am in support of this proposal. See Brandon’s post in the Symmetric Rebase proposal for more details on why. Looking forward to getting this rolled out! Thank you @Naguib and others for all the hard work and thought that went into this!

2 Likes

I see that the onchain proposal has been posted, and voting goes live in slightly less than 2 days.

Thanks for all the hard work @Naguib!

3 Likes