As Defi grows popular, the gas fee also skyrocketed. As a result, it made Ethereum mainnet almost unsuable except big whales. We cannot state that Ethereum is decentralized if small guys cannot participate. For example, if a user is trying to deposit $1000 into a Defi pool, the gas fee can be over $20, which does not make sense at all. To address this problem, we propose Super Saver protocol. It defines simple deposit and redeem implementation to minimize users gas usage. However, the tradeoff is that the final deposit and redeem resolution to Defi will be delegated to a processor. Essentially, Super Saver will aggregate small amount deposit for a certain period, and then processor will trigger processDespoit/processRedeem function to send the sum of small txs to the actual Defi protocol. The processor will be compenseated for its gas usage.
I used to develop smart contract using Truffle, but for this project, I tried out hardhat, which is used in scaffold eth. It has very distinct function and toolchain, so I need to spend some time to go over its document and get familiar with it. It is also my first time to try out The Graph, which is very cool and useful for Dapps development. The Graph mapper has some limitation, like it does not support for loop. And my contract may trigger a edge case of Graph indexer---a function call in my contract will result in error in mapper. I need to design my schema and data structure to overcome these constrains.
Discussion