Lender of First Resort for RAI

This post is meant as a brief introduction to the concept of lender of first resort and how it can help the RAI protocol.

Overview

The lender of first resort is a staking pool where anyone can deposit FLX. In case the RAI protocol is underwater (or better said, it has bad debt that could not be covered by collateral auctions), the staking pool would start to auction FLX in exchange for RAI that is then used to erase bad debt. In case there is no or little FLX left in the pool, the protocol would then start to mint new new FLX (the debt auction mechanism that is already implemented).

In exchange for taking the risk to protect the protocol, lenders of first resort can be rewarded with:

  • More FLX
  • A portion of the stability fees that the system accrues

Initially, the plan is to only offer more FLX for stakers, as the RAI protocol is still in its infancy and does not accrue enough fees to sustain itself (e.g pay for oracles, controller updates), fill the surplus buffer and on top of this reward the staking pool.

Staking Pool Parameters

The initial plan is to offer 2% of the genesis FLX supply (20K FLX) over one year to stakers. This is, of course, unsustainable over the long run although it is a meaningful amount as to encourage people to protect the system in its early stages.

Aside from the reward amount, it’s important to note that people will not be able to exit the pool whenever they want. A staker would need to request an exit and wait a specific amount of time before they can withdraw their FLX from the pool. The delay is necessary so that people do not exit right before their FLX gets auctioned off. The proposed delay right now is one week, although we’re open to other ideas!

Roadmap

The lender of first resort implementation can be followed here. The code is just starting to take shape and, given that it’s an extremely important and highly sensitive piece of infrastructure, it will need thorough testing, audits as well as a Kovan test before it can be deployed in production.

Given this as well as the fact that we’re currently implementing saviours for RAI minters, we expect to release the lender of first resort pool in 2-3 months from now.

Questions

  • What do you think about the lender of first resort? Should we continue to pursue this?
  • Are the proposed params for the pool optimal?
8 Likes

Shall we consider a max slashing % for stakers? For example AAVE stakers’ maximum risk is 30% of their staked AAVE. I don’t know what the optimal % would be, but 100% slashing risk may de-courage some people from staking.

1 Like

From what I know, Aave doesn’t have debt auctions where they mint new tokens and the protocol also doesn’t have a balance sheet.

The pool will make sure that there is some FLX left at all times so people can exit that but I’m not sure if putting a threshold is ideal in our case.

1 Like
  • What do you think about the lender of first resort? Should we continue to pursue this?

Definitely worth pursuing. This would enable FLX holders with a higher risk tolerance to backstop risk for those who want lower risk.

  • Are the proposed params for the pool optimal?

The proposed delay right now is one week

7 days for withdrawal seems pretty long to me. IMO it’s impossible to predict something like an insolvency-causing black swan event 7 days ahead of time.
I only know of two other protocols which lock funds for a similar reason. One is hegic (14 days but it makes sense because one can reasonably predict futures funding out that long) and the other is unslashed which only does 48 hours.

Which parameters did you want feedback on? 20k over 1 year seems reasonable to me.

uint48   public   bidDuration = 3 hours;                                      // [seconds]
// Total length of the auction
uint48   public   totalAuctionLength = 2 days;  

These parameters seem pretty slow to me if the intention is to maintain confidence in the system during a volatile black swan event.

Mainly feedback around the length of the exit delay.

Keep in mind that the exit delay must be higher than the popDebtDelay (the delay from the moment a collateral auction starts to the time when the proceeds from the auction can be used to erase the bad debt it created). If it’s not higher, people can still exit the staking pool before the system becomes insolvent so they aren’t actually protecting anything.

Right now popDebtDelay is set to 12 days which is a really long time. I was thinking of adjusting this value to 5 days and the staking exit delay to 7 days. Personally I’d be comfortable with something like 3 days for popDebtDelay and 5 days for the exit delay but I’m not convinced that we should go lower.

As a note: we’re currently using the fixed discount auction not the English one (you highlighted the params above) and the params can be found here. The plan is to transition to an increasing discount auction in the next two months because it is more efficient.

2 Likes

Right now popDebtDelay is set to 12 days which is a really long time. I was thinking of adjusting this value to 5 days and the staking exit delay to 7 days. Personally I’d be comfortable with something like 3 days for popDebtDelay and 5 days for the exit delay but I’m not convinced that we should go lower.

Wow, 12 days seems really long.

I want to make sure I understand this correctly so I’m pretending we’re experiencing the same price action and massive drop that we saw prior to “Black Thursday” about 1 year ago. All numbers are very approximate. Modeling this properly would be a big project. Let me know if this seems like a reasonable worst-case scenario.

Imagine that people in the FLX lender of first resort pool are seeking 100% APR so there is a total of 20k FLX in the pool.

