<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahima Thacker</title>
    <description>The latest articles on DEV Community by Mahima Thacker (@mahima_thacker).</description>
    <link>https://dev.to/mahima_thacker</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2605656%2F57b2ab50-a45f-4f1d-997f-a58a2a31c986.jpeg</url>
      <title>DEV Community: Mahima Thacker</title>
      <link>https://dev.to/mahima_thacker</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahima_thacker"/>
    <language>en</language>
    <item>
      <title>You Changed One Line and Called It a Migration. Opus 4.8 Has Other Plans.</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 11:25:25 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/you-changed-one-line-and-called-it-a-migration-opus-48-has-other-plans-53jo</link>
      <guid>https://dev.to/mahima_thacker/you-changed-one-line-and-called-it-a-migration-opus-48-has-other-plans-53jo</guid>
      <description>&lt;h2&gt;
  
  
  What actually changes in your backend when you move from Claude Opus 4.7 to 4.8, the 9 things the benchmark screenshots don't tell you.
&lt;/h2&gt;

&lt;p&gt;Most of us ran the same play this week: open the config, swap claude-opus-4-7 for claude-opus-4-8, redeploy, see the request come back 200, move on.&lt;/p&gt;

&lt;p&gt;The API contract didn't break, so it felt finished. It wasn't. &lt;/p&gt;

&lt;p&gt;Anthropic's migration guide says code that ran on 4.7 keeps running on 4.8 with no changes, and that's true, but it's a statement about the request format, not about behavior. &lt;/p&gt;

&lt;p&gt;Your output lengths, token bills, tool-call counts, retries, and where your agent decides to stop can all shift without a single error code.&lt;/p&gt;

&lt;p&gt;So for anyone running Opus in production, 4.8 reads less like a "smarter model" headline and more like a list of changed defaults you should check before trusting it with real traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here's that list:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. What "no breaking changes" actually covers
&lt;/h4&gt;

&lt;p&gt;It covers the call succeeding. That's about it.&lt;br&gt;
The same prompt can come back longer or shorter, spend more or fewer thinking tokens, call tools more or less often, and cost more or less per request, all while returning 200. If the only thing you checked after the swap is that the endpoint still responds, you haven't really tested the upgrade yet.&lt;/p&gt;
&lt;h4&gt;
  
  
  2. The effort default quietly dropped from xhigh to high
&lt;/h4&gt;

&lt;p&gt;This is the one most likely to catch you, and almost nobody's mentioning it.&lt;/p&gt;

&lt;p&gt;On Opus 4.7 the default effort was xhigh. On 4.8 it's high, on every surface, API and Claude Code included. If you upgrade and change nothing, your high-autonomy and coding agents may now reason less by default than they did the day before.&lt;/p&gt;

&lt;p&gt;It's not a regression. high is Anthropic's chosen balance of quality and cost, and they recommend setting xhigh yourself for coding and agentic work. But it's still a behavior change riding along inside a "no breaking changes" release, and the only way you'll notice is by looking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two things worth knowing when you set it:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;effort goes in output_config, not inside thinking. Put it in the wrong place and you get a validation error rather than a silent fallback.&lt;/p&gt;

&lt;p&gt;xhigh isn't new in 4.8. It shipped with 4.7, where it was the default. The change in 4.8 is that you now have to ask for it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-opus-4-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                    &lt;span class="c1"&gt;# leave room to think + act
&lt;/span&gt;    &lt;span class="n"&gt;output_config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;effort&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;xhigh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;   &lt;span class="c1"&gt;# not inside `thinking`
&lt;/span&gt;    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[...],&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The levels run low, medium, high (default), xhigh, max. Use xhigh for coding and long-running agents, step down to medium or low for cheap simple calls, and reach for max only when your own evals show it buys you something over xhigh, since it spends tokens with no ceiling.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Adaptive thinking is something you turn on
&lt;/h4&gt;

&lt;p&gt;A common misread is that 4.8 "thinks adaptively now" out of the box. It doesn't. Adaptive thinking is a mode you enable with thinking: {type: "adaptive"}, and it's off until you set it. Once it's on, the model decides per turn whether a step needs real reasoning or a direct answer.&lt;/p&gt;

&lt;p&gt;This matters because agent loops mix trivial steps and hard ones. "Read this file" and "refactor this module under these three constraints" don't deserve the same thinking budget, and without adaptive thinking you were often paying for deep reasoning on the trivial steps anyway. With it enabled, 4.8 wastes fewer thinking tokens than 4.7 did at the same effort level.&lt;/p&gt;

&lt;p&gt;At high (the default) and max, the model will almost always think. At lower levels it may skip thinking on easy turns. Effort and adaptive thinking are separate knobs that interact, so it's worth setting both deliberately rather than leaving one on its default.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. 1M context is the default.
&lt;/h4&gt;

&lt;p&gt;That's not a reason to stop retrieving.&lt;br&gt;
Opus 4.8 serves the full 1M-token window by default now, with no beta header and no long-context surcharge. If your client still sends an old context-window beta header for backward compatibility, you can drop it.&lt;/p&gt;

&lt;p&gt;What the bigger window doesn't fix: noisy retrieval, duplicate files, stale context, sloppy chunking, missing citations, slow prompts, or a bill that quietly tripled because you started stuffing whole repos into every call.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. The change you'll actually feel is tool behaviour
&lt;/h4&gt;

&lt;p&gt;If there's one capability improvement to care about, it's this.&lt;/p&gt;

&lt;p&gt;Anthropic calls out two things in 4.8: better tool triggering (the model is less likely to skip a tool call the task needed, which some 4.7 users ran into) and better compaction handling (long agentic runs stay on task with fewer derailments after the context gets compacted).&lt;/p&gt;

&lt;p&gt;In practice, production agents don't usually fail because the model is dumb. They fail like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;it should have read the file, but guessed&lt;br&gt;
it should have run the tests, but skipped them&lt;br&gt;
it should have called the API, but assumed the result&lt;br&gt;
it had the constraint earlier in the session, then drifted off it&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;4.8 is aimed at that class of failure. For agent systems, raw intelligence was rarely the limiting factor. Picking the right tool, calling it at the right moment, using the result, and not losing the thread after compaction is most of what decides whether the thing works, and that's hard to read off a benchmark table but easy to feel in a long session.&lt;/p&gt;

&lt;h4&gt;
  
  
  6. System messages mid-conversation
&lt;/h4&gt;

&lt;p&gt;Opus 4.8 accepts role: "system" messages placed immediately after a user turn in the messages array (there are placement rules). Earlier models, 4.7 included, rejected that with a 400.&lt;/p&gt;

&lt;p&gt;It looks minor and it isn't, because it gives you a way to re-steer a running agent without rebuilding the whole prompt history. The agent is halfway through a refactor, tests start failing, your harness drops in a system entry like "fix the failing tests before continuing," and the agent adjusts. &lt;/p&gt;

&lt;p&gt;Since you're not rewriting earlier turns, you keep your prompt-cache hits. Use the top-level system field for instructions that apply from the start, and in-array system messages for course corrections during the run.&lt;/p&gt;

&lt;h4&gt;
  
  
  7. Prompt caching now works for shorter prompts
&lt;/h4&gt;

&lt;p&gt;The minimum cacheable prompt length on 4.8 dropped to 1,024 tokens, down from 4.7's higher threshold. Prompts that were too short to cache before will cache now, with no code change.&lt;/p&gt;

&lt;p&gt;It's worth a few minutes to split the stable parts of your prompt from the dynamic ones so the cache actually earns its keep:&lt;/p&gt;

&lt;p&gt;stable, cache it: system prompt, tool definitions, repo map, schemas, policy text&lt;br&gt;
dynamic, don't: the user's question, retrieved chunks, latest tool output&lt;/p&gt;

&lt;p&gt;Easy to skip in a demo, expensive to skip in production.&lt;/p&gt;

&lt;h4&gt;
  
  
  8. Same sticker price, different real cost
&lt;/h4&gt;

&lt;p&gt;Standard pricing is unchanged from 4.7: $5 / $25 per million input/output tokens. But the sticker price isn't the bill. What you actually pay depends on effort level, context size, output length, tool calls, retries, cache hits, and batch usage.&lt;/p&gt;

&lt;p&gt;There's also fast mode (research preview, Claude API, speed: "fast"): up to about 2.5x the output tokens per second from the same model, at $10 / $50 per million. Worth being precise here, because it's easy to misread: fast mode is a premium, roughly 2x the standard rate, not a discount. It's only cheaper compared to fast mode on the older 4.6/4.7 models, which ran $30 / $150. &lt;/p&gt;

&lt;p&gt;The honest framing is that fast mode finally costs something reasonable for latency-critical paths, not that it got cheap.&lt;/p&gt;

&lt;p&gt;The real cost decision is routing: which requests need 4.8, which can go to a smaller model, which run in batch, which justify fast mode.&lt;/p&gt;

&lt;h4&gt;
  
  
  9. Don't let "new model, must be better" replace your evals
&lt;/h4&gt;

&lt;p&gt;This is the part I'd argue for hardest, and the rest of this post is why. Each change above is a thing to actually measure on your own workload before you trust 4.8 with production traffic:&lt;/p&gt;

&lt;p&gt;The effort drop (§2): compare your hardest agent task at high vs xhigh. If you upgraded and left the default, did reasoning depth or token use quietly fall?&lt;/p&gt;

&lt;p&gt;tool triggering (§5): count skipped-but-needed tool calls across your agent traces, 4.7 vs 4.8. This is the one most likely to have improved, so it's the one worth proving.&lt;/p&gt;

&lt;p&gt;caching (§7): did your cache hit-rate change now that the floor is 1,024 tokens?&lt;/p&gt;

&lt;p&gt;cost and latency (§8): track output tokens, tool-call counts, retries, and p95, and watch which direction each moved.&lt;/p&gt;

&lt;p&gt;The question isn't whether 4.8 is better in the abstract. It's whether it's better for your workload under your cost and latency budget, and that's the one your evals can answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bottom line
&lt;/h3&gt;

&lt;p&gt;For casual chat, 4.8 just feels like a slightly better Claude. For anyone building agents, coding tools, RAG, or automation, the interesting changes aren't in the headline number. &lt;/p&gt;

&lt;p&gt;They're in the defaults and primitives: opt-in adaptive thinking, the effort default moving back to high,fewer skipped tool calls, calmer long-running agents, 1M context by default, mid-conversation system messages, a lower cache floor, and fast-mode pricing that makes more sense than it used to.&lt;/p&gt;

&lt;p&gt;So treat the model swap as the first step, not the whole job. Re-set xhigh for your agents before you forget, re-baseline your prompt caching, and run your evals before you flip production over, not after the bill shows up.&lt;/p&gt;

&lt;p&gt;If you've already done the 4.7 to 4.8 move and hit something I didn't list here, leave it in the comments. The silent-default stuff is usually what you only find out the hard way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources: Anthropic's Opus 4.8 migration guide, the Effort and Adaptive Thinking API docs, and the Opus 4.8 announcement (May 28, 2026).&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>model</category>
      <category>opus</category>
    </item>
    <item>
      <title>Decentralized Finance Part 4: Real World Assets Meet DeFi</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 08:40:19 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/decentralized-finance-part-4-real-world-assets-meet-defi-17k3</link>
      <guid>https://dev.to/mahima_thacker/decentralized-finance-part-4-real-world-assets-meet-defi-17k3</guid>
      <description>&lt;p&gt;What if you could earn rent from a house you don’t own, in a country you’ve never been to, using an app on your phone?&lt;/p&gt;

&lt;p&gt;That’s the power of real-world assets in DeFi.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are Real World Assets (RWA)?
&lt;/h3&gt;

