> For the complete documentation index, see [llms.txt](https://docs.honey.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.honey.finance/lending-protocol/interest-rates/protocol-math-solana.md).

# Protocol math (Solana)

Solana's programs use linear functions to derive interest rates. Thus, all of the interest rates on the Solana lending programs can be expressed as:

**`y = ax + b`**

Where **`y`** is the interest rate for a given utilisation rate **`x`**.

{% hint style="info" %}
Variable **`a`** is the slope of the curve, determining how fast or slow interest accrues given a change in utilisation.
{% endhint %}

```typescript
// Example of interest calculation when current utilisation is below 1st optimal rate 

interestRate = ((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0 )) * utilizationRate + (-1*((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0  )) * 0 + BASE_BORROW_RATE )

/* y = interestRate
 * a = (x2 - x1) / (y2-y1)
 * x = utilizationRate
 * b = -ax + y
 *
 * Meaning that:
 *
 * y = interestRate
 * a = ((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0 ))
 * x = utilizationRate
 * b = (-1*((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0  )) * 0 + BASE_BORROW_RATE )
*/ 
```

Varying risk parameters and collaterals will result in different values for `ax + b`&#x20;

```
// InterestRate.ts
// Parameters used in the default risk model

export const OPTIMAL_RATIO_ONE = 0.4;
export const OPTIMAL_RATIO_TWO = 0.8;
export const BASE_BORROW_RATE = 0.1;
export const BORROW_RATE_ONE = 0.25;
export const BORROW_RATE_TWO = 0.4;
export const BORROW_RATE_THREE = 1.4;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.honey.finance/lending-protocol/interest-rates/protocol-math-solana.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
