Gvisor - User space HTTP Server and Client

This post is a follow-up from previous post Gvisor - User space TCP Server and Client. In this post, we are going to build user space HTTP server and client on top of TCP server and client that we created in previous post. To take a look at complete code for this, refer - https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-http/main.go Creating a Http Server We are using GoLang standard net/http package to build the HTTP server....

October 26, 2024 · 3 min · Vivek Bhadauria

Gvisor - User space TCP Server and Client

In this post, we will see how to create a simple TCP Server and TCP Client in user space network stack. Both server and client will be in the same network. To take a look at complete code for this, refer - https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-tcpip/main.go Creating a Network stack In this section, we are creating a Network stack specifying which protocols it needs to support, assigning addresses to the network and adding default route table....

October 15, 2024 · 5 min · Vivek Bhadauria

How to setup NodeLocalDNS in EKS

In this post, we are going to setup NodeLocalDNS in our EKS cluster. There is a clear guide on kubernetes.io on how to do so, I am writing this post for my reference with a bunch of k8s related commands to validate that its working as expected. I am assuming that you have a EKS cluster running. Before setting up NodeLocalDNS, lets make a DNS query from a pod and see where its getting answered from...

June 1, 2024 · 6 min · Vivek Bhadauria

Moving My Personal Finance Tracking to Paisa

Introduction I have been tracking my personal finances on an excel sheet on an ad-hoc basis. There was no specific system as such, I used to just dump my assets and their current value to calculate Net-Worth. I wanted more insights on how my investments in different asset classes are growing and see their performance over time (not point in time when I am checking it). Tools and Methods I recently found Paisa - Personal Finance Manager and decided to give it a try....

May 11, 2024 · 3 min · Vivek Bhadauria

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 blockchain. But the idea should be generally applicable to the AMMs of any blockchain. We are going to look into simple CFMM based AMM for example Orca....

June 1, 2022 · 3 min · Vivek Bhadauria

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 look at actual solidity code. See Reference section. What are Flash Loans? Flash loans are uncollateralized loans in DeFi. They enable users to borrow liquidity instantly without any collateral....

March 13, 2022 · 3 min · Vivek Bhadauria

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. Misaka wrote a detailed analysis on bots which made money in the “Golden 30 mins” just after the hacker dumped stolen ETH into Solana AMM pools....

March 5, 2022 · 5 min · Vivek Bhadauria

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 better insights to look at code from a security perspective and improved overall Solidity skills. Code solutions can be found on my fork of damn-vulnerable-defi repo....

January 29, 2022 · 3 min · Vivek Bhadauria

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 improvements like supporting very high TPS, parallel smart contract runtime, etc. If you are interested in finding out what makes Solana great in comparison to other layer 1 solutions out there....

June 17, 2021 · 4 min · Vivek Bhadauria

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 a retention policy attached to it. There are 3 types of “Retention Policy” SOURCE -> These annotations are in source code only....

March 26, 2021 · 2 min · Vivek Bhadauria