&lt;p&gt;Real World Assets are things that exist outside the blockchain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Houses&lt;br&gt;
Company shares&lt;br&gt;
Government bonds&lt;br&gt;
Invoices&lt;br&gt;
Art or collectibles&lt;/p&gt;

&lt;p&gt;These things are now being linked to DeFi through tokenization.&lt;/p&gt;

&lt;p&gt;This means creating a digital version of a real asset, which can then be traded or used inside smart contracts.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why Should We Care?
&lt;/h4&gt;

&lt;p&gt;Tokenized real world assets open up new investment opportunities, making high-value assets more accessible to everyone. They bring much-needed liquidity to traditionally hard-to-sell assets, allowing for quicker transactions. The transparency and security of blockchain technology reduce fraud and build trust. Plus, integrating RWAs with DeFi creates innovative financial products and services, building a more inclusive, efficient, and transparent financial system for all, and more...&lt;/p&gt;

&lt;h4&gt;
  
  
  RWA Needs an On-Chain Connection
&lt;/h4&gt;

&lt;p&gt;Real world assets live outside the blockchain.&lt;/p&gt;

&lt;p&gt;To use them inside DeFi, we need a way to connect them to smart contracts.&lt;/p&gt;

&lt;p&gt;This means creating a bridge between the physical world and the digital one.&lt;/p&gt;

&lt;p&gt;Someone needs to verify the asset, hold it safely, and create a digital version of it on-chain.&lt;/p&gt;

&lt;p&gt;That digital token is what DeFi apps can then use for trading, lending, borrowing, or earning.&lt;/p&gt;

&lt;p&gt;Without this connection, real-world assets cannot interact with DeFi tools. The token must reflect the real thing clearly and must be backed by trust.&lt;/p&gt;

&lt;h4&gt;
  
  
  You Can Make These TODAY!
&lt;/h4&gt;

&lt;p&gt;The exciting part is that tokenizing real-world assets isn't just for big corporations or tech gurus. With the right platforms and knowledge, individuals and businesses can also participate in creating these digital representations of physical assets today. The process generally involves a few key steps. &lt;/p&gt;

&lt;p&gt;First, the real-world asset needs to be legally verified and appraised to determine its value and ownership. This is a crucial step to ensure that the digital token accurately reflects the physical asset. Once verified, the asset is then 'tokenized' on a blockchain.&lt;/p&gt;

&lt;p&gt;This means a smart contract is created that represents the asset, and digital tokens are issued. These tokens can then be bought, sold, or traded on various blockchain platforms. While it might sound complex, many platforms are emerging that simplify this process, making it more accessible for a wider audience. This means that the potential for bringing real-world value onto the blockchain is immense, and it's happening right now, opening up new avenues for investment and ownership.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Benefits of RWA + DeFi
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;ol&gt;
&lt;li&gt;New Investment Opportunities: Tokenized real-world assets make high-value assets (like real estate, art, etc.) more accessible to everyone, lowering the barrier to entry for investments.&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increased Liquidity: Traditionally illiquid assets can be bought and sold almost instantly on a global market, allowing for quicker transactions and easier access to asset value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced Transparency and Security: Blockchain technology ensures that every transaction is recorded on an immutable ledger, reducing fraud and increasing trust in asset ownership and transfer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Innovative Financial Products: The integration of RWAs with DeFi platforms enables new financial services, such as using tokenized real estate as collateral for loans or participating in decentralized exchanges with real-world backed assets.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Popular RWA Projects in DeFi
&lt;/h4&gt;

&lt;p&gt;Centrifuge - Brings real-world loans (like invoices) to DeFi&lt;/p&gt;

&lt;p&gt;Goldfinch - Offers loans to real businesses in emerging markets&lt;/p&gt;

&lt;p&gt;Maple - Lets institutions borrow on-chain&lt;/p&gt;

&lt;p&gt;Ondo - Tokenizes US Treasuries for yield&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges to Watch:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Legal rules are not clear yet&lt;br&gt;
Need for trusted middlemen to hold the real asset&lt;br&gt;
Hard to scale across countries&lt;br&gt;
Price feeds and real-world data must be accurate&lt;br&gt;
Final Thoughts&lt;/p&gt;

&lt;p&gt;Real World Assets will bring real growth to DeFi.&lt;/p&gt;

&lt;p&gt;They connect blockchain to the world we live in.&lt;/p&gt;

&lt;p&gt;And they give DeFi a chance to solve real problems, not just trade tokens.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>defi</category>
      <category>rwa</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Decentralized Finance Part 3: The Complete Guide to Stablecoins</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 07:19:31 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/decentralized-finance-part-3-the-complete-guide-to-stablecoins-4m60</link>
      <guid>https://dev.to/mahima_thacker/decentralized-finance-part-3-the-complete-guide-to-stablecoins-4m60</guid>
      <description>&lt;h3&gt;
  
  
  The Problem That Started It All
&lt;/h3&gt;

&lt;p&gt;Imagine you bought a cup of coffee with Bitcoin six months ago. Back then, it cost you 0.0001 BTC. Today, that same amount of Bitcoin could buy you either half a cup or three cups, depending on Bitcoin's wild price swings. But if you paid with dollars six months ago and pay with dollars today, you'd pay roughly the same amount. This is the fundamental problem that stablecoins solve.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are Stablecoins?
&lt;/h3&gt;

&lt;p&gt;Most people think stablecoins are simply "non-volatile crypto assets." This definition is wrong.&lt;/p&gt;

&lt;p&gt;The correct definition: A stablecoin is a crypto asset whose buying power fluctuates very little relative to the rest of the market.&lt;/p&gt;

&lt;p&gt;The keyword here is "buying power." It's not about price stability, it's about purchasing power stability. A stablecoin should let you buy roughly the same amount of goods today as you could yesterday, next week, or next month.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Do We Care About Stablecoins?
&lt;/h3&gt;

&lt;p&gt;Money serves three critical functions, and understanding these explains why stablecoins matter:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Store of Value
&lt;/h4&gt;

&lt;p&gt;Money should preserve your wealth over time. When you save money in a bank or invest in stocks, you expect it to maintain its purchasing power. Volatile assets like Bitcoin fail at this because your wealth can disappear overnight.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Unit of Account
&lt;/h4&gt;

&lt;p&gt;Money should help us measure how valuable something is. We price Bitcoin in dollars, not the other way around, because Bitcoin's constant price changes make it a poor measuring stick. Nobody wants to price their business in Bitcoin when it could be worth 50% less tomorrow.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Medium of Exchange
&lt;/h4&gt;

&lt;p&gt;Money should facilitate transactions. While you can technically buy groceries with Bitcoin, most people won't because they don't want to spend an asset that might double in value next week.&lt;/p&gt;

&lt;p&gt;The Web3 Money Problem: Ethereum works great as a store of value and medium of exchange, but fails as a unit of account due to its volatile nature. We need Web3 money that can do all three functions reliably&lt;/p&gt;

&lt;h3&gt;
  
  
  Categories and Properties of Stablecoins
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Relative Stability: Pegged/Anchored or  Floating
&lt;/h4&gt;

&lt;p&gt;Pegged  Stablecoins: These are tied to another asset's value. Most popular stablecoins fall into this category:&lt;/p&gt;

&lt;p&gt;Tether (USDT): 1 USDT = 1 USD&lt;/p&gt;

&lt;p&gt;USD Coin (USDC): 1 USDC = 1 USD&lt;/p&gt;

&lt;p&gt;Floating Stablecoins: These maintain stable buying power without being tied to any specific asset. Think of it this way: if you could buy 10 apples with 10 dollars five years ago, but today you can only buy 5 apples with 10 dollars due to inflation, a floating stablecoin would adjust so you can still buy 10 apples with the same amount.&lt;/p&gt;

&lt;p&gt;Anchored Stablecoins: These are pegged to a specific reference point that moves over time. Think of it like measuring ocean levels, where the anchor point itself changes but the relationship remains stable.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Stability Method: Governed vs Algorithmic
&lt;/h4&gt;

&lt;p&gt;This refers to who or what controls the minting and burning of stablecoins to maintain their peg.&lt;/p&gt;

&lt;p&gt;Governed Stablecoins: Humans or organizations decide when to create or destroy tokens. These are typically centralized:&lt;/p&gt;

&lt;p&gt;A government entity&lt;/p&gt;

&lt;p&gt;A company (like Circle for USDC)&lt;/p&gt;

&lt;p&gt;A decentralized autonomous organization (DAO)&lt;/p&gt;

&lt;p&gt;Algorithmic Stablecoins: Smart contracts automatically mint and burn tokens based on predetermined rules. No human intervention required:&lt;/p&gt;

&lt;p&gt;DAI (partially algorithmic)&lt;/p&gt;

&lt;p&gt;FRAX&lt;/p&gt;

&lt;p&gt;RAI&lt;/p&gt;

&lt;p&gt;UST (failed example)&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Collateral Type: Endogenous vs Exogenous
&lt;/h4&gt;

&lt;p&gt;This describes what backs the stablecoin's value.&lt;/p&gt;

&lt;p&gt;Exogenous Collateral: Backed by assets outside the stablecoin's ecosystem:&lt;/p&gt;

&lt;p&gt;USDC is backed by US dollars&lt;/p&gt;

&lt;p&gt;DAI is backed by ETH, USDC, and other external assets&lt;/p&gt;

&lt;p&gt;If these stablecoins fail, their underlying collateral (dollars, ETH) continues to exist and function.&lt;/p&gt;

&lt;p&gt;Endogenous Collateral: Backed by assets within the same ecosystem:&lt;/p&gt;

&lt;p&gt;UST was backed by LUNA tokens&lt;/p&gt;

&lt;p&gt;If UST failed, LUNA would fail too (which actually happened)&lt;/p&gt;

&lt;p&gt;The relationship creates a reflexive loop where the stablecoin and its collateral depend on each other for value.&lt;/p&gt;

&lt;p&gt;The Endogenous Dilemma&lt;/p&gt;

&lt;p&gt;Endogenous collateral sounds risky, so why use it at all?&lt;/p&gt;

&lt;p&gt;The Answer: Capital Efficiency&lt;/p&gt;

&lt;p&gt;With exogenous stablecoins like USDC, you need to over-collateralize. To mint $100 worth of DAI, you might need to deposit $150 worth of ETH. This ties up a lot of capital.&lt;/p&gt;

&lt;p&gt;Endogenous stablecoins can theoretically operate with zero external collateral because they're backed by their own ecosystem. This makes them highly capital efficient but also highly risky.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary of Popular Stablecoins
&lt;/h3&gt;

&lt;p&gt;Check out these visuals to understand how some of the most well-known stablecoins are built and how they work&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitgmyv5l6ndxcyih3hp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitgmyv5l6ndxcyih3hp0.png" alt=" " width="800" height="610"&gt;&lt;/a&gt;&lt;br&gt;
(DAI StableCoin)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1kxc1ijxvt6q21qn8bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1kxc1ijxvt6q21qn8bc.png" alt=" " width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(USDC StableCoin)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotgjt9134e2gz93o4qgu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotgjt9134e2gz93o4qgu.png" alt=" " width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(RAI StableCoin)&lt;/p&gt;

&lt;h4&gt;
  
  
  What Stablecoins Really Do
&lt;/h4&gt;

&lt;p&gt;Beyond just maintaining stable value, stablecoins serve as:&lt;/p&gt;

&lt;p&gt;Financial Infrastructure: They enable DeFi protocols to function with predictable unit pricing.&lt;/p&gt;

&lt;p&gt;Bridge Between Traditional and Crypto: They allow seamless movement between fiat and crypto worlds.&lt;/p&gt;

