Uniswap

Uniswap is a Permissionless AMM for Token Swaps

Uniswap is a decentralized token marketplace where an automated market maker - software that prices trades - uses liquidity pools, or shared onchain token reserves. Its smart contracts let a self-custodial wallet swap supported assets without an order book or account approval. The protocol began on Ethereum and now operates across several EVM-compatible networks. Users also provide liquidity, developers integrate the contracts, and UNI holders govern defined protocol parameters.

Swapping USDC for WETH Without an Order Book

A USDC-to-WETH trade suits Uniswap when both assets share one supported network and the selected route has enough active liquidity. The wallet sends USDC, and the route returns WETH in one atomic transaction.

The quote comes from pool state, not from standing buy and sell orders. A router examines direct and multi-pool paths, then presents an expected output, price impact, liquidity-provider fee, and network cost. A DAI trade might pass through WETH when that route offers deeper executable liquidity than a direct DAI pool. Universal Router can combine route steps, while Permit2 manages scoped token permissions. The transaction either meets its encoded minimum output and settles, or the chain reverts every state change as a unit.

The same mechanism serves treasury rebalancing, wallet conversions, and application-level exchanges. Pool creation adds another use: an issuer or community seeds two assets so a market can begin.


Preparing the Wallet and Network

Uniswap starts cleanly when the wallet, token addresses, selected network, and gas asset all refer to the same chain.

Ethereum uses chain ID 1, while Arbitrum One uses 42161, Base uses 8453, Optimism uses 10, Polygon uses 137, and Unichain uses 130. These identifiers prevent a wallet from treating assets on separate ledgers as interchangeable. ETH pays network costs on Ethereum, Arbitrum, Base, Optimism, and Unichain; POL fills that role on Polygon. A token with the same ticker on two networks still has a different contract address and balance. That distinction decides whether the intended pool is reachable from the connected wallet.

  1. Select the network that already holds the assets.
  2. Choose tokens by contract identity, not by symbol alone.
  3. Reserve enough of the network asset for gas.
  4. Review the route, expected output, and minimum received.
  5. Authorize the input token when required, then sign the swap.

An ERC-20 token normally needs an allowance before a router can transfer it. Permit2 separates the durable onchain allowance from a later signature that limits a spender, amount, and time. Native ETH does not require an ERC-20 approval. Keeping some gas asset outside the swap amount leaves the wallet able to submit the transaction.

What Does a Uniswap Swap Cost?

A Uniswap swap costs the pool fee, network gas, and any execution loss caused by price impact or route movement.

At the other end, Uniswap v3 defines four fee tiers: 0.01%, 0.05%, 0.30%, and 1.00%. Uniswap v2 uses one 0.30% tier, while v4 permits static or dynamic fees chosen by each pool. The displayed tier is charged against the swap input. Network gas goes to the chain’s validator or sequencer process, not to the liquidity pool. Price impact comes from trade size relative to active liquidity; it rises when a route consumes a larger share of available depth. The quote brings these separate cost drivers into one decision.

Worked example. Assume a hypothetical input of 1 000 USDC and a hypothetical network charge worth 4 USDC. A v2 pool applies its fixed 0.30% fee, producing a 3 USDC pool fee. The two explicit costs total 7 USDC before price impact, so the reader should compare the final quoted output rather than subtracting only gas.

Related details are covered in Uniswap in practice. Low gas does not ensure a strong quote. A deep 0.30% pool may deliver more output than a shallow 0.05% pool after price impact.

Liquidity Positions, Fee Income, and Range Exposure

Liquidity provision fits Uniswap users who accept two-asset price exposure in exchange for a share of fees from active trades.

Within those limits, Uniswap v2 spreads each position across the full price curve and represents ownership with fungible UNI-V2 tokens. Versions v3 and v4 use concentrated liquidity, so the provider chooses a lower tick and an upper tick. Those positions appear as ERC-721 non-fungible tokens because separate ranges and fee histories are not interchangeable. One tick changes price by 0.01%, following the ratio 1.0001 to the power of the tick index. The v3 tick range runs from -887272 through 887272. Every position boundary aligns with permitted tick spacing.

For that reason, Uniswap v3 links its four fee tiers to tick spacings of 1, 10, 60, and 200 respectively. Narrow spacing gives finer range placement; wider spacing reduces the number of initialized boundaries. A position earns fees only while the market price sits inside its range. If price crosses one boundary, the position becomes inactive and eventually holds 100% of one asset until price returns. Fees do not erase divergence between the position and simply holding both tokens.

Range choice therefore governs workload as much as yield. Narrow ranges concentrate capital near the market, while wider ranges require fewer adjustments.


How Do Uniswap Pools Set a Price?

For a regular user, Uniswap pools set prices from reserve mathematics and active liquidity, while arbitrage trades keep those prices near broader markets, as set out in Uniswap guide.

In v2, a pool holds two ERC-20 reserves and applies the constant-product invariant x × y = k. Taking one asset out requires adding enough of the other, after fees, to preserve the invariant. Each additional unit moves the reserve ratio, which creates price impact. Uniswap v3 divides the curve into ticks and combines only the liquidity active at the current tick. The next initialized boundary changes the active liquidity set, so a large swap can cross several ranges and execute at several marginal prices in sequence.

