# Detailed borrowing process

<figure><img src="https://3798415996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3OgYOXERAylq058dxlxI%2Fuploads%2FlspPoY6fFXoM0KTeQ1B3%2FBorrower_Pov.png?alt=media&#x26;token=b582a1b8-9446-46d1-9cf7-f72f4f1a2533" alt=""><figcaption></figcaption></figure>

### 1. The borrower takes the loan

* Interest starts accruing linearly, every second

### 2. The borrower repays the loan in full

* The borrower repays: the principal, accrued linear interest and the protocol fee
* The borrower recovers full control of their collateral

### 3. The lender sends a refinancing call

* A lender can send a refinancing call to an active loan, at any given time. Reasons why may include:
  * The loan being unhealthy or displaying downward trending health
  * The loan being healthy, and the lender decides to claim the liquidity owed
  * The lender wants to exit this market
* What happens next will be determined by the offers in the order book:

### 4. The order book can auto-refinance the loan

* A healthy loan is more than likely to match an existing offer in the order book
* If so, the loan will be auto-refinanced
* The lender will recover the principal + interest and exit
* The new lender will enter the loan from scratch
* Nothing changes for the borrower, the loan keeps accruing linear interest every second

### 5. The order book cannot auto-refinance the loan

* If the order book contains no better or matching offers, the loan is sent to the refinancing auction

### 6. The 72 hour refinancing auction starts

* The loan will be offered to new lenders on the same terms
* During this time the collateral cannot be liquidated
* The borrower is able to repay if they want to

### 7. New lender refinances via the auction

* Refinancing involves covering the principal of the previous loan and accrued interest, allowing the previous lender to exit in full
* The borrower continues to borrow, and can still repay anytime

### 8. The refinancing auction ends

* The auction ends after 72 hours if no new lender has stepped in to refinance the loan, *and* if the borrower still hasn't repaid
* If this is the case, the lender receives the collateral and the borrower loses it


---

# 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.banx.gg/banx-protocol/how-to-borrow/detailed-borrowing-process.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.