&lt;p&gt;Yield Generation: Many stablecoins can be staked or lent to earn interest.&lt;/p&gt;

&lt;p&gt;Global Access: They provide dollar-equivalent access to people in countries with unstable currencies.&lt;/p&gt;

&lt;p&gt;Which Stablecoins Are Good?&lt;/p&gt;

&lt;p&gt;For Safety and Reliability:&lt;/p&gt;

&lt;p&gt;USDC: Highly regulated, transparent reserves&lt;/p&gt;

&lt;p&gt;DAI: Decentralized, over-collateralized, battle-tested&lt;/p&gt;

&lt;p&gt;For Innovation:&lt;/p&gt;

&lt;p&gt;RAI: Truly algorithmic, not pegged to fiat&lt;/p&gt;

&lt;p&gt;FRAX: Hybrid model balancing efficiency and stability&lt;/p&gt;

&lt;p&gt;Trade-offs to Consider:&lt;/p&gt;

&lt;p&gt;Centralized stablecoins (USDC) offer stability but can be frozen or regulated&lt;/p&gt;

&lt;p&gt;Decentralized stablecoins (DAI, RAI) offer censorship resistance but may have slight fees and complexity&lt;/p&gt;

&lt;p&gt;Algorithmic stablecoins offer capital efficiency but carry higher risks&lt;/p&gt;

&lt;h4&gt;
  
  
  The Future of Stablecoins
&lt;/h4&gt;

&lt;p&gt;The stablecoin landscape continues evolving as projects balance three competing priorities:&lt;/p&gt;

&lt;p&gt;Stability - Maintaining purchasing power&lt;/p&gt;

&lt;p&gt;Decentralization - Avoiding central points of failure&lt;/p&gt;

&lt;p&gt;Capital Efficiency - Maximizing utility of locked assets&lt;/p&gt;

&lt;p&gt;The most successful stablecoins will likely be those that find the optimal balance between these three factors while serving the core functions of money in the digital age.&lt;/p&gt;

&lt;p&gt;Before you use or build with stablecoins, take the time to understand how they’re designed. The more you know, the better decisions you’ll make in the Web3 world.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>defi</category>
      <category>stablecoin</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Decentralized Finance Part 2: Money Markets</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 07:10:24 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/decentralized-finance-part-2-money-markets-4p0h</link>
      <guid>https://dev.to/mahima_thacker/decentralized-finance-part-2-money-markets-4p0h</guid>
      <description>&lt;p&gt;Banks have controlled lending and borrowing for centuries. They decide who gets loans, set the interest rates, and hold all the power. If your credit score isn't perfect or you don't have the right paperwork, you're out of luck.&lt;/p&gt;

&lt;p&gt;DeFi Money Markets flip this system completely upside down.&lt;/p&gt;

&lt;p&gt;No credit checks. No paperwork. No waiting weeks for approval.&lt;/p&gt;

&lt;p&gt;Just deposit your crypto as collateral, and borrow instantly. The smart contract handles everything else.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are DeFi Money Markets?
&lt;/h3&gt;

&lt;p&gt;DeFi money markets are lending platforms built on smart contracts.&lt;/p&gt;

&lt;p&gt;They allow users to:&lt;/p&gt;

&lt;p&gt;Lend crypto and earn interest - Deposit your tokens and get paid for lending them out&lt;/p&gt;

&lt;p&gt;Borrow crypto and pay interest - Put up collateral and borrow different tokens&lt;/p&gt;

&lt;p&gt;The most popular platforms include Aave, Compound, and others.&lt;/p&gt;

&lt;p&gt;But here’s the catch:&lt;/p&gt;

&lt;p&gt;You can’t borrow unless you first deposit something valuable.&lt;/p&gt;

&lt;p&gt;This is called collateral.&lt;/p&gt;

&lt;h4&gt;
  
  
  Traditional Borrowing vs DeFi
&lt;/h4&gt;

&lt;p&gt;In traditional loans, you get money based on:&lt;/p&gt;

&lt;p&gt;Your salary&lt;/p&gt;

&lt;p&gt;Credit score&lt;/p&gt;

&lt;p&gt;Personal background&lt;/p&gt;

&lt;p&gt;In DeFi, none of that matters.&lt;/p&gt;

&lt;p&gt;The only thing that matters is how much you deposit as collateral.&lt;/p&gt;

&lt;p&gt;How Collateral-Based Borrowing Works&lt;/p&gt;

&lt;p&gt;The Collateral System&lt;/p&gt;

&lt;p&gt;In DeFi, collateral is your security deposit. It's like leaving your car keys with a friend when you borrow their bike. If you don't return the bike, they keep your keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a simple example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You deposit 1,000 USDC as collateral&lt;/p&gt;

&lt;p&gt;You can then borrow 800 DAI (or ETH worth $800)&lt;/p&gt;

&lt;p&gt;You can't borrow more than you deposited&lt;/p&gt;

&lt;p&gt;Your collateral stays locked until you repay the loan&lt;/p&gt;

&lt;h3&gt;
  
  
  DeFi Money Markets Glossary
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Collateral
&lt;/h4&gt;

&lt;p&gt;The crypto you deposit as security to borrow other tokens. If you deposit 1 ETH to a protocol, your collateral is 1 ETH.&lt;/p&gt;

&lt;h4&gt;
  
  
  Loan-to-Value (LTV) Ratio
&lt;/h4&gt;

&lt;p&gt;LTV determines how much you can borrow compared to your collateral value. It's expressed as a percentage.&lt;/p&gt;

&lt;p&gt;Example with 75% LTV:&lt;/p&gt;

&lt;p&gt;You deposit 1 ETH worth $1,000 as collateral&lt;/p&gt;

&lt;p&gt;You can borrow up to 0.75 ETH worth of other tokens (or $750 worth)&lt;/p&gt;

&lt;p&gt;The protocol keeps 25% as a safety buffer&lt;/p&gt;

&lt;p&gt;Different tokens have different LTV ratios based on their stability and risk.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Liquidation Threshold
&lt;/h4&gt;

&lt;p&gt;Liquidation happens when your borrowed amount becomes too risky compared to your collateral. It's the protocol's way of protecting itself and other users.&lt;/p&gt;

&lt;p&gt;Common triggers:&lt;/p&gt;

&lt;p&gt;Your collateral drops in value (ETH price falls)&lt;/p&gt;

&lt;p&gt;Your borrowed asset rises in value (borrowed token pumps)&lt;/p&gt;

&lt;p&gt;You borrow too close to your limit&lt;/p&gt;

&lt;p&gt;How Liquidation Works&lt;/p&gt;

&lt;p&gt;When you cross the liquidation threshold:&lt;/p&gt;

&lt;p&gt;Liquidators step in - These are users who "buy" your debt&lt;/p&gt;

&lt;p&gt;You pay a penalty - Usually 5-10% of your collateral value&lt;/p&gt;

&lt;p&gt;Your collateral gets sold - To cover the borrowed amount&lt;/p&gt;

&lt;p&gt;You keep the rest - Any remaining collateral after paying debt and penalty&lt;/p&gt;

&lt;p&gt;The warning system: Most protocols show you a "health factor" that warns you before liquidation happens.&lt;/p&gt;

&lt;h4&gt;
  
  
  Annual Percentage Yield (APY)
&lt;/h4&gt;

&lt;p&gt;The yearly return on your investment, including compound interest. If you earn 10% APY, your money grows by 10% over one year with compounding.&lt;/p&gt;

&lt;h4&gt;
  
  
  Annual Percentage Rate (APR)
&lt;/h4&gt;

&lt;p&gt;The yearly cost of borrowing without compound interest. If you pay 8% APR, you pay 8% interest over one year on the original loan amount.&lt;/p&gt;

&lt;h4&gt;
  
  
  Receipt Token
&lt;/h4&gt;

&lt;p&gt;A special token you receive when depositing into a protocol. It's like a receipt that proves you deposited funds. These tokens are minted when you deposit and burned when you withdraw.&lt;/p&gt;

&lt;h4&gt;
  
  
  Reserve/Underlying Asset
&lt;/h4&gt;

&lt;p&gt;The actual token you deposited into the protocol. For example, if you deposit ETH into AAVE, WETH is the underlying token, and you receive aWETH receipt tokens.&lt;/p&gt;

&lt;p&gt;Key Benefits of DeFi Money Markets&lt;/p&gt;

&lt;p&gt;For Lenders:&lt;/p&gt;

&lt;p&gt;Earn passive income on idle crypto&lt;/p&gt;

&lt;p&gt;No minimum deposit requirements&lt;/p&gt;

&lt;p&gt;Withdraw anytime (subject to liquidity)&lt;/p&gt;

&lt;p&gt;Transparent interest rates&lt;/p&gt;

&lt;p&gt;For Borrowers:&lt;/p&gt;

&lt;p&gt;No credit checks or paperwork&lt;/p&gt;

&lt;p&gt;Instant loan approval&lt;/p&gt;

&lt;p&gt;Keep your crypto exposure while borrowing&lt;/p&gt;

&lt;p&gt;Access to leverage trading strategies&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular DeFi Money Market Protocols&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AAVE: The largest lending protocol with innovative features like flash loans and rate switching.&lt;/p&gt;

&lt;p&gt;Compound: Pioneer in DeFi lending with simple, reliable mechanics.&lt;/p&gt;

&lt;p&gt;MakerDAO: Focused on DAI stablecoin creation through collateralized debt positions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;DeFi money markets represent a fundamental shift in how we think about lending and borrowing. They remove gatekeepers, reduce costs, and provide global access to financial services.&lt;/p&gt;

&lt;p&gt;The power is now in your hands. No banker can reject your loan application. No credit agency can block your access. Just you, your crypto, and the smart contract.&lt;/p&gt;

&lt;p&gt;But with great power comes great responsibility. Understanding collateral, liquidation, and risk management is essential before diving in&lt;/p&gt;

</description>
      <category>defi</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>amm</category>
    </item>
    <item>
      <title>Decentralized Finance Part 1: Understanding DEXs and AMMs</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 07:05:57 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/decentralized-finance-part-1-understanding-dexs-and-amms-3jbn</link>
      <guid>https://dev.to/mahima_thacker/decentralized-finance-part-1-understanding-dexs-and-amms-3jbn</guid>
      <description>&lt;p&gt;A few years ago, if you wanted to buy or sell crypto, you had to go through a central exchange. You'd sign up, verify your identity, and trust the platform to keep your money safe.&lt;/p&gt;

&lt;p&gt;Then came Decentralized Exchanges (DEXs), a new way to trade crypto without giving up control.&lt;/p&gt;

&lt;p&gt;No sign-ups. No middlemen. No waiting for someone on the other side.&lt;/p&gt;

&lt;p&gt;Just you, a wallet, and a smart contract.&lt;/p&gt;

&lt;p&gt;This is the revolutionary promise of Decentralized Finance (DeFi), where smart contracts handle everything automatically. Today, we'll explore the foundation of DeFi: Decentralized Exchanges (DEXs) and the magic behind them&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Decentralized Exchange (DEX)?
&lt;/h2&gt;

&lt;p&gt;A Decentralized Exchange (DEX) lets you trade one token for another, directly from your wallet. There’s no company holding your money. Instead, smart contracts handle everything.&lt;/p&gt;

&lt;p&gt;You connect your wallet. You choose what you want to swap. And the trade happens instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does a DEX Actually Work?
&lt;/h3&gt;

&lt;p&gt;Let's break down the key components that make DEXs possible:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Liquidity Pools
&lt;/h3&gt;

