← Back to blog

Uniswap V2 DApp Development — Overview

Open-source LP/swap DApp on Uniswap V2 covering pool lifecycle and router operations.

Based on Uniswap V2: token swaps, pool creation, liquidity add/remove, and full LP lifecycle management. GitHub

ui_RpcInfo

Overview

This series builds a DApp covering Uniswap pool creation, liquidity management, and swaps — usable for trading, market making, quant strategies, sniping, and more. Code is open-sourced on GitHub in C# for cross-platform Mac/Windows support, with plans for V3/V4.

This article introduces Uniswap, DEX vs CEX, core contracts, ABIs, and the features implemented in the DApp.

Uniswap intro

Uniswap is a leading on-chain DEX with AMM pricing — transparent and non-custodial compared to centralized exchanges, and a cornerstone of DeFi.

Features

  1. AMM — e.g. constant-product pricing (x*y=k).

  2. Open source — contracts are auditable on-chain.

  3. Permissionless pairs — anyone can create ERC20/ERC20 pools.

  4. Flash loans — borrow within a single block for arbitrage strategies.

  5. On-chain transparency — all pool and swap actions are recorded on-chain.

Core contracts & ABIs

UniswapV2Factory

Uniswap_Factory

Factory contract

Creates pairs and returns LP addresses (`createPair`, `getPair`).

UniswapV2Pair

Uniswap_Pair

Pair contract

LP pool instance; `getReserves` for pricing.

UniswapV2ERC20

Uniswap_Erc20

LP token (ERC20)

LP receipt token with standard transfer methods.

UniswapV2Router02

Uniswap_Router

Router

Main external interface: add/remove liquidity, swaps, quotes (`getAmountsOut/In`, `swapExact*` variants, fee-on-transfer support).

Features in this DApp

  1. Create pool via Factory `createPair`

  2. Add liquidity via Router `addLiquidity`

  3. Remove liquidity via `removeLiquidity`

  4. Read pool depth via Pair `getReserves`

  5. Price tokens from reserves

  6. Execute swaps (`swapExactTokensForTokens` and fee-on-transfer variants)

  7. Approve Router and LP tokens

  8. Query LP balances

Reference

Uniswap GitHub: https://github.com/Uniswap