LogDerivativeRateDynOrigFee_Model.xlsm

The GammaPool (Vault contract that LPs provide liquidity to and from where Liquidity loans are made) keeps an interest rate index that depends on the utilization rate of the GammaPool’s funds and the trading fees accrueing in the underlying CFMM. The interest rate calculation aims to pay the same yield LPs earn in the CFMM up until the point that there is more borrowed liquidity out of the CFMM (in the GammaPool) than in the CFMM. In addition the interest rate calculation is capped at a maximum rate of 1000% APY.

The formula for the update of this index (accFeeIndex) is as follows

accFeeIndex = accFeeIndex * min{1 + apy1000, (1 + CFMM_Yield + BorrowRate)}

The formula for calculating the BorrowRate is dependent on the utilization rate of the pool, while apy1000 is the 1,000% APY equivalent yield for the time period (e.g. 1 day ~ 2.7%)

Utilization Rate

The utilization rate of the pool is calculated as follows

utilizationRate = (liquidityInvariantBorrowed) / (liquidityInvarantBorrowed + liquidityInvariantInGammaPool)

Liquidity invariant refers to the invariant used by the CFMM (e.g. geometric mean of reserve assets in UniswapV2)

Log Derivative Rate Model (BorrowRate)

Therefore, the annual rate the pool charges to liquidity borrowers is as follows

borrowRate = min{baseRate + factor * (utilizationRate ^ 2)/(1 - utilizationRate ^ 2), maxApy}

The above formula is based on the first derivative of the logarithmic function. It has the feature of growing exponentially as the utilization rate of the pool increases.

Untitled

The above graph is based on a factor of 0.6 and a base fee of 7.5% combined with an average apy for the CFMM of 30% (e.g. UniswapV2 paying 30% APY). The differences between the borrower and depositor is dependent on the utilization rate and an origination fee of 10 basis points. The effect of the origination fee is dependent on how often loans are opened and closed in the platform (e.g. average lifespan of a loan is 1 week)