MIMD1: Maximizing MarginFi's Capital Efficiency

:bangbang: MarginFi’s current mechanism design is leaving money on the table for LPs & creating unnecessary risk across the platform :bangbang:

The way MarginFi currently calculates APRs uses the total_supplied and the total_borrows amounts of a given asset. However, due to the parameters dictated by the risk engine, the entire total_supplied amount is not available for borrows. This results in low APRs at high utilizations for lenders, and as a result low capital efficiency and increased risk. If pools are consistently at 100% borrowed, this is an indication that market participants are more than willing to pay the current APR, and the protocol is constantly in a state of being forced to accept maximum risk per pool.

The below proposal outlines an alteration to the general formula for calculating the utilization of lending pools that would result in higher APRs at maximum utilization and overall higher capital efficiency for each pool this change is implemented for. Additionally, the proposed mechanism change aids in minimizing risk across the MarginFi platform, and operates within the spectrum of the risk management parameters dictated by MarginFi’s risk engine.

Specifically, this proposal recommends changing the utilization rate formula to use the max_borrows_available value instead of the total_supplied value as the full pool parameter used for determining a utilization rate in APR calculations for isolated pools. The utilization of an asset should be at 100% if there are no available borrows.

This would do 3 things:

  1. Increase returns for LPs and allow for passive capture of volatile market events that spike borrow interest
  2. Allow MarginFi to accurately and optimally price borrows
  3. Reduce overall risk across MarginFi and strain on liquidators

(1) Increase returns for LPs and allow for passive capture of volatile market events that spike borrow interest

While implementing a mechanism change that increases APRs may reduce overall borrows, the interest rate curve can be implemented in such a way that even with lower borrows, returns for LPs are increased due to allowing the market to accurately price borrows on the platform

Currently, the APR that results from borrow pools being 100% utilized does not allow LPs to capture profits from volatile market opportunities that spike borrow interest. If a pool is at 100% utilization, the APR becomes static at the maximum. There exist many opportunities where a borrower is willing to pay, for example, 9% APR on SOL at 100% utilization for a 2-4 week period in order to short SOL, trade NFTs, farm airdrops, provide liquidity in DEXs, and more. If utilizations are consistently at 100% of the available borrows, users cannot borrow more, and borrows are not efficiently distributed to those who value them highest.

(2) Allow MarginFi to accurately and optimally price borrows

Because borrows are not being efficiently distributed to those who value them most, and is constrained by the maximum APR, the price to borrow a given asset on MarginFi is not necessarily an accurate representation of how the market is actually pricing those borrows.

(3) Reduce overall risk across MarginFi and strain on liquidators

By increasing APRs, MarginFi decreases borrow demand, while maintaining at minimum the same level of returns for LPs. As a result of decreased borrow demand and decreased utilization, MarginFi will have lower risk across the board stemming from pools that implement this change. Additionally, higher APRs provide an additional incentive for borrowers to repay faster and may reduce inelastic or fully passive borrowing, which could result in lower strain on liquidators. Additionally, at 100% utilization there is a small, non-zero chance that lenders will not be able to withdraw their supplied assets.

An example:

First, MarginFi’s current utilization rate calculation for isolated pools uses the following parameters:

total_supplied = the amount of an asset supplied to MarginFi

total_borrows = the amount of an asset borrowed from MarginFi

We simply calculate the utilization_rate by dividing total_borrows by total_supplied

We’ll examine two scenarios, one where we use the total_supplied parameter, and one where we use the proposed max_borrows_available parameter, which represents the total amount of an asset that is available to borrow

For both scenarios, let’s assume there is $150M in the supply pool for a given asset, $100M of allowable borrows of that asset, and $100M in borrows of that asset; and we are operating under a similar kinked interest rate model to what Aave has implemented, with an optimal utilization of 80%

Scenario 1:

utilization_rate = total_borrows / total_supplied

utilization_rate $= 100,000,000/150,000,000 = .67 = 67%$

Here, the utilization of the pool appears to be below the optimal 80% and so the APR will be reasonable. Yet there are no borrows available for the market, meaning anyone who would be willing to pay a higher APR to borrow those assets is not able to express that preference, and current borrowers do not have a sufficient incentive to repay.

