<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prayag Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Prayag Agrawal on Medium]]></description>
        <link>https://medium.com/@PrayagAgrawal?source=rss-2d7284f37468------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RKVwSqr-O1Qcrb1XALe19A.png</url>
            <title>Stories by Prayag Agrawal on Medium</title>
            <link>https://medium.com/@PrayagAgrawal?source=rss-2d7284f37468------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:45:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@PrayagAgrawal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ethereum- The Merge and Fork]]></title>
            <link>https://medium.com/@PrayagAgrawal/ethereum-merge-fork-c05d49b146e1?source=rss-2d7284f37468------2</link>
            <guid isPermaLink="false">https://medium.com/p/c05d49b146e1</guid>
            <category><![CDATA[proof-of-stake]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Prayag Agrawal]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 12:38:24 GMT</pubDate>
            <atom:updated>2022-09-17T13:13:46.601Z</atom:updated>
            <content:encoded><![CDATA[<h4>A detailed breakdown</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y7Z_DBvKJKiLAMyL" /><figcaption>Photo by <a href="https://unsplash.com/@nick604?utm_source=medium&amp;utm_medium=referral">Nick Chong</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>1. Ethereum</h4><p>Ethereum Mainnet — with all its accounts, balances, smart contracts, and blockchain state — continued to be secured by <a href="https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/">proof-of-work</a>, even while the Beacon Chain ran in parallel using <a href="https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/">proof-of-stake</a>. The Merge was when these two systems finally came together, and proof-of-work was permanently replaced by proof-of-stake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*AQdRKK2ugtMnj4J5d2gNMQ.png" /></figure><p>Ethereum’s Paris Network Upgrade (a.k.a. the Merge!) happened at block <a href="https://etherscan.io/block/15537394">#15537394</a> on Sep-15–2022 at 06:42:59 AM +UTC</p><p>Block <a href="https://etherscan.io/block/15537392">#15537392</a> was the last block on the Ethereum network to receive the Static Block Reward of 2 ETH which was mined by <a href="https://etherscan.io/address/0xea674fdde714fd979de3edf0f56aa9716b898ec8">Ethermine</a>. There will be no mining rewards to the miners anymore and this means no rewards of <br>2 ETH per block.</p><h3>Ethermine.eth on Twitter: &quot;Ethermine is pleased to say that it has secured the #Ethereum network for the past 7 years and mined 3,271,518 Blocks and a total of 9,836,656 Ether.⁰ ⛏️Goodbye PoW, and welcome to a new era with PoS!💌https://t.co/oS6a1CjYAW / Twitter&quot;</h3><p>Ethermine is pleased to say that it has secured the #Ethereum network for the past 7 years and mined 3,271,518 Blocks and a total of 9,836,656 Ether.⁰ ⛏️Goodbye PoW, and welcome to a new era with PoS!💌https://t.co/oS6a1CjYAW</p><h4>2. Stats</h4><figure><img alt="This table shows the pre-merge and post-merge data of the Ethereum blockchain. The merge happened on 15th September at 06:43 AM UTC" src="https://cdn-images-1.medium.com/max/938/1*SUvlOt4ndCjOerZmYYMUlw.png" /><figcaption>Data Source: <a href="https://etherscan.io/charts">https://etherscan.io/charts</a></figcaption></figure><p>As there is no more static block reward per block, the new supply of Ether became zero after the merge i.e. Execution layer issuance after The Merge is zero. The daily block reward came down to 531 ETH which was from the total transaction rewards only (sum of tx fees from 7092 blocks). A decrease in average block time(secs) was also observed. The Hash rate, mining difficulty, and uncles(orphan blocks) count became zero after the merge.</p><p>Post merge, within 24 hours, <a href="https://cryptoslate.com/over-150m-liquidated-in-24-hours-pushes-eth-below-1500/">ETH liquidations exceeded $150 million</a> &amp; Ethereum saw its price decrease by over 7.5% in a day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqFH7KjRuEBzhjrX6T57JA.jpeg" /><figcaption>ETH liquidations data; green bars represent blown-out long trades. Source: Coinglass</figcaption></figure><h4>3. Ethereum PoW</h4><p>After 24 hours of the merge, <a href="https://medium.com/@ETHW/ethw-mainnet-info-released-d775865a05e6">EthereumPoW (ETHW) Mainnet</a> was launched. <br>ETHW is the forked chain of Ethereum which is still using Proof-of-Work as the consensus mechanism. All the Ethereum addresses received an equal amount of ETHW after the mainnet launch. It saw a significant increase in difficulty from 1.00 in block <a href="https://www.oklink.com/en/ethw/block/15537394">#15537394</a> to about 850T in block <a href="https://www.oklink.com/en/ethw/block/15549000">#15549000</a> which might be a result of miners moving to ETHW and using their available hardware and GPUs to earn the mining rewards of 2 ETHW per block along with the transaction fee reward.<br>Transactions happening on the ETHW chain can be viewed on the <a href="https://www.oklink.com/en/ethw">explorer</a>. ETHW saw a price increase on the previous day of the merge from $33 to reach $60.68 on the day of the merge and then went down to $13 the next day.</p><h4>4. Benefits of the Merge</h4><p>The Merge marked the end of proof-of-work for Ethereum and start the era of a more sustainable, eco-friendly Ethereum. We need to take a closer look at Ethereum’s energy consumption which will be dropped by an estimated 99.95%, making Ethereum a green blockchain. <br>The Merge also set the stage for further scalability upgrades which were not possible under proof-of-work, bringing Ethereum one step closer to achieving full scale, security, and sustainability.</p><p><strong>Follow</strong> me on <a href="https://twitter.com/PrayagAgrawal">Twitter</a> | <a href="https://www.linkedin.com/in/prayag-agrawal-92aa84bb/">LinkedIn</a></p><p>References:</p><ul><li><a href="https://ethereum.org/en/upgrades/merge/#what-is-the-merge">https://ethereum.org/en/upgrades/merge/#what-is-the-merge</a></li><li><a href="https://ethereum.org/en/upgrades/merge/issuance/">https://ethereum.org/en/upgrades/merge/issuance/</a></li><li><a href="https://ethermine.org/">https://ethermine.org/</a></li><li><a href="https://etherscan.io/charts">https://etherscan.io/charts</a></li><li><a href="https://www.coinglass.com/LiquidationData">https://www.coinglass.com/LiquidationData</a></li><li><a href="https://cryptoslate.com/over-150m-liquidated-in-24-hours-pushes-eth-below-1500/">https://cryptoslate.com/over-150m-liquidated-in-24-hours-pushes-eth-below-1500/</a></li><li><a href="https://decrypt.co/109906/ethereum-liquidations-top-127m-amid-post-merge-volatility">https://decrypt.co/109906/ethereum-liquidations-top-127m-amid-post-merge-volatility</a></li><li><a href="https://www.oklink.com/en/ethw">https://www.oklink.com/en/ethw</a></li><li><a href="https://medium.com/@ETHW/ethw-mainnet-info-released-d775865a05e6">https://medium.com/@ETHW/ethw-mainnet-info-released-d775865a05e6</a></li></ul><p>Thanks for reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c05d49b146e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Market Makers (AMMs)]]></title>
            <link>https://medium.com/@PrayagAgrawal/automated-market-makers-amms-611e3b0f1a43?source=rss-2d7284f37468------2</link>
            <guid isPermaLink="false">https://medium.com/p/611e3b0f1a43</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[dex]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[amm]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Prayag Agrawal]]></dc:creator>
            <pubDate>Sat, 13 Aug 2022 07:24:00 GMT</pubDate>
            <atom:updated>2022-08-13T08:20:23.027Z</atom:updated>
            <content:encoded><![CDATA[<h4>The pillar of DEX and DeFi</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sTawUD6zCDi-MsHi" /><figcaption>Photo by <a href="https://unsplash.com/@micheile?utm_source=medium&amp;utm_medium=referral">micheile dot com</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>1. Introduction</strong></h3><p>Decentralized Exchanges(DEXs) enable trading and direct swapping of tokens without the need for an intermediary and users stay anonymous as they do not undergo KYC processes unlike Centralized Exchanges(CEXs)</p><p>Some DEXs are based on order books e.g. <a href="https://dydx.exchange/">dYdX</a> and they have similarities with CEXs where users can set buy and sell orders at their chosen limit prices or market prices also known as limit orders or market orders respectively.<br>And some DEXs are based on liquidity pools. These <strong>liquidity pool-based</strong> DEXs use <strong>Automated Market Maker(AMM)</strong> that has a conservation function that prices assets algorithmically by only allowing the price to move along predefined trajectories. AMMs implement a <strong>peer-to-pool method</strong>, where liquidity providers (LPs) contribute assets to liquidity pools while individual users exchange assets with a pool or pools containing the input and the output assets. Users obtain immediate liquidity without the need to find an exchange counterparty, whereas LPs make a profit from asset supply with exchange fees from users. AMMs provide benefits to both LPs and exchange users with accessible liquidity provision and exchange, especially for illiquid assets.</p><p><em>Liquidity Providers</em>: When some initial amount of crypto assets are supplied to the liquidity pool through smart contracts, the supplier is known as a Liquidity Provider(LP). Other LPs can increase the pool size by adding more of the same asset that is contained in the pool. (e.g. 1st LP created a pool of ETH/USDC pair, then 2nd LP can add more to the existing ETH/USDC pool and in turn receive pool share proportionate to their contribution as a fraction of the entire pool. If the 2nd LP wants to add ETH/DAI or another other pair to the pool then the LP can create a new pool for those crypto assets). LPs receive rewards for supplying assets to a liquidity pool, as they have to bear the costs associated with funds being locked in the pool. LPs receive their share of trading fees paid by exchange users. They are also offered the possibility to stake pool shares or other tokens as part of an initial incentive program from a certain token protocol.</p><p><em>Exchange user (Trader)</em>: A trader submits an exchange order to a liquidity pool by specifying the input and output asset and either an input asset or output asset quantity and then the smart contract automatically calculates the exchange rate based on the conservation function as well as the transaction fee and executes the exchange order accordingly. Arbitrageurs compare asset prices across different markets to execute trades whenever closing price gaps can extract profits. With AMMs, traders can get their orders executed seamlessly without any need for centralized exchange.</p><h3><strong>2. Types of AMMs</strong></h3><p>AMMs are the mathematical functions that price assets algorithmically based on liquidity pools. <em>Constant function</em> means that no matter the size of the trade or the asset being traded, the rules for trading remain the same.</p><p><em>(a) Constant Sum Market Maker (CSMM)</em>: A constant sum market maker function forms a <strong>straight line</strong> when plotting two assets, resulting in the equation <strong>x+y=k. </strong>Liquidity in the pool equals the total value of Asset A plus the total value of Asset B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ratqR77fNAdUGtoCQX2Jmg.png" /></figure><p>It is an ideal model for zero slippage but does not provide infinite liquidity and therefore is likely unfit as a standalone implementation for a decentralized exchange use case. The model has a flaw as it provides an arbitrage opportunity when the quoted price is different from the market price of the asset and arbitrageurs can drain the entire pool reserve without leaving any asset for other traders.</p><p><a href="https://mstable.org/">mStable</a> (current <a href="https://defillama.com/protocol/mstable">TVL $48.2 million</a>) is an autonomous and non-custodial infrastructure for pegged-value crypto assets which uses the constant sum function and the liquidity pools are used to facilitate efficient swaps between pegged crypto assets, contributing swap fees to savers.</p><p><em>(b) Constant Product Market Maker (CPMM)</em>: Many AMMs such as <a href="https://uniswap.org/">Uniswap</a> (TVL $7 Billion) and <a href="https://sushi.com/">SushiSwap</a> utilize the Constant Product Market Maker model (<strong>x * y = k</strong>). This design requires that the total amount of liquidity (k) within the pool remains constant where x and y are the reserves of each asset. A constant product function forms a <strong>hyperbola </strong>when plotting two assets, which has a desirable property of always having liquidity as prices approach infinity on both sides of the spectrum. The cost of each trade is based on how much it shifts the curve. Each additional unit of Asset B that the trader purchases shifts the curve even further right, meaning each unit of Asset B is more expensive than the previous one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*MAO74aBaVlbE6AxureLsdA.png" /></figure><p>e.g. If the USDC/ETH liquidity pool contains 200,000 USDC and 105 ETH then the constant product(k) will be 21,000,000 (200,000*105) and this remains constant until any LP adds more USDC/ETH to the pool. The reserve ratio implies that ETH’s price is 200,000 USDC / 105 ETH =1,904.76 USDC. If a trader wants to buy an ETH from the pool then he/she has to swap it for 1,923 USDC and this will be calculated automatically by the CPMM function.</p><p><em>(c)Constant Mean Market Maker (CMMM):</em> Also known as Value Function, was made popular by <a href="https://balancer.fi/">Balancer</a>. It allows for liquidity pools with more than two tokens and different token ratios beyond the standard 50/50 distribution and the weighted geometric mean remains constant. This allows for variable exposure to different assets in the pool and enables swaps between any of the liquidity pool’s assets. The value function <strong>v</strong> is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*HbUC6Pml4B2arSgo-3Y8ag.png" /></figure><p>where, <em>t </em>ranges over the tokens in the pool, <em>Bt </em>is the balance of the token in the pool, and <em>Wt</em>​ is the normalized weight of the tokens, such that the sum of all normalized weights is 1.</p><h3><strong>3. Associated Risks</strong></h3><p>Using exchanges based on AMM have risks and below are a few of them from both liquidity providers&#39; and traders&#39; perspectives</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*guhoRw5Ne_oVpsFW_o9LSA.png" /></figure><p><em>(a)Price Slippage: </em>It refers to the tendency of prices to move against a trader’s actions as the trader absorbs liquidity, the larger the trade, the greater the slippage. CFMMs incur large slippage costs and are thus better for smaller order sizes</p><p><em>(b)Divergence loss: </em>Also known as impermanent loss, is similar to measuring the opportunity cost of holding the token within the pools versus holding them in their wallet. Note: the loss is not realized until tokens are removed from the liquidity pool. The higher the divergence between the value of holding tokens in the pool and wallet, the higher the impermanent loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*CgGEMLhwztLdELqV4mw7cA.png" /></figure><p><em>(c ) Front running:</em> While transactions within a block share the same timestamp, miners can order transactions, and choose to include or exclude certain transactions at their discretion. Malicious miners can abuse their power to prioritize transactions in their favor, profiting from miner extractable value (MEV). Most mining software, including the most popular CLI for running Ethereum node (geth), sorts transactions based on their gas price and nonce. This feature can be exploited by malicious users of DEX who broadcast a transaction with a higher gas price than the target one to distort transaction ordering and thus achieve frontrunning. The frontrunner will copy the potentially profitable transaction’s code, replace addresses with the frontrunner’s address, and run the transaction locally to double-check that the modified transaction results in a profit to the frontrunner’s address. If the transaction is indeed profitable, the frontrunner will submit the modified transaction with the replaced address and a higher gas price, frontrunning the original transaction</p><h3><strong>Conclusion</strong></h3><p>AMM-based DEX is an incredible innovation in the DeFi space backed by trustless, verifiable, and censorship-resistant distributed ledger technology. However there are economic risks for both traders and liquidity providers, the current disadvantages of DEXs will dissipate over time, and with the adoption of the technology, we are moving towards a borderless future in asset exchanges</p><h4><em>Thanks to the</em> <a href="https://medium.com/u/d6228cc9cbda"><strong>DeFi Talents</strong></a> <em>program, an 18-week mentoring program to empower talent for leadership in the decentralized finance space.</em></h4><p><strong>Follow</strong> me on <a href="https://twitter.com/PrayagAgrawal">Twitter</a> | <a href="https://www.linkedin.com/in/prayag-agrawal-92aa84bb/">LinkedIn</a></p><p><strong>References :</strong></p><ul><li>Egorov, Michael. “StableSwap-efficient mechanism for Stablecoin liquidity.” <em>Retrieved Feb</em> 24 (2019): 2021.</li><li>Werner, Sam M., et al. “Sok: Decentralized finance (defi).” <em>arXiv preprint arXiv:2101.08778</em> (2021).</li><li>Xu, Jiahua, et al. “Sok: Decentralized exchanges (dex) with automated market maker (AMM) protocols.” <em>arXiv preprint arXiv:2103.12732</em> (2021).</li><li><a href="https://osmosis.gitbook.io/o/">Osmosis Labs</a></li><li><a href="https://defillama.com/">DefiLlama</a>, <a href="https://www.defipulse.com/">DefiPulse</a></li><li><a href="https://theammbook.org/">The AMM Book</a></li><li><a href="https://dsenchenko.medium.com/impermanent-losses-in-uniswap-like-markets-4315359ea9b1">https://dsenchenko.medium.com/impermanent-losses-in-uniswap-like-markets-4315359ea9b1</a></li><li><a href="https://docs.uniswap.org/protocol/V2/concepts/protocol-overview/how-uniswap-works">https://docs.uniswap.org/protocol/V2/concepts/protocol-overview/how-uniswap-works</a></li><li><a href="https://kermankohli.substack.com/p/understanding-amms-the-basics-f30">https://kermankohli.substack.com/p/understanding-amms-the-basics-f30</a></li><li><a href="https://blog.chain.link/automated-market-maker-amm/">https://blog.chain.link/automated-market-maker-amm/</a></li><li><a href="https://research.paradigm.xyz/amm-price-impact">https://research.paradigm.xyz/amm-price-impact</a></li><li><a href="https://medium.com/coinmonks/dexs-and-amms-c79bce065703">https://medium.com/coinmonks/dexs-and-amms-c79bce065703</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=611e3b0f1a43" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>