[MIP-1] Proposal for re-enabling borrowing on Moonwell

Hey all – forgive me for the large wall of text but I’d like to introduce motivation for and specific paths towards re-enabling borrowing on Moonwell!

Background

Moonwell did a great job mitigating the damage from the Nomad depegging by quickly pausing borrowing when
the attack started. This should be lauded. Despite being exposed to $100M+ of risk, the protocol has less than $10M of bad debt on its books.

Moonwell is currently in this paused state where borrowing is disabled.

If we re-enable borrowing of non-Nomad assets, we can start to build trust with new users that the protocol has and will continue to operate properly so that they start supplying assets. Healthy money markets have two sides to them: We need borrowers to incentivize suppliers. When the protocol is chugging along, bad debt in the native markets (GLMR, xcDOT, and FRAX) can be slowly rebuilt via the reserve factor and protocol sieze share of liquidations (see below for definitions).

Re-enabling borrowing of non-Nomad assets is safe only if Nomad assets cannot be used as collateral.

There are other changes that would also probably be helpful for the protocol, but this post will only focus on the goal of re-enabling borrowing at this time as this is clearly a very important immediate step to take at this moment.

Overview

There are several knobs to turn to encourage this behavior:

  • Decrease the collateral factor on Nomad assets (to zero or to some percentage of the “true market price”)
  • Increase the reserve factor on Nomad assets
  • Change the oracle price away from the “peg” price

And, further, the manner in which these knobs are turned over time is up for debate:

  • The rate at which the values are changed (instantly, quickly, or slowly)
  • The point at which the values stop changing (collateral factor to 20% or 0%)
  • etc.

Definitions

I will elide some of the basics and terms that aren’t as critical to understanding this post, but please read through the official Moonwell docs to learn more about how the protocol works.

Collateral factor

Collateral factor is the maximum percentage that can be borrowed against some given asset as collateral. For example, with a collateral factor of 60%, if I provide $1000 USDC as collateral, I can borrow $600 worth of assets against that collateral before my loan becomes unhealthy.

Reserve factor

Reserve factor is the percentage of the interest that a borrower owes that goes back to the protocol. For example, with a reserve factor of 20%, if I borrow $1000 USDC and the borrow rate is 10% APY, than over a year I’ll owe an extra $100 on my loan. Of that $100, $20 goes to the protocol, and $80 goes as extra interest to lenders.

Liquidations, Liquidation Incentive, Close Factor, Protocol Sieze Share

Liquidation is the process of paying off the debt of another user whose health has dipped below 1.0. Close factor is maximum percentage of the collateral that can be liquidated at once. The liquidation incentive is an extra percentage paid out to incentivize folks to liquidate others in debt. The protocol sieze share is the percentage that gets paid out to the protocol. For example, for a user with $1000 of collateral and health below 1.0, with a close factor of 50%, liquidation incentive of 10%, and protocol sieze share of 3%, a liquidator can sieze $600 of collateral if they pay $500 of the debt and of that extra $100, $30 is given to the protocol and the liquidator pockets $70.

Looping

Looping is the process of lending and borrowing the same asset over and over again. This is profitable in cases when incentives make borrowing less expensive than the rewards paid for lending.

Bad Debt

Bad debt is debt that could be liquidated but it is unprofitable to actually liquidate because the debt is more expensive than the collateral that can be siezed (even after the liquidation incentive).

State of the World

Basic parameters:

  • The collateral factor for all assets on Moonwell (both Nomad and non-Nomad) is currently set to 60%
  • The reserve factor on USDC is 25%; on ETH and BTC is 30%
  • The close factor on all assets is 50%
  • The liquidation incentive on all assets is 10%
  • The protocol seize share on all assets is 3%

Governance facts:

  • A governance vote takes 3 days and has an additional 24 hour timelock delay after it passes before any changes take effect.

Random facts:

  • Nomad borrowers concerned with liquidation can acquire cheap (below oracle price) assets from StellaSwap if they don’t have enough in their wallet.
  • Despite borrowing being disabled, withdrawing and repaying loans are enabled and so looped positions can still be unwound.
  • Rational liquidators will repay any Nomad asset borrowed against native assets (GLMR, xcDOT, or FRAX) because those are profitable.
  • Rational liquidators may repay any Nomad asset borrowed against another Nomad asset as long as they could sell the siezed asset at a profit (note: This is complex because it depends on StellaSwap market prices of the Nomad assets being siezed).
  • Rational liquidators will probably not repay native assets (GLMR, xcDOT, or FRAX) borrwed against a Nomad asset unless the value borrowed is <19% (the current likely redemption value) of the amount siezed.

