Uniswap

Uniswap is an automated market maker for onchain token swaps

Uniswap is a decentralized exchange, meaning smart contracts run it, and its liquidity pools are shared token reserves that quote onchain swaps. Traders keep control of their wallets while those contracts calculate prices, collect pool fees, and settle token transfers. Concentrated liquidity lets market makers assign capital to chosen price ranges rather than every possible price.

That design connects three decisions: which network to use, which route offers enough depth, and whether the quoted output justifies its pool fee, network cost, and price impact together before signing.

Pool depth and trade size decide whether price impact outweighs a lower fee tier.

Direct token exchange from a self-custody wallet

Uniswap gives self-custody wallet users a direct way to exchange compatible tokens, with smart contracts executing against pooled reserves on the selected blockchain network without opening an exchange account. The swap preserves wallet custody: the input tokens leave only when the signed transaction executes, and the output returns to the address or chosen recipient.

This workflow suits users who already hold assets on Ethereum, Arbitrum, Base, Optimism, or another supported deployment and want an onchain conversion. A route might exchange ETH for USDC in one pool or pass through WETH when an intermediate market offers deeper liquidity. The Universal Router can combine Uniswap v2, v3, and v4 pools inside one transaction, while Permit2 reduces repeated ERC-20 approval transactions. The quote matters as a complete package: output amount, route, pool fee, price impact, network cost, and minimum received should be considered together before signing.


Price movement, pool depth, and execution limits

Price impact and slippage are separate execution risks on Uniswap: the first comes from your trade, while the second comes from market movement before settlement.

Price impact grows when an order consumes a large share of active liquidity. A deep ETH/USDC pool absorbs a given trade with less movement than a shallow pool using the same assets. Slippage tolerance serves another role: it defines the lowest acceptable output before the transaction reverts. A wide tolerance increases execution latitude, whereas a narrow tolerance rejects more price movement. The quote’s minimum-received field turns that percentage into the token amount that governs settlement. Route depth and market conditions can change between quote creation and block inclusion, making that minimum the clearest execution boundary.

Liquidity providers face a separate inventory effect. When the relative price changes, arbitrage rebalances the pool, leaving the position with a different token mix. Concentrated positions also stop earning fees outside their selected range. The relevant comparison is fee income against that inventory change, gas expenditure, and any hook-specific behavior. A companion page walks through Uniswap guide.

A pre-swap decision checklist

A Uniswap swap deserves confirmation only after the quoted route, minimum output, network, token contracts, and wallet balance all match the transaction you intend to execute.

This decision checklist ties each screen value to a concrete stop-or-continue condition. Apply it while every quote field remains available for inspection. A mismatch should return you to the quote before the wallet issues a signing request.

  • Proceed only when the wallet network matches the asset network; identical symbols across chains do not imply an identical contract.
  • For a conventional wallet flow, leave enough native currency to cover the quoted network cost before submitting the transaction.
  • Compare minimum received with the amount your intended use requires, rather than relying only on the larger headline quote.
  • Stop when a token contract address differs from the asset contract that you intended to exchange.
  • Reduce the trade or choose a deeper route when price impact consumes the conversion advantage that motivated the swap.

Pool fees, network costs, and route selection

The cost of a Uniswap swap combines the pool’s liquidity-provider fee, any enabled protocol or interface charge, price impact, and the network’s execution fee together.

For most users, Uniswap v2 assigns a 0.30% swap fee to every pool. Uniswap v3 defines four established fee tiers: 0.01%, 0.05%, 0.30%, and 1%. One basis point equals 0.01 percentage points, so the latter three correspond to 5, 30, and 100 basis points. The selected pool, rather than the token pair alone, determines the charge. A 0.05% pool may quote worse than a 0.30% pool when its active liquidity is thinner. The fee applies to the swap input and accrues around active liquidity positions, so routing compares output after fees and price movement.

By contrast, Uniswap v4 removes a fixed menu. Pool creators select fees from 0% through 100% in 0.0001% increments, or configure a dynamic-fee pool whose hook updates the rate. Gas remains separate and follows the chosen chain’s demand and transaction work. Multi-hop routing can improve the token quote yet add computation. The decisive comparison is net output after pool charges, price impact, and network execution.

Concentrated liquidity for market makers

Concentrated liquidity lets Uniswap market makers deploy two assets inside selected price boundaries, earning fees only while the market trades through their chosen active range, as explained in Uniswap explained.