&lt;p&gt;A liquidity pool is like a jar filled with two tokens. For example:&lt;/p&gt;

&lt;p&gt;50 ETH and&lt;/p&gt;

&lt;p&gt;10,000 DAI&lt;/p&gt;

&lt;p&gt;People add their tokens to these pools. These people are called liquidity providers, and they earn small fees from every trade that happens.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Swapping
&lt;/h3&gt;

&lt;p&gt;You want to swap your DAI for ETH?&lt;/p&gt;

&lt;p&gt;The smart contract pulls ETH from the pool and adds your DAI to it.&lt;/p&gt;

&lt;p&gt;The price changes based on how much you take and how much you give.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Automated Market Maker (AMM): The Price Calculator
&lt;/h3&gt;

&lt;p&gt;Here's where it gets interesting. Instead of matching you with another trader (like in traditional markets), an AMM uses a mathematical formula to determine prices instantly. It's like having a calculator that always knows the fair price based on how much of each token is in the pool.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Small Fees, Big Rewards
&lt;/h3&gt;

&lt;p&gt;Every trade pays a small fee (typically 0.3%). This fee gets distributed among all the people who provided liquidity to that pool. It's like getting a cut of every transaction just for helping keep the marketplace running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Liquidity and Why It Matters
&lt;/h3&gt;

&lt;p&gt;What is Liquidity? Liquidity is simply having enough tokens in a pool to make trading smooth and efficient. Think of it like having enough cash in your wallet to buy coffee without needing to break a $100 bill.&lt;/p&gt;

&lt;p&gt;Why Do We Need It? Without enough liquidity, strange things happen:&lt;/p&gt;

&lt;p&gt;Trades become slow and expensive&lt;/p&gt;

&lt;p&gt;Prices swing wildly with small purchases&lt;/p&gt;

&lt;p&gt;Large trades become nearly impossible&lt;/p&gt;

&lt;p&gt;Who Benefits?&lt;/p&gt;

&lt;p&gt;Traders get fast, reliable swaps&lt;/p&gt;

&lt;p&gt;Liquidity providers earn passive income from fees&lt;/p&gt;

&lt;p&gt;The entire ecosystem stays healthy and functional&lt;/p&gt;

&lt;p&gt;Examples of Popular DEXs&lt;/p&gt;

&lt;p&gt;PancakeSwap - Built on Binance Smart Chain. Fast and great for beginners.&lt;/p&gt;

&lt;p&gt;SushiSwap - Available on many chains. It rewards people who add liquidity.&lt;/p&gt;

&lt;p&gt;There are many more. Each one has its own pools, tokens, and features.&lt;/p&gt;

&lt;h2&gt;
  
  
  DEX vs CEX: Choose Your Adventure
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Centralized Exchange (CEX):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Requires account creation and identity verification&lt;/p&gt;

&lt;p&gt;Company holds your funds&lt;/p&gt;

&lt;p&gt;Easy to use with familiar interfaces&lt;/p&gt;

&lt;p&gt;Customer support available&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decentralized Exchange (DEX):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No signup required&lt;/p&gt;

&lt;p&gt;You always control your funds&lt;/p&gt;

&lt;p&gt;More privacy and anonymity&lt;/p&gt;

&lt;p&gt;Full responsibility for your own security&lt;/p&gt;

&lt;p&gt;The Bottom Line: Want complete control and privacy? Go with a DEX. Prefer simplicity and support? Choose a CEX.&lt;/p&gt;

&lt;p&gt;How Automated Market Makers Work&lt;/p&gt;

&lt;p&gt;An Automated Market Maker (AMM) is a smart contract that lets you swap tokens without needing someone else on the other side.&lt;/p&gt;

&lt;h4&gt;
  
  
  Let’s Break Down the Formula
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;X × Y = K&lt;br&gt;
X = Amount of Token 1 in the pool&lt;br&gt;
Y = Amount of Token 2 in the pool&lt;br&gt;
K = A constant number that never changes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of K as the pool's "balance point." No matter how much trading happens, the formula ensures X × Y always equals K.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Real-World Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's say we have a pool with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;50 ETH (Token 1)&lt;br&gt;
10,000 DAI (Token 2)&lt;br&gt;
K = 50 × 10,000 = 500,000&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now imagine you want to buy 1 ETH using DAI.&lt;/p&gt;

&lt;p&gt;After your trade:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;ETH remaining = 49 (you took 1 ETH out)&lt;br&gt;
To keep K = 500,000, we need: 49 × Y = 500,000&lt;br&gt;
Y = 500,000 ÷ 49 = 10,204.08 DAI&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since the pool started with 10,000 DAI and needs 10,204.08 DAI after your trade, you must add 204.08 DAI to buy 1 ETH.&lt;/p&gt;

&lt;p&gt;The price was calculated automatically by the formula, not by a person!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Prices Change as You Trade:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's where it gets interesting. The more ETH you try to buy, the more DAI you need to add to keep K constant. This makes each additional ETH more expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Buying 1 ETH costs ~204 DAI&lt;/p&gt;

&lt;p&gt;Buying 2 ETH would cost even more per ETH&lt;/p&gt;

&lt;p&gt;Buying 10 ETH would be extremely expensive per ETH&lt;/p&gt;

&lt;p&gt;This price increase is called "slippage," and it's completely normal in AMMs. It prevents any single person from draining the entire pool&lt;/p&gt;

&lt;p&gt;This price jump is called slippage, the more you buy, the more you pay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AMM vs Order Book&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Order Book (used by CEX): Buyers and sellers agree on a price&lt;/p&gt;

&lt;p&gt;AMM (used by DEX): The price is decided by a formula&lt;/p&gt;

&lt;p&gt;In AMMs, you don’t wait for someone to match your trade.&lt;/p&gt;

&lt;p&gt;The pool is always ready, the formula handles everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DEXs eliminate middlemen - You trade directly through smart contracts&lt;/p&gt;

&lt;p&gt;Liquidity pools are the foundation - They provide the tokens needed for smooth trading&lt;/p&gt;

&lt;p&gt;AMMs use simple math - The X × Y = K formula determines all prices&lt;/p&gt;

&lt;p&gt;Everyone benefits - Traders get instant swaps, providers earn fees&lt;/p&gt;

&lt;p&gt;You stay in control - Your funds never leave your wallet&lt;/p&gt;

&lt;p&gt;In Part 2, we'll explore money markets&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>blockchain</category>
      <category>cryptocurrency</category>
      <category>web3</category>
    </item>
    <item>
      <title>Gas Optimization Part 4: Solidity Tips for Cheaper Contracts</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 06:55:31 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/gas-optimization-part-4-solidity-tips-for-cheaper-contracts-2kp6</link>
      <guid>https://dev.to/mahima_thacker/gas-optimization-part-4-solidity-tips-for-cheaper-contracts-2kp6</guid>
      <description>&lt;p&gt;Every line of your smart contract costs something.&lt;/p&gt;

&lt;p&gt;Some lines cost more than others.&lt;/p&gt;

&lt;p&gt;In this part of our gas saving series, we’ll explore how to write smarter Solidity code that keeps your contract lean and efficient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here are six simple and practical ways to reduce gas costs while writing Solidity smart contracts.
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Use payable Only When Needed, But Know It Saves Gas
&lt;/h4&gt;

&lt;p&gt;In Solidity, a function marked payable can actually use slightly less gas than a non-payable one.&lt;/p&gt;

&lt;p&gt;Even if you're not sending ETH, the EVM skips some internal checks when the function is marked payable.&lt;/p&gt;

&lt;p&gt;See this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function hello() external payable {}    // 21,137 gas

function hello2() external {}           // 21,161 gas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That tiny difference may not seem like much, but across thousands of calls, it adds up.&lt;/p&gt;

&lt;p&gt;Only use payable when your function is actually meant to accept ETH&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Use unchecked for Safe Arithmetic When You’re Sure
&lt;/h4&gt;

&lt;p&gt;Since Solidity 0.8.0, all arithmetic operations automatically check for overflows and underflows. While this makes contracts safer, it also uses extra gas. When you're certain that overflow won't occur, you can use the unchecked keyword to skip these safety checks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uint256 public myNumber = 0;