That said, Uniswap v4 keeps concentrated liquidity but moves pool state into one PoolManager contract. Flash accounting records interim balance deltas and settles only net token movements at transaction end. Each v4 pool attaches no more than one hook contract, while one hook can serve many pools. The hook address exposes 14 permission bits for callbacks around initialization, liquidity changes, swaps, donations, and return deltas. EIP-1153 transient storage supports the accounting design, and native ETH removes the mandatory WETH step for v4 pools that use Ether directly.

These versions remain separate smart-contract systems. Routers choose among available pools, so the quoted path reflects liquidity and rules from the exact versions it crosses.


Trade-Offs and Alternatives by Workflow

The decisive Uniswap trade-off is direct onchain control paired with network costs, changing quotes, token behavior, and pool-specific contract logic.

Swappers face price impact in shallow pools and still pay network cost when a submitted transaction reverts. Liquidity providers face range inactivity, asset rebalancing, and the possibility that earned fees trail the value of simply holding the pair. Uniswap v4 hooks widen the design space, yet their rules sit beside the core PoolManager logic and must be evaluated per pool. Rebasing, reflection, and debasing tokens are incompatible with the v3 and v4 routers. An ERC-20 allowance stays effective until it is spent, changed, or revoked; Permit2 signatures add their own expiry.

Alternative venues separate different workflow priorities. Curve concentrates on stable and closely correlated assets. Balancer supports weighted multi-token pools, while SushiSwap provides a familiar constant-product AMM model. The 1inch aggregator searches routes across decentralized exchanges; CoW Swap uses solver competition and batch settlement. A centralized exchange such as Coinbase supplies an account-based order book and internal custody. The choice rests on four named dimensions: custody, route formation, fee source, and asset support. Comparing the final executable quote keeps those dimensions tied to the actual trade.

Composable contracts and self-custody define Uniswap’s strongest fit. Fiat funding, familiar account recovery, or a conventional order book points toward another venue.

Key questions about Uniswap

Do I need UNI to make a Uniswap swap?

No, a Uniswap swap does not require the UNI governance token; the wallet needs the asset being sold, enough of the network’s gas token, and any required ERC-20 allowance, while UNI mainly supports governance functions and does not provide an automatic protocol-wide discount on the liquidity-provider fee that the selected pool itself charges.

Can native Bitcoin be traded in Uniswap pools?

Native BTC does not run inside Uniswap’s EVM smart contracts. A pool on Ethereum or another EVM-compatible network instead uses a tokenized representation, such as WBTC, with its own contract address and custody model. That asset is distinct from BTC on the Bitcoin network. Moving between them requires an external bridge, custodian, or conversion workflow beyond the pool swap itself.

Why does ETH sometimes appear as WETH in a route?

WETH appears because ERC-20-based routers and pools need a token contract that represents Ether through the same interface as other assets. Uniswap v2 and v3 use WETH for those paths, and wrapping preserves a one-to-one claim on ETH. Uniswap v4 also supports native ETH directly, so the exact route determines whether wrapping occurs during execution.

Are Uniswap core contracts upgradeable after deployment?

Deployed Uniswap core contracts are designed as immutable protocol versions rather than contracts that an administrator rewrites in place. Uniswap v2, v3, and v4 remain separate systems, and routers can select liquidity across them. Governance controls defined parameters and protocol-owned components, but it does not turn an existing core version into the next one. Integrators therefore identify the exact version and deployment address they call.

Will a hardware wallet work with Uniswap?

A hardware wallet works with Uniswap when its companion software or wallet connector supports the selected network and transaction type. Ledger, Trezor, and SafePal devices keep signing keys on the device, while a compatible interface prepares the call data. The user still reviews and signs approvals, swaps, or liquidity actions. Network gas comes from the same address on the active chain.

What happens if an ERC-20 token has no existing pool?

An ERC-20 token without a pool has no Uniswap liquidity route until someone creates a compatible pool and supplies assets. Pool creation is permissionless, so there is no central listing application. The first deposit establishes the starting ratio, and subsequent trades move the pool price. A ticker alone does not identify the asset; the network and contract address define the token used by the pool.

Who controls my tokens between Uniswap swaps?

A self-custodial wallet controls idle tokens; Uniswap does not maintain a user account that holds them between swaps. During a standard swap, contracts transfer the authorized input and deliver output atomically within the transaction. Liquidity is different because deposited assets remain in pool contracts until the position owner removes them. The wallet’s UNI-V2 tokens or position NFT represents that ownership claim.

Is a cross-chain Uniswap swap the same as a pool swap?

No, a cross-chain Uniswap swap combines asset movement between networks with a swap, while a pool swap executes on one chain. The Uniswap interface can coordinate bridging through Across and route the destination trade, but the bridge step introduces its own fee, timing, and dependency. The quote should therefore be read as a composed workflow rather than as one AMM pool changing two balances on one ledger.

Updated: