# Borrowing Overview

Arkis provides leverage to Asset Managers through a robust infrastructure that includes the Arkis Margin Engine, Margin Accounts, Compliance Manager, and Markets. This system enables more flexible trading and capital flows, with margin calculated at a portfolio level which can aggregate and offset positions’ risks.

<figure><img src="/files/JSSba8v58MyostKMEpmH" alt=""><figcaption><p>Leverage High-level Infrastructure</p></figcaption></figure>

## Margin Account

A Margin Account is essential for traders seeking to take leverage through the Arkis protocol. It is a standalone smart contract available on the networks where the trader wishes to operate. Traders choose the leverage asset (such USDT, USDC, wETH, wBTC) and provide the necessary collateral.&#x20;

**Properties of Margin Accounts**

* Each account is a separate smart contract containing collateral and leverage assets.&#x20;
* Asset Managers can manage their Margin Accounts similarly to how they manage their personal portfolio or MetaMask wallet, with the ability to swap, stake, or provide liquidity if these operations are whitelisted by the protocol. They can dynamically enter, exit and manage their positions through the Margin Account.&#x20;
* Each Margin Account acts like a proxy to a wallet and can be used via Wallet Connect to interact with integrated DEXs/Protocols.
* Performance, NAV, and transactions for each Margin Account can be tracked separately using Etherscan or respective blockchain explorers.
* Margin Accounts are reusable, meaning that an Asset Manager controls a Margin Account when they have initiated a loan, but the same Margin Account might be used by another Asset Manager when the previous one closes it and repays the loan.&#x20;

## Compliance Manager

The Compliance Manager regulates the venues, DEXs, protocols, tokens, and transactions permissible within a Margin Account. It ensures traders cannot engage in high-risk activities with non-whitelisted tokens or unauthorized DEXs. The Compliance Manager defines:

* Approved protocols/DEXs/Venues for trading.
* Allowed actions and smart contracts for execution.
* Whitelisted tokens for use on DEXs.

For each new protocol integration, the integration pipeline happens in two steps:

1. Add actions and adapters to Arkis Protocol to whitelist protocol operations.
2. Add logic for portfolio monitoring and stress testing to the Arkis Margin Engine.
3. Add Liquidation logic for the protocol.

## Arkis Margin Engine

This centralized analytics module calculates the real-time Margin Account portfolio value and calculates the Risk Factor metric, which defines if the portfolio value is enough to cover the borrowed assets amount.&#x20;

## Markets

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

**Asset Managers** borrow capital from Markets. When the loan is originated, Arkis Protocol takes collateral from the Asset Manager and borrowed capital from the Market and posts it into Margin Account.&#x20;

Each Market defines what can be done within this pool, what are the whitelisted tokens and protocols and who can borrow from it.&#x20;

Asset Managers can click the **"Details"** tab to see the details of each pool configuration.

Each pool has the following set of parameters:&#x20;

* **Pool Address,** onchain address of the pool.&#x20;
* [**Interest Rate Model (IRM)**](/home/concepts/interest-rate-model-irm.md), which defines how LPs get yield on their assets. Different pools within Arkis have different IRMs ranging from widely used utilization-based and fixed rate to more sophisticated (Expected Value or Funding Rate based).
* **Whitelisted Assets and Whitelisted Protocols** define which assets Asset Managers can interact with if they borrow from this pool. This list defines collateral risk exposure of Liquidity Providers who provide liquidity into a particular pool.&#x20;
* **Token Oracles**: Oracle feed (can be off-chain price feed), which are used to price Whitelisted Assets.
* **Stress-Tested Values**: % subtracted from an oracle price to get the price of an asset. Used as a margin of safety for Liquidation. Refer to [Stress-Tested Value](/home/concepts/stress-tested-value.md) for more information.&#x20;
* **Asset Managers** who are allowed to borrow from the pool.&#x20;
* **Margin Call Risk Factor Value**: the value of Risk Factor when Asset Manager is margin called.&#x20;
* **Liquidation Fee**: protocol fee for liquidating unhealthy loan position.&#x20;

<figure><img src="/files/CMWiXVAndUCNpEaHWYvZ" alt=""><figcaption><p>Borrowers can check what they are allowed to do within pools </p></figcaption></figure>

## Opening Margin Account

By clicking <mark style="color:purple;">**"Borrow"**</mark> an Asset Manager initates the flow of opening Margin Account and taking a loan through Arkis.&#x20;

### Step 1. Deciding the list of collaterals&#x20;

First, the user must decide on how much they want to borrow and list of collaterals they want to provide to secure the loan.&#x20;

<figure><img src="/files/bkf3FRU7HBMskJwLlhHV" alt=""><figcaption><p>Deciding the list of collaterals to secure the loan</p></figcaption></figure>

How can the borrowed value be bigger than the value of the provided collateral?&#x20;

Both collateral and borrowed assets are allocated to the Margin Account, which is a smart contract controlled by Arkis Protocol. However, an Asset Manager can trade through Margin Account on integrated and whitelisted DEXs and protocols and interact with whitelisted assets. ***So, essentially, an Asset Manager can margin trade.***&#x20;

{% hint style="info" %}
Within Arkis, for Lenders, each loan is overcollateralized as both collateral and borrowed assets remain within a controlled environment - the Margin Account. While for an Asset Manager, the loan is undercollateralised as they can borrow x2, x3, x5 times the amount of the asset by having x amount of collateral (margin trading).
{% endhint %}

An asset manager can choose "<mark style="color:purple;">**Leverage**</mark>**"** part of the borrow modal to automatically set borrow amount as a function of target leverage. Once all transaction details are set - a user can click "<mark style="color:purple;">**Confirm transaction"**</mark>.

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

### Step 2. Allowances &#x20;

The user provides allowances to the protocol to interact with collateral assets within their wallet.

<figure><img src="/files/YF8KhjVVx17HzmbW3C9l" alt=""><figcaption><p>Providing allowance</p></figcaption></figure>

### Step 3. Sign the transaction

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

Once all transactions are signed - the protocol takes collateral and starts **Registering Margin Account**.

<figure><img src="/files/26FOwUwTGrg6lovsNIPR" alt=""><figcaption></figcaption></figure>

### Opened, On Hold, Closed

When the transaction was initiated - you will find that the protocol took collateral assets from your wallet. There are 3 statuses of Margin Accounts:&#x20;

<figure><img src="/files/z3LMX490744hQZmT1Ea3" alt=""><figcaption><p>Opened, On Hold, Closed margin accounts</p></figcaption></figure>

* **On Hold**: The protocol registered the Margin Account, took collateral from an Asset Manager, and is busy allocating borrowed assets from the pool to the Margin Account. An Asset Manager can't use the Margin Account yet, **but can already see it's address**.
* **Opened**: Margin Account is ready to be used for margin trading.&#x20;
* **Closed**: Margin Account was closed or Liquidated.&#x20;

To sum up, the flow of taking leverage involves the following steps:&#x20;

1. Register Margin Account (take a Margin Account from available accounts and reserve it for an originated loan).&#x20;
2. Take collateral assets from the Asset Managers' wallet.&#x20;
3. Take borrowed assets from the Market.
4. Deposit both borrowed assets and collateral assets into the Margin Account.&#x20;
5. Finish Margin Account opening meaning that now an Asset Manager can trade with Margin Account.&#x20;

### &#x20;


---

# 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.arkis.xyz/home/for-borrowers/borrowing-overview.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.
