🤖🧱⛓ Stateful Blockchains, MEV, and Flashbots [Scratch Space]

  • This repository contains my notes, scripts, code through my journey into stateful blockchains and miner profit.

  • Flashbots maintains a proof-of-concept communication channel for users to send their Ethereum transactions directly to miners.


Episodes


Code


Further references


Terminology

  • Mempool: the set of pending, unconfirmed transactions in the EVM.
  • MEV: Maximal (or miner) Extractable Value
  • Frontrunning: also known as Priority Gas Auctions (PGAs), when a miner steals a profitable opportunity (such as arbitrage) for themselves by sending the same transaction with a higher gas price. For example, a transaction A is broadcasted with a higher gas price than an already pending transaction B so that A gets mined before B (eg. to snatch a Uniswap price arbitrage trade to rebalance a pool).
  • Backrunning: a transaction A is broadcasted with a slightly lower gas price than already pending transaction B so that A gets mined right after B in the same block. (eg. to execute a DyDx liquidation after a price oracle update that triggers a DyDx loan to go under the required collateralization ratio).
  • Sandwiching: profiting off slippage in liquidity pools by buying and selling before and after large transactions posted in the mempool.
  • DEX arbitrage: If two DEXes are offering a token at two different prices, one can buy the token on the lower-priced DEX and sell it on the higher-priced DEX.
  • Liquidations: if the value of a borrowed asset exceeds the collateral, anyone can liquidate the collateral and collect the liquidation fee for themselves.
Description
👾 notes and resources on blockchain's maximal extractable value: on the hope of non-predatory free markets in the metaweb
Readme 2.3 MiB
Languages
Shell 50.1%
Python 46%
Dockerfile 3.9%