Uniswap is one of the largest decentralized exchanges that allows anyone to trade crypto assets and provide liquidity to earn trading fees. Uniswap v2 allows users to buy and sell ERC-20 tokens using an automated market maker (AMM) model and liquidity pools.
Uniswap enables the creation of liquidity pools to swap one token for another. Investors can provide liquidity in pools directly from their wallets and earn yield on swaps. All interactions with Uniswap are fully transparent as they are on-chain. It is based on the Automated Market Maker (AMM) model which uses a constant product curve (x * y = k) to determine the exchange rate based on the ratio between the two assets, the trade size and the amount of liquidity within the pool. The liquidity pools charge a fee on every trade. The latest version (Uniswap V3) offers users the ability to select the lower and upper price ranges where they wish to provide liquidity on a specific pool (a.k.a. concentrated liquidity).
Uniswap makes money via protocol fees that can be optionally turned on by UNI holders through a community governance proposal. Whenever a liquidity pool is created, protocol fees are set to 0 by default. Uniswap could then receive a fraction of these transaction fees. Currently, the protocol does not charge protocol fees and all fees are earned by liquidity providers.
In order to incentivize users to create trading markets on their platform, Uniswap must pay these users who are providing liquidity into these pools in the form of swap fees. Uniswap currently distributes all of the swap fees earned for each pool directly to the liquidity providers that is proportional to the amount they deposited. For Uniswap V2, there is a 0.3% fee for swapping tokens that is fully allocated to liquidity providers.