# InterestRateModel

*The interest rate model used by UTokens*

### BORROW\_RATE\_MAX\_MANTISSA

```solidity
uint256 BORROW_RATE_MAX_MANTISSA
```

*Maximum borrow rate that can ever be applied (0.005% / block)*

### interestRatePerBlock

```solidity
uint256 interestRatePerBlock
```

*IInterest rate per block*

### ReserveFactorExceeded

```solidity
error ReserveFactorExceeded()
```

### BorrowRateExceeded

```solidity
error BorrowRateExceeded()
```

### LogNewInterestParams

```solidity
event LogNewInterestParams(uint256 interestRate)
```

@dev Update interest parameters event @param interestRate New interest rate, 1e18 = 100%

### constructor

```solidity
constructor(uint256 interestRatePerBlock_) public
```

### getBorrowRate

```solidity
function getBorrowRate() public view returns (uint256)
```

*Get borrow rate per block*

### getSupplyRate

```solidity
function getSupplyRate(uint256 reserveFactorMantissa) public view returns (uint256)
```

*Get supply rate for given reserve factor If reserve factor is 100% interest acrues to the reserves If reserves factor is 0 interest acrues to uDAI minters*

#### Parameters

| Name                  | Type    | Description                 |
| --------------------- | ------- | --------------------------- |
| reserveFactorMantissa | uint256 | The reserve factor (scaled) |

### setInterestRate

```solidity
function setInterestRate(uint256 _interestRatePerBlock) external
```

*Set new interest rate per block Interest rate per block must be less than the max rate 0.005% / block*

#### Parameters

| Name                   | Type    | Description   |
| ---------------------- | ------- | ------------- |
| \_interestRatePerBlock | uint256 | Interest rate |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.union.finance/developers/core/iinterestratemodel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
