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