Take this figure with a grain of salt, its supposed to be liquidation price of first 1000 safes but this is an old version of my suite that is even buggier than usual.
flx liquid 5-3

  1. First we see the 72 hour, 20% drop. Some liquidations occur but the system handles it fine. A few lenders of first resort may take some FLX out – not because they’re worried about liquidation but because they may have debts elsewhere that need covering.

  2. A week later we see the second big drop. 25% drop in 48 hours. Too fast for people facing a liquidity crunch to cover their debts. ETH is also -37% since the peak 2 weeks earlier. We’re at ETH price ~$2000 now and if literally nobody added more collateral to their safes then we’re seeing ~20k ETH ~($40M) in liquidations. At this point, RAI is discounted heavily (probably 10%+) so keepers are happy. They’re sucking up a lot of uniswap liquidity (right now there’s $4B in uniswap alone, not including CEXes). Fortunately, the system is still solvent because of the 145% collateral factor. More lenders of first resort want to start withdrawing funds on March 9th.

  3. Black Thursday happens just 3 days after the last big drop. 50% drop in 24 hours to $1000. Every safe with a liquidation price between $1000 and $2000 is getting liquidated (another 20k ETH). There’s a liquidity crunch and the network is congested and Coinbase is down so getting ETH off CEXes is hard. Keepers shit the bed and aren’t covering debt properly.* Every debt with a liquidation price between $1500 and $2000 is ~10% insolvent (total insolvency is ~2k ETH, $2M).

  4. 100% of lenders of first resort are terrified of what could happen and begin withdrawing their FLX with 5 day timer. FLX has also lost 50% of its value so total value of the first resort is $5M. Auction begins and lenders take 40% haircut. Meanwhile, someone just bought a bunch of FLX from the auction and the lending pool is smaller so they ape into it for ~150% APY. Total value of the lender of first resort pool is back to $3M.

One thing I didn’t model in was the amount of RAI/ETH and RAI/DAI liquidity because this is hard to predict and has to do with how subsidized it is.

TL/DR: I think popDebtDelay = 3 and 5 day withdrawal delay would work and seems about right.

Please correct the details I inevitably got wrong.

*I’m a mere armchair expert when it comes to running keepers but IMO the problem there was not the rapid price drop but more that the keeper code everybody was running didn’t function properly and then some guys in Argentina capitalized on this. Hopefully keeper code people are running today is more robust and there’s some diversity in keepers as opposed to everyone running the vanilla Reflexer-provided code.

2 Likes

This is indeed hard to model without spending lots of time on it. In Maker’s case there was also a bug in the smart contracts that made things worse.

Keep in mind that the pool won’t accept new deposits if it’s time to auction FLX. It doesn’t make sense to allow new capital if it will be sold off instantly.

What you said it’s the right way to approach the problem but I don’t have an informed opinion without doing more sims.

Keep in mind that the pool won’t accept new deposits if it’s time to auction FLX. It doesn’t make sense to allow new capital if it will be sold off instantly.

Ah, yea I meant that the FLX pool would be refilled after the first auction. (So days 4 and 5 after auction concludes sometime on day 3 or day 4).

It seems to me like we need to have multiple screw-ups at different levels for any of this to matter and I’ll be putting a good portion of my FLX bags in the first resort pool but would prefer withdrawal delay to be shorter (mostly because I like to be able to withdraw if it pumps).

Stakers do of course want to exit faster although in this case we need to think about the needs of the protocol :smirk:

I think it’s safe to say that we’ll take care of the implementation and in the meantime think about proper params to initialize the pool with.

Issue a staked FLX token (sFLX) upon FLX deposit (which would trade at a discount to FLX and is returned to the system upon initiation of withdrawal) so I can :gorilla: while I :man_farmer:?

2 Likes

Love this proposal, totally makes sense. Amount and delay duration looks reasonable for me.

1 Like

That’s already being done ser.

2 Likes

After discussing the design a bit more, we think it’s better if people don’t directly stake FLX but rather a LP token such as FLX/DAI or similar.

We’ll get back with an implementation in the next weeks.

Would the reason for paring flx with a stable coin make the given liquidity predictable since flx is volatile ?

I like this issue as it would be less correlated to the health of the network as a whole. When Black Thursday hit, the MKR token value falls as well and collapses as well. When things are dropping then demand for RAI should increase and would hold value as the system delever.

I also wonder if the flx/rai could be used as part of the savior pool as a backup to the system. So, at times of stress could unwrap the pair. The FLX would be in line for first loss. The RAI could be used as saviour liquiity if things are going south.

Could you go more into why an LP token would be a better solution in the staking module than using FLX itself?

Imo, exposing FLX stakers directly to the risk of bad debt accruing to the protocol, while rewarding them with inflationary issuance/stability fees, is quite elegant and straightforward.

FLX/RAI is not advisable because we go back to the problem we had in February: people buy RAI to LP it.

The main argument is that it keeps a base liquidity level which can be useful when the market explodes during Black Thursday.

1 Like

Yea this makes sense.

Would this be uniswap V3 LP using the liquidity manager? Or just V2?

Reasons for:

  • Creates liquidity ALL the time which is nice (Single-staked FLX is kind of wasted most or all of the time). Might help jumpstart markets on CEXes as well.
  • Ensures there is some amount of exit liquidity so auction buyers are taking less of a risk.
  • FLX/DAI ensures price stability which is “nice to have”

Now I rant about DAI:

  • I want less DAI/USD exposure, not more.
  • It seems to me that the most likely scenario where the protocol is underwater is a black swan event where DAI is at similar risk of being underwater so using DAI instead of ETH increases uncertainty and risk in FLX pricing.
  • It makes Reflexer more vulnerable to the whims of MakerDAO governance.
  • USDC is valid collateral for MakerDAO CDPs :poop:

Has the team considered using FLX/ETH liquidity instead of FLX/DAI?

edit:

FLX/RAI is not advisable because we go back to the problem we had in February: people buy RAI to LP it.

We had less ways to short RAI back in February/March. Now those people would get punished faster.

i second this option …we need to move away from dai …flx/usdc lp or flx staking alone is better option …

1 Like