Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstration Scenario #33

Open
anilhelvaci opened this issue Aug 26, 2022 · 1 comment
Open

Demonstration Scenario #33

anilhelvaci opened this issue Aug 26, 2022 · 1 comment

Comments

@anilhelvaci
Copy link
Owner

anilhelvaci commented Aug 26, 2022

A demonstration scenario should show below functionalities successfully;

For the users

Supply/Deposit

  • A user should be able to deposit money to an existing pool
  • User should receive protocolTokens in return
  • If there's a borrow in the pool prior to the deposit, borrowing rate should decrease, if not should stay stable

Borrow

  • A user should be able to borrow money from an existing pool by using their protocolTokens as collateral
  • The borrowing rate for that pool should increase
  • The exchange rate for that pool should increase after every time interest is charged as long as the loan is active

Adjust Loan

  • A user can adjust their loan in the following ways;
    • Only pay some debt
    • Only put some more collateral
    • Only want collateral
    • Pay some debt and receive some collateral
  • After every adjust market state should get updated along with its notifier
  • After every adjust loan state should get updated along with its notifier

Close Loan

  • A user should be able to close their loan by paying all debt along with the accrued interest and receive the collateral they put in the first place

Redeem/Withdraw

  • A user should be able to withdraw the money they supplied by sending protocol tokens and receiving the underlying asset corresponding to the amount of protocolToken they supply
  • Exchange rate between underlying asset and protocolToken is affected from the interest that is accrued to the borrows, so if there is no borrow at the time of deposit and still no borrow at withdrawal time user should receive the same amount of underlying asset they deposited at the first time, else they should receive more.

Liquidation

If a loan gets underwater due to a change in price, either collateral value goes down or debt value goes up, we should display a successful swap operation from the AMM trading user's collateral against the debt with a penalty rate.

For the markets

Market Parameters

Every pool is bootstrapped with a collection of parameters on the creation, these parameters are;

  • liquidationMargin
  • baseRate
  • multipilierRate
  • penaltyRate

Different markets should start with different parameters.

Market Activities

Price Changes

We should demonstrate how protocol is affected from the changes in token prices. This affects can be observed from the below;

  • A loan gets liquidated due to the changes in either collateral and debt price causing the loan to get underwater
  • An increase or decrease in the limit of a loan
  • Fluctuation in the fields like Total Supply, Total Borrow

New Markets

Creator should be able to add new markets/pools and UI should get updated accordingly

Faucets

There will be faucets for the tokens listed in the protocol, users should get their tokens from these faucets before they can interact with the protocol

@anilhelvaci
Copy link
Owner Author

Sample User Journey

Here is a sample user journey diagram showing a likely to be common scenario

  journey
    title Pool Based Lending Protocol
    section Initiate Protocol
      Add VAN Pool: 5: Creator
      Add PAN Pool: 5: Creator
    section Supply
      Alice Supply VAN: 5: Alice
      Alice Receive AgVAN: 5: Alice
      Bob Supply PAN: 5:Bob
      Bob Receive AgPAN: 5:Bob
    section Borrow
      Alice Borrow PAN-Col AgVAN: 5: Alice
      Alice Loan Limit %82: 3:Alice 
      Borrow Rate-UP: -:Market
      Interest Accrued: -:Market
      Exchange Rate-UP: -:Market
      Borrow Rate-UP: -:Market
      Col Price Drops: -:PriceAuth
      Alice Loan Limit %95: 1:Alice
    section Adjust
      Alice Pay Some Debt: 3:Alice
      Alice Loan Limit %70: 1:Alice
      Borrow Rate-DOWN: -:Market
   section Close
      Alice Pay All Debt: 5:Alice
      Alice Get All Col: 5:Alice
      Borrow Rate-DOWN: -:Market
   section Redeem
      Bob Give AgPAN: 3:Bob
      Bob Get PAN: 5:Bob
      Borrow Rate-UP: -:Market             
Loading

We chose a mermaid user journey diagram for this but if it is too hard to read we can change it to another diagram type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant