LogoLogo
  • Overview
  • Learn
    • Lend
    • Borrow
    • Interest Rate
    • Liquidate
    • Flash Loans
    • NEPT Token
    • Risks
  • Develop
    • Contracts
      • Market
      • Interest Model
      • Token
      • Oracle
      • Querier
      • Flashloan Reciever
      • nToken
    • Token Addresses
  • User Guides
    • How to Lend on Neptune
    • How to Borrow on Neptune
    • How to Stake with the Neptune Validator
    • How to bridge TIA to Injective
  • Socials and Media
  • Audits
Powered by GitBook
On this page
  • How Interest Rates Work
  • The PID Controller
  • Proportional Component (P)
  • Integral Component (I)
  • Derivative Component (D)
  • Interest Rate Equation
  • Market-Specific Parameters
  • Example Rate Adjustment
  • Advantages of PID Control
  1. Learn

Interest Rate

The Neptune Protocol uses an advanced interest rate model powered by a PID (Proportional-Integral-Derivative) controller to dynamically adjust lending and borrowing rates. This system aims to maintain optimal capital efficiency while ensuring market stability.

How Interest Rates Work

Neptune's interest rates automatically adjust based on market conditions, primarily the utilization ratio of each lending pool. When more users borrow from a pool, rates increase to encourage lending. When borrowing decreases, rates lower to stimulate borrowing activity.

The protocol targets an optimal utilization ratio for each asset. This "sweet spot" balances capital efficiency with maintaining sufficient liquidity for withdrawals and helps the market find the ideal natural rates for lenders and borrowers.

The dynamic nature of Neptune's interest rates continually out performs competition by adjusting to real time market conditions and demand.

The PID Controller

Neptune employs a PID controller - a sophisticated feedback mechanism used in industrial control systems - to manage interest rates. The controller continuously monitors the market's utilization ratio and adjusts rates by considering three components:

Proportional Component (P)

Responds to the current deviation from the target utilization ratio. If utilization is too high, this component increases rates proportionally to the deviation.

Integral Component (I)

Accounts for historical deviations, helping eliminate persistent offsets from the target utilization. This ensures long-term stability of the market.

Derivative Component (D)

Responds to the rate of change in utilization, helping prevent rapid swings by dampening sudden movements.

Interest Rate Equation

The base interest rate for any asset is calculated as:

Where:

Market-Specific Parameters

Each asset market has configurable parameters that influence its interest rate behavior:

  • Target Utilization: The optimal utilization ratio (typically 65-80%)

  • PID Coefficients: (K_p), (K_i), and (K_d) values that determine the controller's response

  • Rate Limits: Maximum and minimum bounds for interest rates

  • Sample Period: How frequently the controller updates rates

Example Rate Adjustment

Consider a market with 70% target utilization:

  1. Current utilization rises to 85%

  2. PID controller detects this +15% deviation

  3. Controller increases rates based on:

    • Immediate response to the 15% gap (P)

    • Accumulated time above target (I)

    • Speed of utilization increase (D)

  4. Higher rates incentivize more lenders and fewer borrowers

  5. Market gradually returns to target utilization

Advantages of PID Control

Neptune's PID-based interest rate model offers several benefits:

  • Precise Control: Maintains utilization close to optimal targets

  • Smooth Adjustments: Prevents sudden rate spikes that could destabilize markets

  • Market Adaptability: Automatically responds to changing market conditions

  • Customization: Parameters can be tuned per asset based on market characteristics

PreviousBorrowNextLiquidate

Last updated 2 months ago

Rate=OutputPID×Polynomialcurve\text{Rate} = \text{Output}_{\text{PID}} \times \text{Polynomial}_{\text{curve}}Rate=OutputPID​×Polynomialcurve​

Output_PID\text{Output}\_{\text{PID}}Output_PID is the controller's output based on utilization

Polynomial_curve\text{Polynomial}\_{\text{curve}}Polynomial_curve is an asset-specific curve that can amplify or dampen the rate response