function increment() external {

unchecked {

myNumber++;

}

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gas used: 24,347 (much cheaper than using safe math)&lt;/p&gt;

&lt;p&gt;Warning: Use unchecked carefully. Only when you're confident there's no risk of overflow.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Turn On the Solidity Optimizer
&lt;/h4&gt;

&lt;p&gt;The Solidity Optimizer is like a smart helper that cleans up and tightens your compiled bytecode.&lt;/p&gt;

&lt;p&gt;It does not change how your contract works, but it removes waste and makes it cheaper to run.&lt;/p&gt;

&lt;p&gt;If you’re using tools like Hardhat or Remix, always enable the Optimizer before deploying to mainnet.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Use uint256 Instead of Smaller Integers (Most of the Time)
&lt;/h4&gt;

&lt;p&gt;Smaller types like uint8 or uint16 might look more efficient, but they can cost more gas during execution.&lt;/p&gt;

&lt;p&gt;That’s because the EVM automatically converts them to uint256 behind the scenes.&lt;/p&gt;

&lt;p&gt;So, if you're not tightly packing them in a struct for storage savings, just use uint256.&lt;/p&gt;

&lt;p&gt;Use smaller types only in structs when trying to save storage space.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Understand Storage Costs: Read + Write Costs Almost Same as Write
&lt;/h4&gt;

&lt;p&gt;Storage operations are expensive. But here’s something surprising:&lt;/p&gt;

&lt;p&gt;Reading a storage variable before writing to it doesn’t cost much more than writing directly.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Read + Write = 2,100 (read) + 20,100 (write) = 22,200 gas&lt;br&gt;
Write only = 22,100 gas&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That means if your code needs to read before writing, it’s okay, you are not losing much.&lt;/p&gt;

&lt;p&gt;Plan your storage usage wisely. Reuse variables and avoid unnecessary writes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference: &lt;a href="https://ethereum.github.io/yellowpaper/paper.pdf" rel="noopener noreferrer"&gt;https://ethereum.github.io/yellowpaper/paper.pdf&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  6. Use &amp;lt; Instead of &amp;lt;= in Comparisons
&lt;/h4&gt;

&lt;p&gt;When comparing numbers, use &amp;lt; instead of &amp;lt;=.&lt;/p&gt;

&lt;p&gt;Why? Because:&lt;/p&gt;

&lt;p&gt;&amp;lt; needs just one check&lt;/p&gt;

&lt;p&gt;&amp;lt;= takes two checks (a comparison and an extra step to flip the result)&lt;/p&gt;

&lt;p&gt;Fewer steps mean lower gas usage.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (uint i = 0; i &amp;lt; limit; i++) {

...

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This small change saves gas on every loop iteration and comparison operation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Gas optimization is about understanding how the EVM works and making informed decisions about your code structure. Each of these techniques might seem to save small amounts of gas individually, but combined and applied across a large contract, they can result in significant cost savings.&lt;/p&gt;

&lt;p&gt;Remember: Always test your optimizations thoroughly. Sometimes gas savings come at the cost of code readability or safety. Strike the right balance for your specific use case.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaways:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use payable functions when appropriate&lt;/li&gt;
&lt;li&gt;Apply unchecked carefully for safe arithmetic&lt;/li&gt;
&lt;li&gt;Enable the Solidity optimizer&lt;/li&gt;
&lt;li&gt;Prefer uint256 for most variables&lt;/li&gt;
&lt;li&gt;Understand storage access patterns&lt;/li&gt;
&lt;li&gt;Choose efficient comparison operators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By implementing these strategies, you'll create contracts that not only work well but also cost less to deploy and interact with, making them more accessible to users and more profitable for developers.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>ethereum</category>
      <category>performance</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Gas Optimization Part 3: The Foundation of Gas in Solidity and Smart Contract Efficiency</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 06:51:43 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/gas-optimization-part-3-the-foundation-of-gas-in-solidity-and-smart-contract-efficiency-3644</link>
      <guid>https://dev.to/mahima_thacker/gas-optimization-part-3-the-foundation-of-gas-in-solidity-and-smart-contract-efficiency-3644</guid>
      <description>&lt;p&gt;You just deployed a smart contract, and it’s costing 98 gas to run a function that does nothing. Literally.&lt;/p&gt;

&lt;p&gt;See for yourself, Why?&lt;/p&gt;

&lt;p&gt;Because even doing “nothing” on Ethereum still means something to the Ethereum Virtual Machine (EVM).&lt;/p&gt;

&lt;p&gt;Welcome to Part 3 of our gas optimization series, where we will look at how gas really works behind the scenes and how you can make your Solidity smart contracts use less gas by removing anything that’s not needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Building Blocks: OPCODEs Are the DNA of Ethereum
&lt;/h3&gt;

&lt;p&gt;In Solidity, saving on gas is like saving fuel in your car. To do that, you need to know about OPCODEs - the basic commands that tell Ethereum what to do. They're the ABCs of Ethereum's language.&lt;/p&gt;

&lt;p&gt;When you write Solidity code, it doesn't run directly on the Ethereum network. Instead, it gets compiled into a set of OPCODEs that the Ethereum Virtual Machine (EVM) can understand and execute. Think of it like translating English into machine language that computers can process&lt;/p&gt;

&lt;h4&gt;
  
  
  What Are OPCODEs?
&lt;/h4&gt;

&lt;p&gt;OPCODEs are low level instructions that perform specific operations:&lt;/p&gt;

&lt;p&gt;Arithmetic Operations: ADD, SUB, MUL, DIV for mathematical calculations&lt;/p&gt;

&lt;p&gt;Memory Operations: MLOAD, MSTORE for temporary data storage&lt;/p&gt;

&lt;p&gt;Storage Operations: SLOAD, SSTORE for permanent blockchain storage&lt;/p&gt;

&lt;p&gt;Program Flow: JUMP, JUMPI for conditional logic.&lt;/p&gt;

&lt;p&gt;Cryptographic Functions: SHA3, ECRECOVER for security operations&lt;/p&gt;

&lt;p&gt;Contract Interactions: CALL, DELEGATECALL for inter-contract communication&lt;/p&gt;

&lt;p&gt;And here’s the catch:&lt;/p&gt;

&lt;p&gt;Each OPCODE consumes gas, and some cost way more than others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can see the full list of OPCODE gas costs here: ethereum.org/en/developers/docs/evm/opcodes&lt;/p&gt;

&lt;h3&gt;
  
  
  The Secret Code: Function Selectors
&lt;/h3&gt;

&lt;p&gt;Here's something that might surprise you: when you compile your Solidity code into bytecode, the names of your functions don't actually show up in the final assembly output. Instead, what ends up on the Ethereum network is something like a secret code called function selectors&lt;/p&gt;

&lt;h4&gt;
  
  
  How Function Selectors Work
&lt;/h4&gt;

&lt;p&gt;Function selectors are created by taking the first four bytes of the hash of the function's signature. Let's look at a real example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apex"&gt;&lt;code&gt;&lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doNothig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;external&lt;/span&gt; &lt;span class="n"&gt;pure&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After compilation, this becomes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;46aad107&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So when someone sends a transaction to your contract, they don’t send the name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;doNothig()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;,they send the selector &lt;strong&gt;0x46aad107&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That’s how the EVM knows which function to run, without storing long names on-chain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gas Optimization Tips Every Developer Should Know
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Keep It Light&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The less code you deploy, the less gas you'll use during deployment. Think of it as packing light for a flight - every extra byte costs money.&lt;/p&gt;

&lt;p&gt;Code size optimization strategies:&lt;/p&gt;

&lt;p&gt;Remove unnecessary functions and variables&lt;/p&gt;

&lt;p&gt;Use libraries for common operations instead of duplicating code&lt;/p&gt;

&lt;p&gt;Implement proxy patterns for upgradeable contracts&lt;/p&gt;

&lt;p&gt;Strip out debugging code and comments in production&lt;/p&gt;

&lt;p&gt;Real impact: A 1KB reduction in contract size saves approximately 200,000 gas units during deployment&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Choose Wisely: OPCODE Selection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Certain commands are cheaper than others. Picking the right ones is like choosing a budget airline over a luxury carrier.&lt;/p&gt;

&lt;p&gt;Cost-effective choices:&lt;/p&gt;

&lt;p&gt;Some instructions (like ADD) cost less than others (like SSTORE).&lt;/p&gt;

&lt;p&gt;Store fewer variables&lt;/p&gt;

&lt;p&gt;Avoid unnecessary require checks&lt;/p&gt;

&lt;p&gt;Minimize state changes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Pack Data Tight: Transaction Data Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The more data you send in a transaction, the more you spend. Keep your transaction data lean.&lt;/p&gt;

&lt;p&gt;Data packing techniques:&lt;/p&gt;

&lt;p&gt;Use struct packing to fit multiple variables in single storage slots&lt;/p&gt;

&lt;p&gt;Compress arrays and use fixed-size arrays when possible&lt;/p&gt;

&lt;p&gt;Batch multiple operations to reduce transaction overhead&lt;/p&gt;

&lt;p&gt;Use events instead of storage for data that doesn't need to be queried on-chain&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Minimize Memory Use&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Memory is temporary, but still costs gas.&lt;/p&gt;

&lt;p&gt;Avoid creating new memory variables when not required.&lt;/p&gt;

&lt;p&gt;Use calldata instead of memory for function inputs when possible&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Be Smart About Storage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Storage is the most expensive operation.&lt;/p&gt;

&lt;p&gt;Only write to storage if you must&lt;/p&gt;

&lt;p&gt;Use events to log non-critical data instead of storing it&lt;/p&gt;

&lt;p&gt;Don’t overwrite storage values unless necessary&lt;/p&gt;

&lt;p&gt;Every time you write to SSTORE, you’re paying a premium.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Compound Effect
&lt;/h3&gt;

&lt;p&gt;A little bit of gas saved on every transaction can add up to significant savings over time. If your contract processes 1,000 transactions per day and you save 500 gas per transaction, that's 500,000 gas units daily - potentially saving hundreds of dollars monthly at current gas prices.&lt;/p&gt;

&lt;p&gt;Understanding OPCODEs and function selectors is just the beginning. In Part 4, we'll explore advanced Solidity techn&lt;/p&gt;

</description>
      <category>web3</category>
      <category>gasoptimization</category>
      <category>solidity</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Gas Optimization Part 2: Timing Strategies and Batch Processing</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 06:47:57 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/gas-optimization-part-2-timing-strategies-and-batch-processing-3gf2</link>
      <guid>https://dev.to/mahima_thacker/gas-optimization-part-2-timing-strategies-and-batch-processing-3gf2</guid>
      <description>&lt;p&gt;You've learned what gas fees are and how they're calculated. Now comes the practical part: how to actually save money on every transaction you make. The difference between a novice and an expert Ethereum user often comes down to understanding when and how to execute transactions efficiently.&lt;/p&gt;

&lt;p&gt;Haven't read Part 1 yet? Check out my introduction to gas fees and how they work to understand the fundamentals before diving into these optimization strategies.&lt;/p&gt;

&lt;p&gt;Let's explore the proven strategies that can cut your gas costs by 50-90% without compromising transaction security or speed&lt;/p&gt;

&lt;h3&gt;
  
  
  Strategy 1: Master the Art of Timing
&lt;/h3&gt;

&lt;p&gt;Weekends: Saturday and Sunday typically see 20-30% lower gas fees as business activity decreases.&lt;/p&gt;

&lt;p&gt;Off-peak hours: Between 2 AM and 6 AM UTC, when both American and European users are asleep, gas prices often drop significantly.&lt;/p&gt;

&lt;p&gt;Avoid these high-traffic periods:&lt;/p&gt;

&lt;p&gt;NFT mint launches&lt;/p&gt;

&lt;p&gt;Major DeFi protocol updates&lt;/p&gt;

&lt;p&gt;Market crash periods (panic selling drives up demand)&lt;/p&gt;

&lt;p&gt;Weekday mornings (8-10 AM UTC)&lt;/p&gt;

&lt;p&gt;You can use trackers like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://etherscan.io/gastracker" rel="noopener noreferrer"&gt;https://etherscan.io/gastracker&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Set up gas price alerts on your phone. When prices drop below your target threshold, that's your window to execute pending transactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strategy 2: Batch Processing
&lt;/h3&gt;

&lt;p&gt;Why send 10 separate transactions…&lt;/p&gt;

&lt;p&gt;When you can send one batch?&lt;/p&gt;

&lt;p&gt;Batching reduces overhead, saves time, and lowers gas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s explore 3 Ethereum standards that enable powerful batching:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) ERC-3005: Batched Meta Transactions - &lt;a href="https://eips.ethereum.org/EIPS/eip-3005" rel="noopener noreferrer"&gt;https://eips.ethereum.org/EIPS/eip-3005&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This standard lets users combine multiple actions into one meta transaction.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Approve token&lt;/p&gt;

&lt;p&gt;Swap on DEX&lt;/p&gt;

&lt;p&gt;Send output to wallet&lt;/p&gt;

&lt;p&gt;All in one call, reducing gas and relayer fees.&lt;/p&gt;

&lt;p&gt;Great for:&lt;/p&gt;

&lt;p&gt;Wallet apps&lt;/p&gt;

&lt;p&gt;Gasless UX&lt;/p&gt;

&lt;p&gt;Relayer-backed platforms&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) ERC-7821: Minimal Batch Executor -  &lt;a href="https://eips.ethereum.org/EIPS/eip-7821" rel="noopener noreferrer"&gt;https://eips.ethereum.org/EIPS/eip-7821&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This one’s about delegations and shared execution.&lt;/p&gt;

&lt;p&gt;Think of it like batching multiple on-chain delegations, such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Voting&lt;br&gt;
Staking&lt;br&gt;
DAO participation&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With atomic execution, if one part fails, nothing gets through so it keeps safe and predictable.&lt;/p&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DAO tools&lt;br&gt;
Governance app&lt;br&gt;
Delegation-heavy protocols&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example scenario: You want to withdraw from a liquidity pool, swap the tokens, and deposit them into a yield farming protocol. ERC-7821 ensures all these operations happen atomically, preventing scenarios where only part of your strategy executes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) ERC-4393: Batch Micropayments - &lt;a href="https://eips.ethereum.org/EIPS/eip-4393" rel="noopener noreferrer"&gt;https://eips.ethereum.org/EIPS/eip-4393&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you need to make multiple small payments, ERC-4393 shines. This standard enables multiple tips or payments in a single transaction call.&lt;/p&gt;

&lt;p&gt;Use case: Tipping multiple content creators or making several small purchases. Instead of paying gas fees for each micropayment, you pay once for the entire batch&lt;/p&gt;

&lt;h3&gt;
  
  
  Strategy 3: Wait for gas to go down
&lt;/h3&gt;

&lt;p&gt;Gas prices go up and down every twelve seconds based on how congested Ethereum is. When gas prices are high, waiting just a few minutes before making a transaction could see a significant drop in what you pay.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strategy 4: Use Layer 2 Solutions
&lt;/h3&gt;

&lt;p&gt;Layer 2 solutions like zkSync, Arbitrum, and Optimism reduce gas fees by up to 95%. By bundling a large number of transactions together, these solutions reduce the number of on-chain transactions.&lt;/p&gt;

