The two biggest challenges of the current Ethereum lending platforms, in our opinion, are the gas cost and (lack of) compliance. So we created the project "Lever" to address both issues in this hackathon. Polygon is an excellent layer 2 solution that reduces gas cost tremendously. We have forked Compound lending platform on Polygon so that users can take advantage of the low cost and speed of Polygon transacting with a lending platform. We used the previous ETHGlobal hackathon project "Molecule Protocol" to tackle compliance. Molecule Protocol is a middleware protocol that uses NFTs to enable whitelisting. Compliant DeFi participants need to go through a proper identity check (KYC) then receive an NFT in their wallet to get whitelisted. We have modified the Compound source code only to allow transactions if the wallet is whitelisted--i.e., only when the Molecule Protocol smart contract returns the value "true." While Lever will be a vast improvement after solving the two major challenges, there are still improvements that we may want to add in the future. First, users still need to bring their assets over to layer 2, and we have seen how bridges could post potential risks. Second, zk-rollups could improve privacy, which we have not implemented in this hackathon.

Lever Finance: Compliant Lending on Polygon showcase

How it's made

While Compound is an open-source project, it is not a trivial task to launch it. Our team has spent a significant amount of time learning Compound's source code and experimenting with the launch process. We have also made modifications to inject the Molecule Protocol middleware to make it a compliance-enabled lending platform. We have deployed a set of cToken contracts to the polygon Mumbai Testnet and also deployed the comptroller. Added the cToken pools to the comptroller markets and can perform supply, borrow, withdraw, repay and all other functionalities of cToken contract for a Whitelisted Wallet Address. Integrated the Molecule-Proxy contract and the Molecule NFT contract to the cToken contracts In addition to the Molecule integration, we also need to integrate with price oracles, and it is not easy to get all the assets from the faucets on Polygon test-nets. At present we are using Chainlink price oracles for the price data feeds. Integrated the chainlink polygon deployed aggregator contracts .