# Interest Model

Interest Model Contract Address: [inj1ftech0pdjrjawltgejlmpx57cyhsz6frdx2dhq](https://injscan.com/contract/inj1ftech0pdjrjawltgejlmpx57cyhsz6frdx2dhq/)

The **Interest Model** **Contract** is a core component of the Neptune protocol. It is responsible for managing and computing the interest rates applied to borrowing assets. Using a configurable PID controller, the contract accrues and updates per-asset interest parameters based on market utilization and other metrics. This data is then used by the Market contract to properly adjust borrowing and lending rates.

## Query Messages

### 1. Get Borrow Rate

**Query:** `get_borrow_rate`

**Purpose:** Retrieves the current borrow rate for a specified asset.

**Query Input:**

```json
{
  "get_borrow_rate": {
    "asset": {
      "native_token": { "denom": "inj" }
    }
  }
}
```

| Parameter                                                                                              | Type     | Description                                    | Required |
| ------------------------------------------------------------------------------------------------------ | -------- | ---------------------------------------------- | -------- |
| `asset`                                                                                                | `object` | The asset for which the borrow rate is queried | Yes      |
| <p><code>asset.</code></p><p><strong><code>native\_token</code></strong></p>                           | `object` | The token type for the target token            | Yes      |
| <p><code>asset.</code></p><p><code>native\_token.</code></p><p><strong><code>denom</code></strong></p> | `string` | The denomination of the native token           | Yes      |

**Query Response:**

```json
"0.032602136599636308"
```

| Parameter | Type         | Description                                        |
| --------- | ------------ | -------------------------------------------------- |
| `rate`    | `decimal256` | The computed borrow rate with 18 decimal precision |

***

### 2. Get Borrow Rates

**Query:** `get_borrow_rates`

**Purpose:** Retrieves borrow rates for multiple assets.

**Query Input:**

```json
{
  "get_borrow_rates": {
    "assets": [
      { "native_token": { "denom": "inj" } },
      { "native_token": { "denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9" } }
    ]
  }
}
```

<table><thead><tr><th>Parameter</th><th>Type</th><th width="233">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>assets</code></td><td><code>array</code></td><td>List of assets for which to fetch rates</td><td>Yes</td></tr><tr><td><p><code>assets.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>Target token type</td><td>Yes</td></tr><tr><td><p><code>assets.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>The denomination of the native token for each asset</td><td>Yes</td></tr></tbody></table>

**Query Response:**

```json
[
  [
    {
      "native_token": {
        "denom": "inj"
      }
    },
    "0.032602136599636308"
  ],
  [
    {
      "native_token": {
        "denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9"
      }
    },
    "0.028516145899841711"
  ]
]
```

<table><thead><tr><th width="274">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>native_token</code></td><td><code>object</code></td><td>Token type</td></tr><tr><td><code>native_token.</code><strong><code>denom</code></strong></td><td><code>string</code></td><td>The denomination of the native token</td></tr><tr><td><code>rate</code></td><td><code>deciaml256</code></td><td>The computed borrow rate with 18 decimal precision</td></tr></tbody></table>

***

### 3. Get All Borrow Rates

**Query:** `get_all_borrow_rates`

**Purpose:** Retrieves borrow rates for all assets with optional pagination.

**Query Input:**

```json
{
  "get_all_borrow_rates": {
    "start_after": {
      "native_token": { "denom": "inj" }
    },
    "limit": 2
  }
}
```

<table><thead><tr><th width="227">Parameter</th><th width="101">Type</th><th width="256">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>start_after</code></td><td><code>object</code></td><td>Object containing information of the token to start after</td><td>No</td></tr><tr><td><p><code>start_after.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>Token type</td><td>Yes</td></tr><tr><td><p><code>start_after.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>Denomination of native token</td><td>Yes</td></tr><tr><td><code>limit</code></td><td><code>u64</code></td><td>Number of responses to return</td><td>No</td></tr></tbody></table>

**Query Response:**

```json
[
  [
    {
      "native_token": {
        "denom": "peggy0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
      }
    },
    "0.024581462271495318"
  ],
  [
    {
      "native_token": {
        "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7"
      }
    },
    "0.122192747997619433"
  ]
]
```

<table><thead><tr><th width="274">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>native_token</code></td><td><code>object</code></td><td>Token type</td></tr><tr><td><code>native_token.</code><strong><code>denom</code></strong></td><td><code>string</code></td><td>The denomination of the native token</td></tr><tr><td><code>rate</code></td><td><code>string</code></td><td>The computed borrow rate with 18 decimal precision</td></tr></tbody></table>

***

### 4. Get All Lending Rates

**Query:** `get_all_lending_rates`

**Purpose:** Retrieves lending rates for all assets with optional pagination.

**Query Input:**

```json
{
  "get_all_lending_rates": {
    "start_after": {
      "native_token": { "denom": "inj" }
    },
    "limit": 2
  }
}
```

<table><thead><tr><th width="227">Parameter</th><th width="101">Type</th><th width="256">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>start_after</code></td><td><code>object</code></td><td>Object containing information of the token to start after</td><td>No</td></tr><tr><td><p><code>start_after.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>Token type</td><td>Yes</td></tr><tr><td><p><code>start_after.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>Denomination of native token</td><td>Yes</td></tr><tr><td><code>limit</code></td><td><code>u64</code></td><td>Number of responses to return</td><td>No</td></tr></tbody></table>

**Query Response:**

```json
[
  [
    {
      "native_token": {
        "denom": "peggy0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
      }
    },
    "0.008849338568075437"
  ],
  [
    {
      "native_token": {
        "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7"
      }
    },
    "0.088057634299353907"
  ]
]
```

<table><thead><tr><th width="274">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>native_token</code></td><td><code>object</code></td><td>Token type</td></tr><tr><td><code>native_token.</code><strong><code>denom</code></strong></td><td><code>string</code></td><td>The denomination of the native token</td></tr><tr><td><code>rate</code></td><td><code>string</code></td><td>The computed lending rate with 18 decimal precision</td></tr></tbody></table>

***

### 6. Get All Assets

**Query:** `get_all_assets`

**Purpose:** Retrieves detailed interest model information (i.e., both the asset state and its parameters) for all assets with optional pagination.

**Query Input:**

```json
{
  "get_all_assets": {
    "start_after": {
      "native_token": { "denom": "inj" }
    },
    "limit": 1
  }
}
```

<table><thead><tr><th width="227">Parameter</th><th width="101">Type</th><th width="256">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>start_after</code></td><td><code>object</code></td><td>Object containing information of the token to start after</td><td>No</td></tr><tr><td><p><code>start_after.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>Token type</td><td>Yes</td></tr><tr><td><p><code>start_after.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>Denomination of native token</td><td>Yes</td></tr><tr><td><code>limit</code></td><td><code>u64</code></td><td>Number of responses to return</td><td>No</td></tr></tbody></table>

**Query Response:**

<pre class="language-json"><code class="lang-json"><strong>[
</strong>  [
<strong>    {
</strong>      "native_token": {
        "denom": "peggy0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
      }
    },
    {
      "state": {
        "time_last_updated": "1740431284262579521",
        "last_utilization_accumulator": "17044762049054025.396573887122519963",
        "last_control_output": "0.33",
        "pid_state": {
          "prev_measurement": "0.60686996262975328",
          "integral_term": "0.33"
        }
      },
      "params": {
        "pid_params": {
          "kp": "0",
          "ki": "-0.1",
          "kd": "-0.1",
          "upper_p_limit": "0",
          "lower_p_limit": "0",
          "upper_i_limit": "3",
          "lower_i_limit": "0.33",
          "upper_d_limit": "1",
          "lower_d_limit": "-1",
          "upper_output_limit": "3",
          "lower_output_limit": "0.33",
          "setpoint": "0.65"
        },
        "sample_period_min_nanos": 18000000000000,
        "sample_period_max_nanos": 28800000000000,
        "curve": {
          "polynomial": [
            [
              1,
              "0.03"
            ],
            [
              6,
              "0.47"
            ],
            [
              12,
              "1"
            ]
          ]
        }
      }
    }
  ]
]
</code></pre>

<table><thead><tr><th width="285">Parameter</th><th width="176">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>native_token</code></td><td><code>object</code></td><td>Contains details about the native token</td></tr><tr><td><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>The denomination identifier of the native token</td></tr><tr><td><code>state</code></td><td><code>object</code></td><td>Contains the state details of the asset</td></tr><tr><td><p><code>state.</code></p><p><strong><code>time_last_updated</code></strong></p></td><td><code>string</code></td><td>Timestamp of the last update in nanoseconds</td></tr><tr><td><p><code>state.</code></p><p><strong><code>last_utilization_accumulator</code></strong></p></td><td><code>string</code></td><td>Accumulated utilization value</td></tr><tr><td><p><code>state.</code></p><p><strong><code>last_control_output</code></strong></p></td><td><code>string</code></td><td>Last computed control output for interest calculations</td></tr><tr><td><p><code>state.</code></p><p><strong><code>pid_state</code></strong></p></td><td><code>object</code></td><td>Contains PID controller state values</td></tr><tr><td><p><code>state.pid_state.</code></p><p><strong><code>prev_measurement</code></strong></p></td><td><code>string</code></td><td>Previous measurement value</td></tr><tr><td><p><code>state.pid_state.</code></p><p><strong><code>integral_term</code></strong></p></td><td><code>string</code></td><td>Integral term for PID computation</td></tr><tr><td><code>params</code></td><td><code>object</code></td><td>Contains interest model parameters</td></tr><tr><td><p><code>params.</code></p><p><strong><code>pid_params</code></strong></p></td><td><code>object</code></td><td>PID controller parameters for interest rate adjustments</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>kp</code></strong></p></td><td><code>string</code></td><td>Proportional gain of the PID controller</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>ki</code></strong></p></td><td><code>string</code></td><td>Integral gain of the PID controller</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>kd</code></strong></p></td><td><code>string</code></td><td>Derivative gain of the PID controller</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>upper_p_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the proportional component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>lower_p_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the proportional component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>upper_i_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the integral component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>lower_i_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the integral component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>upper_d_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the derivative component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>lower_d_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the derivative component</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>upper_output_limit</code></strong></p></td><td><code>string</code></td><td>Maximum allowed output from the PID controller</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>lower_output_limit</code></strong></p></td><td><code>string</code></td><td>Minimum allowed output from the PID controller</td></tr><tr><td><p><code>params.pid_params.</code></p><p><strong><code>setpoint</code></strong></p></td><td><code>string</code></td><td>Target setpoint value for the PID controller</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_min_nanos</code></strong></p></td><td><code>u64</code></td><td>Minimum time interval for sampling in nanoseconds</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_max_nanos</code></strong></p></td><td><code>u64</code></td><td>Maximum time interval for sampling in nanoseconds</td></tr><tr><td><p><code>params.</code></p><p><strong><code>curve</code></strong></p></td><td><code>object</code></td><td>Polynomial curve defining interest rate adjustments</td></tr><tr><td><p><code>params.curve.</code></p><p><strong><code>polynomial</code></strong></p></td><td><code>array</code></td><td>List of exponent-coefficient pairs defining the curve</td></tr></tbody></table>

***

## Execute Messages

### 1. Add Asset

**Execute:** `add_asset`

**Purpose:** Adds a new asset to the Interest Model. This initializes the asset's interest state with the current block time, an initial control output, and an integral term. It also stores the provided (unvalidated) interest parameters.

*NOTE: Only whitelisted addresses can execute* `add_asset`

**Execute Input:**

```json
{
  "add_asset": {
    "asset": {
      "native_token": {
        "denom": "factory/inj1n636d9gzrqggdk66n2f97th0x8yuhfrtx520e7/ausd"
      }
    },
    "integral_term": "1",
    "last_control_output": "1",
    "params": {
      "curve": {
        "polynomial": [
          [1, "0.15"],
          [20, "1.46"]
        ]
      },
      "pid_params": {
        "kd": "-0.15",
        "ki": "-0.1",
        "kp": "0",
        "lower_d_limit": "-1",
        "lower_i_limit": "0.33",
        "lower_output_limit": "0.33",
        "lower_p_limit": "0",
        "setpoint": "0.8",
        "upper_d_limit": "1",
        "upper_i_limit": "3",
        "upper_output_limit": "3",
        "upper_p_limit": "0"
      },
      "sample_period_max_nanos": 28800000000000,
      "sample_period_min_nanos": 18000000000000
    }
  }
}
```

<table><thead><tr><th width="182">Parameter</th><th width="129">Type</th><th width="372">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>asset</code></td><td><code>object</code></td><td>The asset to be added to the interest model</td><td>Yes</td></tr><tr><td><p><code>asset.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>The token type for the target token</td><td>Yes</td></tr><tr><td><p><code>asset.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>The denomination of the native token</td><td>Yes</td></tr><tr><td><code>integral_term</code></td><td><code>string</code></td><td>Initial value for the integral term of the PID controller</td><td>Yes</td></tr><tr><td><code>last_control_output</code></td><td><code>string</code></td><td>Initial value for the control output</td><td>Yes</td></tr><tr><td><code>params</code></td><td><code>object</code></td><td>The interest model parameters for the asset</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>curve</code></strong></p></td><td><code>object</code></td><td>The polynomial curve defining interest rate adjustments</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>curve.</code></p><p><strong><code>polynomial</code></strong></p></td><td><code>array</code></td><td>List of exponent-coefficient pairs defining the curve</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>pid_params</code></strong></p></td><td><code>object</code></td><td>PID controller parameters for interest rate adjustments</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>kp</code></strong></p></td><td><code>string</code></td><td>Proportional gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>ki</code></strong></p></td><td><code>string</code></td><td>Integral gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>kd</code></strong></p></td><td><code>string</code></td><td>Derivative gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_p_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the proportional component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_p_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the proportional component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_i_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the integral component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_i_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the integral component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_d_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the derivative component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_d_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the derivative component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_output_limit</code></strong></p></td><td><code>string</code></td><td>Maximum allowed output from the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_output_limit</code></strong></p></td><td><code>string</code></td><td>Minimum allowed output from the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>setpoint</code></strong></p></td><td><code>string</code></td><td>Target setpoint value for the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_min_nanos</code></strong></p></td><td><code>u64</code></td><td>Minimum time interval for sampling in nanoseconds</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_max_nanos</code></strong></p></td><td><code>u64</code></td><td>Maximum time interval for sampling in nanoseconds</td><td>Yes</td></tr></tbody></table>

***

### 2. Update Asset

**Execute:** `update_asset`

**Purpose:** Updates the interest model parameters for an existing asset. This allows changes to the PID parameters, sample period, or polynomial curve based on current market conditions.

*NOTE: Only whitelisted addresses can execute* `update_asset`

**Execute Input:**

```json
{
  "update_asset": {
    "asset": {
      "native_token": {
        "denom": "inj"
      }
    },
    "params": {
      "curve": {
        "polynomial": [
          [1, "0.04"],
          [20, "1.0"]
        ]
      },
      "pid_params": {
        "kd": "-0.15",
        "ki": "-0.1",
        "kp": "0",
        "lower_d_limit": "-1",
        "lower_i_limit": "0.33",
        "lower_output_limit": "0.33",
        "lower_p_limit": "0",
        "setpoint": "0.8",
        "upper_d_limit": "1",
        "upper_i_limit": "3",
        "upper_output_limit": "3",
        "upper_p_limit": "0"
      },
      "sample_period_max_nanos": 28800000000000,
      "sample_period_min_nanos": 18000000000000
    }
  }
}
```

<table><thead><tr><th width="183">Parameter</th><th width="112">Type</th><th width="354">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>asset</code></td><td><code>object</code></td><td>The asset for which to update interest model parameters</td><td>Yes</td></tr><tr><td><p><code>asset.</code></p><p><strong><code>native_token</code></strong></p></td><td><code>object</code></td><td>The token type for the target token</td><td>Yes</td></tr><tr><td><p><code>asset.</code></p><p><code>native_token.</code></p><p><strong><code>denom</code></strong></p></td><td><code>string</code></td><td>The denomination of the native token</td><td>Yes</td></tr><tr><td><code>params</code></td><td><code>object</code></td><td>The updated interest model parameters</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>curve</code></strong></p></td><td><code>object</code></td><td>The polynomial curve defining interest rate adjustments</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>curve.</code></p><p><strong><code>polynomial</code></strong></p></td><td><code>array</code></td><td>List of exponent-coefficient pairs defining the curve</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>pid_params</code></strong></p></td><td><code>object</code></td><td>PID controller parameters for interest rate adjustments</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>kp</code></strong></p></td><td><code>string</code></td><td>Proportional gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>ki</code></strong></p></td><td><code>string</code></td><td>Integral gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>kd</code></strong></p></td><td><code>string</code></td><td>Derivative gain of the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_p_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the proportional component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_p_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the proportional component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_i_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the integral component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_i_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the integral component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_d_limit</code></strong></p></td><td><code>string</code></td><td>Upper limit for the derivative component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_d_limit</code></strong></p></td><td><code>string</code></td><td>Lower limit for the derivative component</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>upper_output_limit</code></strong></p></td><td><code>string</code></td><td>Maximum allowed output from the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>lower_output_limit</code></strong></p></td><td><code>string</code></td><td>Minimum allowed output from the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><code>pid_params.</code></p><p><strong><code>setpoint</code></strong></p></td><td><code>string</code></td><td>Target setpoint value for the PID controller</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_min_nanos</code></strong></p></td><td><code>u64</code></td><td>Minimum time interval for sampling in nanoseconds</td><td>Yes</td></tr><tr><td><p><code>params.</code></p><p><strong><code>sample_period_max_nanos</code></strong></p></td><td><code>u64</code></td><td>Maximum time interval for sampling in nanoseconds</td><td>Yes</td></tr></tbody></table>

### 3. Next Control Outputs

**Execute:** `next_control_outputs`

**Purpose:** Used to **calculate the next control output values for all assets** using the PID controller. This is part of the interest rate model's dynamic adjustment mechanism.

*NOTE: Only whitelisted addresses can execute* `next_control_outputs`

**Execute Input:**

```json
{
  "next_control_outputs": {
    "assets": [
      {
        "native_token": {
          "denom": "inj"
        }
      },
      {
        "native_token": {
          "denom": "factory/inj1n636d9gzrqggdk66n2f97th0x8yuhfrtx520e7/ausd"
        }
      }
    ]
  }
}
```

| Parameter                                                                                               | Type     | Description                                                 | Required |
| ------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------- | -------- |
| `assets`                                                                                                | `array`  | List of assets for which control outputs are to be computed | Yes      |
| <p><code>assets.</code></p><p><strong><code>native\_token</code></strong></p>                           | `object` | Token type for target token to update                       | Yes      |
| <p><code>assets.</code></p><p><code>native\_token.</code></p><p><strong><code>denom</code></strong></p> | `string` | The denomination identifier for the native token            | Yes      |
