project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Hunnid Finance

A crypto-based microloan platform allows friends to lend and borrow small amounts of cryptocurrency securely and transparently. Using blockchain technology, it ensures trust, transparency, and automation.

Hunnid Finance

Created At

Superhack 2024

Winner of

Blockscout - Use Blockscout Block Explorer!

Prize Pool

Project Description

Project Name: Hunnid Finance

Description: Hunnid Finance is a decentralized peer-to-peer (P2P) micro-lending platform designed to facilitate small, fixed-amount loans in cryptocurrency. The platform allows users to borrow and lend small sums across various assets and blockchains. It leverages blockchain technology to ensure transparency, security, and efficiency in the lending process. The application integrates with crypto wallets for seamless transactions and uses smart contracts to manage loan agreements, collateral, and repayments.

Features:

  1. Borrow

Description: The borrowing feature enables users to request a loan of $100 from other users on the platform. To initiate a loan, borrowers must lock collateral in the smart contract, which secures the loan and provides assurance to lenders.

Steps:

1.	Collateral Requirement: Borrowers are required to lock an amount of collateral in the smart contract. This collateral must be greater than to the loan amount to ensure that the borrower can repay the loan or the collateral can be seized if the loan is not repaid.
2.	Loan Request: Users specify the loan amount (fixed at $100) and provide details about the loan request, including any relevant information about the collateral.
3.	Smart Contract Interaction: The smart contract locks the collateral and records the loan request. This includes updating the borrower’s loan status and tracking the collateral amount.
4.	Approval Process: The loan request is visible to potential lenders. Once a lender agrees to fund the loan, the smart contract confirms the transaction, and the loan amount is transferred to the borrower.

Example: A user wants to borrow $100. They lock $150 worth of collateral into the smart contract. The request is published, and a lender agrees to fund it. The smart contract releases $100 to the borrower and locks the collateral until the loan is repaid or the loan is defaulted.

  1. Browse Loans

Description: This feature allows users to view all available loan requests on the platform. It provides a way for lenders to find loan opportunities and choose which loans they want to fund based on the details provided.

Steps:

1.	Loan Listings: Users can view a list of all active loan requests. Each listing includes details such as the loan amount, collateral, borrower information, and loan status.
2.	Filters and Sorting: Users can filter and sort loan requests based on various criteria such as collateral amount, borrower rating, or loan request date.
3.	Detailed View: Clicking on a loan request provides a detailed view of the loan, including collateral details, borrower’s history, and any other relevant information.
4.	Interactivity: Users can express interest in a loan request or directly fund a loan through the interface.

Example: A lender logs into the platform and navigates to the “Browse Loans” section. They see a list of active loan requests, including details about the collateral and borrower. They filter the list to find loans with higher collateral and decide to fund one that meets their criteria.

  1. Delete Loan

Description: The delete loan feature allows users to remove their own loan requests from the platform. This feature is available to both borrowers and lenders, primarily to handle cases where a loan request is no longer needed or was created by mistake.

Steps:

1.	Loan Management: Users can view a list of their own active loan requests. Each request includes an option to delete.
2.	Deletion Process: When a user chooses to delete a loan request, the smart contract updates the status of the loan, releases any locked collateral, and removes the loan from the active listing.
3.	Confirmation: The user receives a confirmation message indicating that the loan has been successfully deleted.

Example: A borrower decides they no longer need the $100 loan they requested. They go to their loan management page, select the loan they want to delete, and confirm the deletion. The smart contract releases the collateral and removes the loan request from the platform.

  1. Repay Loan

Description: The repay loan feature allows borrowers to repay their loans in full, including any applicable fees or interest. Once repaid, the collateral is released back to the borrower.

Steps:

1.	Repayment Process: The borrower initiates the repayment by sending the loan amount plus any fees or interest to the smart contract.
2.	Smart Contract Interaction: The smart contract verifies the repayment amount, updates the loan status to “repaid,” and releases the collateral back to the borrower.
3.	Confirmation: The borrower receives a confirmation message indicating that the loan has been successfully repaid and the collateral has been returned.

Example: A borrower repays the $100 loan they took out, including $5 in fees. They send $105 to the smart contract. The contract verifies the payment, updates the loan status, and releases the $150 collateral back to the borrower.

Each feature is designed to ensure a smooth and secure lending experience, leveraging blockchain technology to automate and manage loan transactions effectively.

Potential Future Features:

  1. Gasless Transactions and Approvals

Description: Account abstraction can enable gasless transactions, where the platform covers the gas fees or uses a different token to pay for gas, making it easier for users to interact with the platform without needing to hold the native blockchain token (e.g., ETH).

  1. Flexible Collateral Management

Description: Account abstraction can allow for more sophisticated and flexible collateral management strategies. For example, users could set up conditions under which their collateral can be automatically adjusted or liquidated based on specific criteria.

  1. Easy User Onboarding

Description: Account abstraction can simplify the onboarding process for new users by abstracting away the complexity of managing private keys and interacting with smart contracts.

  1. Customizable Loan Agreements and Automation

Description: Account abstraction can be used to create more flexible and customizable loan agreements, where the terms can be automatically enforced by the smart contract.

  1. Credit Score Integration

Description: A decentralized credit score system could be integrated into the platform to assess the creditworthiness of borrowers. This system would analyze users’ borrowing and repayment history, providing a score that lenders can use to make informed decisions.

  1. Collateral Pooling

Description: Allow borrowers to pool different types of collateral (e.g., multiple cryptocurrencies or NFTs) to secure a loan. The system could automatically calculate the risk and value of the pooled assets to determine the loan amount.

  1. Cross-Chain Lending

Description: Enable cross-chain lending where users can borrow and lend assets across different blockchains. Utilize bridging technology to transfer collateral and loans securely between chains.

8 Loan Matching

Description: Implement AI algorithms to match borrowers with lenders based on criteria like preferred interest rates, risk tolerance, and loan duration. The AI could also recommend optimal collateral options.

  1. Borrower Incentives and Rewards

Description: Offer rewards like reduced interest rates or platform tokens for early or on-time repayments. Users could also earn badges or certifications for maintaining a good repayment history.

  1. Decentralized Identity Verification

Description: Implement a decentralized identity (DID) system to verify users’ identities without relying on centralized entities. Users could choose to share their verified identity with potential lenders to get better loan terms.

How it's Made

Here’s a detailed explanation of how the project was built, covering the technologies used, how they were integrated:

Frontend Tech Stack: React, Vite, and TypeScript

  1. Thirdweb SDK for Wallet Connection

The foundation of our project’s user interaction begins with the Thirdweb SDK, which we utilized for seamless wallet connection.

Integration:

•	Implemented Thirdweb’s wallet connection directly into the front-end, allowing users to connect their wallets with a single click.
•	Configured wallet support for popular options such as MetaMask, WalletConnect, and Coinbase Wallet.

2. Portals Finance API for Fetching Portfolio and Token Balances

To provide users with real-time insights into their portfolio and token balances, we integrated the Portals Finance API. This API allowed us to fetch comprehensive portfolio data, including detailed token balances across different blockchains.

Integration:

•	Integrated Portals Finance API to fetch user portfolio data upon wallet connection.
•	Used the API to display real-time token balances on the borrow page ensuring users have real time balance information.

3. Thirdweb for Contract Interaction (Read and Write Functions)

We relied on Thirdweb not only for wallet connection but also for interacting with our smart contracts. This included executing read and write functions related to borrowing, transferring, deleting, and repaying loans.

Integration:

Used Thirdweb’s contract interaction features to facilitate actions such as creating a loan, transferring funds, delete and repaying loans.

  1. Blockscout as the Primary Explorer

To enhance transparency and allow users to track their transactions and portfolio, we integrated Blockscout as the primary blockchain explorer. Whenever users executed transactions, they were redirected to Blockscout to view the details, ensuring that they had full visibility into the operations taking place on the blockchain.

Integration:

•	Redirected users to Blockscout to track the status and details of their transactions.
•	Linked portfolio tracking and transaction history directly to Blockscout, providing users with a clear view of their on-chain activities.

5. Solidity Smart Contracts Deployed on Base and Optimism

The core logic of our platform is driven by Solidity smart contracts, which were written and deployed on the Base and Optimism blockchains. These contracts handle all essential operations, including loan creation, collateral management, and repayments. Deploying on Base and Optimism allowed us to offer users a low-cost, high-speed environment for testing and using the dApp.

Integration:

•	Wrote the smart contracts in Solidity, focusing on security and efficiency.
•	Deployed the contracts on Base and Optimism, offering users ant environment to experiment with the platform.

6. Ethers and Web3 for Formatting Utilities and Token Approval Functionality

To handle the finer details of Ethereum transactions, such as formatting data and managing token approvals, we utilized the Ethers.js and Web3.js libraries. Ethers and Web3 allowed us to format and parse data, handle token approvals, and manage transactions with precision.

Integration:

•	Used Ethers.js for formatting utilities such as converting between different units of currency and parsing transaction data on almost every single page.
•	Implemented token approval functionality using Web3.js, ensuring that users could authorize the platform to manage their tokens securely.
background image mobile

Join the mailing list

Get the latest news and updates