See the following spreadsheet on Nomad Collateral Reduction Impact which contains data pulled from the public retool subgraph with a few extra computed columns. I suggest making a copy and playing with the “New Nomad CF” value in the top-left.

Extra columns in the spreadsheet:

  • Liquidatable (TRUE/FALSE): Whether an account has health > 1 given variable amounts of Collateral Factor applied to Nomad assets
  • Native Borrowed (TRUE/FALSE): Whether an account has any native assets (GLMR, xcDOT, or FRAX) borrowed
  • Native < 19% Nomad (TRUE/FALSE): Whether an account’s native asset borrow balance is < 19% of the Nomad asset collateral value
  • Realistically Liquidatable (TRUE/FALSE): If an account is Liquidatable, AND has Native assets borrowed, AND Native assets are < 19% of Nomad collateral value
  • Pure Nomad Liquidatable (TRUE/FALSE): If an account is Liquidatable, AND has NO Native assets borrowed

Insights from the spreadsheet:

  • With the current 60% collateral factor, there are 0 nomad liquidatable accounts and 0 realistically liquidatable accounts (if there were, there would have been an arb opportunity as liquidation would be profitable).
  • At 50% collateral factor, one big whale who is looping Nomad USDC can be liquidated (0x87839e0378c62d8962c76726cfdd932a97ef626a with a $1.667M position) ($1,667,741.75 total).
  • At 40% collateral factor, 9 accounts are now Nomad-liquidatable but the total is only increased by ~$6k ($1,673,879.90 total)
  • At 30% collateral factor, 11 accounts are now Nomad-liquidatable and the total is only increased by ~$12.5k ($1,686,359.90 total). A single account becomes realistically liquidatble but only for $2.25 of native assets.
  • At 20% collateral factor, 11 accounts are still Nomad-liquidatable ($1,686,359.90 total). 4 accounts are now realistically liquidatable but only for $5.92 of native assets.
  • At 10% collateral factor, 16 accounts are Nomad-liquidatable for ($1,789,912.92 total). 5 accounts are realistically liquidatable for $125.47.
  • At 0% collateral factor, nothing new happens, it’s the same as 10% ($1,789,912.92 on Nomad liquidatable and $125.47 for realistically liquidatable).

Moreover these numbers asume Nomad borrowers don’t repay anything which is unlikely when a governance vote starts.

My Thoughts

I am undecided between two paths and I’d like to hear thoughts from others in the community before we put up a governance proposal.

  • Both paths don’t involve touching the oracle price as that can be quite hairy.
  • Both paths do propose changing the reserve factor to 100%; this will push the supply APY down to 0% on all the Nomad assets. The supply APY is already small, but it doesn’t hurt to make it smaller as maybe this would be a trigger for someone to unwind their position if for some reason they’ve missed all other cues.
  • Both paths (eventually) ramp collateral factor down to zero. I beleive this is safer than trying to move the collateral factor down to a safe RFV of Nomad assets as the market is a bit illiquid and unpredictible. For the health of the protocol, I think we should just effectively “ban” these assets as being collateral which is what a 0% collateral factor does.
  • The only risk that I see of making these changes to the collateral factor are liquidations caused by users not paying attention to their positions. There is no possibility of someone who is paying attention being unfairly liquidated since positions can still be unwound. The only reason not to immediately turn the collateral factor to zero on Nomad assets, for example, is in service of these folks who aren’t paying very close attention.
  • A negligable amount of realistically liquidatable (non-Nomad) funds are at risk of liquidation even if no one pays attention to this change.

Path A

  • Phase1: Ramp down the collateral factor to 30% and increase the reserve factor to 100% on all the Nomad assets
  • Phase2 (wait 1week after phase1 before starting governance vote again): Move the collateral factor to 0% on all the Nomad assets

Why this path? By doing a slower ramp down, hopefully many of the 11 users (should they not notice this change is coming) will notice their health factor significantly decrease or will only get partially liquidated. Maybe this will indicate to those users that they should unwind their positions to avoid being fully liquidated.

Path B

  • Immediately move the collateral factor to 0% and reserve factor to 100% on all Nomad assets

Why this path? There is already a 4 day delay (3 days for governance vote + 24 hour timelock) which in theory is enough time given that the Nomad hack was all over the news so, in theory, anyone that still has Nomad assets in Moonwell is paying close attention.

Thanks

Thanks for reading everyone! Please share your thoughts below if you disagree on any details or which Path you think is best for Moonwell.

