Weighted Algorithmic Compound Distribution

Problem

Currently, all markets have their own COMP distribution rates set through governance. The following is under the assumption that we want a fixed total COMP distribution rate over all markets.

When we add or remove markets, the COMP distribution rates for all other markets have to be adjusted to achieve our desired total COMP distribution. This can be quite cumbersome.

Solution

Assign every cToken a COMP distribution weight and introduce global COMP distribution rate targets for both lending and borrowing. These weights then calculate the distribution rate for each market.

Example

3 markets are supported: COMP, WBTC, and USDT. Global COMP distribution is 1 COMP per block for borrowing.

Market Weight Distribution Rate (Borrowing)
COMP 20 ~0.57
WBTC 5 ~0.14
USDT 10 ~0.29

Formula

borrow_distribution_rate(MARKET) = global_borrow_distribution_rate * (weight(MARKET) / sum(weight(ALL_MARKETS))

supply_distribution_rate(MARKET) = global_supply_distribution_rate * (weight(MARKET) / sum(weight(ALL_MARKETS))

Benefits

  • Changing global distribution rates is simpler
  • Simpler distribution rate changes when adding or removing markets
  • Less room for human error when recalculating weights for all markets

Thoughts?

2 Likes

Maybe in the next comptroller implementation we could use COMP speed weights like you described instead of raw comp rate. New implementation might also give a chance to separate COMP borrow distribution from the supply rates (currently they’re 50/50 with no parameter to change it).

One problem is that the comptroller smart contract size is near the maximum size for ethereum. Much change might require creative ways to reduce comptroller size or separate the functionality into multiple contracts.

I’ve completed the code changes to implement this idea.

https://github.com/TRiLeZ/compound-protocol/tree/weighted-comp-speed

Changes:

  • Add separate borrow and supply distribution rates
  • Add weights for every market for both supply and borrow sides

Note: Comp speeds are now calculated based on utility for their respective market (previous behavior) AND on their supply/borrow weights. I need someone to check my math on this.

2 Likes

@TylerEther thanks for getting creative with this! It’s awesome to see you diving into the Comptroller contract.

The biggest issue that I see, is that the goal isn’t to divide the COMP distribution between a global “supply” side and a “borrow” side, but rather the supply or borrow side of an individual asset. For example, collateral assets (like ETH, WBTC) might see the COMP distribution allocated entirely to suppliers, while stablecoins (popular borrowing assets) might see the COMP distribution allocated more heavily to borrowers.

To the other aspect, having a “weight” by market, is a nice simplification – though it reintroduces the refreshcompspeeds function, which was removed in the last upgrade.

2 Likes

Thanks @rleshner for the response!

I’ll think about this from a new angle - incentivizing borrowing vs. lending for individual assets.