Uniswap protocol guide

Decentralized exchange primer

Uniswap and the Automated Market Maker Model Explained

Uniswap is a set of smart contracts on Ethereum and other compatible blockchains that lets anyone trade tokens directly from a wallet, without an order book, a broker, or a custodian holding the funds. Prices come from a formula and from pooled reserves that ordinary users supply.

This page explains what Uniswap actually is at the contract level, how the automated market maker math produces a price, what liquidity providers earn and risk, how the protocol has changed across four major versions, and what the UNI token governs. It is written for readers who want the mechanics rather than a marketing summary.

Abstract magenta and dark visual representing the Uniswap decentralized exchange protocol
Uniswap runs as public code on-chain. There is no company matching your trade.

What Uniswap is and what it is not

At its core, Uniswap is a family of open-source contracts that hold pairs of tokens in reserve and quote a price for swapping one for the other. Anyone can call those contracts. A trade is a transaction sent to a blockchain, signed by the user's own wallet, and settled in the same block. Nothing is deposited with an intermediary first, and no account is opened.

That distinction matters for how you should think about the system. A centralized exchange takes custody, matches buyers against sellers in an order book, and can freeze, reverse, or delay activity. Uniswap does none of these things, because the contracts have no discretion. They execute whatever a valid transaction asks for, subject only to the rules compiled into them.

The tradeoff is that responsibility shifts to the user. If you send a swap with a bad slippage setting, sign a transaction for a counterfeit token, or lose your seed phrase, Uniswap has no support desk that can undo it. The protocol is indifferent to intent, which is exactly why it is also permissionless.

It also helps to separate three things that share a name. The Uniswap Protocol is the on-chain code. Uniswap Labs is the company founded by Hayden Adams that wrote much of that code and builds front-end products. The Uniswap Foundation is a separate organization that funds grants and supports governance. A regulator, a court, or a bug can affect one without touching the others.

Uniswap Labs also operates a web interface and a self-custody wallet, but those are conveniences layered on top. The contracts can be reached through any interface, a competing aggregator, a command line script, or a raw transaction. When people say an interface delisted a token, the token is usually still tradable on Uniswap contracts directly.

Finally, Uniswap is not a single product frozen in time. Four protocol versions have shipped since 2018, each changing how liquidity is represented, and older versions keep running because nothing on-chain can be switched off by fiat. Liquidity still sits in Uniswap v2 pools years after v3 launched.

First launch

Nov 2018

Uniswap v1 deployed on Ethereum mainnet.

Core formula

x * y = k

The constant product invariant behind Uniswap pricing.

Governance token

UNI

Distributed from September 2020 onward.

Latest version

v4

Singleton architecture with hooks, live in early 2025.

How Uniswap evolved from a side project to core infrastructure

Uniswap began as an experiment by Hayden Adams, a mechanical engineer who started learning Solidity after being laid off, working from an idea about on-chain market making that Ethereum co-founder Vitalik Buterin had described publicly. The first version went live on Ethereum in November 2018 and supported only pairs between ether and an ERC-20 token.

The design was deliberately minimal. Uniswap v1 had no order book, no fee tiers, and no admin keys that could seize funds. Its appeal was that listing a token required no permission at all. Anyone could create a market by depositing both assets, and anyone could trade against it a moment later.

Uniswap v2 arrived in May 2020 and removed the requirement that every pair route through ether. Direct ERC-20 to ERC-20 pools became possible, along with flash swaps, which let a caller borrow tokens out of a pool and repay within the same transaction, and time-weighted average price accumulators that other protocols could read as an oracle.

Uniswap v3, released in May 2021, was the largest conceptual break. Liquidity providers could concentrate their capital inside a chosen price range instead of spreading it across every conceivable price, which made positions non-fungible and turned them into NFTs rather than simple pool share tokens.

  1. Uniswap v1 (2018)

    ETH paired against ERC-20 tokens, one contract per exchange, permissionless listing.

  2. Uniswap v2 (2020)

    Arbitrary token pairs, flash swaps, TWAP price accumulators, a flat 0.30% swap fee.

  3. UNI token (2020)

    Governance token launched in September, with a retroactive airdrop to past users.

  4. Uniswap v3 (2021)

    Concentrated liquidity, multiple fee tiers, positions represented as NFTs.

  5. UniswapX (2023)

    An off-chain signed-order system where fillers compete in a Dutch auction to settle trades.

  6. Uniswap v4 (2025)

    A single pool manager contract, customizable hooks, flash accounting, native ETH support.

