LogoLogo
V2 DocsV2 dApp
English 🇬🇧
English 🇬🇧
  • Welcome to Folks Finance official documentation!
  • Getting started
  • HOW TO
    • Deposit
    • Lock & Earn
    • fStaking
    • Withdraw
    • Borrow
    • Rebalance
    • Repay
    • Rewards aggregator
    • Algo Liquid Governance
      • Algo Liquid Governance - G3
  • User profile
    • Dashboard
    • History
    • Notifier
  • Developer
    • Contracts
    • Official SDKs
  • Protocol architecture
    • Overview
      • Liquidity pool dynamics
      • Interest rates model
      • Interest accrual
      • Deposit
      • Withdraw
      • Borrow
      • Slippage
      • Liquidation
      • Algo Liquid Governance
      • Incentive system
      • fStaking
      • Token types
  • Security
    • Audits
    • Bug bounty
  • Support
    • FAQ
    • Glossary
    • Fees
  • helpful guides
    • Creating a My Algo Wallet
    • Buying Algo using FIAT - CEXs guide
    • Buying Algo with FIAT - Pera wallet/MyAlgo wallet guide
    • Allowing pop-up
    • Folks Finance's Testnet
  • Community
    • What can I do with gALGO?
    • Aeneas liquidity program
    • Contact
    • Community treasury
    • FOLKS
  • Legal
    • Privacy Policy
    • Terms & Conditions
    • Disclaimer
Powered by GitBook
On this page
  • Thresholds
  • Borrow Balance
  • Thresholds Parameters

Was this helpful?

  1. Protocol architecture
  2. Overview

Borrow

Dynamics behind the borrow operation.

PreviousWithdrawNextSlippage

Last updated 2 years ago

Was this helpful?

A user who has made a obtaining an amount MMM of can request a loan by locking them as .

At the time of the borrow request, named tbt_btb​, the user possesses a collateral amount AtbA_{t_b}Atb​​ correspondent to the amount MMM of fToken multiplied by IdtbI_{d_{t_b}}Idtb​​​ which is the at the time of borrowing tbt_btb​:

Atb=M∗IdtbA_{t_b} = M * I_{d_{t_b}}Atb​​=M∗Idtb​​​

The collateral amount AtbA_{t_b}Atb​​, can be expressed in the borrowed token value following this formula:

Qtb=Atb∗RBorrowedDepositedtbQ_{t_b}=A_{t_b} * R_{\frac{Borrowed}{Deposited}_{t_b}}Qtb​​=Atb​​∗RDepositedBorrowed​tb​​​

Where RBorrowedDepositedtbR_{\frac{Borrowed}{Deposited}_{t_b}}RDepositedBorrowed​tb​​​ represents the conversion rate between the borrowed and the collateralized asset.

Thresholds

S1 - Loan To Value

For safety reasons, the total amount of QQQ cannot be borrowed by the user; it is necessary to retain a portion of it within the protocol to safeguard the loan in case of negative fluctuations in the value of the collateralized asset and to guarantee the interest repayment. Therefore, a safety threshold S1S1S1 is devised by the protocol. S1S1S1 is expressed in percentage form, e.g., S1S1S1 = 0.8 (i.e., 80%), which determines the Loan to Value (LTV).

The granted value is given by the following:

Atb∗S1=M∗Idtb∗S1A_{t_b} * S1 = M * I_{d_{t_b}} * S1Atb​​∗S1=M∗Idtb​​​∗S1

Therefore, the borrowable amount BABABA is calculated as follows:

BAt=M∗RB2CtBA_t = M * R_{B2C_t}BAt​=M∗RB2Ct​​

Where RB2CtR_{B2C_t}RB2Ct​​ is the Borrowable to Collateral ratio, and it is calculated as follows:

RB2Ct=Idt∗RBorrowedDepositedt∗S1R_{B2C_t} = I_{d_t} * R_{\frac{Borrowed}{Deposited}_{t}} * S1RB2Ct​​=Idt​​∗RDepositedBorrowed​t​​∗S1

So, the borrowable amount at the time of borrow is calculated as:

