dao lending pool that uses in-real-life trust between people to give credit
a micro-lending pool of people that personally know the borrower
This is an alternative to collateralized loans and mimics the credit-score system. From my experience in working in consumer banking and researching various models for financing, including microfinancing and anthropology, this is our society's best bet 🙂
Key ideas:
- lenders personally know the borrower(s). they are family and real-life friends
- lending pool is a dao
- dao chooses whom to accept as an additional lender (AL) based on the AL's relationship with other lenders and borrower(s)
- the loans are structured.
- bi-weekly or monthly payments of a specific amount
- downpayment
- interest
- limit on how much to take from the loan in a month
- dao approves addresses, where the borrower can spend the loan
- white-listed or token-gatedspending addresses for spending
- credit-score based on the connectivity in a graph and past history
- optional: dispute resolutions
- optional: annonymity
- previous: kyc ( https://ethglobal.com/showcase/zk-kyc-sbt-ozwb2 ) and aml (https://ethglobal.com/showcase/complisend-3j0jx )
Lenders, Borrowers, merchants, oracles
User flow
- Borrower (B) wants to buy sawing machine and yarn to start a sewing business.
- B asks for a loan from her friends and family. By doing that, B puts her reputation at stake.
- These IRL Lenders form a dao
4.B creates a proposal that has the terms
- Amount
- Downpayment
- Withdrawals (initial $40 for the sewing machine, $20 every week for textiles, and $5 for other expenses; for two months)
- When (includes start and end day)
- How much
- To which addresses (seller of the sewing machine, textile suppliers, and other expenses)
- Interest (included in the payments) d. Repayments: when and how much (withdrawals end + 2 months to build capital, start repaying, specify dates and amounts)
- Dao votes and approves the terms
- Loan starts
- If all repayments are according to the schedule, no problem –the dao emits an event.
- If skipping a payment by less than 30 days, the dao emits an event, payment schedule is delayed.
- If the payment is more than 90 days late → default event
This is a Next.js + Web3Modal + wagmi project bootstrapped with create-wagmi
git clone --recurse-submodules https://github.com/kirilligum/irl-trust
To demo this project, we first need to run 2 submodules: ceramic2 & snappy-recovery Open each folder to see Readme for detailed steps on how to run them.
This is resource intensive. If you encounter the error "ENOSPC: System limit for number of file watchers reached" You can run this:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
After running all the dependencies above... run the main webapp:
cd src && npm install && npm run dev
Since a submodule is already running a webapp, this main webapp should open at localhost:3001
cd huma-contracts && yarn install
cp .env.example .env
fill out mnemonic from a development metamask
(bottom of file, wrap in single quotes)
npx hardhat node
(new terminal)
to run basic workflow tests
npx hardhat test ./test/IrlTrustTest.js
to preset for web integration
npx hardhat run ./scripts/irl-trust-predeploy
We use ceramic to store loan contract term sheets. Modeled after ceramic's workshop, the ceramic2 submodule spins up a ceramic node plus a graphiql server. The run time composite enables the frontend to execute graphql queries. In this video, when a borrower initiates a lending pool, the browser console logs the query string and sees it was successful as the streamID is shown. Through a query on the graphiql server we can also see that the new data was written to ceramic. This has little data but if this were to go to production, the lending pool would contain a lot more data that wouldn't make sense to store on Ethereum. Ceramic was a great option as it allowed quick access to read and write data supplementing on-chain data. https://youtu.be/7r-PXMzLgq8
Wallet connect enables our users to easily pick from a wide range of wallets they prefer. This allows the unbanked to use our personal lending protocol to put the oldest credit system on chain.
Huma's contracts are the backbone of our lending protocol. It helps evaluate risk and reputation, facilitate loans and repayments.
we use USDC for all loans as it's the simplest way to provide unit of measure. People don't want volatility in simple loans.
Social recovery is an important aspect for our users. Since our lending pools are people that know each other in real life, it's a great safety mechanism for our borrowers to get help from lenders for recovery. This was built on the Snappy recovery repo by Ziad. We've enabled recovery from just 2 lenders. With more time we would have liked to streamline the recovery process so that in our dapp's workflow, recovery can be set up automatically by default. https://youtu.be/FroCueniXcY