Decentralized trading on permission-less blockchains has many interesting properties—an efficient form of price discovery between buyers and sellers, and no intermediate parties taking a cut. Smart contracts are the intermediaries and require no trust.
There's another incentive (see Blockchain incentives) at play that changes the dynamic of decentralized finance: Miner Extractable Value (MEV).
MEV is a form of arbitrage on transactions performed by miners while they are mining new blocks. The arbitrage opportunity comes from the miners' ability to:
- see pending transactions before they are verified and added to a new block
- specify the order of transactions within a block.
Miners take advantage of these two abilities to extract value in a few ways.
DEX Arbitrage. Tokens are trading on two exchanges at different prices. Buy one token on an exchange and sell it on the other in an atomic transaction.
Frontrunning. Find a profitable transaction that has yet to be approved, e.g., mispriced assets or even someone else's arbitrage trade. Copy the transaction but replace the addresses with ones that belong to you.
Find a large trade that will move the bid-ask spread and trade in the direction of that trade (e.g., buy, process large buy order, sell). Likewise, one could do the same for NFTs.
Forced Liquidation. Some lending protocols have certain thresholds that allow lenders to be margin-called with forced liquidation and an additional liquidation fee. MEV bots find eligible borrowers and margin call them.