> For the complete documentation index, see [llms.txt](https://beratlas-organization.gitbook.io/semper-ascendit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beratlas-organization.gitbook.io/semper-ascendit/overview/borrowing.md).

# Borrowing

#### **Borrowing $BERA Using $BATLAS as Collateral**

## **Mechanism:**

Users can borrow **$BERA** by using **$BATLAS** as collateral.

***

## **Loan Terms**

* **Collateral Requirement:**\
  Users can borrow up to **99% of their $BATLAS value** in $BERA (**99% Loan-to-Value Ratio**).
* **Duration:**
  * **Minimum:** 1 day
  * **Maximum:** 365 days
* **Interest:**\
  Interest rates are calculated linearly, starting with a **base rate of 0.05%**. Interest is collected **upfront** upon loan initiation from the borrowed amount.
* **Liquidation:**\
  If a loan defaults, the **$BATLAS collateral is burned**. Since all loans are over-collateralized, burning the collateral increases the **$BERA backing per $BATLAS**.
  * **Automated Liquidation:** All liquidation of **$BATLAS** collateral happens automatically

<figure><img src="/files/U3B4RmVGSY4YlVjSHCt8" alt=""><figcaption></figcaption></figure>

***

#### **Interest Rate Calculation Example (Python)**

```python
def linear_interest_rate(days, slope, base_rate):
    """
    Calculate interest rate based on a linear model.
    
    :param days: Number of days for the loan term
    :param slope: Slope of the interest rate increase per day
    :param base_rate: Base interest rate (for 1 day or 0 days)
    :return: Interest rate in percentage
    """
    return slope * (days - 1) + base_rate  # Adjusting for 1-day base

# Example usage:
slope = 0.0548  # Slope factor from internal calculations
base_rate = 0.05  # 0.05% interest rate for a 1-day loan
days = 10
interest_rate = linear_interest_rate(days, slope, base_rate)
print(f"The interest rate for a {days}-day loan is approximately {interest_rate:.2f}%")
```

***

## **Burning Example (Liquidation)**

Suppose there are **100 $BATLAS** tokens in existence, backed by **100 $BERA** tokens in the contract. This means **1 $BATLAS = 1 $BERA**.

* A user borrows **99 $BERA** using **100 $BATLAS** as collateral.
* The user **fails to repay** their loan, leading to liquidation.
* **99.7% of the collateral (99.7 $BATLAS) is burned**, while the remaining **0.3 $BATLAS** is allocated to **LP incentives and the team**.
* Since the user's collateral represented all circulating $BATLAS, the **only remaining tokens are the 0.3 $BATLAS distributed to LPs and the team**.

The new $BATLAS price is calculated as:\
**1 $BERA / 0.3 $BATLAS = 3.333... $BERA per $BATLAS**

Thus, the **value of every remaining $BATLAS token has increased**!

> *Note: This example simplifies the calculation by excluding interest, which would further increase the $BERA backing per $BATLAS.*

***

## **Instant Default (Redeeming $BATLAS for $BERA)**

Similar to how **$BATLAS** is minted by depositing **$BERA**, it can also be **burned** to redeem the underlying asset:

* **Process:**
  * A user **takes a 1-day loan** against their $BATLAS.
  * The user **purposely defaults**, allowing them to **walk away with the underlying $BERA** while their $BATLAS is burned.
  * This process **increases the $BERA backing per $BATLAS** over time.
* **Fees:**
  * Subject to the **same 1% collateral premium and interest rates** as standard loans.

***

## **Flash Loans**

To support **leverage trading, arbitrage, and other financial strategies**, the **BerAtlas Finance dApp** will offer **seamless flash loans** with a **1% fee**.


---

# 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:

```
GET https://beratlas-organization.gitbook.io/semper-ascendit/overview/borrowing.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.
