1

1inch Quote Bot

A Twitter-bot that shows how much you save from 1inch for a trade.

The problem 1inch Quote Bot solves

We have developed a full-stack application that constantly monitors all the latest completed transactions on various DEX's like Uniswap, Sushiswap, and Balancer. After fetching the data we make a quote on 1inch using the same amount and tweet the benefit the user could had have if he had used 1inch for that particular trade. We also have developed a PostgreSQL database that stores all the data we have monitored and tweeted for future references. This database is connected to a real-time, React-based web app that displays the activity of our bot in a synchronous manner.
Our Bot helps people to save more money when trading tokens on the web3 platform.

Challenges we ran into

Developing an application using the web3 tech for the first time was quite more complicated than we initially thought. However, we were able to come over all the hurdles we ran into with the help and support of the ethereum community.
The main challenges are as follows:

  1. Monitoring all the latest transactions:
    We started it by using the Infura for fetching the latest transactions but were receiving not the exact data that we hoped for (that EtherScan shows). So after our research, we found a JSON RPC from Cloudfare, which gave us the exact same results which we needed. Now the next challenge was to extract the data for swaps from a transaction. This was quite a hectic process, first, we had to fetch the logs of a transaction using the DEX's ABI and then decode those logs and use them for further references. We were able to find the exact method to decoded those hashed logs, which gave us the details regarding a swap in a transaction.
  2. Twitter tweeting limit issue:
    While we were able to successfully tweet the relevant data, we came across a new issue. Twitter only allows 300 tweets for every 3 hours, which was a very small amount for us. So after talking with the mentors, we made an algorithm that only made tweeting possible every 36 seconds (which implies 300 in 3hrs).
  3. The Break Switch:
    So once we started testing the backend server on the cloud, we figured out that we were unable to stop the process once its executed. To fix this problem was very important to us, as otherwise, it would have cost us a huge amount of bill for now reason. The solution was to make a programmatical switch (true/false), which if changed anytime in our database would also exit our server from running.

Discussion