Skip Protocol has nearly completed the Protocol Revenue module approved in Osmosis Prop 341. This first-of-its-kind module will allow the Osmosis DAO to capture the arbitrage profits that are lost to external agents in other DEXs: bots, validators, and centralized middleware providers. While the initial module will be limited to single-chain, three-hop cyclic arbitrage, as the Osmosis ecosystem expands, future iterations may include in-protocol Defi liquidations, cross-chain arbitrage, and priority blockspace auctions.
Based on historical Osmosis arb volumes, ProtoRev v1 is expected to generate $10k - $35k per $100m in DEX volume – perhaps more, now that the multihop fee discount has made OSMO-pool trades cheaper. And perhaps less, as trade routing becomes smarter and pool liquidity is concentrated. The DAO can use this revenue however it sees fit: 1) lower fees, 2) create insurance, 3) acquire protocol-owned liquidity, 4) pay stakers, 5) buy back OSMO, 6) extend emissions, or 7) fill the community pool for further development.
ProtoRev is perhaps the biggest appchain innovation since Osmosis Labs developed superfluid staking last year. It is a game-changing improvement to MEV mitigation and capture, and it creates a sustainable revenue mechanism for Defi applications. Moreover, only appchains currently have the power to conduct arbitrage on-chain in this way. Non-app chain DEXs lack the necessary full-stack, consensus-to-smart-contract controls, so they must simply accept MEV or divert it into off-chain, centralized channels.
How ProtoRev Works
When a token is bought or sold from an AMM pool, its price there tends to diverge from its price in other pools, creating the opportunity for cyclic arbitrage, a backrunning strategy that restores the pre-trade price equilibrium across pools.
To profit from this strategy, an arbitrageur begins with some amount of an asset and then trades it through multiple pools before ultimately trading it for more of the original asset. For example: a cycle might use 100 OSMO to acquire 10 ATOM, then 2700 STARS, and finally 101 OSMO.
Taken in isolation, this process is good for the health of the DEX since it keeps asset prices from going stale, improving overall UX. However, when MEV bots compete for these arbitrage opportunities, not only is the revenue taken outside the protocol but the UX is degraded by thousands of transactions as searchers strive for atomic execution across all legs of their arbitrage sequence.
ProtoRev swaps, on the other hand, are guaranteed to execute because they run outside of the regular block-building process. The module runs after every transaction in the posthandler, a Cosmos SDK feature that allows appchains to run customizable post-transaction processing. For this reason, ProtoRev does not pay gas fees, and its swap sequences – as always, barring a full-scale governance/protocol takeover – cannot be front-run, reordered, or left out.
Further, its swaps are guaranteed to profit since ProtoRev can only execute trade-sequences that output a surplus of the starting asset.
Mechanism Details: From its position in the post handler, ProtoRev watches for successful swaps. Following each of these, it looks at a set of possible 3-hop arbitrage routes that begin and end in either OSMO or ATOM. (While longer routes can be profitable, the majority of available arbs can be captured in three hops, and limiting the module’s computational load prevents it from substantially slowing down the chain.)
Among this world of possible 3-hop arbs, the module finds the most profitable greater-than-zero arb and optimally sizes the trade. It then flash-loans itself the necessary tokens from the Bank module, inserting its swap sequence before any new transactions are made, guaranteeing the trade and the profit. Finally, it burns the flash-loaned amount and directs the remaining profits to the ProtoRev account for later distribution by the DAO.
After that, the next transaction in the block is processed, and the cycle repeats. For a fuller account of the ProtoRev mechanism, see Skip’s impressively clear documentation.
Profit Sharing: According to the revenue-sharing agreement set up in Prop 341, Skip will receive 20% of ProtoRev profits in Year 1, 10% in Year 2, and 5% thereafter, provided they actively maintain the module. Other modules, such as the priority blockspace auction described below, may follow similar incentive structures.
MEV Reduction: ProtoRev is squarely aligned with the Osmosis DAO’s overall aims of reducing MEV and improving trader UX. Indeed, the module takes the bulk of backrunning arbitrage out of the realm of MEV and puts it in the hands of the DAO. This is no semantic game but an actual power shift from block producers to sovereign code that benefits regular traders, stakers, and LPs. Block producers will no longer control this form of arbitrage with their powers of transaction inclusion, exclusion, and order. Instead, ProtoRev, from its privileged, governance-directed position in consensus/block order, has the sole power to collect that revenue.
It should be noted that the module cannot perform any user-harming MEV: classically, frontrunning, and sandwich attacks. In these sorts of bad MEV, an entity with the power to affect block building watches the mempool for victim transactions (high value + wide price impact settings) in order to sneak a transaction in ahead so that it can drive the asset price away from the victim tx, giving it worse execution, and only afterward attempting to collect the stolen arb with a single-pool backrun of both transactions.
As yet, bad MEV seems not to have been a major problem on Osmosis. Nor will it become an issue with ProtoRev, since it cannot frontrun or sandwich but acts only after the normal inclusion of user transactions.
Next Steps: ProtoRev v1 is only the beginning of Osmosis MEV reduction and capture. First, and most obviously, the module itself can be improved. For example, swap routes can be solved more efficiently, allowing access to longer routes and a greater percentage of the available arbs.
It will also need to handle the concentrated liquidity (CL) pools coming to Osmosis in the coming weeks. However, these will not substantially affect how the module works since although CL positions are non-fungible, the (fungible) underlying assets can still be arbitraged across pools as normal. One thing to watch will be the amount of available cyclic arbs in CL pools since it will take more volume to produce the same revenue in CL pools. At the same time, because the trading experience should be better than in unconcentrated liquidity pools, these pools are likely to see more volume.
Second, the general model of protocol-directed arbitrage is extensible to Defi, where the bulk of liquidations in lending protocols like Mars, as well as in vaults, ETFs, CDPs, and more, can also make use of the post handler.
Finally, a similar mechanism can also handle priority block space auctions. Whatever MEV is not brought in-house by the ProtoRev module, or prevented by a threshold-decryptable mempool, can be brought in-protocol by auctioning off premium blockspace to MEV searchers, who will pay a substantial proportion of their arbitrage profits in order to have their transaction bundles accepted. Until MEV is completely solved, these auctions will be the mechanism for minimizing how much external agents can extract from Osmosis users.
Cross-chain MEV is likely to be handled with the same auction mechanism rather than with the ATOM 2.0 suggestion of a single interchain blockspace market where arbitrageurs could purchase synchronous blockspace on multiple chains at once.
While the ATOM 2.0 proposers believed this was necessary to achieve a near-guarantee of atomic execution for cross-chain arbitrage, atomicity is not necessarily a requirement for successful arbitrage. For example, if DEXs are being arbitraged against a CEX/price oracle, neither arbitrage has to be won by the same entity to guarantee profits. Moreover, the coordination problem is difficult, particularly with respect to revenue splits between seller chains, as well as any fees levied by the marketplace.
Instead, in-protocol auctions are likely to occur chain-by-chain, at least in the near term. The solution to cross-chain front-running is more likely to be something like Osmosis liquidity outposts, which may have their own liquidity or may have the power to flash-mint against the pools on the main chain, allowing for fully atomic, synchronous cross-chain transaction sequences.
The ProtoRev design is elegant and computationally minimalist, a working proof of concept for all sorts of app-specific code that can run automatically during block production in order to improve execution, guard against bad actors, and improve all aspects of the user experience.
Since only sovereign appchains can capture these sustainable non-fee revenues, they are poised to gain a sizable, ongoing UX advantage, especially as crypto apps begin to compete against their zero-fee tradfi counterparts. With the help of the Skip Protocol team, funded in part by a DAO grant, Osmosis is once again leading the way.