Alongside the protocol versions, Uniswap Labs shipped supporting infrastructure that is easy to overlook but widely used: Permit2 for signature-based token approvals, the Universal Router for batching swaps across versions, a mobile self-custody wallet, and a browser extension. Encyclopedic background on the project's origins is available on Wikipedia's Uniswap article.

The constant product formula that prices every trade

Classic Uniswap pools follow one rule. Multiply the reserve of token X by the reserve of token Y and the result, called k, must not decrease when a trade happens. A pool holding 100 ETH and 300,000 USDC has a product of 30,000,000, and the spot price implied by those reserves is simply one reserve divided by the other.

When a trader adds tokens on one side, they may remove only as much of the other side as keeps the product intact. Buy a large amount of ETH from that pool and the ETH reserve shrinks while the USDC reserve grows, which pushes the implied ETH price up for the next buyer. This is price impact, and it is a feature rather than a defect. It is what stops a pool from being drained at a stale price.

The curve never touches either axis, so a Uniswap pool can never be fully emptied by trading. As one reserve approaches zero, the price of the remaining asset approaches infinity. That property gives the design an unusual robustness: there is always a quote, however bad, and the contract never needs to halt.

Swap fees enter by making the input slightly smaller than what the trader actually paid. In Uniswap v2 the fee is 0.30% of the input amount, retained in the pool so that k grows a little with every trade. Liquidity providers are not paid a separate dividend; their claim on the pool simply becomes worth more as fees accumulate inside it.

Arbitrage does the rest of the work. If a Uniswap pool quotes ETH below the price on other venues, traders buy from the pool until the two converge, and the pool keeps the fees generated along the way. No one has to update prices manually, which is why the mechanism is described as an automated market maker rather than a matching engine. The general concept is covered in the automated market maker entry.

Uniswap v3 keeps the same invariant but applies it only within a price range chosen by each liquidity provider. Mathematically the pool behaves as though it holds virtual reserves that would satisfy the constant product rule at the current price, while the real capital required to back it is far smaller. That is the whole idea behind concentrated liquidity.

Output amount with fee

The Uniswap v2 pricing function, expressed in integer arithmetic as the contracts use it.

amountInWithFee = amountIn * 997
numerator       = amountInWithFee * reserveOut
denominator     = reserveIn * 1000 + amountInWithFee
amountOut       = numerator / denominator

The 997 over 1000 ratio is the 0.30% fee. Larger trades relative to reserves produce disproportionately worse output.

Worked example

Against reserves of 100 ETH and 300,000 USDC, a 10,000 USDC buy on a Uniswap v2 style pool returns roughly 3.22 ETH rather than the 3.33 ETH a fee-free, impact-free quote would suggest. The gap is fee plus price impact, and it widens as trade size grows.

What happens when you send a swap

A swap on Uniswap is a single blockchain transaction, but several steps sit behind it. An interface first quotes the trade by simulating the pricing function against current reserves. It then chooses a route, because the best price for an obscure token may involve hopping through two or three pools rather than trading directly.

If the input token is an ERC-20, the contracts need permission to move it. Historically that meant a separate approval transaction before the swap. Uniswap Labs' Permit2 contract reduced that friction by letting users sign an off-chain message granting a time-limited allowance, so many swaps now require one signature and one transaction instead of two transactions.

The transaction then reaches a router contract, which walks the route, calls each pool in turn, and checks a minimum output amount supplied by the user. If the final amount falls below that floor, the whole transaction reverts and the trade does not happen. This is the mechanism behind the slippage tolerance setting in any Uniswap interface.

Slippage tolerance deserves care. Set it too tight and volatile trades fail repeatedly while still costing gas. Set it very wide and you invite a sandwich attack, where a searcher places a buy in front of your transaction and a sell behind it, pocketing the difference your generous tolerance permitted. On busy pools a fraction of a percent is usually enough.

Gas is a separate cost from the swap fee. Whether a Uniswap trade settles on Ethereum mainnet or on a layer-2 network changes that cost by orders of magnitude, which is a large part of why the protocol has been deployed so widely beyond mainnet. A trade that is uneconomic at mainnet gas prices may be trivial elsewhere.

UniswapX changed the flow again for interfaces that support it. Instead of broadcasting a transaction, the user signs an order that decays in price over time, and independent fillers compete to fill it, absorbing the gas cost themselves and sourcing liquidity from Uniswap pools or elsewhere. The user experience becomes closer to submitting a limit order than to pushing a transaction.

