project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Block-DeFi

Using block based programming the application will allow users to easily interact with DeFi

Block-DeFi

Created At

ETHOnline 2023

Winner of

🥈 Spark — Best use of SparkLend 🌳

Project Description

This project allows users to interact with multiple DeFi(Decentralized Finance) protocols on both Arbitrum Goerli and Goerli. The frontend allows for users to create a flow of transactions. This flow of transactions allow for a user to interact with Decentralized applications in any way they want as long as they can draw it. Our simplified U.I (User Interface) makes it easy for users to create these complex interactions, as all they need to do is click and drag nodes together. The protocol features functions from COMP V3 and Spark Lend in terms of what a user can do. Furthermore, the protocol contains a Uniswap V4 hook that allows a control flow scheme to be executed from a swap. The protocol also uses Hyperplane and Wormhole to facilitate the movement of data and tokens across different chains. This multichain aspect helps to expand what the protocol can do.

Links to the frontend github: https://github.com/LukeFost/ethonlinereal

How it's Made

The protocol itself utilizes an ERC-2535 storage format or a Diamond structure. This structure is vital to the protocol because it allows for all the contracts to fit under a single address. This is important to the next part of the protocol, the code sequencer(ManagerFacet.sol). The code sequencer was a novel contract that would execute multiple functions at once. Essentially, it was a multicall, but the outputs of one function affected the inputs of the next function. The control diagrams created on the website are packed together into bytes and then added to the diamond contract to be stored. Upon execution of one of the bytes, the code sequencer is used to determine which function should be called and to call it. The sequencer utilizes assembly to scrape off 5 bytes from the bytes. The first 4 bytes contain the selector of the function, while the last byte contains the number of inputs in the first value and the number of outputs in the second value. The Diamond is important for the protocol because it means that every function can be called for the same address, which makes the management of instructions much easier and allows for much tighter packing. After the execution of a function, the output is then given to the next calling function, which then uses it as its input. One of the partner technologies used in the protocol was COMP V3. COMP V3 was used to facilitate the lending, borrowing, and leveraging of assets. In combination with a Uniswap V4 flash swap, COMP V3 was used to create a leveraged position(1-5x leverage on Goerli). They were important for our project because they helped to expand the DeFi functions that we're able to offer. Another partner was SparkProtocal, where we used SparkLend to allow for users to create leveraged positions with DAI(1-3x on Goerli). Uniswap was also integrated to deploy into the protocol through the implementation of their V4 system. It was necessary to use V4 to facilitate the flash swaps for the leverage and to create a hook that can trigger a control flow scheme of any type. Another partner used in the protocol was Hyperlane. Hyperlane was used to send a control flow scheme across chains, so that a control flow is limited to a single chain. Integrated with Hyperlane was UMA, where we used their data asserter to assert the validity of a Hyperlane message through a modification of the ISM of our message receiver. Wormhole was also used within the protocol to allow for users to send tokens and data across chains. This was vital to our protocol as a multichain system because many DeFi protocols have different amounts of liquidity across multiple chains, so moving tokens is important.

background image mobile

Join the mailing list

Get the latest news and updates