# Overview

Welcome to Loanshark

![](https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2F1tEuk3KcIxRA1Gtz0tEw%2F1500x500.jfif?alt=media\&token=84214317-3601-4eaa-b50d-a69082955403)

Loanshark is a risk-isolated money market on Scroll. We are incubated by the [Polygon X HyperNest DeFi accelerator](https://www.f6s.com/polygon-hypernest-defi-accelerator-2023).

### Our Motivation

Our team has identified several key issues with the current state of DeFi money markets:

* High-quality collateral assets, such as Uniswap V3 LP, are not widely supported.
* Manual operations are time-consuming, error-prone, and result in low capital efficiency.

### **Our Solution**

Loanshark addresses these challenges by providing the following features:

* A money market with independent risk-based pools that offer superior capital efficiency.
* Automated borrowing position management, including liquidation protection triggered by user pre-set conditions and one-click looping. (Coming Soon!)


# Supply

Become a liquidity provider

When users supply an asset to the Loanshark Core Protocol, they begin earning a variable interest rate instantly. This return, also known as the Supply APY, originates from the interest accumulated from borrowers within a pool. Users can withdraw their principal plus interest anytime.


# How to Supply

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FLEcjKQw45vbDXU90oinh%2Fimage.png?alt=media&amp;token=f04ae154-7ad1-47de-bef9-4d4de45c7b0d" alt="" width="375"><figcaption></figcaption></figure>

Click onto the asset you wish to supply and choose **“Supply”** in the pop-up.

1. You may choose to supply an exact quantity or all of your wallet balance (click "**MAX**").
2. If you wish to also enable the asset as collateral for borrowing, you may turn on the **“Use as Collateral”** toggle.
3. Please observe the corresponding changes to your Borrow Limit. Once you confirm the parameters and changes in your borrowing metrics, click **“Supply”.**
4. Once the transaction is successful, you should see the cTokens in your wallet alongside the updated position.


# How to Withdraw

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FznaQVEJqNwKMpIcpCJ3v%2Fimage.png?alt=media&amp;token=194fdfaf-0438-4ab3-960b-91fc404140ed" alt="" width="375"><figcaption></figcaption></figure>

Click onto the asset you wish to withdraw and choose **“Withdraw”** in the pop-up.

1. You may choose to withdraw an exact quantity or your entire position (click "**MAX**").
2. If you have an open borrowing position and the asset is enabled as a collateral, clicking "MAX" will only enable you to withdraw an amount such that your Borrow Utilization is 95% or lower.&#x20;
3. Please observe the corresponding changes to your Borrow Limit and Borrow Utilization. Once you confirm the parameters and changes in your borrowing metrics, click **“Withdraw”.**
4. Once the transaction is successful, you should see the withdrawn asset in your wallet alongside the updated position.


# Enable as Collateral

You can enable collateral in two ways:

1. Supply assets and simultaneously enable as collateral \[See the [How to Supply](/loanshark-core/supply/how-to-supply) section]
2. Directly turn on the **"Collateral”** toggle for the target asset at the pool page.


# cToken

Loanshark tokenises debts on the protocol with **ERC20**-compliant cTokens.&#x20;

Upon deposit, the depositor receives a corresponding amount of cTokens into their wallet. Each deposited asset will be represented by its own cToken (i.e. cDAI, cETH, cUSDC) and each of them will have a value that maps the prevailing exchange rate relative to the underlying asset that reflects both the principal as well as interest accrued overtime in the pool.

cToken contract addresses may be found in the [Contracts](/loanshark-core/technical/contracts) page.<br>


# Borrow

Protect your borrowing position with smart vault.

Users can borrow assets deposited into various liquidity pools using their pledged assets as collateral. The financing cost for each asset depends on the interest rate model, which is based on the type of borrow assets and liquidity pool utilization.&#x20;


# How to Borrow

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FqR7yYXqYgABQEGm5cNj8%2Fimage.png?alt=media&amp;token=7f7e543d-d0da-4890-bfdd-126bfa18d08c" alt="" width="375"><figcaption></figcaption></figure>

Click onto the asset you wish to borrow and choose **“Borrow”** in the pop-up.

1. You may choose to repay an exact quantity or 80% of your remaining borrowing capacity (click "**80%**").
2. Please observe the corresponding changes to your borrow utilization. Once you confirm the parameters and changes in your borrowing metrics, click **“Borrow”.**
3. Once the transaction is successful, you should see the borrowed asset in your wallet alongside the updated position.


# How to Repay

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FFZoa0GJQFA2xjXoaa716%2Fimage.png?alt=media&amp;token=2a1bfa15-635b-4ddb-9a0b-2a0d6acfa99a" alt="" width="375"><figcaption></figcaption></figure>

Click onto the asset you wish to repay and choose **“Repay”** in the pop-up.

1. You may choose to repay an exact quantity or the entire loan (click "**MAX**"). If you select "**MAX**" in the repayment toggle but do not have sufficient funds to close the position, the protocol will calculate the maximum repayment possible from your wallet balance.
2. Please observe the corresponding changes to your borrow utilization. Once you confirm the parameters and changes in your borrowing metrics, click **“Repay”.**
3. Once the transaction is successful, your outstanding borrow and borrowing utilization will be updated.


# Liquidation

The liquidation process is triggered when a borrower's borrow utilization increases to 100% or higher, indicating that the value of their collateral may not be enough to cover their debt, posing risks to lenders and the protocol.

The liquidation process incentivises external party(ies) to actively monitor Loanshark's loan portfolios to seek out borrowings that have borrow utilization above 1 and to actively repay these loans to ensure liquidity safety and health of the protocol.

Liquidation bonuses paid to the liquidator vary by asset and can be found under [Asset Parameters](/loanshark-core/technical/asset-parameters).


# Health and Earning Metrics

Health and Earning Metrics are displayed at the top of each pool to help users track their  net yield and manage their portfolio risk. Users should find a balance between maximising their borrowing capabilities and budgeting for volatility in the market to avoid liquidations.

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FlZ7HtQMsWSpxAWj7nLYr%2Fimage.png?alt=media&amp;token=10321941-3416-401c-9138-a8cf41cd5337" alt=""><figcaption></figcaption></figure>

**Pool Data**

1. **Total Supply -** total value of principal deposited and interest accrued in the pool
2. **Total Borrow -** total value of loan principal and interest owed in the pool

**User Data**

1. **Net APY -** the net annual percentage yield earned or paid. A positive Net APY represents that the user is earning more than he/she has to pay out in interest whereas a negative Net APY means the user is paying more interest than what is being earned
2. **Borrow Utilization -** see section below.
3. **Borrowed -** total value of loan principal and interest owed of the user.
4. **Limit -** sum of the market value of the user's collateral discounted by each asset’s Collateral Factor&#x20;
5. **Collateral -** Sum of the market value of the user's collateral.

### Borrow Utilization

The Borrow Utilization is a metric that reflects a user's leverage and portfolio health. It is calculated by dividing a user’s Liabilities by their Risk-adjusted Collateral.&#x20;

$$
Borrow Utilization = \cfrac {Liabilities}{ Limit}
$$

where:

* Limit:  Sum of the market value of a user's collateral discounted by each asset’s Collateral Factor&#x20;
* Liabilities: The sum of the market value of a user's outstanding borrowings and accrued interest

{% hint style="info" %}
A Borrow Utilization above 100% means that a user’s liabilities now exceed his/her borrowing capacity. During liquidation, the debt are repaid (either partial or full repayment) and the liquidation bonus is taken from the available collateral.
{% endhint %}

The Borrow Utilization of your portfolio is influenced by changes in the underlying value of your deposits. For example, say you deposit ETH as collateral and use that to borrow DAI, and if the value of ETH drops, the underlying value of your collateral will decrease. This can negatively impact your Borrow Utilization and increase the risk of liquidation.

Maintaining a low Borrow Utilization can provide you with portfolio flexibility in two ways:

1. Decreased likelihood of liquidation, especially when fluctuating assets are used as collateral (low-risk strategy)
2. Improved borrowing eligibility, allowing you to leverage more collateral (high-risk strategy)


# Technical

Manage your borrowing position.

The technical section of the Gitbook offers an in-depth explanation of the construction of Loanshark Core. It provides a comprehensive overview of the financial models employed in the protocol, along with detailed information on contracts and assets.


# Contracts

| Name        | Address                                    |
| ----------- | ------------------------------------------ |
| Unitroller  | 0xC1D290D7D618b77C419B905D17673Aad0e989777 |
| Comptroller | 0xEFB0697700E5c489073a9BDF7EF94a2B2bc884a5 |
| cETH        | 0xF017f9CF11558d143E603d56Ec81E4E3B6d39D7F |
| cUSDC       | 0x466da81A766Ff502FE8eA318D4d1E044b1Bf84C1 |
| Maximillion | 0x4F5196f8b49D566342e42efD310F47Cc1C9F6d7E |


# Asset Parameters

Every asset within Loanshark undergoes risk assessment, which determines how they are supplied and borrowed within the protocol.&#x20;

### **Main Hub**

| Asset | Collateral | Collateral Factor | Reserve Ratio |
| ----- | ---------- | ----------------- | ------------- |
| ETH   | Yes        | 80%               | 20%           |
| USDC  | Yes        | 80%               | 10%           |
| USDT  | Yes        | 80%               | 10%           |
| WBTC  | Yes        | 80%               | 20%           |

#### Borrow Caps

Borrow caps are implemented at the pool level, which means that once the aggregate limit has been reached, users will not be able to borrow that asset until repayment is made. Currently borrow caps is set up be unlimited for all assets.

<table><thead><tr><th>Asset</th><th>Borrow Cap</th><th data-hidden>Uo (%)</th><th data-hidden>Ro (%)</th><th data-hidden>S1</th><th data-hidden>S2</th><th data-hidden>Liquidation Discount</th></tr></thead><tbody><tr><td>ETH</td><td>Unlimited</td><td>65%</td><td>0%</td><td>8%</td><td>100%</td><td>6.5%</td></tr><tr><td>USDC</td><td>Unlimited</td><td>90%</td><td>0%</td><td>4%</td><td>60%</td><td>5.0%</td></tr><tr><td>USDT</td><td>Unlimited</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>WBTC</td><td>Unlimited</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### For Interest Rate Model

<table><thead><tr><th>Asset</th><th>IR Model</th><th>Uo (%)</th><th>Multiplier</th><th>JumpMultiplier</th><th>Ro (%)</th><th data-hidden>Ro (%)</th><th data-hidden>Collateral</th><th data-hidden>Collateral Factor</th><th data-hidden>Borrow Factor</th><th data-hidden>Reserve Ratio</th></tr></thead><tbody><tr><td>ETH</td><td>Standard</td><td>N/A</td><td>15%</td><td>N/A</td><td>2.5%</td><td>0%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>USDC</td><td>Jump</td><td>80%</td><td>6%</td><td>160%</td><td>0%</td><td>0%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>USDT </td><td>Jump</td><td>80%</td><td>6%</td><td>160%</td><td>0%</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>WBTC</td><td>Standard</td><td>N/A</td><td>15%</td><td>N/A</td><td>2.5%</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### For Liquidations

<table><thead><tr><th>Asset</th><th>Liquidation Incentive</th><th data-hidden>Uo (%)</th><th data-hidden>Ro (%)</th><th data-hidden>S1</th><th data-hidden>S2</th><th data-hidden>Collateral</th><th data-hidden>Collateral Factor</th><th data-hidden>Borrow Factor</th><th data-hidden>Reserve Ratio</th></tr></thead><tbody><tr><td>ETH</td><td>15.0%</td><td>65%</td><td>0%</td><td>8%</td><td>100%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>USDC</td><td>15.0%</td><td>90%</td><td>0%</td><td>4%</td><td>60%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>USDT</td><td>15.0%</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>WBTC</td><td>15.0%</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

\*`protocolSeizeShare`is 3%.&#x20;

\*`CloseFactor`is 50% for all assets.

***

### **LSD Hub**

| Asset              | Collateral | Collateral Factor | Reserve Ratio |
| ------------------ | ---------- | ----------------- | ------------- |
| ETH                | Yes        | 90%               | 10%           |
| rETH (Coming soon) | Yes        | 90%               | 10%           |
| wstETH             | Yes        | 90%               | 10%           |

#### Borrow Caps

Borrow caps are implemented at the pool level, which means that once the aggregate limit has been reached, users will not be able to borrow that asset until repayment is made. Currently borrow caps is set up be unlimited for all assets.

<table><thead><tr><th>Asset</th><th>Borrow Cap</th><th data-hidden>Uo (%)</th><th data-hidden>Ro (%)</th><th data-hidden>S1</th><th data-hidden>S2</th><th data-hidden>Liquidation Discount</th></tr></thead><tbody><tr><td>ETH</td><td>Unlimited</td><td>65%</td><td>0%</td><td>8%</td><td>100%</td><td>6.5%</td></tr><tr><td>rETH</td><td>Unlimited</td><td>90%</td><td>0%</td><td>4%</td><td>60%</td><td>5.0%</td></tr><tr><td>wstETH</td><td>Unlimited</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### For Interest Rate Model

<table><thead><tr><th>Asset</th><th>IR Model</th><th>Uo (%)</th><th>Multiplier</th><th>JumpMultiplier</th><th>Ro (%)</th><th data-hidden>Ro (%)</th><th data-hidden>Collateral</th><th data-hidden>Collateral Factor</th><th data-hidden>Borrow Factor</th><th data-hidden>Reserve Ratio</th></tr></thead><tbody><tr><td>ETH</td><td>Jump</td><td>80%</td><td>6%</td><td>160%</td><td>0%</td><td>0%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>rETH</td><td>Jump</td><td>80%</td><td>6%</td><td>160%</td><td>0%</td><td>0%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>wstETH</td><td>Jump</td><td>80%</td><td>6%</td><td>160%</td><td>0%</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

#### For Liquidations

<table><thead><tr><th>Asset</th><th>Liquidation Incentive</th><th data-hidden>Uo (%)</th><th data-hidden>Ro (%)</th><th data-hidden>S1</th><th data-hidden>S2</th><th data-hidden>Collateral</th><th data-hidden>Collateral Factor</th><th data-hidden>Borrow Factor</th><th data-hidden>Reserve Ratio</th></tr></thead><tbody><tr><td>ETH</td><td>15.0%</td><td>65%</td><td>0%</td><td>8%</td><td>100%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>rETH</td><td>15.0%</td><td>90%</td><td>0%</td><td>4%</td><td>60%</td><td>Y</td><td>80%</td><td>100%</td><td>15%</td></tr><tr><td>wstETH</td><td>15.0%</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

\*`protocolSeizeShare`is 3%.&#x20;

\*`CloseFactor`is 50% for all assets.


# Interest Rate and Utilisation Model

Both the interest rate recieved by depositors and paid by borrowers is derived from the two models below.

## Interest Rate Model&#x20;

#### Standard Interest Rate Model

$$
R\_t=Multiplier∗U\_t+R\_0
$$

#### Jump Rate model

$$
\begin{align\*}
R\_t​ &= Multiplier∗min(U\_t,U\_0) \\
&+ JumpMultiplier∗max(0,U\_t−U\_0) \\
&+ R\_0
\end{align\*}
$$

where:

* Rt = borrowing rate at Ut&#x20;
* Ro = base interest rate&#x20;
* Multiplier = the rate of increase in interest rate with respect to utilization&#x20;
* JumpMultiplier = the rate of increase in interest rate with respect to utilization after the kink
* Ut = current utilisation
* Uo = Kink

#### Supply Interest Rate

$$
S\_t=R\_t
∗ U\_t
∗(1−Reserve Factor\_a)
$$

where

* St = supply rate at Ut&#x20;
* ReserverFactor = percentage of the spread between the supply and borrow rates that the protocol keeps as profit

## Utilisation Model

The utilisation rate of each pool is a function of the current loaned amount and the amount available to loan out. This number is refreshed intraday. Over time, protocol use will provide data points to assess and refine the best parameters for our utilisation model.

Each asset pool will have a specific optimal utilisation rate (Uo). This is a function of market liquidity pool size, historical utilisation rate and risk buffering for sudden large-sum withdrawals within the given market pools.

Utilisation rate of market pool 'x' is calculated as:

$$
U\_x = \cfrac {B\_x} {C\_x + B\_x - R\_x}
$$

​where:

* Ux = Utilisation rate of market pool x
* Bx = Borrowings of market pool x
* Cx = Total liquid assets in market pool x
* Rx= Reserves of market pool x


# Oracle

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2F3mpOZWghTtYKlYHX2Pnl%2Fimage.png?alt=media&amp;token=4e5704df-ff82-49b4-8e62-ba611ac09a7d" alt=""><figcaption></figcaption></figure>

Our oracle provider is [Redstone](https://docs.redstone.finance/docs/introduction). RedStone offers flexible Data Feeds with <10s update time perfect for money markets. The infrastructure is well battle-tested and **secures hundreds of millions of USD on mainnets**. Trusted by some of the best protocols in DeFi and supported by well-renowned Builders such as Stani Kulechov (Aave), Coinflipcanada (GMX), Jacob Blish (Lido), Sandeep Nailwal (Polygon), Emin Gün Sirer (Avalanche) and Alex Gluchowski (zkSync).\
\
RedStone oracle uses an innovative model of providing signed data feeds with a transaction. This is far more efficient, as providing additional data to a transaction is very cheap compared to calling another contract. Loanshark contracts check if the data feeds were signed by trusted signers to ensure that data was not manipulated.


# Risk and Security

It is crucial for users to understand the potential risks associated with utilizing Loanshark Core and to conduct their own research (DYOR) before committing funds. This page outlines some, but not all, of the risks involved.

**Types of Risks**

When using Loanshark, users should be aware of both endogenous and exogenous risks, as they can impact the loss of funds and collateral liquidations. Let's take a closer look at these risks:<br>

<table><thead><tr><th width="373.4675821592205" align="center">Endogenous</th><th align="center">Exogenous</th></tr></thead><tbody><tr><td align="center">Smart Contract</td><td align="center">Collateral Assets</td></tr><tr><td align="center">Centralisation</td><td align="center">Bad Debt</td></tr></tbody></table>

<details>

<summary>Our Endogenous Risk Mitigation Practices</summary>

**Smart Contract Risk**&#x20;

* *Audit:* To ensure the protocol operates safely and as intended, an independent security audit is currently underway. Once completed, the results will be published transparently on this documentation site to maintain openness and build user trust. For the latest audit findings or to discuss protocol security, please contact the development team through the Loanshark Discord server or GitHub repository.&#x20;

**Centralisation Risk**&#x20;

* *DAO transition:* Eventual DAO transition with transparent onchain governance

</details>

<details>

<summary>Our Exogenous Risk Mitigation Practices</summary>

**Collateral Assets Risk**

* *Selective whitelist*: Loanshark maintains a whitelist of conservative and trusted assets with higher market caps for collateral, ensuring a safer initial ramp-up phase.
* *Dynamic Interest Rate and Reserve Ratios*: Parameters are customized for different assets and pools, allowing flexibility and risk management.

**Bad Debt Risk**

* *Interest Curve:* Varying optimal utilisation rate (65-90%) reflective of asset and debt risk
* *Liquidator Incentive*: Fixing liquidator discount for all collateral across the protocol

</details>


# Interface

**Overview:**

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2Fdkl6Xyap2MJrE606c5T3%2Fimage.png?alt=media&amp;token=0157ac61-d911-48bd-907b-2aa8d7f0025d" alt=""><figcaption></figcaption></figure>

Lending:

<figure><img src="https://2917571215-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcvJRm0pEtrF6Rzz4Gyaz%2Fuploads%2FITLwvYiLoFZU3egRPSVX%2Fimage.png?alt=media&amp;token=b9c5974b-4e90-49f2-b249-f1c930a8ddd2" alt=""><figcaption></figcaption></figure>


# Brand Assets

Logos:

<https://drive.google.com/drive/folders/1wCixg1CtpapiRQHCFUbeBCJB887ON49o?usp=sharing>


# Links


