> For the complete documentation index, see [llms.txt](https://docs.folks.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.folks.finance/architecture/loan-borrow.md).

# Loan borrow

After a user has locked up their collateral, they can borrow against it. The amount the user has borrowed of a given asset is defined as $$B\_t$$​ whereas the borrow balance of a given asset $$BB\_t$$​ is defined as the amount borrowed plus accrued interest.

The borrow factor $$BF$$​ represents the effective borrowed amount given a borrow, in percent terms. For example, a more volatile asset may have $$BF=110$$​% (for $10 borrowed, it is as if $11 has been effectively borrowed) whereas a less volatile asset may have $$BF=100$$​%.

Consider a user who borrows multiple assets. The total borrowed amount $$TB\_t$$ at time t for a given loan’s borrows is:

$$
TB\_t=\sum\_{i=ASSET,V/S}^{borrowed}BB\_{t\_i}*P\_i*BF\_i
$$

Where:

* $$BB\_t$$ denotes the current user borrow balance of a borrow,
* $$P\_i$$ is the price of the borrowed asset,
* $$BF\_i$$ is the borrow factor,
* the subscript $$i$$ represents each borrow of the loan where a borrow is a unique pairing of asset and variable/stable rate.

The total borrowed $$TB\_t$$ must not exceed the borrowable amount $$BA\_t$$, otherwise the loan can be liquidated by a third party:

$$
TB\_t \leqslant BA\_t
$$

If a borrow or reduce collateral operation would lead to the above condition being violated then it will be rejected by the protocol.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.folks.finance/architecture/loan-borrow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
