Hoyu Protocol Fee Mechanism is Resilient Against MEV
In this post, we show that even in most extreme conditions, only a part of the protocol fee may be diverted away by a Maximal Extractable Value (MEV) searcher. Borrowers, lenders, and traders are completely unaffected.
Consider a HOYU-CUR market, where HOYU is protocol token, CUR is a stablecoin. If a HOYU-CUR market is available, every CUR borrower pays the Hoyu protocol fee by sending 5CUR or 0.5% of the principal (whichever is greater) to the HOYU-CUR trading market (DEX Pool; the Pool) at the moment of borrowing. This mechanism is akin to paying HOYU tokens to use the protocol. The CUR sent to the HOYU-CUR pool is not swapped; it is merely transferred there, and the sync function of this Pool is called to update its state. These actions increase the CUR side of the Reserves of the Pool. Since the change happens abruptly, in principle there is a possibility to extract value from such a transaction by sandwiching it. Here we analyze if and when value extraction is possible.
We limit this discussion to conditions favorable to MEV searchers and unfavorable to the Hoyu protocol. In particular, we assume that there is a single HOYU-CUR market, i.e., there is no HOYU/CUR arbitrage possible due to the existence of other markets. We also exclude gas expenses from our discussion, in other words, gas is free. Note that the HOYU-CUR Pool is the usual uniswapV2 Pool, which charges a 0.3% swap fee. Finally, we will assume that HOYU cannot be borrowed from other sources on chain, contrary to CUR, which can be borrowed without cost in any amount, provided it is repaid within the same transaction.
The MEV extraction in question consists of the following steps:
- Borrow CUR (open the flashloan);
- Buy HOYU for CUR;
- Put the protocol fee into the Pool - that's the borrower transaction;
- Sell HOYU for CUR;
- Repay the CUR flashloan.
Upon analyzing these actions, the following MEV searcher profit condition emerges:
where is the Hoyu protocol fee, stands for the CUR reserves in the HOYU-CUR Pool, comes from the 0.3% swap fee and yields . This means that some value extraction is possible for extremely illiquid HOYU-CUR pools or extremely large loans. More concretely, these actions become profitable when the CUR reserves in the HOYU-CUR Pool are approximately 166 times the protocol fee. In other words, maximizing the loan size (such that Hoyu protocol fee is maximized) or draining the CUR reserves away from the HOYU-CUR Pool could make some value extraction possible. Let us consider some concrete scenarios.
If the loan in question is under 1000CUR, the protocol fee is 5CUR. This represents a straightforward threshold: the MEV bundling is unprofitable as long as there is 830CUR or more in the HOYU-CUR Pool.
For loans larger than 1000CUR, the situation becomes slightly more complex since these loans depend on multiple factors. Let us consider a market for another generic token ALT, which stands for altcoin, and CUR. Recall that the loan size in CUR is limited by the ALT collateral, and also by the CUR reserves in the ALT-CUR Pool. In particular, assume that the largest possible loan is limited by a fraction of the CUR reserves in the ALT-CUR Pool. If that Pool has sufficiently large CUR reserves, the Hoyu protocol fee will be
where are the CUR reserves in the ALT-CUR Pool. For example, for , we find that the MEV searcher profit condition becomes approximately
which means that this profit-sharing MEV opportunity is possible only when there is 12x more CUR in the ALT-CUR Pool as compared to the HOYU-CUR Pool.
Here, the MEV searcher is effectively taking a part of newly-arriving CUR away from the liquidity providers of the HOYU-CUR Pool. It is important to note that no other actors are affected. In particular, lenders, borrowers, and traders in any of the Pools are not affected. Furthermore, liquidity providers of the ALT-CUR Pool are not affected either. Finally, even though the searcher takes part of the CUR that would otherwise end up with the HOYU-CUR liquidity providers, the MEV searcher still pays the swap fee, and thus makes sure that HOYU-CUR liquidity providers receive some fraction of the Hoyu protocol fee in every case.
To summarize, a protocol fee distribution mechanism theoretically introduces an opportunity for MEV searchers. However, this opportunity presents itself only in most extreme circumstances, and even in this worst-case scenario it merely diverts a fraction of Hoyu protocol fee, without harming other protocol participants.