&lt;p&gt;Popular options:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Arbitrum&lt;br&gt;
Optimism&lt;br&gt;
Base&lt;br&gt;
Polygon (PoS)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many dApps are now L2-ready. Just bridge your ETH once, and you’re good to go.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrap-up
&lt;/h3&gt;

&lt;p&gt;Ethereum gas fees aren’t going away, but you can outsmart them with:&lt;/p&gt;

&lt;p&gt;Good timing&lt;/p&gt;

&lt;p&gt;Layer 2 networks&lt;/p&gt;

&lt;p&gt;Batched transactions using ERC-3005, ERC-7821, and ERC-4393&lt;/p&gt;

&lt;p&gt;Wait for the gas to go down&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s next?
&lt;/h3&gt;

&lt;p&gt;While timing and batching strategies can dramatically reduce your transaction costs, the next frontier in gas optimization lies in smart contract efficiency. In Part 3, we will explore advanced Solidity techniques that developers use to minimize gas consumption at the code level.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>ethereum</category>
      <category>gasoptimization</category>
      <category>solidity</category>
    </item>
    <item>
      <title>Gas Optimization Part 1: Understanding Ethereum Gas Fees</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 06:42:08 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/gas-optimization-part-1-understanding-ethereum-gas-fees-gi2</link>
      <guid>https://dev.to/mahima_thacker/gas-optimization-part-1-understanding-ethereum-gas-fees-gi2</guid>
      <description>&lt;p&gt;&lt;strong&gt;“I paid $62 just to send $100. What?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s the kind of reaction many new users have after making their first Ethereum transaction during peak congestion.&lt;/p&gt;

&lt;p&gt;No NFTs. No DeFi. Just a simple ETH transfer.&lt;/p&gt;

&lt;p&gt;Yet the gas fee was more than half the value of the transaction.&lt;/p&gt;

&lt;p&gt;And they thought it was a bug.&lt;/p&gt;

&lt;p&gt;But it wasn’t.&lt;/p&gt;

&lt;p&gt;It was Ethereum being busy.&lt;/p&gt;

&lt;p&gt;Welcome to the world of gas fees.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Gas, Really?
&lt;/h3&gt;

&lt;p&gt;If you’ve ever driven a car, you already understand gas.&lt;/p&gt;

&lt;p&gt;Think of your Ethereum transaction as a car trip. To drive (process your transaction), you need fuel, and on Ethereum, that fuel is called Gas.&lt;/p&gt;

&lt;p&gt;Just like fuel powers a car, gas powers your transaction on the Ethereum network.&lt;/p&gt;

&lt;p&gt;But there’s a catch: The busier the road, the higher the fuel price.&lt;/p&gt;

&lt;p&gt;So when the Ethereum network is crowded (say, during a hyped NFT mint), gas prices shoot up because everyone’s trying to get their transactions through.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Gas Prices Change
&lt;/h3&gt;

&lt;p&gt;Back to our highway example:&lt;/p&gt;

&lt;p&gt;If traffic is light, fuel is cheap, and if traffic is jammed, fuel costs more to cut through&lt;/p&gt;

&lt;p&gt;Ethereum works similarly.&lt;/p&gt;

&lt;p&gt;You can pay a higher gas price to get your transaction picked up faster by validators&lt;/p&gt;

&lt;p&gt;Or you can set a lower price and wait.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Components
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Gas Limit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the maximum amount of gas you're willing to use.&lt;/p&gt;

&lt;p&gt;For simple ETH transfers, it's usually 21,000.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gas Price&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is how much you're willing to pay per unit of gas, measured in Gwei.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gas Usage:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the actual amount of gas consumed by your transaction. It's often the same as your gas limit for simple transactions, but complex operations might use less than the limit you set.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breaking Down Gas Fees: A Real Example:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Gas Limit = 21,000&lt;br&gt;
Gas Price = 35.06 Gwei&lt;br&gt;
ETH Price = $3,492.21&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step 1: Calculate Gas Fee in ETH&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;21,000 × 35.06 / 1,000,000,000 = 0.000736 ETH&lt;br&gt;
Step 2: Convert to Dollars&lt;/p&gt;

&lt;p&gt;0.000736 × 3,492.21 = $2.57&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, the fee for that simple transaction is about $2.57.&lt;/p&gt;

&lt;p&gt;But when the network gets congested, gas prices might 10x,  and that’s how people end up paying $50+ just to send ETH.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Game-Changer: EIP-1559
&lt;/h3&gt;

&lt;p&gt;In August 2021, Ethereum introduced EIP-1559, which revolutionized how gas fees work. Instead of the old auction-style system where users had to guess appropriate gas prices, EIP-1559 brought predictability and efficiency.&lt;/p&gt;

&lt;h4&gt;
  
  
  How EIP-1559 Works
&lt;/h4&gt;

&lt;p&gt;The new system introduces several key components:&lt;/p&gt;

&lt;p&gt;Base Fee: This is a fixed price per unit of gas that the network automatically adjusts based on demand. Here's the interesting part: this base fee gets burned (destroyed), permanently removing ETH from circulation.&lt;/p&gt;

&lt;p&gt;Max Fee: The maximum amount you're willing to pay for the transaction. This acts as your safety net.&lt;/p&gt;

&lt;p&gt;Max Priority Fee: The tip you're willing to give to miners to prioritize your transaction.&lt;/p&gt;

&lt;h4&gt;
  
  
  A Real EIP-1559 Example
&lt;/h4&gt;

&lt;p&gt;Let's say you're making a transaction with these parameters:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Base Fee: 70 Gwei&lt;br&gt;
Max Fee per Gas: 90 Gwei&lt;br&gt;
Max Priority Fee per Gas: 15 Gwei&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's what happens:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;70 Gwei gets burned (the base fee is destroyed)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Miners receive 15 Gwei (your full priority fee since Max Fee - Base Fee = 20 Gwei, which is higher than your 15 Gwei priority fee)&lt;/p&gt;

&lt;p&gt;You get 5 Gwei refunded (90 - 70 - 15 = 5 Gwei back to your wallet)&lt;/p&gt;

&lt;p&gt;This system eliminates the guesswork. You know exactly what you'll pay upfront, and any excess gets refunded automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looking Ahead
&lt;/h3&gt;

&lt;p&gt;Gas optimization isn't just about understanding current fees. It's about developing strategies to minimize costs while maintaining transaction reliability. In the next part of this series, we'll dive into practical techniques for optimizing your gas usage, including timing strategies, transaction batching, and smart contract optimization tips.&lt;/p&gt;

&lt;p&gt;The key takeaway? Gas fees might seem complex, but they follow predictable patterns. Once you understand these patterns, you can navigate the Ethereum network like a pro, saving money and avoiding the frustration of failed transactions.&lt;/p&gt;

&lt;p&gt;Remember: every Gwei saved is money back in your pocket. And in the world of DeFi and NFTs, where you might make dozens of transactions per month, those savings add up quickly.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>gasoptimization</category>
      <category>ethereum</category>
      <category>solidity</category>
    </item>
    <item>
      <title>They Lost Millions by Clicking ‘Sign’ - Here’s How to Never Make That Mistake</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Fri, 29 May 2026 06:35:53 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/they-lost-millions-by-clicking-sign-heres-how-to-never-make-that-mistake-1751</link>
      <guid>https://dev.to/mahima_thacker/they-lost-millions-by-clicking-sign-heres-how-to-never-make-that-mistake-1751</guid>
      <description>&lt;p&gt;Picture this: You're the treasurer of a major crypto exchange. Your phone buzzes with a notification - another routine transaction needs approval. You glance at your screen, see familiar addresses, and click "approve" without a second thought. Within minutes, millions of dollars vanish into thin air.&lt;/p&gt;

&lt;p&gt;This isn't fiction. This exact scenario played out when Bybit, one of the world's largest cryptocurrency exchanges, fell victim to a sophisticated hack executed by North Korean cybercriminals. The culprit? A signer who didn't fully verify a transaction, leading to a critical Safe UI vulnerability that drained millions from their multi-signature wallet.&lt;/p&gt;

&lt;p&gt;The harsh reality is that even the most secure wallet setups can crumble with one careless click. But here's the good news: these disasters are completely preventable when you know what to look for.&lt;/p&gt;

&lt;p&gt;Don’t want to be the next victim?&lt;/p&gt;

&lt;h4&gt;
  
  
  Let’s walk through how to verify calldata, use multi-sig safely, and pick the right wallet for your level.
&lt;/h4&gt;

&lt;h3&gt;
  
  
  The Wallet Hierarchy: Choosing Your Guardian
&lt;/h3&gt;

&lt;p&gt;Before diving into verification techniques, let's address the elephant in the room: which wallet should you even use?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total Beginner with Small Amounts:&lt;/strong&gt; Start with custodial wallets or keep funds on reputable exchanges. Yes, "not your keys, not your crypto" is true, but losing $100 to exchange risk beats losing $100 to your own mistakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner with Small Money:&lt;/strong&gt; Browser wallets like MetaMask or Phantom work well. They're user-friendly and perfect for learning the ropes with amounts you can afford to lose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Users with Medium Amounts:&lt;/strong&gt; Hardware wallets like Ledger or Trezor become essential. They keep your private keys offline and away from internet threats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Users with Large Amounts:&lt;/strong&gt; Combine multi-signature wallets with hardware wallets. This creates multiple checkpoints that hackers must breach simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Users with Significant Holdings:&lt;/strong&gt; Multi-signature wallets with social recovery, or custom solutions. At this level, you're building Fort Knox for your digital assets.&lt;/p&gt;

&lt;p&gt;For wallet comparisons and security audits, check out walletscrutiny.com, it's like a Consumer Reports for crypto wallets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hot vs Cold Wallets
&lt;/h3&gt;

&lt;p&gt;Hot wallets stay connected to the internet (MetaMask, Phantom, and mobile apps). They're convenient for daily transactions but vulnerable to online attacks.&lt;/p&gt;

&lt;p&gt;Cold wallets remain offline (Ledger, Trezor hardware devices). They're like keeping cash in a physical safe, much harder to steal remotely.&lt;/p&gt;

&lt;p&gt;Important:&lt;/p&gt;

&lt;p&gt;Even a cold wallet becomes hot if you connect it to a Safe multi-sig UI!&lt;/p&gt;

&lt;p&gt;Always be aware of when you’re online vs offline&lt;/p&gt;

&lt;p&gt;Verifying Simple Transactions: Your First Line of Defense&lt;/p&gt;

&lt;p&gt;When using MetaMask or similar wallets, you'll sometimes see transaction details that look like gibberish. Don't panic,  here's how to decode them:&lt;/p&gt;

&lt;p&gt;Check These Three Things:&lt;/p&gt;

&lt;p&gt;Estimated changes - What's actually moving in and out of your wallet&lt;/p&gt;

&lt;p&gt;The "to" address - Where your money is going&lt;/p&gt;

&lt;p&gt;Hash data - The first 4 bytes reveal the function being called&lt;/p&gt;

&lt;p&gt;For example, if you see "0xa9059cbb" in your transaction data, you can decode it using Cast (a developer tool):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cast sig "transfer(address,uint256)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This returns the function selector you can compare against your transaction. If they match, you're calling a transfer function. If they don't match, stop immediately.&lt;/p&gt;

&lt;p&gt;To verify the specific parameters of a transfer:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cast calldata-decode "transfer(address,uint256)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This shows exactly where your tokens are going and how many.&lt;/p&gt;

&lt;p&gt;Multi-Sig Transactions: Where Things Get Complicated&lt;/p&gt;

