AMPL problem on Aave v2 Ethereum

So what do I do? Do I hold the LP or exit? What happens if snapshot happens and then I get dumped on even more? This has been extremely frustrating, especially since other aspects of AMPL like WAMPL are doing really well.

Thanks for reaching them, they fixed it :slight_smile:


Since this proposal executed on 11th April, aAMPL is not transferable , which means the proportion of aAMPL balance that one address has compared to the total supply can’t change anymore. Because of that, the balance of aAMPL on the Mooniswap contract can’t change: no aAMPL can be transferred in, or transferred out.

However, the entity with rights to distribute the USDC claim allocated to the Mooniswap contract is the owner of that contract. We will try to reach to that platform for them to distribute the claim for LP token holders, but we recommend users of the platform like you to do the same.
If we would get confirmation from Mooniswap that they can’t/won’t claim the USDC, we will include direct distribution to final LP holders in the following and final distribution.

1 Like

Here’s the reply from a team member of 1Inch- See screenshot. He gave me permission to share.
Screenshot 2024-04-19 at 12.43.34 PM
Screenshot 2024-04-19 at 12.49.25 PM

Also look at this. I tried to withdraw my Mooniswap aAMPL/AMPL LP and it’s locked. Merkl claim is supposed to be for aAMPL… but I can’t claim my LP to get my AMPL back. This makes the loss worse.
Screenshot 2024-04-20 at 9.33.48 AM

@bgdlabs Wondering if there are any updates on the final distribution?

According to previous reports, this would take place this week. I am also very curious whether this will be achieved?

Adjusted Proposal

Summary

The following analysis from BGD Labs and Chaos Labs dives into the technical aspects of aAMPL post-mortem and highlights an updated, impartial distribution methodology stemming from the root issue.

1. aAMPL Problem Description

The root cause of the problem on the AMPL reserve is a misuse of the custom aAMPL implementation of the supply and borrow indexes as if they would be the same value.

The following is a more detailed analysis of it.

Analysis

By design, the aAMPL total supply should return the AMPL available liquidity (non-borrowed) plus the total AMPL borrowed with interest (ampl-aave/contracts/protocol/tokenization/ampl/AAmplToken.sol at master ¡ ampleforth/ampl-aave ¡ GitHub). The available liquidity will be rebasing and increasing the total supply up and down accordingly, while the total borrowed will not, and will only increase from interest.

However, on the implementation of the _scaledTotalSupply() function, this “virtual” balance doesn’t really represent what it intends to. To understand how the incorrect calculation on the _scaledTotalSupply() is caused, we need to analyze how the code on aAMPLToken.totalSupply() differed from the formula intended: totalSupply = AMPL.balanceOf(aAMPLToken) + AmplVariableDebtToken.totalSupply()


aAMPLToken.totalSupply() depends totally on the _scaledTotalSupply() function and is also proportional to the balanceOf() of users: the sum of all user balances is equivalent to the total supply.

Let’s take a look at the implementation of the _scaledTotalSupply() function (https://github.com/ampleforth/ampl-aave/blob/master/contracts/protocol/tokenization/ampl/AAmplToken.sol#L640-L644).

function scaledTotalSupply() public view virtual override returns (uint256) {
  return _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited);
}

With _fetchExtData() (ampl-aave/contracts/protocol/tokenization/ampl/AAmplToken.sol at master ¡ ampleforth/ampl-aave ¡ GitHub) getting data from the borrow tokens side, from this function

function getAMPLBorrowData() external view returns (uint256, int256) {
  return (super.totalSupply(), _totalGonsBorrowed);
}

For the sake of this analysis, we will look closely on two variables: _totalGonsDeposited accounted for on the aToken, and _totalGonsBorrowed , accounted for on the vToken, but received on aToken from the chain of calls getAMPLBorrowData() → _fetchExtData() , and passed to _scaledTotalSupply().

These variables are calculated the following way on the respective mint() functions on aToken and vToken.

aToken

_totalGonsDeposited = _totalGonsDeposited.add(
  _amplToGons(e.totalAMPLSupply, amountScaled).toInt256Safe()
);

In this case, amountScaled uses internally the liquidity index of AMPL, which is a variable belonging completely to the supply side. It also uses the AMPL supply, submitted to rebases, but that is not meaningful to see the core of the problem.

