Reflecting back on my Internship at Koinex

Chronicling my amazing journey as a part of an agile Fintech startup

Karthik Varma
Koinex Crunch
9 min readMar 4, 2019

--

I was really fascinated by how people used blockchain and developed solutions that catered to their needs for decentralization. I wondered how the technology works, what makes it disruptive and how exactly it is known to be one of the starting points of Web 3.0. Little did I know that soon all my questions would be answered, as I would be a part of one of the hottest Fintech companies in this space— Koinex.

The past summer, was full of surprises when Koinex took me in as a Software Engineering Intern and my life has never been the same. I am a fourth-year college student about to major in Computer Science. I finally got the opportunity to apply all the theories I learnt during the last three years by working on real products when I decided to do an internship.

My first internship and I had no idea what it meant to work in a team or any product-oriented environment, I was a total noob! So this is my personal testimony and to make this a little interesting I am going to break my journey into smaller sections a.ka. shards. 😂

The Interview

Koinex were hiring Interns and other positions through various platforms like Internshala and AngelList. The first round of interview was scheduled as soon they understood my enthusiasm for learning about blockchain.

The interviews tested my knowledge across various domains like Data Structures, Design Patterns, javascript basics like event loops, callbacks and also spanned to the core concepts of how OS and networks work.

The team gave me the opportunity to learn things that were completely new to me. In a short span of time, I was completely engrossed in DLTs, dApps and the development process behind all the Koinex products! All of this came with a stupendous stipend, trust me I’m not getting paid to say that.

My Experience At Work

The first thought that came to my head when I entered the office was “This is awesome!”. My co-workers gave me a very warm welcome. Everything at work was so on point, there was nothing to not love about Koinex. Right from extremely enthusiastic engineers, to a great support team and free food — Koinex gave me exactly what I needed — Love and Tech on the same page!

The first few days were the honeymoon period. We (yes, there were other interns as well) had to interact with everyone and learn how things went around at Koinex. Before I joined, the team at Koinex told me about the flat hierarchy and how everyone was always welcomed to learn, talk and gel up with everyone else. I got the first-hand experience of this practice when I along with the other interns were invited to an engineering team meeting. Although we didn’t know much, our opinions and thoughts were respected as much as others in that room.

The First Project

My first project at Koinex was to test the Exchange platform on the Web. I set up my Selenium stack to run every possible use-case I could come up with. After running the test, I discovered issues that needed fixing, however, most of them were on low priority as they didn’t affect the functionality of the product. The QA team at Koinex helped me a lot during this process, they guided and directed me right from the beginning.

With things moving forward I could see that the senior developers and Rakesh [CTO of Koinex] clearly wanted me to spread my wings in different regions of tech roles. This was something that not a lot of people find in many companies. The logic behind it was simple — Hustle. Then there was no looking back from then on, just hustling towards growth.

Arbitrage App

Arbitrage is described as the simultaneous buying and selling of securities, currency, or commodities in different markets or in derivative forms in order to take advantage of differing prices for the same asset.

As cryptocurrencies are decentralized and their prices keep fluctuating according to the supply and demand ratio, there are a lot of possibilities for arbitrage. These opportunities can be utilized by traders to make quick gains. There were already a lot of apps that people were using to detect these opportunities but each of them had their own issues. I was teamed up with another intern and we were entrusted in building a rock solid mobile arbitrage app.

Overview

Arbitrage opportunities are detected by comparing the prices of different crypto coins and tokens across different marketplaces a.k.a exchanges. There are two possible outcomes for such comparison — Gain or Loss.

There are two types of arbitrage — Direct and Triangular.

Direct arbitrage involves buying a coin/token on an exchange and then moving it to another exchange and selling it there for a premium price. Compared to Triangular arbitrage, this is the quicker route.

The formula for calculating direct arbitrage

Triangular arbitrage involves buying a coin/token on an exchange and then moving it to another exchange and selling that coin for a premium amount and then buying another token/coin on that exchange and then moving it to another exchange. Triangular arbitrage is time taking but usually results in more gains than direct arbitrage.

The formula for calculating triangular arbitrage

Key Features:

There are many things to consider while calculating arbitrage. As iterated earlier, we wanted to develop an app that is different from the existing applications in the market and has some rock-solid advantages over its competition. With this in mind, we had a few key aspects that need to be implemented. Here is a list of the top aspects:

  1. User Friendliness — The existing apps have a very clumsy UI with a lot of filters and options everywhere. This made it tough for beginners. We built a product which looked clean and minimal.
  2. Fees — In order to calculate the final arbitrage, it should include withdrawal and deposit fees of the exchanges. These parameters have to go into the formula to calculate arbitrage. We implied this learning for good in our product.
  3. Multiple Marketplaces — We integrated multiple exchanges which had a good reputation. There was a framework that was built to decide which exchanges to add. This was done to keep the user’s funds safe and to show feasible arbitrages.
  4. Wallet Status — This is our unique feature and is a major point of difference from other implementations. The app shows the details of the arbitrage along with wallet status. So a user doesn’t need to login to the exchange to double check if the opportunity is available.
Arbitrage App

Building this project introduced me to many technologies such as in-memory database like Redis, cronjobs, React Native and much more.

Lessons Learnt from my time as an intern

There was a lot I learnt during my time at Koinex. Whatever I know now is mostly what Koinex taught me.

It’s all about Scale

Finding out the arbitrage involves constantly fetching new price data from the exchanges without any lag. All the exchanges didn’t have WebSockets and it involved us hitting their REST APIs. During this whole process of sending the requests every ’N’ seconds, we were consuming quite a lot of the server bandwidth. There were many instances where the responses for the old requests were coming back when we were trying to fetch new data.

Just imagine you have to hit an exchange’s Rest API for each coin. There are around 8 exchanges that were using Rest APIs and each of them had like 200 coins/tokens listed. So we had to fire ~1800 requests every ‘N’ seconds. Imagine this scale of requests along with the data from the WebSocket. We were literally drowning in data!

We immediately understood that we needed to scale our product. We converted some parts of the code to async and used libraries to batch the requests. This solved the issues of stale data along with other rate-limiting issues.

Write maintainable and module code

During the initial phases of development, I remember writing 8832 lines of code into a single file 😅 . It was very tough to find each part of the program that was in the file. My teammate immediately came to my rescue and taught me to split the code into multiple modules following proper Architecture such as MVC.

Dividing the code into different structures

Follow notations

Always follow notations. A lot of exchanges call different tokens with different notations. Eg: BCH is BCHSV on a few exchanges and BCHABC on others. Things like these caused a lot of errors while building the arbitrage app. Since different exchanges call tokens with own notations we are basically comparing two different currencies thinking its the same and thus showing it as an arbitrage option to the user (when in reality it’s really not).

So to avoid such issues we built a file that had key-value pairs mapped. This taught me why proper naming and coding standards need to be followed.

Learn from constructive criticism

I learnt to take constructive criticism instead of fighting it and I found myself building a better quality product. If we don’t take feedback from the team first, we can’t take it from the users later.

Take advantage of the network

I got to meet the most talented, creative and dedicated developers at Koinex. I wasn’t used to being surrounded by so many people interested in technology, entrepreneurship and code. I’m very grateful for Koinex’s culture that encourages you to reach out to colleagues from other departments at the company. Here I took advantage of the network around me.

Test Driven Development

One needs to develop products without relying on the QA team to test for functionality issues. A good developer always builds modules and tests them for expected output and proceeds to the next module.

Man Maketh Mistakes

You are an Intern and you can’t know everything. “Sometimes you do mistakes and you are here to learn.” — is a statement that I kept reminding myself every day.

Collaborate, don’t compete

If you find someone else who is good at programming, collaborate with them and don’t waste time competing with them.

The Fun Parts

It was more fun than work at Koinex. We have regular company outings and parties. Here are a few places we went:

Soccer in the rain

Yes, you read that right. We once went to play cricket and soccer when it was raining and luckily no one got sick the next day.

True sportsmanship

Loop Success Party

When we launched Loop, the customer response was amazing! To celebrate this success we partied hard with unlimited drinks 🍻.

Trip to Bhutan

We had an outing to Bhutan with the engineering team. It was definitely an experience of a lifetime.

The engineering team in Bhutan

Finally

There was no looking back from the time I became a part of Koinex. I am really glad I got a chance to work here. I learnt a lot of lessons- some personal and some professional. Now I am a Software Engineering Intern at the R&D wing of Koinex in Bengaluru. The wing is dedicated to building Web 3.0 also popularly known as “The New Internet”.

--

--

Karthik Varma
Koinex Crunch

Technology @CoinDCX Prev: Software Engineering Intern @Koinex.