&lt;p&gt;Multi-signature wallets require multiple people to approve transactions before they execute. Think of it like a shared bank account where both you and your spouse need to sign checks for large purchases&lt;/p&gt;

&lt;p&gt;Critical Point: A signature request is NOT the same as a transaction request. You're not sending money yet, you're just adding your approval to a pending transaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Verify a Multi-Sig Transaction
&lt;/h3&gt;

&lt;p&gt;Step 1: Install the Right Tools Get Cyfrin's Safe_hashes tool from GitHub&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://github.com/Cyfrin/safe-tx-hashes?tab=readme-ov-file#curl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tool decodes Safe transactions into a human readable format.&lt;/p&gt;

&lt;p&gt;Step 2: Run the Verification Command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;safe_hashes --address --network --nonce&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If no transaction appears, use --untrusted mode in above command&lt;/p&gt;

&lt;p&gt;Step 3: Manual Verification (Advanced) For complete independence from APIs, use Cast:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cast calldata "approve(address,uint256)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then verify with Safe hashes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;safe_hashes --address --network --nonce 2 --data --offline --to&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Golden Rules That Could Save Millions
&lt;/h3&gt;

&lt;p&gt;Never sign and execute simultaneously. Some wallets try to streamline this process, but convenience is the enemy of security.&lt;/p&gt;

&lt;p&gt;Watch for operation codes. If you see "operation = 1" in your transaction, you're looking at a DELEGATECALL - essentially giving another contract permission to act with your wallet's full authority. This is extremely dangerous and should only be used in very specific circumstances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always verify these three elements before any signature:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The destination address (where is this going?)&lt;/li&gt;
&lt;li&gt;The function selector (what action is being performed?)&lt;/li&gt;
&lt;li&gt;The value or amount (how much is involved?)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Why This Matters More Than Ever:
&lt;/h4&gt;

&lt;p&gt;The Bybit hack wasn't an isolated incident. Similar attacks happen regularly because people skip verification steps. The difference between a secure transaction and a devastating hack often comes down to spending 30 seconds to verify what you're actually signing.&lt;/p&gt;

&lt;p&gt;Remember: in the world of cryptocurrency, there's no "undo" button. Once a transaction is confirmed on the blockchain, it's permanent. The few minutes you spend verifying could be the difference between protecting your assets and reading about your loss in tomorrow's crypto news.&lt;/p&gt;

&lt;p&gt;The tools and techniques outlined here aren't just for crypto professional, they're for anyone who values their digital assets enough to protect them properly. Start with the basics, build good habits, and gradually level up your security practices as your holdings grow.&lt;/p&gt;

&lt;h3&gt;
  
  
  TL;DR
&lt;/h3&gt;

&lt;p&gt;Pick the right wallet for your level&lt;/p&gt;

&lt;p&gt;Always verify the transaction before signing, especially calldata&lt;/p&gt;

&lt;p&gt;Never trust the UI blindly&lt;/p&gt;

&lt;p&gt;Use Safe_hashes or Cast for decoding&lt;/p&gt;

&lt;p&gt;Multi-sig ≠ automatic safety&lt;/p&gt;

&lt;p&gt;One wrong click can empty your wallet. Take 30 seconds and verify,  your future self will thank you.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>wallet</category>
      <category>security</category>
      <category>foundry</category>
    </item>
    <item>
      <title>RAG for Codebases Is Harder Than It Looks</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Wed, 27 May 2026 13:20:36 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/rag-for-codebases-is-harder-than-it-looks-1nhg</link>
      <guid>https://dev.to/mahima_thacker/rag-for-codebases-is-harder-than-it-looks-1nhg</guid>
      <description>&lt;p&gt;Building RepoChat, an AI tool that explains GitHub repos&lt;/p&gt;

&lt;p&gt;I built a small AI tool called RepoChat.&lt;/p&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Paste a GitHub repo. Ask questions. Get answers from the codebase.&lt;br&gt;
Something like:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What does this project do?&lt;br&gt;
How is the backend structured?&lt;br&gt;
Where is authentication handled?&lt;br&gt;
How do I run this locally?&lt;br&gt;
Which files should I read first?&lt;/p&gt;

&lt;p&gt;I did not want to build another chatbot. I wanted to build something useful for developers.&lt;/p&gt;

&lt;p&gt;Because every developer has faced this problem:&lt;/p&gt;

&lt;p&gt;You open a new repo.&lt;br&gt;
There are 50 files.&lt;br&gt;
The README is either missing, outdated, or too high-level.&lt;br&gt;
You don’t know where to start.&lt;/p&gt;

&lt;p&gt;So I wanted to see if RAG could help make codebase onboarding faster.&lt;/p&gt;
&lt;h2&gt;
  
  
  What RepoChat does
&lt;/h2&gt;

&lt;p&gt;RepoChat takes a GitHub repository and turns it into something you can ask questions about.&lt;/p&gt;

&lt;p&gt;The first version is intentionally small.&lt;/p&gt;

&lt;p&gt;It has two main flows.&lt;/p&gt;

&lt;p&gt;Indexing happens once for a repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub repo&lt;/li&gt;
&lt;li&gt;files&lt;/li&gt;
&lt;li&gt;filtered files&lt;/li&gt;
&lt;li&gt;chunks&lt;/li&gt;
&lt;li&gt;OpenAI embeddings&lt;/li&gt;
&lt;li&gt;Chroma vector DB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Querying happens every time someone asks a question:&lt;/p&gt;

&lt;p&gt;question&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; embed question&lt;/li&gt;
&lt;li&gt; search Chroma&lt;/li&gt;
&lt;li&gt; top-K chunks&lt;/li&gt;
&lt;li&gt; Claude&lt;/li&gt;
&lt;li&gt; answer with sources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This split helped me think about the system more clearly.&lt;/p&gt;

&lt;p&gt;The indexing pipeline prepares the repo.&lt;/p&gt;

&lt;p&gt;The query pipeline uses that indexed repo to answer questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumzjdnbkp92670rnjtsa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumzjdnbkp92670rnjtsa.png" alt=" " width="799" height="392"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The basic architecture
&lt;/h2&gt;

&lt;p&gt;The first version has a frontend and a backend.&lt;/p&gt;
&lt;h4&gt;
  
  
  The frontend is simple:
&lt;/h4&gt;

&lt;p&gt;repo URL input&lt;br&gt;
question input&lt;br&gt;
answer section&lt;br&gt;
sources section&lt;/p&gt;
&lt;h4&gt;
  
  
  The backend does the heavier work:
&lt;/h4&gt;

&lt;p&gt;fetch repo files&lt;br&gt;
filter useful files&lt;br&gt;
chunk text/code&lt;br&gt;
create embeddings&lt;br&gt;
store chunks&lt;br&gt;
retrieve relevant chunks&lt;br&gt;
call the LLM&lt;/p&gt;

&lt;p&gt;I used this kind of structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repochat-ai/
  apps/
    web/
    api/
  data/
    chroma/
  README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  The stack:
&lt;/h4&gt;

&lt;p&gt;Frontend: Next.js, React, Tailwind&lt;br&gt;
Backend: FastAPI&lt;br&gt;
Chunking: LangChain text splitters&lt;br&gt;
Embeddings: OpenAI text-embedding-3-small&lt;br&gt;
Vector DB: Chroma&lt;br&gt;
LLM: Anthropic Claude Sonnet 4.6&lt;br&gt;
Repo data: GitHub API&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I used two providers for different jobs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OpenAI handles embeddings because its embedding models are simple and reliable for this use case.&lt;/p&gt;

&lt;p&gt;Claude handles generation because I wanted stronger reasoning and clearer explanations for codebase questions.&lt;/p&gt;

&lt;p&gt;This felt better than forcing one provider to do everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Fetching the repo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first problem was getting the right files.&lt;/p&gt;

&lt;p&gt;At first, I thought:&lt;/p&gt;

&lt;p&gt;Just fetch the repo and send everything to the AI.&lt;/p&gt;

&lt;p&gt;That sounds simple, but it breaks quickly.&lt;/p&gt;

&lt;p&gt;Repos contain a lot of files that are not useful for understanding the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules/
.git/
dist/
build/
lock files
generated files
images
large JSON files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So I had to filter files.&lt;/p&gt;

&lt;p&gt;For the first version, I focused on files like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;README / readme files&lt;br&gt;
.md&lt;br&gt;
.py&lt;br&gt;
.ts&lt;br&gt;
.tsx&lt;br&gt;
.js&lt;br&gt;
.jsx&lt;br&gt;
.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This already made the answers better.&lt;/p&gt;

&lt;p&gt;One thing I learned here:&lt;/p&gt;

&lt;p&gt;Good RAG starts before embeddings. It starts with choosing what data should enter the pipeline.&lt;/p&gt;

&lt;p&gt;If you put garbage into the vector database, retrieval will return garbage too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Chunking code is not the same as chunking docs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was the first part that felt harder than expected.&lt;/p&gt;

&lt;p&gt;Most RAG tutorials use normal text:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;paragraph&lt;br&gt;
paragraph&lt;br&gt;
paragraph&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But code is different.&lt;/p&gt;

&lt;p&gt;A code file has:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;imports
functions
classes
comments
config
repeated names
small pieces that only make sense together
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If chunks are too small, the model loses context.&lt;/p&gt;

