Stable Rate Borrowing via Order Book

Originally posted here in response to the incident that will likely do away with stable rates as we know them: Aave v2/v3 security incident 04/11/2023 - #4 by awbvious

It is time for a new way to do stable rates.

For Aave, the old way of stable rate is determined via a rough 2x calculation of the variable rate. And it is called “stable,” but Aave’s stable rate won’t stay the same in some outlier situations: Borrowing - FAQ .

However, if the lender stipulates upfront how much they are willing to accept no matter what the utilization rate is, then you can get true stable rates. And that works great for the borrower. And it is fantastic for shorting. To do it Aave would use a behind-the-scenes orderbook.

It would be the same interface as currently exists in Aave, just with extra functionality for this behind-the-scenes order book that really only happens after you click the “Supply” or “Borrow” button. The “Borrow” pop-up per the old way of stable rates has an option on top to choose between “Stable” and “Variable.” This new way is similar, except both the “Borrow” and “Supply” have “Stable” and “Variable” options.

This example of Alice, Bob, and Charles will generally explain the functionality.

Alice has MEMESHT and she really believes in it, she’s in it for the long term.

Bob has MEMESHT but is not as bullish.

Charles wants to short MEMESHT.

Alice sees MEMESHT under “Assets to supply,” clicks “Supply.”

In pop-up, she clicks the “Stable” option on top.

She puts in the amount of MEMESHT tokens of “100.”

She slides the 0% to 100% slider, with 5% increments, to “10%”.

She slides the 6 months to 48 months slider, with 6-month increments, to “12 months.”

She clicks “Submit.”

The MEMESHT tokens are taken from her wallet and put into the contract.

This means Alice will accept 10% or more borrow rate with a lock of 1 year or more on 100 MEMESHT tokens.

Bob sees MEMESHT under “Assets to supply,” clicks Supply.

In pop-up, he clicks the “Stable” option on top.

He puts in the amount of MEMESHT tokens of “200.”

He slides the 0% to 100% slider, with 5% increments, to “50%”.

He slides the 6 months to 48 months slider, with 6-month increments, to “48 months.”

He clicks “Submit.”

The MEMESHT tokens are taken from his wallet and put into the contract.

This means Bob will accept 50% or more borrow rate with a lock of 4 years (the max) on 200 MEMESHT tokens.

Charles sees ETH under “Assets to supply,” clicks Supply.

In pop-up, clicks the “Stable” option on top.

He puts in the amount of ETH tokens of “0.1.”

He slides the 0% to 100% slider, with 5% increments, to “5%”.

He slides the 6 months to 48 months slider, with 6-month increments, to “48 months.”

He clicks “Submit.”

The ETH tokens are taken from his wallet and put into the contract.

This means Bob will accept 5% or more borrow rate with a lock of 4 years (the max) on 0.1 ETH tokens.

Charles sees MEMESHT under “Assets to borrow,” clicks Borrow.

In pop-up, clicks the “Stable” option on top.

He sees below the amount field for MEMESHT tokens the text: “Max 300.”

He puts in the amount of MEMESHT tokens of “100.”

The 0% to 100% slider, with 5% increments, defaults the best option of “10%”.

The range between 0% and 10% and 50% and 100% are deactivated.

The 6 months to 48 months slider, with 6 month increments, defaults to the best option of “12 months.”

The range between 6 months and 12 months is deactivated.

He knows he can increase the amounts of rate and lock but has no incentive to.

This means Charles can accept 10% or more borrow rate with a lock of 1 year or more on 100 MEMESHT tokens.

The maximum possible for him to borrow is 300 MEMESHT, because while his ETH is worth 400 MEMESHT, the total possible liquidity from Alice and Bob is only 300 MEMESHT.

Charles, though, wonders what would happen if he borrowed 200 MEMESHT.

Charles changes the amount of MEMESHT tokens of “200.”

The 0% to 100% slider, with 5% increments, defaults the best option of “45%”.

Directly below the 45% slider the text: “10% for 12 months, then 50% for 36 months.”

The range between 0% and 45% and 50% and 100% are deactivated.

The 6 months to 48 months slider, with 6-month increments, defaults to the only option of “48 months.”

The range between 6 months and 48 months is deactivated.

He knows he can increase the amounts of rate and lock but has no incentive to.

Clicks “Submit.”

The MEMESHT tokens are removed from the contract and put in his wallet.

This means Charles will pay 45% or less borrow rate with a lock of 4 years or more on 200 MEMESHT tokens.

Charles knows this because he borrows half of the MEMESHT from Alice at a cheap rate and the rest from Bob at a higher rate. Someone can undercut Alice or Bob, like Daniel might offer 100 MEMESHT at 5% for 1 year, and thus Charles’ rate would go down, but it can never go over 45%.

If Alice, Bob, Charles, or Daniel ever wants to, they can go info.aave.com to see the entire order book.

A note about locks:

First the token gets deposited in the contract. Until/unless it is utilized, it is “soft locked” and can be withdrawn at any time. Utility could mean it is actively being used as collateral or the source for borrowing. Once it is utilized, it is “hard locked” until either:

Someone else’s funds gets utilized because of a better rate offer.

The one utilizing it is stops utilizing it (e.g. fulfills obligation).

Per a, Charles was utilizing 100 MEMESHT from Alice and 100 MEMESHT from Bob. Alice cannot withdraw. Bob could only withdraw 200 MEMESHT if he wanted to. But Daniel is offers his 100 MEMESHT at a better rate than Alice and Bob. And now Charles is utilizing 100 MEMESHT from Alice and 100 MEMESHT from Daniel, thus Bob could withdraw all 300 MEMESHT if he wants. Presuming that Bob is not using that 100 MEMESHT as collateral to borrow.

Per b, Charles’ 0.1 ETH is worth twice the 200 MEMESHT he is borrowing. So, he can immediately his 0.05 ETH. Unless, of course, Charles’ 0.1 ETH is the entire stable liquidity of ETH and then Edgar comes along and borrows all 0.1 ETH. But in this case, no one is borrowing his 0.1 ETH. In a scenario where Charles is only borrowing from Alice and Bob, if Charles decides to repay the borrow, he would need to repay 290 MEMESHT. Once he does that, his 0.1 ETH is completely unutilized. Charles can now withdraw all 0.1 ETH.

Thanks.

Reach out to me on the Aave Discord, my username is awbvious and my DMs are open.

1 Like

I asked the Aave Discord why I am not getting any feedback (I really want some, I have no idea if my idea is complete hogwash), and the bot said:

You can post your suggestion on the Aave governance forum for visibility and feedback. If you've already done so and haven't received any feedback, it might take some time for the community to respond. You can also follow up on your post to keep the conversation active.

Hence, this reply. Anyone? Really could use even a “this is stupid and here’s why…” response.

Hi @awbvious , I suggest you to bring your topic to “Other” section in Forum, as this topic is not related to Aave Grants DAO, and could be removed. I would also suggest you to be more concise when explaining your idea, example is great but idea is understandable from start.