About the project
We saw trillions of dollars held in low yield financial instruments like bonds, treasuries, and high interest savings accounts and wondered why this capital wasn’t moving to DeFi lending protocols for improved yields, information clarity, and systemic guarantees.
Diving into this further, we discovered people are still concerned with losing their crypto to hacks or other catastrophic events.
We built a decentralized protocol to offer protection against these events to encourage DeFi lending and in the process, promote economic fairness.
Interested in seeing a slowed down extended demo video? Please feel free to check out our longer 7 minute demo video!
Decentralized finance is a rapidly expanding and highly volatile market; it has limited options for availability of insurance coverage or risk management smart contracts. Generally, insurers find it extremely difficult to insure against DeFi “Black Swan” events, and coverage options are nearly universally non-parametric. Users must work through a claims process to receive compensation for lost funds. The pseudo-centralization caused by a claims process is highly undesirable for users who are used to interacting with DeFi’s automated systems. As a result of a lack of stablecoin insurance, many DeFi users are exposed to nearly unlimited risk when interacting with DeFi protocols, which is an extremely unappealing prospect both to DeFi veterans and to people with no prior DeFi experience.
To address some of these concerns, we decided to experiment with a potential parametric risk management product, which would protect specific stablecoin assets (TUSD) using a combination of smart contracts and data feeds powered by Chainlink’s Proof-of-Reserve and Proof-of-Supply technology.
People want to lend their crypto and earn lucrative yield, but are afraid of:
- Hacks to the platform, the smart contract, or liquidity reserves.
- Failure of the underlying asset/token
- Business failures & the resulting long, drawn-out litigations.
What it does
- This risk management smart contract, as currently deployed, accepts a user request to engage with the smart contract, accepts user funds and the right to deposit them for the user, and transfers user funds to a DeFi protocol, such as Aave, which are then stored in the appropriate liquidity pool.
- The smart contract monitors TUSD’s Proof-of-Reserve and Proof-of-Supply data feeds. If the Proof-of-Reserve is greater than the Proof-of-Supply, this smart contract is valid; if the Proof-of-Reserve is less than the Proof-of-Supply by a difference of 5% or more, this contract becomes invalid, and it removes the user’s funds from the DeFi protocol (Aave) and returns them to the user. This is to protect the user from any cascading failures associated with the failure of the TUSD “stablecoin peg”.
- The smart contract monitors the wallet reserves of the wallet that holds the user’s funds. For testing on Kovan, we used two different wallets: one is Aave’s TUSD testnet wallet; the other is a Mock Wallet that we have access to, and we can modify the contents of this wallet to demonstrate the smart contract’s ability to detect dramatic changes in the wallet’s contents which triggers a payout to the user from the smart contract’s “Smart Wallet”.
- Finally, the smart contract gives the user the ability to withdraw their deposited funds and any interest, at any time, if they so choose.
- As compensation for this protection, the user currently is required to pay a percentage of their initially deposited funds to the smart contract. Ideally, the protocol would also periodically collect a portion of the interest-generated aTokens from Aave as payment for automated DeFi protection.
How we built it
- We used Chainlink for data delivery for our smart contract, we used Scaffold-Eth for our development framework, and we used IPFS to deploy, host, and load our website.
Challenges we ran into
We had multiple challenges during the development process.
- There was no TUSD Proof-of-Reserve or Proof-of-Supply data feed on the Kovan testnet, so we had to create and deploy our own external adapters to simulate these data feeds. Thanks to the LinkRiver team for allowing us to deploy our external adapters on their Kovan testnet Chainlink nodes!
- We had specific challenges with the economic structure of the smart contract. What constitutes a hack, how much should be paid out, and how much should the fee cost? We decided to assume we had unlimited funding for this testnet implementation, and we would resolve the economic challenges later.
- We had significant trouble enabling our risk management smart contract to harvest a proportion of the Aave interest tokens to act as compensation to the smart contract for the work it performed. I hope we can find a way to include this functionality, because it is an innovative and sustainable system-funding model.
Accomplishments that we're proud of
- We developed a smart contract that uses data to manage user risk when interacting with specific decentralized finance protocols.
- The smart contract has end-to-end security, responds to changes in Chainlink-powered Proof-of-Reserve and Proof-of-Supply data feeds, responds to changes in the “locked liquidity” of simulated proxy wallets meant to represent commonly used DeFi protocols, pays users in denominations they desire when the parametric conditions are met, and allows the user to withdraw their funds nearly instantly if they choose to do so.
- In essence, our smart contract provides improved risk management, information clarity and symmetry, and helps facilitate improved yields compared to investing in traditional financial instruments.
- We learned to collaborate remotely, we managed and overcame multiple problems, and we learned a lot in the process!
- 10/10 would hackathon again!
What we learned
Insurance products for DeFi are highly contextual and require extremely specific parameterization. Pricing models will be difficult to develop and necessitate the development of more robust sets of parameters for risk management systems. Increased complexity of parameterization is necessary to properly define the events which would trigger a payout, to reduce the cost of coverage and enable a widely adopted product. Finally, the liquidity reserves required for large-scale, mainnet ready deployment will need to be substantial.
- Luis: I learned a lot from both the workshop sessions and my team. I understood the implementation and how to apply the concepts of Proof of Reserve and Proof of Supply. By researching the implementation of these mechanisms, I got to learn how price feeds in Chainlink are implemented, and how we can mock one. I gathered knowledge and experience in how to integrate smart contracts to the Aave protocol using Solidity. Finally, one of my hackathon goals was to try new development tools for smart contracts, hence why I learned how to use Hardhat and ethers.js for this project. I used these tools via the Scaffold-ETH project, which was instrumental in our development workflow.
- Lukas: I gained perspective about my own design process by teaching and learning from other teammates. Together we collaboratively taught each other about various topics including but not limited to design, Figma, Proof of Reserve, Proof of Supply, Chainlink, Aave, Parametric insurance, IPFS, Optimism, Arbitrum and Bancor. In the end, I am happy with the design system crafted and molded after listening to our team's vision.
- Mike: I learned about various DeFi lending protocols like Aave and Bancor and CeFi platforms like Celsius and Blockfi. Also learned about the PoR and PoS data feeds and their importance for verifying critical information. The workshops and videos were great and Sergey’s speech incredibly inspiring. The possibilities for Chainlink and smart contacts are endless. We are entering a new era of innovation.
- Seth: I learned a lot from the hackathon workshop videos. I learned about all sorts of decentralized systems like IPFS, Polkadot, and The Graph that I had no exposure to before the hackathon. I also learned about the utility of PoS and PoR data feeds, and how they can improve smart contract performance and add useful functionality. Finally, I learned a lot about UI/UX design and programs like Figma and Lucidchart!
What's next for Parametric Digital Asset Risk Management
- A delayed payment is required to connect the wallet to the Smart Contract as a Service for improved risk management. Implementation of this functionality is the highest priority.
- It would be useful to expand the connectivity to different types of PoR/PoS enabled stablecoins, and to additional DeFi lending protocols and vaults.
- It would be pragmatic to expand the involved parameters to monitor for things like money laundering via increased TUSD & ETH on-chain volume and monitoring of requests that are directed at TornadoCash (if possible).
- It would be great to fully flesh out the economic structuring of this system, so it could be a self-sustaining risk management system. We initially intended to have the smart contract capture a portion of the Aave interest tokens to act as compensation to the smart contract for the work it performed.
- It would be especially nice if we were able to create a way for donors to “sponsor” wallets. Donors could use this risk management protocol to protect a sponsored target’s wallet; this would create a financial protection mechanism for individuals in emerging markets, and a tax-deductible donation system for charitable donors.
- Finally, it would be incredible to see all this work realized in the form of a mainnet deployment on the Ethereum blockchain, or on other EVM compatible blockchains.
How we integrated with sponsors
- Aave: Direct integration with the AAVE platform. Our contract code enabled token deposits and withdrawals with complex triggering conditions to/from the Aave platform.
- Armanino: Used a web request External Adapter to scrape Armanino TUSD Proof of Reserve and Proof of Supply data from their API. We called this External Adapter installed in a Chainlink node, so we could use the results of the PoR/PoS data to trigger specific smart contract events.
- Protocol Labs: We used IPFS to deploy and host our project’s website, store and display images on the website, and to display smart contract analytical data on user dashboards.
- Social Impact Prize: This project streamlines the donation process of user profits directly to charitable organizations, while teaching users about the transparent nature of blockchain. Donations are given directly to Giveth, a community of makers running a free, open-source, and decentralized application for peer-to-peer donations. All funding for Giveth has been tracked transparently and securely using blockchain technology.