Genesis Arbitrage

Genesis Arbitrage · · 2 min read

DEX (decentralized exchange)

A DEX (decentralized exchange) is a venue where you swap crypto straight from your own wallet through smart contracts, with no account and without handing funds to an exchange. The price is usually set not by an order book but by a liquidity pool, a reserve of two tokens that you trade against.

How the price is formed

A classic pool follows the constant product rule.

When you buy a token, there is less of it in the pool and its price rises. The smaller the pool relative to the trade, the bigger the move.

Example

Say a pool holds 100,000 tokens and 100,000 USDT, so the price is $1.00. You buy with $1,000 and receive about 990 tokens: the average price is roughly $1.01. The trade cost you 1% more, and that is before the pool fee. In a pool ten times larger the difference would be about 0.1%.

DEX vs CEX

FeatureDEXCEX (centralized exchange)
Where funds are heldIn your walletIn an exchange account
Where the price comes fromLiquidity poolOrder book
CostsPool fee and gasExchange fee
Who adds tokensAnyone can create a poolThe exchange decides

Since anyone can create a pool, fake tokens and honeypots show up on DEXs.

DEXs in arbitrage

The price in a pool changes only through trades, so it lags behind the exchange price and differs between networks. Arbitrage between DEXs and exchanges is built on this; the lesson What is DEX arbitrage explains where to start. Subtract gas and slippage from the spread, and check the pool's liquidity before a trade.

Questions and answers

Do you need to sign up to use a DEX?

No. You connect a wallet and confirm the transaction. The keys stay with you, so keeping them safe is your responsibility too.

What fees does a DEX charge?

A pool fee, usually a fraction of a percent of the amount, plus network gas. On top of that, a large trade moves the price in the pool.