<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Alessio Giannini]]></title><description><![CDATA[I'm Alessio Giannini, a Blockchain & MEV Engineer with a background in enterprise software development, now focused on DeFi, MEV, protocol economics, and execution across EVM and Substrate-based chains.
I build open source tooling for MEV analysis and cross-chain data collection under xchain-mev-research.
Graduate of the Polkadot Blockchain Academy (Hong Kong, 2024).
I write about what I build and what I find — MEV mechanics, DeFi infrastructure, cross-chain architecture, and the occasional deep dive into protocol internals.]]></description><link>https://alessiogiannini.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/69c7bdbe7cf27065100b6650/144410b6-d828-43f0-a306-d8bb2d855aa0.jpg</url><title>Alessio Giannini</title><link>https://alessiogiannini.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 13:55:59 GMT</lastBuildDate><atom:link href="https://alessiogiannini.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Indexing DEX liquidity across EVM and Substrate chains]]></title><description><![CDATA[Official DEX subgraphs are built for dashboards. They produce one state snapshot per block, with no record of what happened inside it. For anyone who needs to reconstruct the exact sequence of price c]]></description><link>https://alessiogiannini.dev/indexing-dex-liquidity-across-evm-and-substrate-chains</link><guid isPermaLink="true">https://alessiogiannini.dev/indexing-dex-liquidity-across-evm-and-substrate-chains</guid><category><![CDATA[MEV]]></category><category><![CDATA[defi]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[substrate]]></category><category><![CDATA[EVM]]></category><category><![CDATA[TypeScript]]></category><dc:creator><![CDATA[Alessio Giannini]]></dc:creator><pubDate>Mon, 20 Apr 2026 08:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/fd3b204b-17f5-44f7-8ebe-ea62a9fbf806.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Official DEX subgraphs are built for dashboards. <strong>They produce one state snapshot per block, with no record of what happened inside it</strong>. For anyone who needs to reconstruct the exact sequence of price changes within a block, that resolution is a hard limit.</p>
<p>This article describes <strong>xchain-dex-indexer</strong>, an <strong>open-source TypeScript framework for indexing DEX liquidity pools</strong> on EVM-compatible and Substrate-based blockchains. The design priorities are: per-block and intra-block snapshot granularity, a unified schema across protocol types, and a chain-agnostic architecture that separates the indexing engine from chain-specific implementations.</p>
<hr />
<h2>The granularity problem</h2>
<p>A standard subgraph snapshot tells you the state of a pool at the end of a block. If ten transactions touched that pool within the block, you see only the result of the last one. The <strong>intermediate states</strong>, the ordering of those transactions, and the priority fees attached to each are not visible.</p>
<p>The sequence matters because <strong>identical end-of-block states can result from very different intra-block dynamics</strong>. Consider three scenarios that produce the same final pool price:</p>
<ul>
<li><p>A large swap followed by an arbitrage that restores the price.</p>
</li>
<li><p>A sandwich: a frontrun, the victim's swap, a backrun.</p>
</li>
<li><p>Several independent swaps that happen to net out.</p>
</li>
</ul>
<p>With one snapshot per block, these are indistinguishable. With intra-block snapshots ordered by <code>transactionIndex</code>, the sequence is recoverable and each scenario produces a distinct signature in the data.</p>
<p>This granularity enables two classes of analysis that are not possible with standard subgraph data.</p>
<p>The first is strategy <strong>simulation based on intra-block positioning</strong>. Given a pool and a historical block range, you can simulate what a strategy would have observed and executed at a given position within each block, using the actual sequence of price states rather than the single end-of-block approximation.</p>
<p>The second is <strong>block producer analysis.</strong> If you control a validator node with front- and back-running capabilities, intra-block data provides the price states needed to estimate what value a node with those capabilities could have captured across a historical block range.</p>
<p>xchain-dex-indexer addresses this at two levels.</p>
<p><strong>Per-block gap filling.</strong> Every tracked pool receives an end-of-block snapshot at every block, regardless of whether any event occurred. This guarantees a continuous time series with no missing blocks, which is a prerequisite for any statistical analysis across a block range.</p>
<p><strong>Intra-block snapshots.</strong> When multiple transactions modify the same pool within a single block, a snapshot is saved after each one, ordered by <code>transactionIndex</code>. Each snapshot carries an <code>afterTxId</code> field (null for end-of-block snapshots, the transaction hash otherwise) and an <code>index</code> field for ordering within the block.</p>
<p>Each snapshot also records <code>priorityInclusionFeePerUnit</code>, which is <code>baseFee + priorityFee</code> on EVM chains and <code>tip + weightFee</code> on Substrate. This field does not identify MEV actors, but it provides the raw input for correlating transaction position with the fee a sender was willing to pay for that position, which is a necessary input for any ordering simulation.</p>
<p>To query only end-of-block snapshots, equivalent to a standard subgraph, filter with <code>afterTxId_isNull: true</code>. To reconstruct the full intra-block sequence, query by <code>blockNumber</code> and sort by <code>index_ASC</code>.</p>
<p>Intra-block snapshots are opt-in per DEX via <code>intraBlockSnapshots: true</code> in the DEX config, so the additional storage cost applies only where sub-block granularity is needed.</p>
<hr />
<h2>Cross-chain architecture</h2>
<p><strong>The framework is designed around a separation between the indexing engine and chain-specific implementations</strong>. The core is chain-agnostic. EVM and Substrate processors are implemented as distinct abstractions at the base layer, both feeding into the same snapshot schema and the same PostgreSQL database.</p>
<p>The class hierarchy reflects this separation:</p>
<pre><code class="language-markdown">AbstractDataImporter                  ← block loop, gap filling, commit
  └── AbstractDexDataImporter         ← pool registry, snapshot tracker, per-tx dedup
        ├── V2EvmDexDataImporter      ← Uniswap V2 forks (EVM)
        ├── V3EvmDataImporter         ← Uniswap V3 forks (EVM)
        │     └── V3EvmAlgebraDataImporter   ← adapter: Algebra ABI + event processors
        ├── V4EvmAlgebraDataImporter  ← Algebra V4 (EVM)
        └── [SubstrateDexDataImporter]  ← Substrate DEX pallet indexer (planned)
</code></pre>
<p><code>AbstractDataImporter</code> owns the block loop, tracks the last processed height, and fills end-of-block snapshots for any skipped range between batches. <code>AbstractDexDataImporter</code> manages the pool registry, the per-pool snapshot tracker used for gap filling, and the per-transaction deduplication map. The EVM and Substrate implementations sit above this layer and handle only chain-specific concerns: decoding events, reading logs, and extracting fee data in the format each runtime exposes.</p>
<p>The consequence is that adding a new chain requires implementing a chain-specific processor config, not modifying the core. Gap filling, snapshot tracking, intra-block ordering, and GraphQL exposure are all inherited.</p>
<p><strong>Schema unification across protocol types.</strong> V2 (Uniswap forks), V3 (Uniswap and Algebra forks), V4 (Algebra), and custom vault types are stored in a single PostgreSQL database under a consistent snapshot structure. All snapshot entities share the same ordering fields (<code>blockNumber</code>, <code>afterTxId</code>, <code>index</code>, <code>priorityInclusionFeePerUnit</code>), so cross-protocol queries use the same filter patterns.</p>
<p><strong>Per-chain schema extensions.</strong> The schema system has two layers. <code>common.graphql</code> defines entities shared across all chains: pool types and their snapshot counterparts. Each chain can extend this with a chain-specific file, for example <code>moonbeam.graphql</code> adds <code>StDotVaultSnapshot</code> for the Nimbus liquid staking vault. At build time, a codegen script merges the two layers, generates TypeORM entities, and applies migrations to the chain's isolated database. Each chain gets its own PostgreSQL database, constructed at runtime as <code>DB_URL_PREFIX + chain_name</code>. Running codegen for one chain never touches another chain's database.</p>
<p><strong>Pool filtering via token whitelist.</strong> On public DEXs anyone can deploy a pool with any token pair, including tokens designed to mimic legitimate assets. Indexing all pools indiscriminately would pollute the dataset. Each chain defines a <code>WhiteListTokensManager</code> with a static list of trusted token addresses. A pool is registered only if both tokens are present in the whitelist. On Moonbeam, the whitelist covers native assets, XCM cross-chain assets, major stablecoins, wrapped assets, and liquid staking tokens, approximately 35 tokens total.</p>
<hr />
<h2>Extending the framework</h2>
<p>The extension model is designed to minimize the surface area of a new integration.</p>
<p><strong>Adding a Uniswap V2 fork</strong> requires four steps: defining the pool list filtered through the chain whitelist, adding a <code>DexType</code> enum entry to the schema, registering the DEX config with factory address and ABI, and enabling the importer in the chain entry point. The V2 ABI is reused across forks. The result is full gap-filling, intra-block ordering, and GraphQL exposure with no changes to the core engine.</p>
<p><strong>Adding a Uniswap V3 fork</strong> uses an adapter pattern. <code>V3EvmDataImporter</code> implements all snapshot logic, tick tracking, and gap filling against the standard Uniswap V3 event interface. A fork adapter overrides only the methods whose event signatures differ. For most forks this means one <code>EventChecker</code> and one <code>EventsProcessor</code>, each overriding one or two decode methods. The Algebra adapter (<code>V3EvmAlgebraDataImporter</code>) is the reference implementation: it injects a custom <code>AlgebraEventsProcessor</code> and <code>AlgebraEventChecker</code> into the standard V3 importer, covering the differences in swap event structure without touching the parent class.</p>
<pre><code class="language-typescript">export class AcmeDexV3DataImporter extends V3EvmDataImporter {
    constructor(dexType: DexType, parachain: ParachainInfo) {
        super(
            dexType,
            parachain,
            new AcmeDexV3EventsProcessor(DexConfig.getConfig(dexType, parachain)!.poolAbi),
            new AcmeDexV3EventChecker(DexConfig.getConfig(dexType, parachain)!.poolAbi),
        );
    }
}
</code></pre>
<p>Gap filling, snapshot tracking, intra-block ordering, and GraphQL exposure are all inherited. A new V3 fork integration adds roughly two adapter files and thirty lines of code.</p>
<p><strong>Adding a Substrate chain</strong> follows the same pattern at a higher level. <code>AbstractDexDataImporter</code> is chain-agnostic. A Substrate DEX importer would extend it with a <code>@subsquid/substrate-processor</code>, decode the relevant pallet events, and map them to the shared pool snapshot schema. The gap-filling and snapshot-tracking logic is inherited unchanged.</p>
<p><strong>Data integrity verification.</strong> The framework includes a test suite that validates indexed data against official DEX subgraphs. It samples random blocks within a configured range, queries both the local GraphQL server and the official endpoint, and diffs the results. This covers V2, V3, and V4. It was used during development on Moonbeam against StellaSwap and Beamswap subgraphs and caught several edge cases in intra-block deduplication.</p>
<hr />
<h2>Current state and roadmap</h2>
<p>The framework is deployed and tested on Moonbeam, indexing StellaSwap (V2, V3, V4), Beamswap (V2, V3), and the Nimbus stDOT vault. The Stable AMM indexer (Curve-style pools) has schema and entity models defined but the indexer implementation is not yet complete.</p>
<p>Open items on the roadmap:</p>
<ul>
<li><p>Bootstrap pool state from on-chain data at indexer start block, to avoid depending on historical event replay from genesis</p>
</li>
<li><p>Stable AMM indexer implementation</p>
</li>
<li><p>Substrate DEX pallet indexer</p>
</li>
<li><p>Docker Compose setup for one-command startup</p>
</li>
</ul>
<p>The repository is at <a href="https://github.com/xchain-mev-research/xchain-dex-indexer">https://github.com/xchain-mev-research/xchain-dex-indexer</a>.</p>
<p>Contributions and questions are welcome, particularly around Substrate chain integrations and additional EVM DEX support.</p>
<hr />
<p><em>This article is part of the series</em> <em><strong>Building a Cross-Chain MEV Bot</strong></em><em>.</em> <em>Next up: once you have the data, you need to know what to do with it. The next article covers the simulation engine — exact AMM math, price impact across sequential hops, and how to compute the real PnL of a route before committing capital.</em></p>
]]></content:encoded></item><item><title><![CDATA[The MEV Layer Cake
]]></title><description><![CDATA[Encrypted mempools are increasingly adopted as a structural response to MEV. The protection they provide is real but bounded: systems operating under this model are often assumed to be shielded more b]]></description><link>https://alessiogiannini.dev/the-mev-layer-cake</link><guid isPermaLink="true">https://alessiogiannini.dev/the-mev-layer-cake</guid><category><![CDATA[MEV]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Mempool trading bot]]></category><category><![CDATA[defi]]></category><category><![CDATA[substrate]]></category><dc:creator><![CDATA[Alessio Giannini]]></dc:creator><pubDate>Mon, 13 Apr 2026 08:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/210eb867-82bf-479c-9bb7-d57872dbb524.svg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Encrypted mempools</strong> are increasingly adopted as a structural response to MEV. The protection they provide is real but bounded: systems operating under this model are often assumed to be shielded more broadly than they are, and the <strong>residual exposure lives in layers that encryption does not reach</strong>. This article examines what that protection covers, what it does not, and why real exposure cannot be assessed at a single layer.</p>
<p>It applies to any system that executes on-chain operations under an encrypted mempool model.</p>
<hr />
<h2><strong>The Layer Cake</strong></h2>
<p><strong>MEV exposure</strong> in a blockchain system is not a single surface. It is a <strong>stack of independent layers</strong>, each with its own attack vector and its own class of mitigations. A fix applied at one layer has no effect on the others.</p>
<p><em><strong>Encrypted mempools target one layer</strong></em> <em>of this stack directly. The others remain exposed, each for different reasons and through different mechanisms.</em></p>
<img src="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/70ad9a9d-7ccf-42a4-8b81-7f36b285a3c3.svg" alt="" style="display:block;margin:0 auto" />

<p><strong>Consensus layer.</strong> The block producer controls which transactions are included and in what order. An adversarial producer can exploit this position independently of mempool visibility or transaction content.</p>
<p><strong>Protocol layer.</strong> The rules governing transaction ordering, priority, and replacement within the node software. Vulnerabilities here do not require reading transaction content.</p>
<p><strong>Mempool layer.</strong> The propagation and visibility of pending transactions before inclusion. This is the layer that encryption directly targets.</p>
<p><strong>Application layer.</strong> The behavioral surface exposed by the system executing transactions: scheduling patterns, operational cadence, strategy composition, size distribution. <strong>Encryption has no effect here.</strong></p>
<hr />
<h2>Consensus-Level MEV</h2>
<p>In systems where a small, known, and trusted set of entities produces blocks, consensus-level MEV is a limited practical concern. In <strong>permissionless systems</strong> with open validator sets, the same assumption does not hold: <strong>a validator with economic incentives can reorder or insert transactions to extract value independently of any mempool-level protection.</strong></p>
<hr />
<h2>Reactive MEV</h2>
<p>Reactive MEV <strong>requires reading the content of a pending transaction before it is executed</strong>. Front-running and sandwich attacks are the canonical forms: an attacker observes a target transaction in the mempool, infers its effect on price, and acts before or around it.</p>
<p><strong>This is the problem encrypted mempools are designed to solve</strong>, and within its scope, the protection is structural.</p>
<hr />
<h2>Structural MEV</h2>
<p>Structural MEV operates at the protocol layer and does not require reading transaction content. <strong>It exploits the mechanics of transaction ordering</strong>: how priority is assigned, how competing transactions are sequenced, and whether the protocol allows replacing a pending transaction before it is included.</p>
<p>An attacker operating in this space does not need to know what a target transaction does. <strong>Controlling relative position is sufficient to front-run or displace it</strong>. For example: an attacker who can <strong>place a transaction at the start of a</strong> block gains <strong>risk-free access to liquidation opportunities</strong> before any competitor can act.</p>
<p>The specific mechanics vary by protocol, but the common thread is that ordering rules, if they can be gamed, create extractable value independently of mempool encryption.</p>
<hr />
<h2>Anticipatory MEV: The Residual That Encryption Cannot Touch</h2>
<p><strong>Anticipatory MEV</strong> <strong>is the vector that survives</strong> encrypted mempools and protocol-level ordering fixes. It does not require transaction content visibility, <strong>only public information</strong>: on-chain history, observable cadence, inferrable strategy composition.</p>
<p><strong>An attacker who can estimate</strong> the direction and timing of a future operation can take a position before execution and exit after the price impact, without ever reading a transaction.</p>
<img src="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/43c86948-9eac-4afb-937f-8e199c2de862.png" alt="" style="display:block;margin:0 auto" />

