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

Spark-To-Flash

Planning to build a DAPP called Spark-To-Flash , which interacts with the SPARK Lend protocol , and makes flash loans easy and accessible to the everyday user.

Spark-To-Flash

Created At

ETHOnline 2023

Project Description

Spark-To-Flash is a flash loan arbitrage protocol which makes use of the flashLoanSimple() method from the spark Lend protocol to execute a flash loan and then uses this flash loaned amount to perform arbitrage between USDC and DAI tokens to create profit and execute this said transaction without having the initial principal amount to perform arbitrage with.

The main problem statement that this protocol tackles is that the average Web-3.0 service users are unable to leverage the amazing potential and advantages that come with flash loans due to the fact that flash loans require development experience , and this protocol allows users to harness one such advantage of flash loans (arbitrage without having principal sum) , without having to delve into the technical aspects of it.

How it's Made

Technologies Used - Hardhat , Ethers.Js , React , Github Pages , Remix Ethereum IDE .

  1. Smart Contracts : the protocol has two smart contracts that we will talk about seperately:

i) SparkToFlash.sol implements the IFlashLoanSimpleReceiverBase.sol interfaces from the aave v3 core packages by inheriting from the FlashLoanSimpleReceiverBase.sol contract , to which an addressProvider is passed in as constructor argument , which is taken from the spark dev docs (allows us to interact with the pool contract) . After this a function called requestFlashLoan() is used to handle executing the flash loan and receiving funds from the pool contract . The executeOperation() method handles the arbitrage logic once the funds are received by interacting with the DummyDex contract and it also approves the pool contract to pull back the loaned amount + premium back from the contract. Finally we also have a function to withdraw the arbitrage profits to our wallet address.

ii) DummyDex.sol is a mock dex contract which allows us to buy and sell USDC and DAI respectively between two different dex exchange rates to get invariant arbitrage opportunities while demonstrating the protocol.

  1. Frontend - The frontend is made completely using React.
background image mobile

Join the mailing list

Get the latest news and updates