A position specifies a lower tick and an upper tick. Within that band, its capital participates in swaps and receives its proportional fee share; outside the band, the position becomes entirely one asset and fee accrual pauses. Narrower bands place more liquidity near the chosen price, increasing capital efficiency at the cost of more active monitoring and rebalancing. Wider bands cover more movement but spread the same capital across more prices. Unlike a v2 deposit, each v3 position has unique bounds and is represented by an ERC-721 non-fungible token.

A v3 pool spans ticks -887272 through 887272, and usable position boundaries must align with that pool’s tick spacing. The 0.01%, 0.05%, 0.30%, and 1% tiers use tick spacings of 1, 10, 60, and 200, respectively. Each tick changes the price ratio by a factor of 1.0001, which equals a 0.01% step.

Market makers choose ranges by weighing expected price movement, fee tier, active liquidity, and the cost of repositioning. Tax records also become more detailed because additions, removals, and fee collections create separate onchain events.

Four protocol generations, four design choices

Four Uniswap protocol generations remain relevant because each encodes a different balance of simplicity, capital efficiency, routing support, and pool-level customization for integrators and users. Uniswap v1 paired ERC-20 tokens only against ETH, while v2 introduced direct ERC-20 pairs and fungible ERC-20 liquidity tokens.

Said differently, Uniswap v3 concentrated liquidity into chosen ranges, added multiple fee tiers, and represented positions as ERC-721 NFTs. Uniswap v4 retains range-based liquidity while consolidating pool state in PoolManager, supporting native ETH, flexible fees, and hooks. These versions are separate deployed contracts, so liquidity does not migrate merely because a later generation exists. The Universal Router can route across v2, v3, and v4, giving swappers access to fragmented depth without manually selecting a version. Builders start with v4 for new integrations, while existing markets continue to use earlier pools.


UNI governance and protocol control

UNI gives delegated holders voting power over protocol governance, including authority over treasury actions, fee parameters, and contracts that execute approved onchain proposals through voting.

UNI follows ERC-20 and uses 18 decimal places. One billion UNI were minted at launch in September 2020, including 43% for the community treasury, 15% for historical users and liquidity providers, 21.27% for team and future employees, 18.04% for investors, 0.69% for advisers, and 2% for an initial liquidity program. Governance retains authority to mint up to 2% of total supply annually. Delegation assigns voting power while the tokens remain in the holder’s wallet.

Formal onchain proposals require 1 million UNI delegated to submit and 40 million UNI voting in favor to pass. A 2-day voting delay precedes a 7-day voting period, followed by a 2-day timelock after approval. Protocol fee assets can enter an onchain process that obtains and burns UNI. That mechanism does not grant holders a direct proportional claim on the collected assets.

Wallet setup and first transaction

A first Uniswap transaction requires a compatible self-custody wallet, the assets on one supported network, and enough of that network’s native token for execution costs.

MetaMask, Rabby, Coinbase Wallet, and Uniswap Wallet provide EVM-compatible signing flows. Choose the network before selecting assets because USDC on Base and USDC on Ethereum occupy different contracts and balances. A conventional Ethereum transaction needs ETH for gas; Arbitrum, Base, and Optimism also use ETH as their native execution token.

Most ERC-20 inputs need an approval before a router can transfer them. Permit2 separates a one-time onchain token approval from a later signature carrying defined permissions. After approval, review output, minimum received, fee, price impact, route, and network cost, then sign the swap. Save the transaction hash with your wallet records so the final state remains easy to identify.

How does Uniswap set a swap price?

Even so, Uniswap sets each swap price from the active liquidity in a pool, then moves that price along the curve as the trade changes token balances.

The v2 design expresses the basic relationship as x × y = k. Here, x and y are the pool’s two reserve balances, while k is the invariant that trading preserves apart from accumulated fees. Buying token y removes it from the pool and adds token x, so y becomes progressively more expensive along the curve. A larger order travels farther, creating greater price impact.

The v3 and v4 designs divide that curve into tick ranges. Only liquidity active at the present tick contributes to the immediate quote; as a swap crosses a boundary, another set of positions enters or leaves the calculation. This makes visible reserve totals less informative than active depth near the execution price. It also explains why two pools holding the same pair and charging different fee tiers produce different outputs.

Arbitrage trading links pool prices to wider markets by trading price differences away. The protocol itself does not import a company-set price list for ordinary swaps. Each quote emerges from pool state, route composition, fees, and the exact input amount submitted.


Curve, Balancer, CoW Protocol, 1inch, and centralized exchanges

