---
title: "Discussion on \"The Math Behind Every Uniswap-Style Swap\" | Hashnode"
description: "Discussion on \"The Math Behind Every Uniswap-Style Swap\". Explaining the constant-product formula that powers DeFi\n\nTL;DR\n\nAMMs like Uniswap use the formula x * y = k\n\nYou swap dx of token X to get dy of token Y\n\nFee is charged on the input, and price impact depends on pool reserves\n\nThis post walks through..."
url: "https://hashnode.com/posts/the-math-behind-every-uniswap-style-swap/68c9e21361f46b0261a228f7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Math Behind Every Uniswap-Style Swap](https://devsadi.hashnode.dev/the-math-behind-every-uniswap-style-swap?utm_source=hashnode&utm_medium=feed)

Explaining the constant-product formula that powers DeFi TL;DR AMMs like Uniswap use the formula x \* y = k You swap dx of token X to get dy of token Y Fee is charged on the input, and price impact depends on pool reserves This post walks through...

Sep 16, 2025 · 2 min read · devsadi.hashnode.dev  
Read the article

## Written by

[Adityaa kr](https://hashnode.com/@Adityaakrx)

@Adityaakrx · India

  
[View profile](https://hashnode.com/@Adityaakrx)

Developer | Reader | Writer | Community Builder

Passionate about tech and driven by curiosity.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
