DefiLens

DefiLens

Simplifying Defi Trading process by Batching Protocol and Account Abstraction.

The problem DefiLens solves

DefiLens is addressing the absence of robust solutions that offer batching for a wide range of DeFi protocols across various networks. Users currently encounter challenges like manual network switching, multiple transaction confirmations, the cumbersome management of multiple wallets and multiple gas fee payments for cross-chain orders. DefiLens tackles these issues by leveraging the ERC4337 module and implementing a smart batching protocol, applicable to both single and cross-chain scenarios. This enables the execution of multiple transactions with a single click, establishing a robust batching protocol that not only enhances the user experience but also ensures fast execution.

Key Benefits of DefiLens:
Cross-Chain Lending and Trading: Users can effortlessly lend or trade assets across different chains with a single click. This streamlined process bypasses complex steps such as approvals, bridging, and execution.
Refinance DeFi Positions: Easily refinance multiple DeFi positions with a single click, transitioning from one protocol to another.
Gasless Transactions: DefiLens supports gasless transactions through a paymaster-based system, allowing users to trade without using native tokens.
Pay Gas in ERC20: DefiLens enables users to pay gas fees in ERC20 tokens, providing flexibility in transaction settlement.
Batching Transactions: Create a series of transactions in a single batch, including multiple lending actions, buy-sell orders, and derivative positions. DefiLens also allows cross-chain orders within the same batch, facilitating seamless execution with options for gasless transactions or paying gas in ERC20 tokens to enhance the user experience.
Session Key Based Transaction: DefiLens introduces session key-based transactions, eliminating the need for Metamask and providing a user experience similar to web2 stock exchange apps for executing transactions.

Challenges I ran into

1. Difficulty in Batching Implementation: Implementing batching transactions is challenging due to the crucial nature of correct execution order, which is essential to prevent transaction failures. For instance, placing a transaction to borrow assets from AAVE before depositing assets into AAVE can lead to batch failure.
Solution: DefiLens architecture and smart contracts ensure correct execution orders, minimizing the risk of transaction failures.
2. Complexity of Batching Architecture: Managing every shared token of each protocol deployed on multiple networks poses significant challenges. 

Solution: We have optimized our architecture to enable seamless interactions between protocols, including swapping, lending, perpetuals, and cross-chain bridge protocols, streamlining the complex task.


3. Identifying Hidden Operations: During the refinance of DeFi positions from one protocol to another, there may be a need for swapping from one token to another or any other operation to deposit or create a new position.
Solution: DefiLens automates the identification of necessary operations to refinance positions, simplifying the process and reducing the risk of overlooking essential steps.

Discussion