The paperExchangeCrypto WikiWikiAcademywiki.notitiaplatform.com
Sign in
● LIVE
CAC 408 347,4▼ 0.22%S&P 5007 297,1▼ 1.47%EURO STOXX6 201,5▼ 0.31%BTC/USD46 155▲ 7.70%ETH/USD1 434▲ 8.42%EUR/USD1.08▲ 0.06%BRENT91.63▲ 0.00%GOLD3 783,3▲ 0.00%OAT 10Y5.02%▼ 1.06%VIX21.67▲ 17.39%CAC 408 347,4▼ 0.22%S&P 5007 297,1▼ 1.47%EURO STOXX6 201,5▼ 0.31%BTC/USD46 155▲ 7.70%ETH/USD1 434▲ 8.42%EUR/USD1.08▲ 0.06%BRENT91.63▲ 0.00%GOLD3 783,3▲ 0.00%OAT 10Y5.02%▼ 1.06%VIX21.67▲ 17.39%
 
Europe edition
Notitia

Decentralised exchange (DEX)

A token exchange run by smart contracts where you keep your keys: Uniswap, Curve.

From wallet to blockchain
1Private keyproves ownership2Transactionsigned3Validationminers or validators4Ledgerpublic, tamper-proof

An automated market maker

On a classic exchange, buyers and sellers meet in an order book. On most decentralised exchanges, such as Uniswap, you trade against a pool: a contract that holds two tokens and sets the price from their ratio. The most common rule keeps the product of the two quantities constant (x x y = k).

Liquidity providers deposit both tokens and earn the fees on every trade, in exchange for the risk of impermanent loss.

The x · y = k curve: the bigger the order, the more the price slips
0 k200 k400 k50100150200ETHUSDCbefore · $2,000after selling 10 ETH · $1,653
Formula
x × y = k
x and y
quantities of the two tokens in the pool, k constant before fees.
Worked example

The impact of a large purchase

  1. Pool: 100 ETH and 300,000 USDC, price $3,000, k = 30,000,000.
  2. You add 30,000 USDC: the pool holds 330,000.
  3. ETH left: 30,000,000 / 330,000 = 90.91; you receive 9.09 ETH.
  4. Average price paid: 30,000 / 9.09 = $3,300, 10% above the quoted price.

The larger the order relative to the pool, the stronger the price impact.

Common mistakes

  • Ignoring the maximum slippage allowed: a bot can buy just before you and sell just after.

Questions and answers

DEX or centralised exchange?

On a DEX you keep your keys and no intermediary can freeze your funds, but you bear mistakes and contract risk. On a centralised exchange, it is the other way round.

Notitia newsroom · education, not investment advice.