Note: I have run this post by the Moonwell team to make sure that (a) all objective information I am sharing is accurate, (b) that the raw data was collected properly, and (c) that the computed data was evaluated properly. While the Moonwell team helped me with fact-checking, and I am an advisor for the company, the opinions expressed here are my own as an independent community member of the Moonwell ecosystem.

8 Likes

I’ve also created an accompanying Snapshot Snapshot

4 Likes

This is awesome @bkase, huge thank you for putting this together! :clap: :clap: :clap:

1 Like

I’m against this. Afaik, nomad is working around the clock to retrieve the funds, as such, preventing to borrow against nomad assets should be enough instead of changing the collateral factor to force liquidations (besides its predatory, and honestly pretty scummy, the protocol is trying to make some gains liquidating users who are already in an awful state post-hack). If and when the bridge opens, a new proposal should be set to take into consideration the value that can be retrieved, as a possible future oracle price. The suggestion of changing the oracle price to the price of some random exchange is absurd. Some users cannot unwind positions as there is no liquidity on some assets (which they can have borrowed). The way to move forward should be: a) Continue to not allow new borrowing for mad assets b) Wait for the nomad bridge situation to be resolved and reactivate all the other markets.

3 Likes

It’s important to note that it is impossible to prevent borrowing against Nomad assets alone in the protocol. The community can prevent borrowing of Nomad assets, but this doesn’t prevent people from taking out new loans against Nomad collateral if borrowing of GLMR, xcDOT, or FRAX were to be turned back on.

This is also important to note. Borrowers have the ability to repay loans and suppliers have the ability to withdraw. Governance takes time (3 days for a signal vote, 3 days for a binding on chain vote, 24 hour timelock if the vote passes before execution) and the hope is that borrowers and suppliers will have time to react and take the necessary steps to prevent liquidations from occurring.

I’d encourage you to get help in Discord if you would like to unwind a Nomad supply or borrow position and it seems difficult for any reason. There should be plenty of liquidity in all Nomad markets for suppliers to withdraw, and borrowers should be able to repay loans.

You can’t freeze one market? I didn’t knew this.
There is still no reason to force liquidations at illiquid market prices when it is factual nomad has already retrieved some funds that will end up being redeemed in the future.

Discord won’t help users that have deposited dai and borrowed frax to fold, for instance. Unless someone provides liquidity on frax, that user is stuck.

Yeah, it’s an unfortunate part of the design. Since you can use any supplied collateral to take out a loan, the protocol doesn’t discriminate against which type of collateral you use. All collateral is considered “good” up to the value reported by the price oracle. You can only stop borrowing of a specific asset.

I personally won’t vote for or against this proposal because I’m a contributor to Moonwell and don’t want to influence the vote, but the protocol is crippled now without borrowing enabled. If the community chooses to move forward, borrowers have plenty of time to react and repay their loans. Nobody should be “forced” to be liquidated unless they take no action.

Did you mean USDC? DAI isn’t available on Moonwell. Hypothetically, if someone deposited Nomad USDC and borrowed FRAX, they can simply repay their FRAX loan and not worry about being liquidated.

Realistically though, a liquidator that is rational will probably not liquidate that position because they would have to repay the FRAX loan, which is worth more than the Nomad USDC they would be able to seize by liquidating. Does that make sense?

Yes

I mean, if he folds the position (he deposited the frax he borrowed), he is now stuck. He can’t repay because he deposited it and there’s no liquidity for him to withdraw.

I see what you mean. But in that scenario, the liquidator would have to pay $1 for FRAX to liquidate $1.07 in Nomad USDC that is worth maybe 20 cents? No liquidator is likely to liquidate that loan.

@nujhe As Luke said, I think folks that have effectively shorted FRAX against USDC.mad assets (which includes me, actually) if they already aren’t, will become liquidatable, but rational liquidators won’t actually liquidate because Nomad assets aren’t actually worth $1 (this is what causes bad debt). But even if they were, the bet was wrong. I figured FRAX was more likely to depeg that USDC which is why I shorted it against my USDC collateral, but the opposite happened and I was punished.

But the specific case that you’ve share about users who have some amount of FRAX borrowed and folded FRAX against Nomad assets and are stuck and unable to repay part of their fold because there is no available FRAX to withdraw – this is actually very reasonable in my opinion to try and protect these folks.

So we should at least consider trying to resolve this liquidity issue . It’s great that the supply APY is so high, but it’s still profitable to fold (this is probably why liquidity is too thin). Maybe we can consider first adjusting some knobs to disincentivize borrowing (perhaps that’s reducing Reserve Factor or the supply incentives?) before we starting to lower collateral factor.

I checked and this is not hypothetical: There are definitely a few accounts in this situation (here’s a few I found just by manually scanning Retool )
0x70b7b7e027ef6f528930a11a6bbb3c9b007443db
0xb5ab290e152290b6bd5bdb04e23236d3f9d4aaec
0xa89da48796bb808cb9af3637ff7ab436f968c7d5

Wouldn’t a rational liquidator be able to seize some of the FRAX collateral in the folding case? This would be profitable, right? Or am I missing something?

1 Like

I think it’s a good idea to force liquidations and then make a new proposal to include new assets to replace Nomad.

Eliminating all nomad assets will benefit Moonwell

I don’t know if this is possible.
Excuse my bad English, I support myself with a translator.

1 Like

If there is liquidity to seize then yes. But there is no liquidity in the FRAX market that anyone can seize.

It is definitely a challenging situation that the FRAX market is in. If new liquidity arrives, it is getting withdrawn almost immediately by a large supplier that still has 6 figures of mFRAX.

If new FRAX liquidity arrives, people looping FRAX would be wise to unwind (not financial advice) if it is collateralized by Nomad assets. But without liquidity, there is nothing for liquidators to seize.

This is a good call out. Right now it appears there is still a large supplier that is withdrawing Frax liquidity as soon as it arrives. If more liquidity can be added to the Frax market, even temporarily, that would let people unwind.

If CF were to go to 0 right now on all Nomad assets, those liquidations still wouldn’t happen because there is no FRAX to seize in the market (zero liquidity), however as soon as FRAX liquidity arrives (either through loan repayments or new supply) underwater borrowers could be liquidated a tiny amount at a time, which would definitely hurt.

It is possible to unwind a leveraged FRAX borrowing position with flash loans from a DEX, but it requires constructing a complex transaction and interacting with contracts directly. I wonder if someone in the community could make a tool to help these borrowers unwind?

If there’s decent liquidity, users might also rather keep their frax than unwind and hope for nomad to resolve the issue. At least they would get 60% back.
At least now, they are earning rewards while waiting for more frax depositors and for nomad to resolve their problem.

I’m still a bit flabbergasted that moonbeam believes they can just shrug off 200M being siphoned out of their network and just move on like nothing happened. A bridge that is still presented in their official channels, through a video-guide, as a tool to move assets to their network.

In moonwell’s case, it was also the protocol decision to move forward with the choice to list nomad assets.

On further reflection, I actually think these folks that are wound up looped positions took on the risk of a liquidity crunch + depending on Nomad asset collateral going in, and treating these accounts separately than all the others that are affected seems more unfair than singling these wound up accounts out for extra help. If they didn’t have anything wound up, they would get to keep the FRAX but this is actually “unfair” in the other direction—this is what’s causing the bad debt in the protocol; folks are borrowing against worthless collateral. Does that make sense? Please share if you disagree and why.

The accounts that are wound up have less than $100k of nomad collateral at risk total, so even if you disagree with me, perhaps in the future there can be a vote to have Moonwell’s treasury payback those who lost funds.

Given that the snapshot seems to be pointing towards the quick collateral factor switch, and that there is potential recourse for these accounts, I think it’s worth starting the governance vote soon.

3 Likes

I would be very happy if Moonbeam covered some of the losses as a holder of a large amount of Nomad assets, but I think it’s irrelevant for this thread.

4 Likes

i agree with this, the moonwell project still bear some responsibility for the nomad incident. please help to refund us

Hi everyone,

The top priority should be to not take any further action that could harm more users. A remember, most of them came into Nomad assets through Moonwell, who decided alone, without any governance to integrate Nomad Asset. An internal or external audit should have been performed by Moonwell, having the internal resources and budget with recent 10M$ fundraising.

It exists other solutions to not harm users. Moonwell team should investigate into other solutions if disable borrowing with Mad assets only is not possible.

Here a list of options.

  1. Create an isolated market lend-borrow like Euler Finance
  2. Fork the actual smart contracts to keep freezing the actual Artemis market until a definitive resolution plan from Nomad
  3. Create a new page with its new smart contract V2; Now and later, it would easily allow users to transfer their assets through amigration process from actual V1 to V2.

We don’t feel fair that Moonwell want to pass all Bad Debt of their protocol into User sides and also on the lender side.

PS : The vote snapshot " Paths towards re-enabling borrowing on Moonwell" does not allow to vote only on the option “Other”, I don’t know if it is a frontend or a backend error.

Have a nice day,

1 Like