Swap Limit Send

Sell

10,000.00 USDC

Buy

3.2226 ETH
Rate
1 ETH = 3,103.10 USDC
Fee tier
0.30%
Price impact
3.22%
Max slippage
0.50%

Review swap

Static illustration of the fields a Uniswap swap interface exposes. The numbers reuse the worked example above and are not a live quote.

Providing liquidity and the economics of a position

Every Uniswap pool is funded by liquidity providers who deposit both assets of a pair. In return they receive a claim on the pool and a proportional share of the fees paid by traders. There is no application process and no minimum size beyond what gas costs make sensible.

In Uniswap v2 that claim is an ERC-20 token minted at deposit and burned at withdrawal. Because it is fungible, it can itself be moved, staked elsewhere, or used as collateral, which is how so much of the wider DeFi ecosystem ended up building on top of Uniswap pool shares.

Uniswap v3 replaced that with a position defined by a lower and an upper price bound. Capital sits idle outside those bounds and earns nothing, but inside them it backs far deeper quoted liquidity than the same money would in v2. A tight range around the current price can multiply fee income for the same deposit, at the cost of needing active management.

When price moves outside a v3 range, the position converts entirely into the weaker asset and stops earning fees until price returns or the provider rebalances. This is the practical burden of concentrated liquidity, and it is why passive providers sometimes prefer wide ranges or older Uniswap v2 pools despite lower theoretical efficiency.

The risk that gets discussed most is impermanent loss, also called divergence loss. When the relative price of the two pooled assets changes, the automated rebalancing inside a Uniswap pool leaves the provider holding more of the asset that fell and less of the one that rose, so the position is worth less than simply holding both tokens would have been. Fees may or may not cover the gap.

Impermanent loss is worst for volatile, uncorrelated pairs and mild for assets that track each other, such as two dollar stablecoins. That is the main reason Uniswap v3 introduced several fee tiers: correlated pairs need only a sliver of fee to be viable, while long-tail tokens need much more to compensate providers for the risk they take.

Fee tiers available in Uniswap v3 pools and their typical use
Fee tier Typical pairs Rationale
0.01% Stablecoin to stablecoin Prices barely diverge, so volume rather than margin drives returns.
0.05% Correlated assets, major stable pairs Low divergence risk with meaningful two-way flow.
0.30% Most standard token pairs The default inherited from Uniswap v2, balancing fee and competitiveness.
1.00% Thin or highly volatile tokens Compensates providers for large expected divergence loss.

Uniswap governance can add further tiers, and Uniswap v4 goes further by allowing pools with fees that change dynamically through a hook. Before committing capital, it is worth checking realized fee income for a pool rather than a headline yield figure, since displayed returns are usually annualized from a short recent window and swing sharply with volume.

Contract architecture from factories to hooks

The classic Uniswap layout separates core from periphery. Core contracts hold the funds and enforce the invariant, and they are written to be as small and as immutable as possible. Periphery contracts hold the convenience logic that users actually touch: routing, deadlines, minimum output checks, and wrapping of native ether.

A factory contract deploys and registers pools. In Uniswap v2 each pair is its own contract, created deterministically so any caller can compute the address of a pair before it exists. Uniswap v3 adds the fee tier to that identity, which means a single token pair may have several independent pools at different fee levels.

Routers were introduced because calling pools directly is unforgiving. The router validates the path, enforces the user's slippage bound, and reverts the entire transaction if anything is off. Uniswap Labs later shipped a Universal Router that batches multiple actions, including trades across different protocol versions, into one call.

Uniswap v4 restructured this significantly. Instead of one contract per pool, a single PoolManager contract holds every pool's state, which cuts the cost of creating a pool and makes multi-hop routes far cheaper because tokens no longer move between separate contracts at each step. Balances are netted and settled once at the end of a transaction, a pattern called flash accounting.

The headline feature of Uniswap v4 is hooks. A hook is an external contract attached to a pool at creation that can run logic at defined points in the pool's lifecycle, such as before or after a swap, or when liquidity is added or removed. Hooks make it possible to build on-chain limit orders, custom oracles, dynamic fees, or automated rebalancing without forking the protocol.

Hooks also expand the surface a user must evaluate. A Uniswap v4 pool is only as trustworthy as the hook attached to it, since that contract can charge additional fees or behave in ways the base protocol never would. Reading which hook a pool uses becomes part of due diligence, in the same way that checking a token contract already is.

Licensing has followed a consistent pattern. Uniswap v3 launched under a Business Source License that restricted commercial reuse for a period before converting to open source terms, and later versions reused the approach. The code remains publicly readable throughout, which is why so many forks appeared once each restriction lapsed.

Canonical Ethereum mainnet addresses

Widely referenced deployments. Always verify an address against an official source before interacting with it.

Uniswap v2 factory
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Uniswap v2 router 02
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Uniswap v3 factory
0x1F98431c8aD98523631AE4a59f267346ea31F984
UNI token
0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984

Illustrative router call

A single-hop exact-input swap in the style of the Uniswap v3 swap router interface.

ISwapRouter.ExactInputSingleParams({
  tokenIn:           USDC,
  tokenOut:          WETH,
  fee:               3000,          // 0.30% tier
  recipient:         msg.sender,
  amountIn:          10_000e6,
  amountOutMinimum:  minOut,        // slippage floor
  sqrtPriceLimitX96: 0
});

Shown to explain the shape of the parameters. Check current documentation before writing production code.

Comparing the four protocol versions

Because nothing on-chain is retired, all four generations of Uniswap coexist. Routers and aggregators quote across them, so a trader may end up filling on v2 for one token and v3 for another without noticing. The table below summarizes what actually differs.

Feature comparison across Uniswap protocol versions
Version Liquidity model Fees Position type Notable
v1 Full range, ETH paired only 0.30% Fungible share Proof that permissionless listing works
v2 Full range, any ERC-20 pair 0.30% ERC-20 LP token Flash swaps and TWAP oracles
v3 Concentrated within a range 0.01 / 0.05 / 0.30 / 1.00% NFT position Large gain in capital efficiency
v4 Concentrated, one shared manager configurable, can be dynamic Manager-tracked position Hooks, flash accounting, native ETH

For an ordinary swap, the version usually does not matter, since routing is automatic. For a liquidity provider it matters a great deal, because the same deposit produces very different work and very different risk in Uniswap v2 versus Uniswap v3. For a developer building on Uniswap, it determines which interfaces to import and whether hooks are available at all.

One more practical difference: gas. Multi-hop routes through separate v2 and v3 pool contracts each require token transfers, while Uniswap v4 nets everything inside the pool manager. On congested networks that difference can be the deciding factor in which venue quotes the best all-in price.

The UNI token and what it actually controls

UNI launched in September 2020 as a governance token for the Uniswap Protocol. Its most discussed feature at launch was a retroactive distribution: anyone who had used the protocol before a cutoff date could claim 400 UNI, an unusual move that rewarded prior users rather than buyers.

The initial supply was one billion tokens, allocated across community members, the team, investors, and advisors, with team and investor allocations vesting over four years. After that period the design includes a low perpetual inflation rate so that governance participation can continue to be funded without a fixed cap forcing a hard stop.

Holding UNI is not the same as holding equity in Uniswap Labs and carries no promise of revenue. What it confers is voting weight over the protocol's on-chain parameters and over a treasury of tokens that governance can spend on grants, integrations, and deployments to new chains.

The parameter that generates the most debate is the protocol fee switch. The contracts allow a portion of the swap fee to be diverted from liquidity providers to a destination that governance chooses. Turning it on would create protocol revenue but reduce the return to the people supplying liquidity, and the tradeoff has been argued over repeatedly since Uniswap v2 shipped.

UNI is also used to authorize new deployments of Uniswap contracts to other chains, since the license and the brand attach to deployments blessed by governance. That is why proposals about supporting a particular network appear regularly in the forum before the contracts show up.

For everyday users, none of this is required. You can swap on Uniswap or provide liquidity without ever touching UNI. The token matters if you want influence over how the protocol develops, or if you are evaluating the project as an investment, which is a different question from evaluating it as software.

How Uniswap governance makes decisions

Uniswap governance runs as a staged process rather than a single vote. Ideas start as forum posts, move through informal temperature checks to establish whether there is any appetite, and only then become formal proposals with executable code attached.

Voting power comes from delegation. UNI held in a wallet does not vote by itself; the holder must delegate it, either to themselves or to someone else. Delegates who publish their reasoning and vote consistently accumulate influence, which has produced a semi-professional class of participants including university blockchain groups and research firms.

An approved on-chain proposal does not execute immediately. It queues in a timelock contract for a delay, giving the community a window to react if something unexpected slipped through. Only after the delay can the transaction be executed against the Uniswap contracts it targets.

This structure is deliberately slow, and the friction is the point. Because governance can move treasury assets and adjust protocol parameters, a fast path would be a security risk. The cost is that Uniswap sometimes responds to competitive pressure over months rather than days.

The Uniswap Foundation exists in part to absorb work that governance handles badly, funding developer grants, research, and operational support so that not every task requires a vote. It is independent from Uniswap Labs, though both are oriented toward the same protocol.

Typical proposal path

  • 01Discussion thread in the public governance forum, open to anyone.
  • 02Temperature check to gauge whether the idea has support at all.
  • 03Formal on-chain proposal with the exact calldata to be executed.
  • 04Voting period in which delegated UNI is cast for or against.
  • 05Timelock delay, then execution against the Uniswap contracts.

Thresholds and periods are themselves governance parameters and have been amended over time, so check current values before relying on a specific number.

Where the protocol runs

Uniswap started on Ethereum mainnet and still treats it as the canonical home for governance and the UNI token. But high mainnet gas costs pushed activity toward rollups and other EVM-compatible chains, and governance has approved deployments across a broad set of them, including networks such as Arbitrum, Optimism, Polygon, Base, and BNB Chain.

Each deployment is a separate set of contracts with its own liquidity. A pool for a given pair on one chain has nothing to do with the pool for the same pair on another, and prices can differ until arbitrage closes the gap. Bridged versions of a token are also distinct assets, which is a common source of confusion and of costly mistakes.

Practically, this means checking which network your wallet is connected to before doing anything on Uniswap. Sending funds to a contract address that exists on a different chain, or trading a bridged wrapper you did not intend to hold, are among the most frequent user errors and neither is reversible.

The upside is real. On a low-fee rollup, small trades and modest liquidity positions become viable in a way they never were on mainnet, and rebalancing a concentrated Uniswap v3 range stops being prohibitively expensive. Much of the routine activity in the protocol now happens away from Ethereum layer 1 for exactly this reason.

Interfaces, tooling, and building on the protocol

Most people meet Uniswap through a web app that connects to a self-custody wallet, quotes trades, and manages liquidity positions. Uniswap Labs also publishes a mobile wallet and a browser extension, which fold key management and swapping into one product rather than requiring a separate wallet application.

Interfaces are not the protocol, and they can and do apply their own rules. Token lists, warning banners for unverified assets, and regional restrictions live at the interface layer. An interface fee has also been applied to some trades at various points, which is separate from the swap fee that goes to liquidity providers.

For developers, Uniswap publishes TypeScript SDKs that handle price math, route construction, and encoding calldata for the routers, along with subgraphs for indexed pool and swap data. Reading historical volume, fee income per pool, or the exact ticks of a v3 position is usually easier through a subgraph than by scanning the chain.

Integrators frequently use Uniswap in ways that have nothing to do with a user-facing exchange. Lending markets have read its oracles, treasuries have used pools to execute rebalances, and countless protocols route through it to acquire a token they need in the middle of a larger transaction. That composability is part of why the contracts matter beyond their own volume.

If you write code against Uniswap, two habits save a lot of pain. Always compute a minimum output and pass it in, since a quote taken a block earlier can be stale. And always verify the contract addresses you hardcode against current official documentation for the chain you are targeting, because addresses differ per network.

Reading pool state

A generic sketch of quoting against reserves before submitting a trade. Adapt to the version and library you use.

// 1. fetch current reserves or pool state
const state = await pool.getState();

// 2. compute the expected output locally
const quote = computeOutput(amountIn, state);

// 3. apply a slippage bound before sending
const minOut = quote * (1n - slippageBps / 10_000n);

// 4. submit with minOut so the tx reverts
//    rather than filling at a worse price
await router.swap({ amountIn, minOut, path });

Pseudocode for explanation only. Function names and shapes vary between Uniswap versions.

Risks worth understanding before you trade

Counterfeit tokens

Anyone can create a pool for any token, so a familiar ticker on Uniswap proves nothing. Match the contract address against an authoritative source.

Divergence loss

Providing liquidity is not a savings account. Price movement can leave a position worth less than simply holding the two assets.

Ordering games

Public mempools let searchers reorder around your trade. Tight slippage and private order flow reduce, but do not remove, the exposure.

Smart contract risk sits underneath everything. The core Uniswap contracts have been audited, formally reviewed, and battle-tested by years of high-value use, which is meaningful evidence but not a proof of safety. Peripheral contracts, hooks, and third-party integrations have far less scrutiny behind them.