vToken

_totalGonsBorrowed = _totalGonsBorrowed.add(
  amountScaled.mul(GONS_TOTAL_SUPPLY).div(fetchAMPLTotalSupply()).toInt256Safe()
);

Here, amountScaled uses internally the borrow index of AMPL, which is a variable belonging completely to the borrow side. Same as on the supply side, other components like the AMPL supply are used.

Now, going to how they are used on _scaledTotalSupply()

function _scaledTotalSupply(ExtData memory e, int256 totalGonsDeposited) private pure returns (uint256) {
  // require(totalGonsDeposited>=e.totalGonsBorrowed);
  return _gonsToAMPL(e.totalAMPLSupply, uint256(totalGonsDeposited.sub(e.totalGonsBorrowed)))
    .add(e.totalPrincipalBorrowed);
}

The key component to look here is uint256(totalGonsDeposited.sub(e.totalGonsBorrowed). There is something extremely evident after checking the 2 variables involved: totalGonsDeposited and totalGonsBorrowed are dependent on the supply index and borrow index respectively, as we just mentioned, two completely separate variables. However, the logic is subtracting one from the other. It is simply wrong to add/subtract two variables in factually different dimensions to derive another one.

As the total supply of aAMPL and the balanceOf() for each user uses _scaledTotalSupply() , which does that wrong subtraction, the calculation on both are simply wrong due to this.

In practice, the inflation of aAMPL supply and balances got only magnified during 2023 (post-freezing of AMPL happened end of 2022) because of the high utilization, which increased the difference over time of the borrow index and the supply index, and with it, the inherent error inflating the aToken supply.

2. Adjusted Distribution Analysis

Summary

Amend aAMPL compensation framework to provide more equitable terms for current holders.

Motivation

In our efforts to enhance overall welfare and equitably address the standing of existing aAMPL holders, we propose a modification to our initial proposal. This adjustment effectively removes the Aave Collector from the equation entirely, opting instead to utilize the liquidity index for the interest component rather than the borrow rate over time. Initially, the inclusion of the borrow rate was crucial as we aimed to ascertain the precise AMPL value per aAMPL, necessitating an assessment of all aAMPL in circulation, including the Aave Collector. However, with this modification, we focus solely on modeling the returns of the underlying users, under the assumption that the collector never obtained aAMPL to begin with. This adjustment aims to significantly enhance claims per aAMPL by artificially reducing the incorrect deviation of aAMPL from the correct returns due to inaccurate rebasing, while simultaneously increasing the relative interest accrual.

Simultaneously, we have heightened the frequency of snapshots taken to evaluate aAMPL market activity to approximately every 2.5 hours, compared to our initial analysis which relied on daily snapshots to align with the daily rebases. At a high level, these adjustments serve two primary purposes, leading to a greater payout per aAMPL in circulation:

  1. It mitigates the exponential deviation between correct and incorrect values. By disregarding the interest accrued to the collector and opting for the liquidity rate, the cumulative rate decreases. Consequently, any incorrectly applied positive rebases accumulate on a smaller principal over time.
  2. The adjustment of the reserve factor to 99%, as outlined here, contributed to the market deprecation, occurring about two months before the decrease in interest rates. By utilizing the liquidity rate, we implement the pure liquidity rate adjustment at 256% APR (1193% APY) for the adjusted correct aAMPL returns from December 16th, 2023 (the date of the reserve factor adjustment), rather than February 7th, 2024.

Quantification

Initial Cumulative Aave AMPL Returns Since Freeze Until Date of 99% RF

The plots below depict the adjusted cumulative returns for both the incorrect aAMPL returns and the expected correct aAMPL returns, incorporating our adjustments up to the date when the reserve factor transitioned from 20% to 99%.

By dividing the correct aAMPL returns by the current incorrect aAMPL returns, we establish the effective claim per aAMPL in circulation at the time of the freeze to be 46%. With an aAMPL circulating supply of 764,303 on that day, this amounts to 351,579 AMPL.

Liquidity Index Adjustment

In our ongoing efforts to ensure fair compensation for users impacted by recent events, we have introduced a continuously compounding liquidity index to account for the opportunity cost experienced since the date of freezing. This index reflects the interest that borrowers would have accrued due to significant rebases, assuming a consistent reserve factor and borrow rate at 100% utilization.

With a continuously compounding liquidity rate of 256% APR from December 16th, 2023 to the present day, the value of aAMPL claims surges by 136%. In addition, we propose including an extra number of days’ worth of interest accrual to account for the exact timing of the distribution proposals’ creation, increasing the 136% value to 140-150%, depending on the precise day of creation. This adjustment significantly enhances the terms for victims, with the total cumulative value of claims set at greater than 351,579 * 2.36 = 829,726 AMPL. Additionally, despite the recent crash in AMPL price, we maintain our initially proposed AMPL price of 1.198 per AMPL, equivalent to >$994,012 in dollar terms. This represents a substantial 54% increase from the initial proposal value, during an overall downturn in AMPL price and rebases, aiming to provide equitable compensation to those affected.

Simulating Since Market Inception

For users seeking a simulation of returns since the market’s inception on July 24th, 2021, quantifying respective returns yields a notably subpar outcome in the context of aAMPL to AMPL claims. This discrepancy primarily stems from the prevalence of negative rebases and the market’s efficiency prior to the freeze. During this period, sophisticated borrowers often capitalized on positive rebases, leaving suppliers with negative ones, given the relatively smaller effective daily interest rate. Crucially, this extractive activity did not occur as a result of any systemic bug. Instead, it stemmed from the transparent on-chain configuration of the system and its inherent economic principles.

image

This was initially illustrated above, but can also be observed on a different axis by plotting AMPL rebases against a given utilization rate until the market freeze.

image

Conclusion

We firmly believe that the quantification surrounding the compensation plan should accurately reflect the intended payoff of supplying AMPL into the Aave market, rather than erroneously compensating users with an extra premium as if they were completely detached from the Aave aAMPL custom implementation. We want to reiterate that the current aAMPL supply is nothing but virtual at the moment, and is simply utilized to derive the underlying claims per virtual aAMPL. Alternatively, the proposed plan offers numerous additional subsidies for current holders, including:

  • An additional four months of historically high liquidity rates (1193% APY) for suppliers as a time-based subsidy. This extension follows adjustments such as decreasing rates and increasing reserve factors aimed at phasing out a legacy implementation of the protocol, a substantial one and a half years after the market freeze.
  • Maintaining the previously defined $1.198 price per AMPL, despite the price falling below and negative rebases accruing on the aAMPL supply since.
  • Assuming returns started accruing at the date of the freeze, disregarding the highly extractive economic activity that occurred while the market was live.

Specification

Based on the initial pro-rata distribution of $300K, the proposed implementation results in an additional >$694K being distributed to affected users. This distribution employs the same methodology as the initial distribution, utilizing snapshot balances. For example, a user who held 20% of the total aAMPL supply on the snapshot day of the initial distribution would receive 20% of the extra >$694K, on top of what was already received in the initial distribution. Cases like Mooniswap will be handled on a case-by-case basis to ensure fair compensation for those users as well.

Next steps

Similar to any other governance proposal of a technical nature, this procedure will require the following 2 steps

  1. This ARFC proposal is to be voted on Snapshot, and the on-chain AIP factually starts the distribution. The ARFC will be created on Wednesday 24 Apr, to leave some time for discussion before.
  2. If the previous Snapshot passes, the estimation for the creation of the on-chain AIP (starting distribution) is approximately Saturday-Sunday 27-28 Apr. Any delay will be properly disclosed in advance.

We appreciate feedback from the community.

Disclaimer

This proposal is created by Chaos Labs and BGD Labs as part of our respective service provider agreements with the Aave DAO, due to the highly technical nature of the problem and remediation.

Copyright

Copyright and related rights waived under CC0.

2 Likes

Dear Chaoslabs,

That would mean I have a loss of around 50% of my investment!
And that in a period of 2.5 years. That doesn’t make me or the rest of the victims very happy! I hope the rest of the community will respond as well. And that we can all come to a better arrangement than this. And once again we (the customers) cannot do anything about the error, but we will still be presented with the bill

2 Likes

Thank you for the breakdown of the bug, you’ve done an excellent job explaining it clearly.

1 Like

So this proposal is a still very unfair for investors who deposited AMPL on Aave. Here is why with the real case:

I deposited “D” numbers of AMPL tokens on Aave at the time the AMPL global Supply was “S”.

As of writing of this post today, the AMPL global supply is 1.63 times the supply on the day I deposited.

So by design of AMPL Protocol, if I had earned ZERO supply rewards on AAVE, I should be owning 1.63D number of AMPL tokens TODAY. But, I did earn rewards on AAVE for supplying my AMPL. So in a fair world, I should be receiving the distribution that corresponds to AMPL tokens >> 1.63D.

Now, the proposal above is telling me that I will receive 65% of my AMPL supply. I am not even factoring in the AMPL price impact. My average price of AMPL token was 1.4x the price team is comping at ($1.19) so I basically take a ~100% hit on what my AMPL investment (in USD) would have been if I hadn’t deposited on AAVE, as of today. And if my AMPL were not stuck on AAVE, I may have sold them when the price hit $2.2 last month so from there, I am now taking a 200% hit because of an error in the AAVE protocol.

How is this fair to a user who believed in the AAVE protocol?

Can we do this just very simply? You know all the deposit dates of AMPL token on AAVE. You have the global supply of AMPL on those dates from AMPL dashboard: Ampleforth Dashboard

Instead of this whole complex on-chain analysis, can you just compare the AMPL global supply today and on the day of deposit for each user and proportionate the AMPL token claim? I am OKAY with letting go of all the rewards earned on the AAVE, will probably think twice before using DeFi next time. I am okay with taking the price hit i.e. you are paying at 1.19 dollar a token, but at least give me what I technically deserve. I deserve 1.63 times my original supply of AMPL tokens. This is only fair. I am not asking for AAVE to eat the AMPL token price fluctuations, I am letting go of all the rewards earned on AAVE but please return what I truly own.

4 Likes

Hello @OneGoodDude. After checking with the 1inch team, to simplify things we will move the claimable amount to the final proposed distribution for Mooniswap LPs.
Regarding AMPL deposited in the pool, we will evaluate it too ad-hoc.

1 Like

@psmith05 as described on previous analysis shared by Chaos Labs, and commented repeatedly on this thread, there are 2 fundamental aspects to consider:

  • By design, depositing AMPL on Aave has never been equivalent to AMPL rebases, balances over time were determined by rates. This is precisely the reason on why the proposal compensates based on a 1’198% APY, which means that balances since December 2023 had increased in 136% following the compensation.
    There is no rationale reason to only consider rebases, because the system was not intended to behave that way; the bug had no relation with this.
  • Depositing AMPL on Aave at price X (e.g. $1.4) didn’t give any type of assurance that your price or balance when withdrawing will be on those levels. Both AMPL itself and consequently AMPL on Aave had important volatility, so same as interest rates were very high on positive rebases (e.g. the 136% appreciation of balances proposed in 4 months), impact of negative rebases was important too.

Together with Chaos Labs we believe the last proposed solution is fair, and will be our final one going to Snapshot and if positive, to on-chain proposal.

1 Like

Hello.
From everything that has been written, I only have a question about this, how did 87.5k ​​APY turn into 1.19k APY from December 16, 2023. We are not asking you to give us the entire virtual AMPL, but why not calculate the real AMPL based on 87.5k ​​APY, which worked all this time with 100% of borrowed liquidity.


Here you decided that you would increase the percentage for those who borrowed deposited assets, but without understanding the operation of the AMPL and its unique characteristics, you made this percentage equal to all other assets. Therefore, why not simply calculate in the simulation the real aAMPL at the time of December 16, not taking into account rebases, but taking into account 87.5k ​​APY?

3 Likes

Call for Fair Treatment and Open Discussion for AMPL Investors on Aave

Dear Aave and Ampleforth Community,

I am writing as a long-term investor in AMPL through Aave v2, to express my serious concerns regarding the recent proposals and their unfair impact on us, the investors who have sustained our trust in the platform.

In July 2021, AMPL was integrated into Aave with a unique rebase mechanism, leading to significant discrepancies between displayed balances and actual economic value. Because we trusted the integrity of these virtual balances, many of us chose not to withdraw our investments. Unfortunately, we are now facing unfair penalties for this prolonged trust, as early withdrawers may have reaped undue benefits while we confront potential losses.

The freezing of AMPL assets in November 2022 further complicated the issue and restricted our options. It is concerning that Aave proposes to address these problems through a rapid vote, without allowing for extensive discussion and input from all investors, which brings the platform’s commitment to decentralization into question.

The plan to proceed with a vote without sufficient discussion is troubling, especially as it appears to lack transparency and undermines the principles of decentralization. A small group of large account holders often influences decisions, which may not align with the broader community’s best interests.

I urge an open and transparent dialogue where the interests of all investors are thoughtfully considered. We must collaboratively seek a fair solution that promotes transparency, reinstates trust, and respects the rights of all community members.

Thank you for your time and attention. I sincerely hope for constructive cooperation to resolve this situation justly.

3 Likes

First of all, both AMPL and AAVE projects knew about the error back in 2022, but none of them took action to notify liquidity providers about this so that they would withdraw funds. They also did not fix the problem and stopped monitoring it, exposing everyone involved to the risk we faced.
Also, from what I read on the AMPL Discord, when this Quantum man wrote about that error, they initially did not pay attention to it and ignored all his messages. Then, when AAVE opened this topic on the forum, AMPL said in the discord that this error appeared only during the freezing of the asset at the end of 2023, although they knew very well that this error was identified at the beginning of 2022. They lied, is that okay? Surely NO.
And regarding the fact that both projects did not take any action to notify investors in 2022, and also did not try to correct this mistake, and are now offering us less than what we should get, this is terrible and if they do not change their approach, we will apparently have to do report to the authorities about what happened so that they can intervene and help investors. Also, all investors can connect to the information company and tell everyone about how both of these projects dealt with us.
But let’s first wait for the final decision from them, perhaps they will realize that all this is their fault, and that investors should not be deceived and at last they will make a true and fair calculation.

3 Likes

@MarcZeller @stani Frens, I know you from 2017 as reliable and fair people, can you please help depositors and AAVE investors in this situation? We will all be very grateful

2 Likes

Thanks for the response @bgdlabs and appreciate the patience.

I fully understand and agree on the price dynamics, I do not expect the AMPL token price to stay same. That’s an investor’s risk and AAVE should not compensate an investor for that.

However, I respectfully disagree with the 136% proposition. My assets were 100% borrowed during this entire time and hence, I should be compensated at 87500% APY, not 1198%. This is not investor’s error, this is technical error in AAVE and investors should not suffer because of that.

Right now, all the AMPL investors are paying for AAVE’s Technical issues. How is that fair? @stani - could you please help understand? I would like to understand if this was the founding philosophy? Investors are paying for the Protocol’s mistakes?

2 Likes

Our decision to utilize the selected liquidity rate was based on a straightforward principle: it was the last rate applied on-chain, prior to the deliberate drastic decrease in February in an attempt to deter further exacerbation of the issue. Aave operates as a decentralized protocol governed by its DAO, meaning that any updates made by the Aave community effectively become the reference rate to be used.

Moreover, this decision came 1.5 years after the market was frozen, with borrowers unable to actively borrow AMPL. By calculating rates from the time of freezing, we effectively bypass all the extractive behavior that occurred during the protocol’s active period, where the liquidity rate reached 677% APR (87K% APY) at a utilization rate of 100%. This adjustment alone has quadrupled the claims per aAMPL.

Considering the liquidity rate when the market was active (87K% APY), leads to the assumption that borrowers would only borrow when economically viable, typically when the rebase is positive. However, this was the case for only 48% of days since December 16th, leaving suppliers with negative rebases. Even when assuming that the utilization rate scaled to 100% every time a rebase was positive (which is unlikely, considering the 2.08% paid per day at this rate, suggesting borrowers likely borrowed for only a few hours to collect the rebase), returns would only amount to around 82% since December 16th until present day, considerably lower than the proposed 140%-150%. Extending the analysis to returns since inception would only exacerbate this further.

Furthermore, the current utilization rate is not actually 100% due to the bug within the system. If all 71.5K vAMPL were burned today, only 71.5K aAMPL would be available for withdrawal, a significant shortfall relative to the proposed compensation amounts. Our assumption, based on the rate enshrined on December 16th, 2023, artificially assumes a utilization rate of 100%, even though only 71.5K AMPL is effectively being borrowed today.

1 Like

Could be interesting IF you offered something for folks who have been AMPL supporters, and willing to grow through this code breakage as an even greater supporter. For example IF you offered 50% more in a locked token that offered yield over time.