Inspiration

Decentralised lending while effective requires excessive overcollateralization - think Aave, Solend. Traditional lending is able to optimise rates using credit but has too much friction with the presence of middlemen.

Imagine if a Smart Contract could store everyone’s lending history in private variables. Using this to optimise interest rates and collateralisation. Imagine freeing the assets used to over collateralize a loan. Imagine if credit was completely private (think storing data privately where only a contract can access it), trustless, and free from any bias that tradfi uses like gender, ethnicity, occupation etc.

What it does

We have created a set of smart contracts for decentralised lending, a credit algorithm, and a fullstack app to interact with all of this through a GUI, which governs a decentralised lending policy. Built on top of the Lens protocol we have created a social network for decentralised lending. Instead of each interaction with the blockchain being independent, we aggregate peoples experiences with other Defi contracts through Lens and generate a credit algorithm that optimises loan terms for people.

To help understand the concept, here is a simplified example:

Let’s say 10 people want to borrow 10 USD. On Aave each would have to provide 12.5 worth of ethereum. Also each person must pay 2 USD in interest. This means 25 - 10*2 = 5 USD in assets is redundant.

If you knew that each person has an 80% chance of repayment and must pay 2 in interest how can we calculate the necessary collateral to ensure for the lender?

The expected value of repayment = 12*10*0.8 = 96. Given that we only need to get past 100 USD each person must pay a collateral of 4/2 = 2 USD. Saving 8*12.5 + 5 - 4 in ETH!

Obviously this relies on the central limit theorem for large expected values predicting outcomes with small variances, but given the benefits that the borrower gets, attracting users should be an easy proposition! Our React App is a simple way to access the liquidity (borrowing and lending pools) in our contract: 0x1112a15e083bd889458d5272f2f93647f3b61729.

How we built it

We used the ethereum blockchain, including custom smart contracts and the Lens protocol for the backend and metamask to simplify the interaction for our users. We built a GUI on React and Firebase.

Challenges we ran into

Not publishing API creds on Github Centering divs (obviously!)

Accomplishments that we're proud of

Deploying to Heroku in 1 go Pulling the allnighter ;)

What we learned

All of us had different skills from blockchain to frontend and backend dev. Interfacing tasks to optimise people for certain roles was a big realisation for us and a good learning point.

What's next for Loanfish

With an optional layer of KYC over the Lens Protocol we can improve our rating algorithm as we can ensure people do not interact with the contract through different addresses.

Share this project:

Updates