# InterestRate contract

This contract implements InterestRateModel logic and provides methods to calculate supply, borrow, utilization rate.

### Common usage

Common usage is to call view with needed params of type `rateParams` where callback is contract entrypoint that receives [`yAssetParams`](/yupana-document-portal/developer-space/ytoken-contract-methods/lending-methods.md#types).

```pascaligo
type rateParams         is [@layout:comb] record [
  tokenId               : nat;
  borrowsF              : nat;
  cashF                 : nat;
  reservesF             : nat;
  precision             : nat;
  reserveFactorF        : nat;
  callback              : contract(yAssetParams);
]
```

{% hint style="info" %}
`varF` params multiplied by `precision`

also, `amount` returned to callback is multiplied by `precision.`
{% endhint %}

{% content-ref url="/pages/oYg3JDUMGsyR8LhD3wA5" %}
[On-chain views](/yupana-document-portal/developer-space/interestrate-contract/on-chain-views.md)
{% endcontent-ref %}

For `admin` methods, please look

{% content-ref url="/pages/ycTIw9vQnfLnkOFSPLGZ" %}
[Admin methods](/yupana-document-portal/developer-space/interestrate-contract/admin-methods.md)
{% endcontent-ref %}


---

# 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://yupana-finance.gitbook.io/yupana-document-portal/developer-space/interestrate-contract.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.