Scenario 2:

utilization_rate = total_borrows / max_borrows_available

utilization_rate $= 100,000,000/100,000,000 = 1 = 100%$

Here, the utilization of the pool is 100%, and the APR will be rather significant. If users do not repay, LPs will earn significantly more in this scenario. LPs will still earn more than they currently do even if users do repay up to a certain utilization_rate, due to the higher APR that results from a higher utilization_rate value, and is thus more capital efficient as it produces the same or higher returns with fewer borrows:

at 100% utilization and a 9% borrow APR, in the most simplistic case, lenders are receiving $9M annualized, non-compounding. Split amongst all lenders, this is a 6% APR:

$(100*1.09 - 100)/150 = .06$

at 80% utilization and a 12% borrow APR (20% less borrows, 25% higher APR), lenders are receiving $9.6M annualized, non-compounding. Split amongst all lenders, this is a 6.4% APR:

$(80*1.12 - 80)/150 = .064$

Clearly, in this scenario less overall borrows are resulting in better returns for lenders, while implying lower risk and allowing the market to accurately price borrows.


In addition to Hexagon’s initial proposal above outlining a recommended change to how MarginFi calculates the utilization parameter and any further analysis desired or needed there, Hexagon Research would like to work with MarginFi to further review and optimize the interest rate model, and propose any potential changes be first tested in small, isolated lending markets such as $SHDW, $BONK, $BLZE, etc. This partnership would entail systematic reviews of:

  1. User behavior across MarginFi’s lending products
    • The goal of this review is to obtain an overview of how users behave on MarginFi under different market conditions, which will help parametrize agents in later analyses
  2. Parametrization of the current interest rate model for each agreed upon pool
    • The goal of this review is to ensure that MarginFi is operating at the maximum possible level of capital efficiency under the current model, while minimizing risk across the platform
  3. Mechanism design for interest rates
    • Simulation analysis of outcomes for MarginFi under different model implementations inspired by the review, with user agents based on MarginFi’s user behavior
    • Recommendation of model based on outcomes
    • The goal of this review is to find the interest rate mechanic that maximizes MarginFi’s capital efficiency while minimizing MarginFi’s risk
  4. Parametrization of a selected model across pools (if it differs from the current implementation)
    • The goal of this review is to maximize the capital efficiency and minimize the risk of MarginFi’s selected interest rate model across each individual pool in MarginFi’s lending product under a differentiated model from what exists currently
  5. Impact any changes recommended by Hexagon & implemented by MarginFi had on MarginFi and its users.
    • The goal of this is to identify the impact that design choices recommended by Hexagon had on MarginFi’s user’s bottom lines.

Initially, to show the MarginFi community that Hexagon Research intends to become a valuable contributor to the ecosystem, Hexagon would like to do the additional work outlined in bullets above essentially for free over the next ~3 months, in order to begin building our relationship with the MarginFi community through contribution. We just ask for access to MarginFi’s data. This would require minimal involvement from MarginFi’s current team. At the end of this work & assuming MarginFi & the community are happy with the work product, Hexagon will seek an expanded partnership scope and retainer fee for helping to ensure MarginFi is continuously maximizing capital efficiency and minimizing risk across the platform and each product offering.


lfgrow - super bullish on this update

1 Like

Launch the token so I can vote yes Edgar! :grin:


@snomis - appreciate you putting this MIMD up! It looks like we’ve gotten quite a few likes on this proposal and I think it makes sense to me, let’s go ahead and move forward with it.

A small commitment from my end: MRGN, Inc. will commit developer time to implementing this once design is completed, and is happy to help with design here.

Moving from total_supplied to max_borrows_available is a relatively easy change here, but I’m wondering if we can go further: does it make sense to design more dynamic interest rate curves that better reflect borrower demand?

For consideration:


1 Like

@edgarpavlovsky yes, i think it definitely makes sense to explore dynamic mechanisms such as the optima control model you mentioned. We can start to look into this and design some options over the next few weeks and revert back on the forum once we have some formulations & analyses of these options to share.

Looking forward to working with the MarginFi team & community!


Fire - let me know how we can help!

1 Like