Your personal assistance for cryptocurrency arbitrage!
View Demo
·
Report Bug
·
Request Feature
Demo (Note: FTX Exchange is not working in the hosted version due to connectivity issues from a virtual machine. Sometimes the AWS demo wont work as its a free instance. Let me know if its down so I can reboot the instance.)
The web page contains the following
- Prices of Cryptocurriencies
- Any Available Arbitrage opportunities among integrated exhanges
List of Exchanges Integrated
Follow the steps below for setting up the project locally.
git clone https://github.com/gummideepak/arbitrage-scan
Install the npm
packages described in the package.json
and verify that it works:
cd arbitrage-scan
cd arbitragescan-web
npm install
npm start
The npm start
command builds (compiles TypeScript and copies assets) the application into dist/
, watches for changes to the source files, and runs lite-server
on port 4200
.
Shut it down manually with Ctrl-C
.
There are several ways to run a Spring Boot application on your local machine. One way is to execute the main
method in the com.arbitragescan.arbitragescandemo.ArbitragescanApiApplication
class from your IDE.
Alternatively you can use the Spring Boot Maven plugin like so:
cd arbitrage-scan
cd arbitragescan-api
mvn spring-boot:run
Question: Are there any sub-optimal choices( or short cuts taken due to limited time ) in your implementation?
Answer:
- I think the UI is a little unfinished.
- To create the exhange object I went ahed and created them manually in the ExchangeService.java. Ideally we should be using dependency injection or use a Factory Pattern to create the objects. I was in the middle of doing it but didnt have enough time to integrate it. I will focus to setup a live demo in the remaing time.
Question: Is any part of it over-designed?
Answer: Mabey I belive the backend desing was necessary to support easy extension to more exhanges. I also implemented a swagger so that we dont have to write the http requests in typescript instead use the auto genrated code from swagger codegen.
Question: If you have to scale your solution to 100 users/second traffic what changes would you make, if any?
Answer: As the data is not user specific we can to implement a cache system (ex: Redis) or even a simple in memory cache to increase the response time. The cache expire time would be less (5 seconds mabey? Just a guess) as prices are very volatile in nature.
Question: What are some other enhancements you would have made, if you had more time to do this implementation
Answer:
- I would make the application more daynamic in nature like fetching all the available tokens from a particular exhange. Currently there are only few currencies/tokens supported which are hardcoded in the API call. The API's support any token as of now but I went with a few popular tokens.
- I also want to ask the user the amount of investment and calulate the profit percentage according to it.
- Alerts - Notify the user when some certian condition is met like profit percentage or profit amount is larger than some threshold.
- Instead of only doing it with 2 exchanges we can also perform the arbitrage analysis with 3 exhanges. (More than that would be expensive in terms of transaction fees)
- We can later extend the application to detect any unusual amount of money being sold or bought indicating a pump and dump.
I have lot other features in mind like providing links to exact buy/sell orders (time is key because of the volatile nature) or even doing that using a click of a button