&lt;p&gt;If chunks are too large, retrieval becomes noisy.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getUser() {
  ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function alone may not be enough.&lt;/p&gt;

&lt;p&gt;The useful context may include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { db } from "./db"
import { users } from "./schema"

function getUser() {
  ...
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So I had to think more carefully about chunk size and metadata.&lt;/p&gt;

&lt;p&gt;For every chunk, I kept metadata like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm5ktf541ct6i05m7609.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm5ktf541ct6i05m7609.png" alt=" " width="540" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The file path is very important.&lt;/p&gt;

&lt;p&gt;A chunk from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apps/api/auth.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;means something different from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apps/web/components/Login.tsx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Even if both mention “user” or “auth”.&lt;/p&gt;

&lt;p&gt;The file extension is not stored separately, but it is still available through the path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb286lo0babiu3nm27j4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb286lo0babiu3nm27j4u.png" alt=" " width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Embeddings and retrieval&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the files were chunked, I created embeddings using OpenAI’s text-embedding-3-small model and stored them in Chroma.&lt;/p&gt;

&lt;p&gt;When a user asks a question, I embed the question too.&lt;/p&gt;

&lt;p&gt;Then the system searches Chroma for chunks that are close to that question.&lt;/p&gt;

&lt;p&gt;So if someone asks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where is authentication handled?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;the system may find related chunks even if the exact word “authentication” is not used everywhere.&lt;/p&gt;

&lt;p&gt;It can still find related words like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;auth&lt;br&gt;
login&lt;br&gt;
session&lt;br&gt;
token&lt;br&gt;
middleware&lt;br&gt;
jwt&lt;br&gt;
user&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is where RAG becomes useful.&lt;/p&gt;

&lt;p&gt;But retrieval is not magic.&lt;/p&gt;

&lt;p&gt;Sometimes it retrieves:&lt;/p&gt;

&lt;p&gt;the README instead of the actual code&lt;br&gt;
a frontend file when the backend file is more useful&lt;br&gt;
a config file because it has matching words&lt;br&gt;
a chunk that mentions the right term but does not answer the question&lt;/p&gt;

&lt;p&gt;That was a good reminder:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAG is not just “put data in vector DB and ask questions.” Retrieval quality matters a lot.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Asking questions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Q&amp;amp;A flow looks like this:&lt;/p&gt;

&lt;p&gt;User asks a question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;embed the question&lt;/li&gt;
&lt;li&gt; retrieve top relevant chunks&lt;/li&gt;
&lt;li&gt; send chunks + question to Claude&lt;/li&gt;
&lt;li&gt; generate answer&lt;/li&gt;
&lt;li&gt; show answer with source files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted answers to include sources because without sources, it is hard to trust the output.&lt;/p&gt;

&lt;p&gt;For developer tools, source references are not optional.&lt;/p&gt;

&lt;p&gt;If the AI says:&lt;/p&gt;

&lt;p&gt;Auth is handled in middleware.&lt;/p&gt;

&lt;p&gt;I want to know:&lt;/p&gt;

&lt;p&gt;Which file?&lt;br&gt;
Which function?&lt;br&gt;
Where should I look?&lt;/p&gt;

&lt;p&gt;So the answer should include something like:&lt;/p&gt;

&lt;p&gt;Sources:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;- apps/api/middleware/auth.ts&lt;/code&gt;&lt;br&gt;
&lt;code&gt;- apps/api/routes/users.ts&lt;/code&gt;&lt;br&gt;
This makes the tool much more useful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq48ohi5wt3ro78ga6mw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq48ohi5wt3ro78ga6mw2.png" alt=" " width="799" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What broke or felt messy&lt;/p&gt;

&lt;p&gt;This was the most useful part of the build.&lt;/p&gt;
&lt;h4&gt;
  
  
  A few things were harder than expected.
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Large repos are noisy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Small repos are easy.&lt;/p&gt;

&lt;p&gt;Large repos need better filtering.&lt;/p&gt;

&lt;p&gt;A real repo may contain:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;docs&lt;br&gt;
examples&lt;br&gt;
tests&lt;br&gt;
scripts&lt;br&gt;
generated files&lt;br&gt;
frontend&lt;br&gt;
backend&lt;br&gt;
infra&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If everything is indexed equally, answers become messy.&lt;/p&gt;

&lt;p&gt;A better version should rank files based on importance.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;README.md
package.json
main entry files
routes
config files
src/
docs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;should probably matter more than random test snapshots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. README is useful but not enough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;README files are helpful for high-level questions.&lt;/p&gt;

&lt;p&gt;But if you ask:&lt;/p&gt;

&lt;p&gt;How does auth work?&lt;/p&gt;

&lt;p&gt;the README is usually not enough.&lt;/p&gt;

&lt;p&gt;You need code.&lt;/p&gt;

&lt;p&gt;This is where code-aware retrieval becomes important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. File paths matter a lot&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At first, I treated chunks mostly as text.&lt;/p&gt;

&lt;p&gt;But for codebases, metadata is part of the answer.&lt;/p&gt;

&lt;p&gt;A chunk from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;backend/routes/payment.ts&lt;/strong&gt;&lt;br&gt;
It is not just text.&lt;/p&gt;

&lt;p&gt;It tells you:&lt;/p&gt;

&lt;p&gt;This is backend code&lt;br&gt;
This is route-level logic&lt;br&gt;
This likely handles payment APIs&lt;/p&gt;

&lt;p&gt;So the file path helps both retrieval and explanation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The model needs strict instructions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the model does not know something, it should say so.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;I could not find authentication logic in the indexed files.&lt;/p&gt;

&lt;p&gt;is much better than:&lt;/p&gt;

&lt;p&gt;The app probably uses JWT authentication.&lt;/p&gt;

&lt;p&gt;For a developer tool, guessing is dangerous.&lt;/p&gt;

&lt;p&gt;So the prompt rule was intentionally strict:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Answer using only the provided repo context.&lt;br&gt;
If the answer is not present in the context, say that clearly.&lt;br&gt;
Always mention the source files used.&lt;br&gt;
Do not guess implementation details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  What I learned about RAG
&lt;/h4&gt;

&lt;p&gt;Building RepoChat made RAG feel much more real to me.&lt;/p&gt;

&lt;p&gt;Before building it, RAG sounded simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;embed docs&lt;br&gt;
retrieve docs&lt;br&gt;
ask LLM&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After building it, I see it more like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;choose the right data&lt;br&gt;
clean the data&lt;br&gt;
chunk it properly&lt;br&gt;
store useful metadata&lt;br&gt;
retrieve the right chunks&lt;br&gt;
control the prompt&lt;br&gt;
show sources&lt;br&gt;
test bad answers&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The retrieval part is only one piece.&lt;/p&gt;

&lt;p&gt;The developer experience around it matters just as much.&lt;/p&gt;

&lt;p&gt;A developer should not care about embeddings or vector DBs.&lt;/p&gt;

&lt;p&gt;They should only feel:&lt;/p&gt;

&lt;p&gt;“I understand this repo faster now.”&lt;/p&gt;

&lt;h4&gt;
  
  
  What I would improve next:
&lt;/h4&gt;

&lt;p&gt;The first version is useful, but there are many things I would improve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Better code parsing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of splitting files only by text size, I want to split code by structure:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;functions&lt;br&gt;
classes&lt;br&gt;
exports&lt;br&gt;
API routes&lt;br&gt;
components&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tools like Tree-sitter could help with this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Repo map&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before answering questions, the app could build a repo map:&lt;/p&gt;

&lt;p&gt;frontend&lt;br&gt;
backend&lt;br&gt;
API routes&lt;br&gt;
database&lt;br&gt;
auth&lt;br&gt;
config&lt;br&gt;
tests&lt;/p&gt;

&lt;p&gt;This would help the model understand the project layout better.&lt;/p&gt;

&lt;p&gt;Better source citations&lt;/p&gt;

&lt;p&gt;Right now, file-level sources are useful.&lt;/p&gt;

&lt;p&gt;But line-level sources would be better.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;apps/api/auth.ts:45-72&lt;/p&gt;

&lt;p&gt;That would make answers easier to verify.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Evaluation questions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every repo could have test questions like:&lt;/p&gt;

&lt;p&gt;How do I run this project?&lt;br&gt;
Where is auth handled?&lt;br&gt;
Where are API routes defined?&lt;br&gt;
What database does it use?&lt;/p&gt;

&lt;p&gt;Then I can test whether RepoChat answers correctly.&lt;/p&gt;

&lt;p&gt;This is where evals become useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.MCP integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Later, RepoChat could expose repo search as an MCP tool.&lt;/p&gt;

&lt;p&gt;Then an agent could ask:&lt;/p&gt;

&lt;p&gt;search_codebase("where is auth handled?")&lt;/p&gt;

&lt;p&gt;and use RepoChat as a codebase understanding tool.&lt;/p&gt;

&lt;h4&gt;
  
  
  Final thoughts
&lt;/h4&gt;

&lt;p&gt;RepoChat started as a small demo, but it taught me a lot.&lt;/p&gt;

&lt;p&gt;The biggest lesson:&lt;/p&gt;

&lt;p&gt;RAG is only useful when the developer can trust the answer.&lt;/p&gt;

&lt;p&gt;For codebases, trust comes from:&lt;/p&gt;

&lt;p&gt;good retrieval&lt;br&gt;
useful chunks&lt;br&gt;
file metadata&lt;br&gt;
clear sources&lt;br&gt;
honest “I don’t know” answers&lt;/p&gt;

&lt;p&gt;I still want to improve RepoChat, but even this first version made one thing clear:&lt;/p&gt;

&lt;p&gt;AI tools for developers should not try to replace understanding.&lt;/p&gt;

&lt;p&gt;They should help developers reach understanding faster.&lt;/p&gt;

&lt;p&gt;That is the part I find exciting. &lt;/p&gt;

&lt;h3&gt;
  
  
  Code
&lt;/h3&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/mahimathacker/repochat-ai" rel="noopener noreferrer"&gt;https://github.com/mahimathacker/repochat-ai&lt;/a&gt;&lt;br&gt;
Live demo: &lt;a href="https://youtu.be/kSgZSqH6iXk" rel="noopener noreferrer"&gt;https://youtu.be/kSgZSqH6iXk&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I’m still improving it, especially around better code parsing, line-level citations, repo maps, evals, and MCP support.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>python</category>
      <category>devtool</category>
    </item>
    <item>
      <title>Are u still confused about how swapping works on Uniswap or other DEXs?</title>
      <dc:creator>Mahima Thacker</dc:creator>
      <pubDate>Sat, 29 Mar 2025 05:13:50 +0000</pubDate>
      <link>https://dev.to/mahima_thacker/are-u-still-confused-about-how-swapping-works-on-uniswap-or-other-dexs-4c18</link>
      <guid>https://dev.to/mahima_thacker/are-u-still-confused-about-how-swapping-works-on-uniswap-or-other-dexs-4c18</guid>
      <description>&lt;p&gt;Not anymore 💁‍♀️ &lt;br&gt;
This might seem long, but trust me it’s worth every scroll 😉 &lt;br&gt;
Let’s break it down in simple terms — no advanced math, no technical fluff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1/ What is AMM?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An AMM (Automated Market Maker) is like a robot that lets you swap tokens without needing a buyer or seller.&lt;/li&gt;
&lt;li&gt;Instead of matching orders like an order book used in a centralised exchange. 
it uses a liquidity pool (a jar of tokens) and a formula to decide the price.
So, &lt;/li&gt;
&lt;li&gt;No order books&lt;/li&gt;
&lt;li&gt;No middlemen&lt;/li&gt;
&lt;li&gt;Just a smart contract doing the job &lt;/li&gt;
&lt;li&gt;The formula calculated the price -&amp;gt;X * Y = K &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2/ What’s in the Liquidity Pool?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each pool holds two tokens, say: Token 1 = ETH (e.g., 50 ETH)
Token 2 = DAI (e.g., 10,000 DAI)&lt;/li&gt;
&lt;li&gt;This pool is created by users (called liquidity providers) who deposit equal value of both tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3/ The Magic Formula: X * Y = K&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This is the core logic of how prices are determined.&lt;br&gt;
X = Amount of Token 1 (ETH)&lt;br&gt;
Y = Amount of Token 2 (DAI)&lt;br&gt;
K = Constant value that should never change&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As you trade, the values of X and Y shift, but K always remains the same. That’s what keeps everything balanced!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4/ Let’s Understand With an Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before Trade:
ETH in pool = 50
DAI in pool = 10,000
Constant K = 50 * 10,000 = 500,000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's say you want to buy 1 ETH using DAI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After the Trade:
ETH left = 49 (because you took out 1 ETH)&lt;/li&gt;
&lt;li&gt;To maintain K = 500,000, the pool must now hold more DAI.
49 * Y = 500,000 
Y = 500,000 / 49 ≈ 10,204.08 DAI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the pool needs 10,204.08 DAI after your trade. That means you have to add ~204.08 DAI to buy 1 ETH &lt;/p&gt;

&lt;p&gt;That’s how price is automatically calculated — by using the formula, not a person 🫣 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1vnpwf7nykb4khiaweu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1vnpwf7nykb4khiaweu.png" alt=" " width="800" height="813"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5/  Why Price Increases as You Trade?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The more ETH you try to buy, the more DAI you must add to keep K constant.&lt;br&gt;
This makes ETH more expensive with each purchase. That’s slippage — and it’s normal in AMMs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6/ Order Book vs AMM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In an order book, trades are matched between buyers and sellers at the same price.&lt;br&gt;
In an AMM, the price is calculated automatically based on how much is in the pool&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7/ Final Takeaway&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re trading with math, not a person.&lt;/li&gt;
&lt;li&gt;The pool keeps everything balanced using X * Y = K.&lt;/li&gt;
&lt;li&gt;More buying = price goes up (and vice versa).&lt;/li&gt;
&lt;li&gt;No need for someone on the other side — you just interact with the 
pool! &lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