Curve, Balancer, CoW Protocol, 1inch, and centralized exchanges answer different trading needs, so the right alternative follows from asset type, workflow, and custody preference together.

Curve’s StableSwap invariant concentrates efficiency around assets expected to trade near a common value, such as USDC and DAI. Balancer supports weighted pool designs, which suit portfolios whose target proportions differ from the equal-value constant-product pattern. Both remain automated market makers, yet their pool math and market focus differ. A quote comparison should include output, gas, approval state, and route complexity because each venue creates a different execution path.

CoW Protocol gathers signed orders into batch auctions and lets solvers seek settlement through coincidences of wants plus onchain liquidity. 1inch aggregates routes across multiple liquidity sources. Coinbase uses a centralized account, custody model, and order-book workflow, which changes access and settlement assumptions. Uniswap emphasizes self-custody and direct pool access. Venue aggregation, batch execution, stable-asset specialization, and account-based exchange remain separate requirements served by the other workflows.

Hooks and flash accounting in v4

In those conditions, Uniswap v4 moves every pool into one PoolManager contract, then lets optional hooks change defined moments around initialization, swaps, liquidity changes, and donations during execution.

Earlier versions deploy pools as separate contracts; v4 stores their state inside the singleton. Flash accounting records interim balance deltas in EIP-1153 transient storage and settles only the final net amounts when the caller’s operation ends. This reduces intermediate token transfers during multi-hop or multi-action execution. Pool creation becomes a state update rather than deployment of another pair contract. Native ETH support removes the compulsory WETH9 wrap-and-unwrap step for pools that pair Ether directly. PositionManager issues an ERC-721 position token, while PoolManager uses ERC-6909 claims for internal accounting.

A hook is an external contract selected when a pool is created. Its callbacks run before or after defined actions and can implement dynamic fees, custom oracle updates, liquidity rules, or alternate accounting. Hook behavior belongs to that individual pool, so two pools with the same token pair can expose materially different execution rules.

Fee flexibility expands accordingly: v4 supports static values from 0% to 100% in 0.0001% increments, while dynamic capability is fixed at pool creation even though the rate later changes. Traders should therefore read the route at pool level, rather than merely at token-pair level. Builders gain a programmable settlement layer, and users gain more varied markets under one protocol architecture.

Still wondering about Uniswap?

Can any ERC-20 token have a Uniswap pool?

Any compatible ERC-20 pair can have a permissionless Uniswap pool when someone initializes it and supplies liquidity. Creating a pool does not establish meaningful depth, a reliable market, or router compatibility. Rebasing, reflection, and debasing token mechanics are unsupported by the v3 and v4 routers, so contract behavior matters as much as the token standard used.

Are completed Uniswap swaps reversible?

No, a confirmed Uniswap swap changes blockchain state and has no protocol-level cancellation or chargeback. A pending transaction might be replaced or cancelled through a wallet before inclusion, but success depends on network handling and timing. Once settlement confirms, reversing the economic position requires a new swap, with a fresh quote, pool fee, price impact, and network cost.

Do I need UNI to pay for a swap?

UNI is not required to trade or pay network execution costs on Uniswap. Gas uses the native asset of the selected network, such as ETH on Ethereum, Base, Arbitrum, and Optimism. UNI serves governance functions through delegation and voting. The tokens involved in the swap, plus the native gas asset for a conventional wallet flow, are the relevant balances.

When does a Uniswap token approval expire?

An ERC-20 approval does not expire by time unless the token or approval mechanism encodes such a limit. Standard allowances remain until they are spent, changed, or revoked. Permit2 adds signature-based permissions that specify a spender, amount, and expiry after the token receives its onchain Permit2 approval. A wallet may therefore show both a durable token allowance and a shorter permission for one router.

Does a Uniswap v3 position need to be burned after liquidity is removed?

No, a Uniswap v3 position NFT can remain in the wallet after its liquidity reaches zero. The ERC-721 token identifies the position and its pool parameters, while liquidity and uncollected fees are separate state values. Removing principal does not automatically destroy that identifier. Burning becomes a distinct action only after liquidity is zero and the position no longer holds collectible tokens.

Is native Bitcoin compatible with Uniswap pools?

Native BTC on the Bitcoin network cannot enter an EVM Uniswap pool directly. A deployment accepts assets represented on its own chain, so Bitcoin exposure requires a compatible token representation issued through a separate system. That representation has its own custody or bridging model. Different contracts can share a BTC-style symbol, making the network and contract address decisive.

Updated: