This is the paper detailing the research behind my talk "Optimizing fee estimation via the mempool state" (the presentation only covers part of the paper) at Scaling Stanford (this coming Sunday). Feedback welcome. https://bc-2.jp/mempool.pdf