Interest Rate Model
Last updated
Last updated
Dahlia Protocol utilizes an adapted version of Fraxlend's Variable Interest Rate Model v2. This model has been proven in production for nearly two years, demonstrating robustness across diverse market conditions. We optimized the implementation to reduce gas usage by up to four times, making it even more efficient for use within Dahlia markets.
The IRM used in Dahlia operates on a dual-component system:
Interest Rate Curve: This determines the interest rate based on utilization at any given block. The curve functions similarly to those in other lending protocols like Aave, with adjustments based on current market utilization. The interest rate changes at different rates before and after the target utilization range, with distinct slopes for each segment of the curve. Specifically, the curve is calibrated to adjust gradually before reaching the target utilization, and more steeply afterward. Additionally, there are maximum and minimum full utilization rates, which determine the sharpness of the curve and ensure the interest rate remains within predefined bounds.
Curve Adjustment: The shape of the interest rate curve adjusts dynamically over time in response to deviations from the target utilization level. This ensures the curve aligns with market conditions, adapting to both under-utilization and over-utilization. The curve adjustment mechanism relies on a parameter called rate_half_life, which determines how quickly the interest rate changes in response to deviations from the target utilization level. Specifically:
If utilization is at 0%, the interest rate will halve over the period defined by the rate_half_life
(e.g., 7 days).
If utilization is at 100%, the interest rate will double over the same period.
The adjustment happens incrementally every time the accrueInterest()
function is called, effectively splitting the overall rate change into smaller chunks based on how frequently users interact with the market. If the rate_half_life
were shorter (e.g., 1 day), the adjustments made each time the function is called would be more pronounced.
The adjustment is proportionally slower if the utilization is between 0% and target utilization, or target utilization and 100%.
The IRM parameters allow for detailed control over the interest rate behavior:
min_target_utilization
The minimum utilization rate below which no adjustments are made to the full utilization or target rates.
max_target_utilization
The maximum utilization rate above which no adjustments are made to the full utilization or target rates.
target_utilization
The utilization rate at which the slope of the interest rate curve increases.
min_full_utilization_rate
The minimum interest rate (per second) applied at 100% utilization. It is lower than the maximum full utilization rate.
max_full_utilization_rate
The maximum interest rate (per second) applied at 100% utilization. It is higher than the minimum full utilization rate.
zero_utilization_rate
The interest rate (per second) at 0% utilization, representing the minimum rate borrowers will pay.
rate_half_life
Determines the speed at which the interest rate curve adjusts to changes in utilization. At 100% utilization, the interest rate doubles at this rate; at 0%, it halves.
target_rate_percent
A percentage indicating the difference between the full utilization rate and the zero utilization rate, providing a smoother adjustment.
Optimized Efficiency: Our implementation is designed to significantly reduce gas costs, making transactions more affordable for users.
Robust and Flexible: The IRM aims to maintain stability across various market conditions, encouraging participation from both lenders and borrowers while keeping lending markets competitive and sustainable.
Dynamic Adjustments: The curve adjusts in real-time, ensuring the interest rate aligns with optimal utilization levels and responds to changes in demand.