Ampleforth flash minting

Ampleforth flash minting

I would like to start a discussion inside the community of chances, dangers, and the overall future of flash loans/mints in the elastic finance world.

Background

Flash loans are a new Defi primitive to provide uncollateralized loans.
First developed by AAVE, with flash loans it’s possible to borrow instantly “any” amount of collateral for exactly one transaction. If the collateral (plus possible interest rate) is not returned by the end of the transaction, the transaction is reverted.

As Ethereum transactions are atomic, no state is changed in case the flash loan fails.

Current and future flash loan providers

More and more Defi-protocols provide flash loans of their underlying collateral or flash mints for their ERC20 tokens.
An incomplete list includes:

The MakerDAO governance has a Declaration of Intent to add a DAI Flash Mint Module. Currently, it seems to be stalled.

Interesting differences between some providers are the anticipated fees. AAVE and Balancer can only provide flash loans of their underlying collateral, and as they are money markets it seems reasonable to expect fees. Interestingly, Balancer provides a somewhat vague argumentation:

[...] Flash Loan fee will start at a small value to ensure
there is always a cost of capital to create a flash loan on
Balancer.

There is no cost to provide them though…

On the other side, MakerDAO and WETH10 can provide flash mints of their ERC20 tokens and while MakerDAO’s MIP anticipates fees too, WETH10 does provide flash mints for free!

The free option makes sense for WETH10 as there is no company, DAO or other kinds of stakeholder behind the contract and earnings would be somewhat useless.

Future of flash loans/mints

Putting it nicely, flash loans helped a lot with hardening the whole Defi landscape. They are also praised as a democratization tool, mostly for arbitrage. IMHO it’s at the very least safe to say they are here to stay. But that’s probably not all.

Any ERC20 token used as “money” has reasons to provide flash minting abilities as this would help grow and harden their protocol ecosystem.

Ampleforth and flash minting

Ampleforth is designed as base money. A first natural, somewhat stable curve in a world of chaos.

Additionally, there seems to be a lot of focus on derivates deriving from AMPLs. Ampleforth could evolve as the foundation of many future protocols building upon it, elastic finance.

Questions and chances with flash minting AMPLs:

  • One of the positive side effects of flash loans is the hardening of the surrounding ecosystem. If AMPL evolves as the foundation of elastic finance, it would be nice to be able to use this tool from the very beginning.

  • Flash minting AMPLs provides the ability of “flash minting” derivates using AMPLs as an underlier. This ability would be kind of “built-in”.

  • Fees?

    • One could argue Ampleforth does not need to have earnings.
    • In the long run, fees could become competitive.
    • No fees are more inclusive.
    • It does not have any costs to provide flash mints, why take fees?
  • Is it even possible to implement flash minting now that AMPL is decentralized?

Other Ressources

7 Likes

I think the one caveat with flash loans and AMPL is the rebase. I propose that the principal for flash loans that are taken on a rebase block should expand and contract the same as the token themselves. Or else all of the rebase can be stolen from one flash loan from AAVE, which would just end up being added to MEV transaction ordering.

2 Likes

I agree that the rebase is a challenge for the implementation of flash mints and flash loans.

From my understanding (which could be wrong), this would be the case as long as the flash loan provider does not buffer the total supply but fetches it before and after the flash loan.

Anyway, this problem would arise if the rebase transaction itself is called inside the flash loan, in which case the flash loan provider would need to expand/contract the principal as you said.

Could this maybe be mitigated if AMPL provides flash mints that forbid any “rebase and flash mint in the same transaction”-scenarios?

1 Like

I think the easiest way is to do the accounting of flash loans with GONs instead of AMPL, which is the underlying unscaled unit of AMPL. I guess you could cause the transaction to fail if there was a rebase that occurred between flashloan taken and debt repaid in the block, but then there is another MEV attack vector for cancelling the transaction.

1 Like

One thing to keep in mind is that the AMPL ERC-20 on ethereum is no longer upgradable and hence we can’t add this capability to the contract.

However, we could add this to the cross-chain AMPL instances and a V2 ERC-20 (when we build one) …

Yeah I think this is a really interesting idea, but it does raise some conceptual questions.

Ampleforth has followed the philosophy of defining money by two qualities:

  1. The nature of its scarcity
  2. Its use value

For example, Bitcoin’s scarcity is determined by its enforced 21M ceiling. It has no use value so it’s not subject to price distortions from non-monetary demand. A lot of things could change about Bitcoin, but if either of these changed it would stop being Bitcoin and start being something else.

What is it that makes AMPL, AMPL? I’d say that AMPL

  1. is a pure money with no non-monetary use, and
  2. it’s scarcity is defined by a monotonic and non-dilutive rebase curve

#2 is the sticking point. Flash loans don’t change scarcity, but flash mints definitely do. During a flash mint everyone else is diluted, breaking what many would consider an invariant of the system.

I like flash loans a lot, but I’m not sure I’m sold on flash mints. (For AMPL or other “pure monies” at least).

3 Likes

I’m sorry I got the two concepts mixed up. I was thinking about flash loans.

I tend to agree with @Brandon here, we should likely keep a base money as simple as possible. Flash minting could be done with a derivative, although maybe I’m missing something but what is the benefit over a flash loan?

1 Like

While @Brandon raised good points about AMPL’s philosophy of money, the benefit of flash mints compared to flash loans could be the benefit of governance through FORTH.

Flash loans would be provided by money markets, e.g. AAVE, or similar protocols with big liquidity. I’m unsure about how much the AMPL community/FORTH governance would have a voice regarding the rules of the provided flash loans.

1 Like

Could you expand on this a little further? As I read in the FMT contract that they’re thought of as “credit” tokens. Ample’s scarcity wouldn’t be effected by expansion and contraction of credit if it’s happening within 1 block.

1 Like

Yeah I see what you’re saying about credit. At such small timescales the distinction does start to blur and it might just be a matter of taste where I could see legitimate support.

If the totalSupply increases in the mint and burn operations, then it really is an expansion of the M0 monetary base. It only lasts for the span of one transaction, but as we’ve seen a lot can happen within one tx. For better or worse, devs could no longer rely on a user’s balance / totalSupply ratio being constant.

If the totalSupply does not increase, then there is suddenly extra float that is not accounted for in the supply. Devs could not know a user’s balance / totalSupply ratio. Not the end of the world, but not the cleanest either.

I view flash mints being more of a derivative then “the commodity itself”. This does match up with the WETH implementation, actually. WETH is a derivative of the ETH primitive (an IOU) and the flash minting happens at the WETH level. There’s no reason why it has to be this way, aside from technical restrictions… but I’m sure the ETH dev team would do a serious security review before adding flash minting to ETH proper.

4 Likes

So im kinda confused as to what these tokens are because you’re saying in one hand that they are a mint that would dilute everyone’s shares, but on the other hand you’re saying it’s a derivative?