Skip to content

Commit

Permalink
Merge pull request #113 from defactor-com/docs(pools)-creates-new-fil…
Browse files Browse the repository at this point in the history
…e-in-pools-documentation

docs(pools) create new file for pools
  • Loading branch information
xavier506 committed Jun 17, 2024
2 parents 73870b6 + dd770b3 commit d9a05c1
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/pools/pools-processes/borrowing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Pool Borrowing Process
sidebar_position: 1
---

## Introduction to Borrowing

Overcollateralized crypto borrowing is the predominant form of lending and borrowing on the blockchain. It allows for the creation of a lending and borrowing market without the need for credit history checks. Borrowers can use their volatile crypto assets as collateral to borrow stable coins, providing a way to access liquidity without selling their crypto assets and thus protecting those crypto assets from market volatility.

### How do I borrow crypto assets from a pool?

If you choose to borrow from a pool, start by connecting your wallet to the platform, navigate to the supply/borrow button in the tab of the pool of your choice, or navigate to the pool page and choose borrow from the top right corner. Once you decide on the amount you would like to borrow, simply input that amount and the pool will calculate how much collateral you need to supply before completing the borrow action. The collateral amount is calculated according to the loan to value ratio (link). If you have sufficient funds to complete the transaction then proceed with the borrow action and sign the transaction in your wallet.

### How is Interest Calculated on My Position

When you have an open borrow position (borrowing liquidity from a pool) interest is accrued on your position every minute that the position is open until the maturity date of the pool. When deciding which pool suits your needs you first need to look at the APY (annual percentage yield) of that pool. If you want to know how much interest you will be paying every minute your position is open you simply have to take into consideration 2 metrics:

- **The Duration of your deposit:** The duration of your deposit refers to the time between your deposit action and the time the pool matures ( (Pool maturity date) - ( Deposit date)) measured in minutes to accurately capture the time your deposit has been sitting in the pool.
- **The interest rate of the pool:** Reflected in the pool metric calculated on a per minute basis. APY/(360 Days*24 Hours*60 Minutes).

Your interest payment is then calculated as follows: Amount Borrowed * Duration * Interest rate

### Loan Repayment

Repaying a loan involves the borrower paying back the principal amount plus any accrued interest to reclaim their collateral. The overcollateralized nature of the loans provides an economic incentive for borrowers to repay their loans and reclaim their collateral.

### How it works?

Once you choose to repay your loan go to the borrowed page that shows you all your borrowed positions in different pools (open and closed), or you can also go to the pool page where you borrowed from. Choose the borrow position you would like to repay. A window will pop up showing you the position details including how much you borrowed, the interest that accrued since you opened that position and the total amount that you would need to pay to close that position. If you proceed with the transaction you pay the required amounts and sign the transaction from your wallet and once the transaction is confirmed, then you will get your collateral back.
26 changes: 26 additions & 0 deletions docs/pools/pools-processes/lending.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Pool Lending Process
sidebar_position: 2
---

## Introduction to Lending

Once a pool is set up, you can offer incentives to your community to become liquidity providers by depositing stable coins (e.g., USDC) into your supply pools, offering them a return on their investment. This process allows stable coin holders to earn revenue with relatively low risk by providing secured loans to different borrowers.

### How it works: Supplying liquidity into the Pool

To supply liquidity into the pool you are interested in, simply connect your wallet to the platform, navigate to the tab of the pool of your choice and select the supply/borrow button on the home page or navigate to the pool page and select supply in the top left corner from your screen. Choose the amount you would like to supply into the pool and sign the transactions from your wallet. Once this is done you can continuously monitor the rewards accrued on your position by going to the page of the pool where you made the deposits or by simply visiting the supplied tab.

### When can I collect my rewards and capital?

Once a pool matures no further loans can be taken from the available funds. If all previously made loans are repaid before the maturity date then your supplied funds and rewards will be available for collection immediately. However, if the pool requires liquidation, you would need to wait until the liquidation action has taken place, and only after that your funds will be available for withdrawal.

### How are my rewards calculated once I deposit into a POOL?

The rewards on your pools deposits are calculated by taking into account three different variables:

- **The Duration of your deposit:** The duration of your deposit refers to the time between your deposit action and the time the pool matures ( (Pool maturity date) - ( Deposit date)) measured in minutes to accurately capture the time your deposit has been sitting in the pool.
- **The interest rate of the pool:** Reflected in the pool metric calculated on a per minute basis. APY/(360 Days*24 Hours*60 Minutes).
- **The utilisation ratio:** Measures the effectiveness of the capital deposited in the pool. This metric reflects how much of the capital deposited in the pool is being utilised by active loans and is measured as (Borrowed Pool capital)/ (Total supplied pool capital).

The effective reward function becomes: Capital deposited in the Pool * Duration * Interest rate * utilisation ratio.
20 changes: 20 additions & 0 deletions docs/pools/pools-processes/liquidation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Pool Liquidation Process
sidebar_position: 3
---

## Introduction to Liquidation

Liquidation is an essential process in lending activities. It occurs when a lending pool reaches its maturity date, but some loans are still outstanding. The liquidation process ensures that lenders can recover their funds even if borrowers fail to repay their loans on time.

#### For the Borrower

If the pool’s maturity date passes and you have not paid back your borrowed amount, then you will have to wait until the pool is liquidated to collect back the remainder of your collateral once your loan has been liquidated. A part of your collateral will be sold to the liquidator to cover the borrowed amount, the required interest, and any additional fees that will be required to cover the cost of liquidation. Once the remainder of your collateral is available to be reclaimed you will be notified through the portal.

#### For the Supplier

If you have supplied liquidity to a pool that has some unpaid loans by the maturity date then you may not be able to collect your collateral right away. However, do not worry, Pools guarantees that your liquidity is borrowed against over-collateralized loans. This means that there is always sufficient collateral to cover your supplied liquidity. Your liquidity will be available once the pool has been liquidated by external agents that will buy the collateral in the pool by paying the outstanding balances and any additional interest required. Once the liquidation is executed, your liquidity and all additional rewards that have been accrued will be made available and you will be notified through the system.

#### For the Liquidator

As a liquidator, you interact directly with POOLS smart contract to learn about possible liquidation opportunities. Once you identify a liquidation opportunity you need to learn how much you need to pay in order to cover outstanding loans plus interest and how much collateral you should expect to receive by the end of the operation. All this information is supplied by querying the smart contract. If you believe that the liquidation opportunity is sufficiently interesting for you then you send the required payment to the smart contract directly and receive the collateral on the blockchain address you choose.

0 comments on commit d9a05c1

Please sign in to comment.