# Repayment/Interest Rates

If a user wants to reclaim their previously pledged collateral, they must, prior to the expiry of the loan, pay a pre-determined repayment amount, which takes into account the borrow amount plus some interest rate.

<figure><img src="https://604675069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBRZCTg83PrW16UddBSaw%2Fuploads%2FQyLojNRXUoY6jKWkosds%2Fmysorepayment.png?alt=media&#x26;token=7f84b34d-894d-4fa2-bdf3-d91811c2ba19" alt=""><figcaption></figcaption></figure>

This interest rate is determined through a function that takes into account the pool's liquidity after a user has borrowed some amount y(x), along with the an underlying rate La, denoted by the piecewise function below:

<figure><img src="https://604675069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBRZCTg83PrW16UddBSaw%2Fuploads%2FAu00ozX5nOg4krLhwibV%2Finterest%20rate%20L.png?alt=media&#x26;token=0ad8a8af-7830-498a-b8be-a115d8d68897" alt=""><figcaption></figcaption></figure>

<figure><img src="https://604675069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBRZCTg83PrW16UddBSaw%2Fuploads%2Fct8ljbN56yvVi4fh0xdh%2Finterest%20rate%20piecewise.png?alt=media&#x26;token=9bc85c62-e979-47b4-a6ac-74bdf47175c1" alt=""><figcaption></figcaption></figure>

Though quite complex visually, this function is a curve that takes into account a given pool's target liquidity **(L1, L2)** and interest rate bounds **(r1, r2)**, which are set at the deployment of a given pool and are immutable.&#x20;

The interest rate for a given pool changes depending on available pool liquidity and also takes into account these interest rate bounds.&#x20;

<figure><img src="https://604675069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBRZCTg83PrW16UddBSaw%2Fuploads%2FaX2zbG0wGflAfkeqknsa%2Finterestpool.png?alt=media&#x26;token=458b2af7-c680-4970-9b7a-35f55a1068a3" alt=""><figcaption><p>Example of how rate(L) changes depending on available pool liquidity</p></figcaption></figure>

Generally speaking, the more liquidity there is (i.e., by LPs adding liquidity) the lower the interest rate, and conversely, the less liquidity there is (either by users borrowing or by LPs removing liquidity), the higher the interest rate. Rates can never fall below some lower rate r2, providing LPs a guaranteed lower bound at which their capital is lent to borrowers. However, rate(La) isn’t bound upwards to allow the market to find an interest rate equilibrium, even for highly volatile collateral assets.