<p>The severity of <strong>exposure depends on how predictable the execution timing is and how reliably an attacker can estimate direction and size</strong>. Both variables are determined by the system's architecture and operational behavior, not by its mempool model.</p>
<hr />
<h2>Application-Level Mitigations</h2>
<p>Mitigations for anticipatory MEV operate at the application layer. None eliminates the vector. <strong>Their collective effect is to increase the cost and uncertainty of pre-positioning until the expected payoff becomes statistically unprofitable</strong>.</p>
<p>Two categories of approach address different dimensions of the exposure.</p>
<p><strong>Timing unpredictability.</strong> Reducing the precision with which an attacker can anticipate when execution occurs forces a longer holding period, increasing capital commitment and exposure to adverse price movement during the wait.</p>
<p><strong>Size and impact distribution.</strong> Splitting operations across time and reducing the magnitude of any single event lowers the price impact available for extraction and makes individual operation sizes <strong>harder to estimate in advance.</strong></p>
<p>The appropriate combination depends on the system's specific architecture.</p>
<hr />
<h2>Conclusion</h2>
<p><strong>Encrypted mempools close one attack surface, not the full stack</strong>. Structural MEV depends on protocol-level ordering rules. Anticipatory MEV depends on how much an attacker can infer from public data. Both survive mempool encryption and require independent evaluation.</p>
<p><strong>The gap between what encryption protects and what operators assume it protects is where most unaddressed exposure lives</strong>. Closing it requires examining the full stack, and that work is necessarily protocol-specific.</p>
]]></content:encoded></item><item><title><![CDATA[How Sandwich Bots Extracted Value from Every Stake on Bittensor ]]></title><description><![CDATA[On Bittensor, for a certain period, every time a user staked/unstaked their tokens, a bot was ready to profit from it. It wasn't an exploit in the classic sense, no code vulnerability, no direct theft]]></description><link>https://alessiogiannini.dev/how-sandwich-bots-extracted-value-from-every-stake-on-bittensor</link><guid isPermaLink="true">https://alessiogiannini.dev/how-sandwich-bots-extracted-value-from-every-stake-on-bittensor</guid><category><![CDATA[bittensor]]></category><category><![CDATA[MEV]]></category><category><![CDATA[substrate]]></category><category><![CDATA[defisecurity]]></category><category><![CDATA[Blockchain]]></category><dc:creator><![CDATA[Alessio Giannini]]></dc:creator><pubDate>Mon, 06 Apr 2026 08:30:00 GMT</pubDate><content:encoded><![CDATA[<p>On Bittensor, for a certain period, every time a user staked/unstaked their tokens, a bot was ready to profit from it. It wasn't an exploit in the classic sense, no code vulnerability, no direct theft. It was <strong>MEV: Maximal Extractable Value</strong>. Value extracted from the ordering and visibility of transactions, without anything you could do about it.</p>
<p>This article explains how these attacks worked on Bittensor, why the Substrate architecture made them possible in a specific way, and how they were eliminated, first with protocol fixes, then with <strong>MEV Shield</strong>: every transaction travels encrypted until the moment of block proposal, where it is decrypted and included atomically, with no exploitable visibility window.</p>
<h3>Bittensor and its mempool</h3>
<p>Bittensor is a solo-chain built using the <strong>Substrate</strong> framework. Like all Substrate chains, user transactions pass through a <strong>public mempool</strong> before being selected and included in a block.</p>
<p>The <strong>mempool is public by design:</strong> anyone running a node can see pending transactions. This is normal and not inherently a problem, but it becomes one when someone can use that visibility to react before your transaction is executed.</p>
<blockquote>
<p><strong>Worth noting</strong>: on Bittensor, staking and unstaking are not simple transfers, they execute as swaps under the hood, which is precisely what makes them <strong>attractive targets for MEV</strong>.</p>
</blockquote>
<p><strong>One important thing to clarify upfront</strong>: Bittensor operates with a <strong>Proof of Authority</strong> (PoA) model, with known and selected validators and no open competition to produce blocks. <strong>This excludes by design the MEV extracted by the validator itself. The relevant MEV here is that of external actors, bots.</strong></p>
<h3>Why the mempool was exploitable</h3>
<p>The attack exploited three elements that combined in a particularly effective way.</p>
<p><strong>Transaction visibility.</strong> The mempool was open. A bot monitoring nodes could see every stake or unstake transaction before it was included in a block, with all the necessary information: wallet, subnet, direction, size.</p>
<p><strong>The separate EVM channel.</strong> Substrate handles transactions through a system of <strong>dispatch classes and priority</strong>. Dispatch classes define categories of transactions with different behaviors in terms of inclusion and ordering. A bug allowed EVM transactions to operate on a separate priority channel, meaning they could be included ahead of native transactions regardless of when they arrived in the mempool. For a bot, this was equivalent to a <strong>deterministic front-running tool</strong>: send your EVM transaction, it will be included before the target.</p>
<p><strong>The nonce-replace mechanism.</strong> In Substrate, as in Ethereum, every transaction is identified by a nonce. It was possible to replace a pending transaction with another at the same nonce by sending a new transaction with a higher dispatch class, even at minimal cost. <strong>Bots exploited this to make nearly free speculative bets</strong>: they pre-positioned on multiple assets simultaneously, and once they identified which subnet was actually involved, they kept that position. For all the others, where no user transaction had arrived, they sent a replace at minimal cost. The risk was almost zero: <strong>either you collected the sandwich, or you exited spending a tiny fraction of a fee.</strong></p>
<h3>Anatomy of the attack</h3>
<p>Combined, these three elements produced a classic sandwich attack, but with specific characteristics.</p>
<ol>
<li><p>The bot monitors the mempool</p>
</li>
<li><p>It detects a stake transaction on a subnet</p>
</li>
<li><p>It sends a buy transaction on the same asset (front-run) → uses the EVM channel to guarantee execution before the target</p>
</li>
<li><p>The user's transaction is executed → moves the price in the expected direction</p>
</li>
<li><p>The bot sells immediately after (back-run) → captures the price difference</p>
</li>
<li><p>Wrong bets on other assets are cancelled via nonce-replace.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/2abd95be-1a13-4bc9-a844-e6379c04ae42.png" alt="" style="display:block;margin:0 auto" />

<p><strong>In a Proof of Stake chain</strong>, <strong>the validator proposing the block could theoretically extract MEV from the decrypted content before executing it</strong>. On Bittensor, the PoA model and the accountability of known validators make this scenario substantially different from an <strong>anonymous competitive system</strong>.</p>
<h3>How the protocol responded</h3>
<p>The Bittensor team introduced a series of targeted fixes, each of which closed one of the three elements of the attack.</p>
<p><strong>Removal of the separate EVM channel.</strong> The bug that allowed EVM transactions to operate on a distinct priority channel was removed. All EVM transactions now have lower priority.</p>
<p><strong>Nonce-replace blocking.</strong> The node now blocks by default the replacement of transactions with the same nonce. Without this mechanism, speculative bets become costly: every transaction sent is a real commitment, not a cancellable bet.</p>
<p><strong>Time-based ordering.</strong> For transactions with equal dispatch class and priority, ordering is now based on arrival time.</p>
<h3>MEV Shield: decrypt-at-proposal</h3>
<p>With the structural fixes in place, Bittensor introduced the <strong>MEV Shield pallet</strong>.</p>
<p>The principle is simple: the transaction travels through the mempool as <strong>opaque ciphertext</strong>, no bot and no external node can see its contents. Decryption happens exclusively at the moment of block proposal, and the transaction is included atomically in the same block. <strong>There is no time window between the moment the content becomes visible and the moment it is executed</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/69c7bdbe7cf27065100b6650/ff46b4ee-4c20-4e83-9a0c-8728262622c5.png" alt="" style="display:block;margin:0 auto" />

<p><strong>A key note on the PoA model</strong>: <strong>in a Proof of Stake chain, the validator proposing the block could theoretically extract MEV from the decrypted content</strong>, it would see the transaction before it was executed and could act accordingly.</p>
<p><strong>On Bittensor this scenario does not apply</strong>: the PoA model implies known and accountable validators, with a substantially different risk profile and incentive structure compared to an anonymous validator in a competitive system.</p>
<h2>How much MEV was extracted and how much remains</h2>
<p>Measuring historically extracted MEV is difficult without a specific on-chain analysis. It is however possible to estimate maximum user exposure from on-chain data.</p>
<p>Based on on-chain data from the five Bittensor subnets with the highest market cap, an average $10,000 trade produces a price impact between 0.01% and 0.04%. <strong>With a slippage tolerance of 1%</strong>, which many UIs apply by default, the residual gap represents <strong>the user's maximum MEV exposure</strong> — i.e., how much an attacker could have extracted in the worst case.</p>
<p><strong>Conservative estimate: ~0.9% per stake/unstake operation.</strong></p>
<blockquote>
<p>In practical terms: on \(10,000 staked without protection, a user was exposed to a potential loss of up to \)90 per operation. With MEV Shield active and structural fixes in place, this vector is eliminated.</p>
</blockquote>
<hr />
<h2>What remains</h2>
<p><strong>The reactive and structural vectors are eliminated</strong>. MEV Shield removes visibility, the protocol fixes remove the abusable ordering mechanisms.</p>
<p>What remains is a surface that no encryption or ordering system can structurally close: <strong>publicly observable behavioral patterns</strong>. A wallet that always operates at the same time, a strategy whose direction is inferable from on-chain history.</p>
<p>Those who are unpredictable are substantially safe. <strong>Those who are not still offer a surface, small, uncertain, but present.</strong></p>
<h2>Conclusion</h2>
<p><strong>The runtime fixes and MEV Shield operate at distinct levels and complement each other.</strong></p>
<p>Without both, one alone is not enough, a correct ordering system leaves the reactive vector open, and transaction encryption alone is not sufficient if the ordering mechanisms remain exploitable.</p>
<p>The result is an architecture where <strong>classic MEV</strong>, the kind based on visibility and ordering abuse, <strong>no longer has any operational space</strong>.</p>
]]></content:encoded></item></channel></rss>