Token contracts themselves are a distinct hazard. Some tokens implement transfer fees, blocklists, or the ability to mint arbitrarily, and behavior like that can break assumptions a Uniswap pool makes or trap a holder who can buy but not sell. The pool cannot protect you from a malicious asset.

Rug pulls follow a recognizable pattern. A team seeds a pool, promotes the token, and then removes the liquidity, leaving holders with an asset that has no market. Because listing on Uniswap requires no permission, the presence of a pool tells you nothing about the project behind it.

Approval hygiene matters too. Granting an unlimited allowance to a contract you do not understand is a standing risk, since that contract can move the approved token later. Signature-based approvals with expiries, as used by Permit2 in the Uniswap stack, reduce the blast radius, and periodically revoking stale allowances is good practice.

Finally, be skeptical of yield figures. A pool advertising an extreme annualized return on Uniswap is usually extrapolating from a brief spike in volume, or sitting on an asset whose price is about to move against providers. Fee income is real, but it is compensation for risk, not a free return.

Legal and regulatory context

Because the contracts are autonomous while the interfaces are operated by a company, regulators have generally focused on Uniswap Labs rather than on the code. That split raises hard questions that different jurisdictions have answered differently, including who, if anyone, is the operator of a permissionless exchange.

Uniswap Labs disclosed in 2024 that it had received a Wells notice from the U.S. Securities and Exchange Commission, indicating that enforcement action was under consideration. The agency later closed the investigation without bringing charges, a resolution reported alongside a broader shift in the SEC's posture toward crypto firms during that period.

Tax treatment is a separate matter and varies widely by country. In many jurisdictions each swap is a disposal that must be reported, and fee income earned from providing liquidity on Uniswap may be taxable as it accrues. This page is not tax or legal advice, and local rules should be checked with a qualified professional.

Glossary of terms used around Uniswap

The vocabulary around Uniswap borrows from trading, from cryptography, and from Ethereum engineering, which is part of why the learning curve feels steep. These are the terms that appear most often in documentation and in governance discussions.

Liquidity pool
A contract holding reserves of two tokens that traders swap against. Every market on Uniswap is one of these.
Price impact
The move in a pool's quoted price caused by your own trade, distinct from slippage caused by others trading first.
Tick
The discrete price step used by Uniswap v3 and v4 to define the boundaries of a concentrated liquidity range.
Flash swap
Withdrawing tokens from a pool and repaying within the same transaction, introduced in Uniswap v2.
Hook
An external contract attached to a Uniswap v4 pool that runs custom logic at defined lifecycle points.
TWAP oracle
A time-weighted average price derived from pool data, harder to manipulate than a single spot reading.

Frequently asked questions

Do I need an account to use Uniswap?
No. You connect a self-custody wallet and sign transactions from it. There is no registration, no deposit step, and no balance held on your behalf. The corollary is that you alone control the keys, and losing them means losing access permanently.
What does a trade on Uniswap cost?
Three things, and they are separate. The pool's swap fee, which goes to liquidity providers and depends on the tier. Network gas, which depends on the chain and congestion. And price impact, which grows with the size of your trade relative to pool depth. An interface may add its own fee on top.
Why did my transaction fail and still cost gas?
Most often the price moved past your slippage bound before the transaction was included, so the router reverted the trade to protect you. The computation still consumed gas. Widening tolerance slightly or trading a smaller size into a deeper pool usually resolves it.
Can Uniswap freeze or reverse my funds?
The contracts have no such capability, and no administrator can seize a user's assets from a pool. An interface can decline to display a token or restrict access from certain regions, but that affects one front end, not the underlying protocol.
How is Uniswap different from a centralized exchange?
A centralized venue holds your assets, matches orders internally, and can list or delist at will. Uniswap settles every trade on-chain against pooled reserves, never takes custody, and lists nothing because listing is not a decision anyone makes. You gain control and lose recourse.
Is providing liquidity profitable?
Sometimes, and it depends heavily on the pair, the fee tier, and how prices move while you are in the pool. Fee income has to exceed divergence loss and gas costs to leave you ahead of simply holding. Correlated pairs and high-volume pools are generally kinder than speculative ones.
Which version should I use?
As a trader you rarely choose, since routing spans versions automatically. As a liquidity provider, Uniswap v2 style full-range positions are simpler and passive, Uniswap v3 rewards active range management, and Uniswap v4 pools additionally depend on whatever hook is attached.
Do I need UNI to swap?
No. UNI is a governance token, not a required fee token or an access pass. You can use Uniswap indefinitely without holding any, and holding it grants a vote rather than a discount.