Introducing a private, KYC-free lending platform on Oasis Sapphire. Utilizes dual-token setup, ROFL (TEE) for fetching real time price feeds. Features on-chain and off-chain confidentiality to ensure secure, private transactions.
PROJECT OVERVIEW :
A private lending platform in the Oasis Sapphire blockchain that leverages on-chain and off-chain confidentiality to provide secure and private financial transactions without KYC. It simulates a dual-token setup for loans and collateral, with automated oracle price feeds facilitated by Runtime Off-Chain Logic (ROFL) in Trusted Execution Environments (TEEs).
HOW SAPPHIRE BENEFITS OUR PLATFORM ?
This platform takes full advantage of the Oasis Sapphire blockchain to offer a secure environment for executing EVM compatible smart contracts with enhanced on-chain data confidentiality. This feature ensures that sensitive transaction details such as sender and receiver information are encrypted, allowing users to engage in lending and borrowing without compromising privacy. This shields them from common blockchain threats like front-running, where exposed transaction details could be misused by opportunistic observers.
Moreover, we integrate off-chain confidentiality using ROFL, which significantly boosts out platform's integrity and security, when paired with Trusted Execution Environments (TEEs). This setup not only secures sensitive operations like real-time pricing feeds but also ensures the accuracy and integrity of these feeds, crucial for calculating loan values reliably. By automating financial processes such as loan issuance based on collateral and auto-liquidation protocols in a secure manner, out platform delivers tailored and responsive financial services that preserve the inherent privacy first ideals of blockchain technology.
HOW THE PLATFORM WORKS ?
Dual token setup: Token1 is used as collateral by borrowers and Token2 is loan currency provided by liquidity providers. This is what borrowers receive when they take out a loan.
Lending process: People who want to lend money, deposit Token2 into a lending pool and earn an interest rate of 6% for particular time periods. These deposits boost the total amount of money available in the pool, which is then used to provide loans to borrowers.
Borrowing process: Borrowers secure a loan by depositing Token1 as collateral. Then they receive an amount of Token2 equivalent to 90% of their Token1's current market value. This price feed is fetched through real-time, secure price feeds from ROFL. Borrowers are charged an interest rate of 7% on the loan amount.
Pricing and Valuation: The value of Token1 and Token2 is dynamically updated using data from ROFL, which gathers information form multiple off-chain sources to ensure accurate, tamper proof pricing (with the help of TEEs). This is critical for fair loan assessments.
Repayment process: Borrowers agree to repay the borrowed Token2 plus the accrued interest. The total amount to be repaid is based on how long the loan has been outstanding.
Auto-Liquidation: A system continuously checks the price ratio of Token1 to Token2. If the value of the collateral falls significantly, and the loan-to-value (LTV) ratio drops below a set threshold, auto-liquidation is triggered automatically.
Security leverage: All price feeds are tamper proof, with the help of TEEs, and on-chain confidential transactions leveraged over Sapphire.
WHAT REAL WORLD PROBLEM OUR PLATFORM INTENDS TO SOLVE ?
Eliminates the need for personal identification through KYC, ensuring user transactions remain anonymous and secure.
Uses confidential smart contracts to keep transaction details private, preventing potential front-running and market manipulation.
Integrates real-time data feeds to dynamically adjust loan terms based on market conditions, protecting both lenders and borrowers from volatility.
Utilizes blockchain's inherent properties to offer a transparent and secure environment, reducing the risks of fraud and corruption.
FRONTEND: For the frontend of our dapp, we have used react.js famework and bootstrap, material UI for the CSS of our dapp. ethers.js library is used to call the smart contract functions from the frontend.
SMART CONTRACTS: We have two ERC20 tokens and the main lending contract which provide functionalities such as depositing into liquidity pool by LPs, getLoan function that gives loan to the borrower, repayLoan where user can repay the loan with the interest. The borrower has to deposit the collateral for taking the loan and if the user is unable to pay the loan, their collateral will be locked in the pool forever. The contracts are deployed on sapphire, which ensure the encryption and security of all the addresses being used.
ROFL APP The ROFL app has 3 main parts: The rust app which calls the data of the price of the 2 tokens in the decentralized TEE, the solidity contract written on hardhat, which pushes all the data coming periodically on chain, and finally the ts file, which allows us to interact with the deployed chain. Alternatively, the deployed solidity contract is also called in the front-end, which shows the live price of both the tokens as the state changes, and from where the prices is used to calculate the maximum allowed loan and auto-liquidation conditions.