AMM Reserve Monitoring

In this post, we are going to see how we can set up monitoring for AMM’s. This might be required for use-cases like Developing an API service which allows clients to query price of some asset in AMM Develop an arbitrage bot I am referring to AMM’s on the Solana... more

Understanding Flash Loans

I was always wondering how Flash loans actually work, how can we get uncollateralized loan on blockchain. I got better understanding of Flash loans while solving Free Rider problem. In this post, I tried to explain how Flash loans actually work using pseudo code. If you want to have a... more

Arbitrage Bot Analysis on Solana

Recently, I came across bots doing arbitrage on Solana. Was reading about wormhole hack and how it created great opportunities for bots to make free money. Note that the wormhole hack was a long tail event. In general, arbitrage is a very competitive space and needs constant improvements in strategy.... more

Damn Vulnerable DeFi Solutions

I recently came across a post “How to become a Smart Contract Auditor” by cmichel. The post breaks down the skills required and points to good resources to get started with Smart Contract security. Before this, I was exploring development on Ethereum using Solidity. Solving these challenges has given me... more

Decoding Raydium Swaps

In this post, we are going to look into how raydium swap works using Serum CLOB (Central limit order book). Before diving into how swap works in raydium, let’s have a brief look into Solana blockchain and Serum DEX. Solana It’s a layer 1 blockchain similar to ethereum but with... more

Annotations in Java

Annotations are one of those features of Java whose working is not much clear to the developers. This post is for self reference for annotations in java. Some example of annotations below - @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface FunctionalInterface { } @Target(ElementType.METHOD) @Retention(RetentionPolicy.SOURCE) public @interface Override { } Any annotation has... more

Generic Segment Tree

In this post, we are going to create a Generic Segment Tree. Before creating a Generic Segment Tree, we will try to solve a basic segment tree problem and try to find what part of our code is problem specific and abstract it out i.e there are some things which... more

git rebasing - rewrite history

In this post, I am going to discuss a scenario where I had to use “git rebasing” for something other than squashing commits. Lets build up from the starting, I am going to use a short form “CR” for code review. When I have to work on a feature, I... more

Integer Cache in Java

Before starting with the post, try to find the output for below code snippet: Integer a = 100; Integer b = 100; System.out.println(a == b); Integer c = 1000; Integer d = 1000; System.out.println(c == d); Note the answer somewhere, we will come back to it after looking at some... more

Streams in Java

In this post, we are going to discuss about: what streams are in context of CS their support in Java lazy evaluation in streams how to create finite and infinite streams how streams along with functions help in writing declarative code Stream by definition is a sequence of data which... more