R

Refi

A variable interest rate lending & borrowing protocol that maintains a credit score for its users and also issues on-chain credit cards.

Carousel Gallery Item: 1
Carousel Gallery Item: 2
Carousel Gallery Item: 3
Carousel Gallery Item: 4
Carousel Gallery Item: 5

Last updated: 03 April 2022 05:49 PM

Added Demo video, Screenshots

The problem Refi solves

Credit Score

In the existing DeFi protocols, all users have to adhere to the same rules or conditions of lending and borrowing. The users with a good credit record, who maintained their positions at optimal state without ever defaulting don’t get any incentives for doing so. Refi tracks every user's financial activities in its lending pool and calculates/maintains an on-chain credit score. The higher the credit score, the higher a user can borrow against their deposited collateral. The users are divided into 4 classes based on their credit score i.e. Bronze (300-600), Silver (600-700), Gold (700-800) and Platinum (800-900). All users of a class recieve the same benefits and higher classes provide higher borrowing capacity.

Protocol Security

Since existing protocols have the same conditions for all the users, it introduces some level of risk. As a completely new user also gets the same features as another user who has maintained a good credit record for long duration. Thus, introducing a credit score model helps us build some sort of trust on the user. This is because a new user will initially have lesser LTV (borrowing capacity) than usual. As a user maintains a good record for longer durations, more LTV is provided. Such a user is less likely to get into risky positions, since they have put in lot of time and efforts for reaching this level of benefits.

UX

Existing Defi protocols feel too complicated with all the technical terms. We have tried our best to keep the UI as simple as possible for normal users. We have provided a brief documentation explaining all the technical terms related to the protocol.
Users can get their Refi credit card as an NFT. The credit card has a borrow limit and lets user borrow and pay in a single transaction. This allows user to pay an asset without holding it or swapping existing ones for it. Since the web2 experience of credit cards is replicated in web3, this takes the UX for crypto payments to the next level.

Challenges we ran into

1. Understanding Defi

In order to implement a credit scoring framework, we needed a base DeFi protocol. We chose AAVE v2 as they had an extensive and beginner friendly documentation with a well organized code base. We would really like to thank the AAVE community for this, as it definitely helped a lot. But as complete beginners in the field of DeFi it took us a lot of time and efforts to understand AAVE's algorithms and architecture. Thus, for the initial iteration of Refi, we decided to drop some features from AAVE v2. So, to get started, we built a minimal implementation of it consisting of only variable rate lending and borrowing.

2. Mumbai Testnet Resources

We could not deploy the final version of protocol on mumbai testnet and the error reasons we got were vague. The same code, however is successfully deployed on rinkeby. We tried almost every mumbai RPC URL, every stackoverflow fix, but nothing helped. Not sure if contract bug. Also, the chainlink price feeds are limited on the mumbai testnet. The protocol relies on price feeds of tokens w.r.t. MATIC and there aren't many such price feeds. So, we created mock price feeds with externally adjustable price for the time being.

Features -

  • Lending & borrowing protocol built on top of AAVE with Simple and Minimal UX
  • Protocol health monitored using Chainlink price feeds
  • Deployed Subgraph that tracks all positions on the protocol and serves as a base for liquidation data
  • Dedicated liquidation page that makes it easier for liquidators to find under-collateralized loans
  • Unique on-chain Credit scoring framework for Defi protocols
  • Dynamic LTV and Liquidation threshold based on user’s credit score
  • On-chain Refi credit cards that make crypto payments seamless
  • Credit cards minted as dynamic NFTs that change their look and feel based on user’s credit score
  • Immutable storage of credit card images on IPFS

To know more about credit score calculation see this

Discussion