BAtb=M∗RB2CtbBA_{t_b} = M * R_{B2C_{t_b}}BAtb​​=M∗RB2Ctb​​​ or BAtb=Atb∗RBorrowedDepositedtb∗S1BA_{t_b} = A_{t_b}* R_{\frac{Borrowed}{Deposited}_{t_b}} * S1BAtb​​=Atb​​∗RDepositedBorrowed​tb​​​∗S1

S2 - Liquidation Threshold (or under-collateralization threshold)

The critical value S2S2S2 represents the liquidation threshold, and it is given in percentage defined such that: S1S1S1 < S2S2S2 (e.g., S1S1S1 = 80%; S2S2S2 = 90%). When the borrowed amount plus accrued interest reaches down the amount Atb∗S2A_{t_b} * S2Atb​​∗S2 (in the same currency), the position is considered under-collateralized and must be liquidated.

The quantity At∗S2A_{t} * S2At​∗S2 is the threshold of under-collateralization of the loan. Therefore, the equivalent amount in the borrowed asset is calculated as:

Tt=At∗S2∗RUSDC/ALGOtT_t = A_t * S2 * R_{{USDC}/{ALGO}_t}Tt​=At​∗S2∗RUSDC/ALGOt​​

The user will have to pay interest on the loan. Regular payments are not required to simplify the protocol. However, the non-payments may correspond to a decrease in the collateral value, which must be kept above the T threshold. If the user does not pay interest or stabilize its collateral, a liquidator can repay the debt, acquiring collateral control.

Rebalance Threshold

1−S1/S2<LM1-{S1}/{S2}<LM1−S1/S2<LM

Borrow Balance

The variable state Borrow Balance BBtBB_{t}BBt​represents the actual amount the user must repay to the platform to close the debt position. To clearly understand all the situations that a loan position could incur, four components are defined as follows:

1. BtnB_{t_n}Btn​​​ which represents the actual value borrowed by the user, which is initially Btb=BAtbB_{t_b} = BA_{t_b}Btb​​=BAtb​​. This is checked and updated only when one of the following occurs: Repay Loan (fully/partially or liquidate) and borrow additional asset (collateral value increased).

2. CCC which is the amount of asset added (borrow additional asset) or subtracted (Repay loan/interest) from the borrow balance.

3. BBtnBB_{t_n}BBtn​​is the borrow balance of the loan at the time t updated at the last loan operation N. It is calculated as an update of the previous borrow balance and the relative compounded interest, plus/minus the contribution of CCC.

BBtn=BBtn−1∗IbtIbtn−1±CBB_{t_n} = BB_{t_{n-1}} *\frac{I_{b_t}}{I_{b_{t_n-1}}} \pm CBBtn​​=BBtn−1​​∗Ibtn​−1​​Ibt​​​±C

4. AItNAI_{t_N}AItN​​is the part of the user debt composed of the accrued interest on the borrowed amount . When the user repays, the accrued interest part of the payment is addressed to the reserve pool.

AItN=BBtn−1∗IbtIbtn−1−BtN−1AI_{t_N} = BB_{t_{n-1}} *\frac{I_{b_t}}{I_{b_{t_n-1}}} - B_{t_{N-1}}AItN​​=BBtn−1​​∗Ibtn​−1​​Ibt​​​−BtN−1​​

Thresholds Parameters

The Borrow Cap is the global maximum borrowable amount for a given token pair, specified in the absolute terms using the borrowed asset.

Token Pairs (Col-Bor)

S1

S2

Borrow Cap

ALGO - USDC

0.7

0.8

ALGO - USDt

0.7

0.8

ALGO - goBTC

0.65

0.8

ALGO - goETH

0.65

0.8

ALGO-Planet

0.7

0.8

600,000

USDC - ALGO

0.7

0.8

USDC - USDt

0.85

0.95

USDC - goBTC

0.75

0.825

USDC - goETH

0.7

0.8

USDC-Planet

0.65

0.8

350,000

USDt - ALGO

0.7

0.8

USDt - USDC

0.85

0.95

USDt - goBTC

0.75

0.825

USDt - goETH

0.7

0.8

USDt-Planet

0.65

0.8

350,000

goBTC - ALGO

0.65

0.8

goBTC - USDC

0.75

0.825

goBTC - USDT

0.75

0.825

goBTC - goETH

0.8

0.875

goETH - ALGO

0.65

0.8

goETH - USDC

0.7

0.8

goETH - USDt

0.7

0.8

goETH - goBTC

0.8

0.875

gALGO - ALGO

0.75

0.9

3,500,000

gALGO - USDC

0.65

0.75

1,000,000

gALGO - USDt

0.65

0.75

1,000,000

gALGO - goBTC

0.6

0.75

10

gALGO - goETH

0.6

0.75

200

gALGO-Planets

0.65

0.75

500,000

gALGO3 - ALGO

0.85

0.9

gALGO3 - USDC

0.65

0.75

gALGO3 - USDt

0.65

0.75

gALGO3 - goBTC

0.5

0.675

gALGO3 - goETH

0.5

0.675

Planet-ALGO

0.7

0.8

40,000

Planet-USDC

0.65

0.8

8,000

Planet-USDt

0.65

0.8

8,000

ALGO/gALGO PLP - ALGO

0.725

0.85

750,000

ALGO/gALGO PLP - USDC

0.65

0.8

250,000

ALGO/gALGO PLP - USDt

0.65

0.8

250,000

ALGO/USDC TMP1.1 - ALGO

0.65

0.825

400,000

ALGO/USDC TMP1.1 - USDC

0.7

0.8

200,000

ALGO/USDC TMP1.1 - USDt

0.7

0.8

200,000

ALGO/USDC PLP - ALGO

0.65

0.825

200,000

ALGO/USDC PLP - USDC

0.7

0.8

100,000

ALGO/USDC PLP - USDt

0.7

0.8

100,000

ALGO/gALGO3 TMP1.1 - ALGO

0.725

0.85

400,000

ALGO/gALGO3 TMP1.1 - USDC

0.65

0.8

100,000

ALGO/gALGO3 TMP1.1 - USDt

0.65

0.8

100,000

ALGO/gALGO3 PLP - ALGO

0.725

0.85

350,000

ALGO/gALGO3 PLP - USDC

0.65

0.8

75,000

ALGO/gALGO3 PLP - USDt

0.65

0.8

75,000

USDC/gALGO TMP1.1 - ALGO

0.65

0.825

750,000

USDC/gALGO TMP1.1 - USDC

0.7

0.8

250,000

USDC/gALGO TMP1.1 - USDt

0.7

0.8

250,000

USDC/USDt TMP1.1 - ALGO

0.65

0.8

400,000

USDC/USDt TMP1.1 - USDC

0.85

0.9

250,000

USDC/USDt TMP1.1 - USDt

0.85

0.9

250,000

USDC/USDt PLP - ALGO

0.65

0.8

400,000

USDC/USDt PLP - USDC

0.85

0.9

250,000

USDC/USDt PLP - USDt

0.85

0.9

250,000

goBTC/gALGO PLP - ALGO

0.7

0.8

600,000

goBTC/gALGO PLP - USDC

0.65

0.775

200,000

goBTC/gALGO PLP - USDt

0.65

0.775

200,000

goBTC/gALGO PLP - goBTC

0.675

0.775

8

goBTC/gALGO PLP - goETH

0.7

0.8

120

goETH/gALGO PLP - ALGO

0.725

0.825

600,000

goETH/gALGO PLP - USDC

0.675

0.8

200,000

goETH/gALGO PLP - USDt

0.675

0.8

200,000

goETH/gALGO PLP - goBTC

0.725

0.825

8

goETH/gALGO PLP - goETH

0.7

0.8

120

The S1 and S2 parameters are related to the collateralized-borrowed assets pair. Their value is established using an innovative algebraical model specifically built for Folks Finance that considers the covariance of the pairs of assets, market capitalization and liquidation risk.

Users can borrow more assets against the same collateral or reduce the locked up collateral if the is greater than:

Liquidation Margin
deposit
deposit interest index
fToken
collateral