Revisiting Fees and Impermanent Loss
A deep-dive into the rationale for THORChain’s fee models and how it affects Impermanent Loss
THORChain is a decentralised liquidity network to facilitate cross-chain liquidity pools with no pegged or wrapped tokens. THORChain processes inbound transactions, reaches consensus on them, and then applies swap logic. The result is an outgoing transaction which is then signed and broadcast back to the relevant external network.
THORChain’s fee model has some design requirements unique to its purpose. When users interact with the network, they demand three different things:
- They are using the network’s liquidity (assets staked in THORChain liquidity pools)
- They are using the network’s computational resources (to witness, process and sign transactions)
- They are using resources on external networks (computational resources to pay for outgoing transactions and gas fees)
THORChain has two fees to cover these things:
- A fixed Network Fee, which pays for network resources as well covering external gas costs. The Network Fee is a multiple of the 7-day trailing average of gas prices.
- A slip-based Liquidity Fee, that pays for demand of liquidity.
The liquidity fee is designed to do two important things. Conceptually, fees are both value-capture and access-control mechanisms.
The fees need to capture value from those accessing the resource, and pay it to those providing the resource, and in this case the resource is liquidity. However liquidity is relative to the size of the transaction that demands it over the depth of the market that will service it. A small transaction in a deep pool has less demand for liquidity than a large transaction in a small pool.
The other reason for fees is access-control; a way to throttle demand for a fixed resource and let natural market forces take over. If there is too much demand for a resource, fees must rise commensurately. The resource in this case is liquidity, not market depth, thus fees must be proportional to liquidity.
Fixed-rate fees (such as Uniswap’s 30 basis points) have poor value-capture and access-control when considering the nature of the resource being paid for, which is liquidity, and not market depth. Since fees are proportional to trade size (volume), the pools with the largest depth will attract the most volume and thus the most fee revenue. This potentially leads to a bootstrapping problem, where low-depth pools have less incentives to add liquidity, even though the demand for liquidity may be much higher.
Additionally, the fixed-rate fee model has poor access-control, since in a high-demand scenario, the fees do not increase. As a result, a fixed-rate fee model is vulnerable to sandwich attacks since an attack can be performed for a cost of only 60 basis points. A sandwich attack is an attack where a victim’s order is sandwiched by two large bi-directional trades. The consequence of this is that XYK pools cannot be used reliably as price feeds.
An alternative fee model is the slip-based fee model. Since demand for liquidity is defined as the size of the transaction over the depth of the market that will service it, then a fee which is proportional to liquidity solves key problems.
Firstly it has better value-capture when demand for liquidity is high, no matter the size of the transaction or the depth of the market. This means that over time, pool depths will settle to an equilibrium that is relative to the sizes of transactions that are passed over it. This solves the bootstrapping problem, because low-depth pools may turn out to be more profitable than high-depth pools to liquidity providers.
Secondly it has better access-control, since the more a trader (or attacker) demands liquidity, the more they have to pay for it. This makes sandwich attacks prohibitively expensive allowing pools to become reliable price feeds.
Additionally a slip-based fee is stateless and non-opinionated. The final fee paid is always commensurate to the demand of resources (both internal and external) no matter what it is.
Impermanent Loss is a term derived from the Uniswap community to describe how, through the act of providing liquidity on both sides of a pair, the net sum of assets loses relative purchasing power when prices move away from the entry price.
The team, on preliminary analysis, wrote a blog where they described the slip-based fee model as preventing impermanent loss to liquidity providers, since by the same rate at which prices move, slip-based fees pay back liquidity-providers. Whilst true, this turned out to be a misdirection when considering the case of arbitrage, where traders need to capture an edge since they are profit-seeking. Insight from the Balancer Labs team was valuable in helping the THORChain team understand this.
When arbitrage occurs, an entity wishes to exploit a price delta between two different markets. They can continue to trade up until the cost to perform the trade exceeds the profit from closing the delta, or the price delta no longer exists (due to either market moving).
For Uniswap, most of its volume is in fact arbitrage and its highest volume days are during high market volatility. This makes sense, since liquidity pools are in fact large bounties to restore prices back to what is considered correct.
In a system of fixed-rate fees, the trader who is first to take an opportunity will take it all. However, in the case of slip-based fees which brings in the imperative of time, traders are forced to share the opportunity.
Looking at a single trade, the following is apparent. As the trader attempts to take more of the opportunity, the fee paid for the privilege of doing so increases commensurately. The trader will make a margin the entire time, but there is a sweet spot where their margin is at a maximum. Any higher than this, the fee will reduce their margin. This sweet spot is between 1/3rd and 1/2th of the opportunity (relationship yet to be derived).
Slip-based fees force traders to share the opportunity and choose between being patient with small trades (and small margins) or being impatient with large trades (and small margins). Efficient traders will attempt to make the ideal trade indicated above, however they are all in competition with each other.
Since it is not possible to close the opportunity in a single trade, there are several trading strategies that could emerge, influenced largely by how patient the trader is.
With a starting pool described below, and a 10% arbitrage opportunity, the team identified 9 different trading strategies, and compared to the XYK+30BP set-up.
The 1x trade is simply making the largest trade possible to capture the delta, yet still close out in profit. This is the most impatient trade, leaving the pool with very little Impermanent Loss.
2x — 7x (down)
The next class of trades start with the 2x — 7x (down) trades, where the trader makes a number of trades, each trade 50% the size of the previous and chasing ever diminishing returns. The final margin is summed and shown. The margins asymptote to around ~70% of the margin captured by XYK+30BP, with higher number of trades (more patient) leaving the pool with a small Impermanent Loss (no more than 65% of that experienced by XYK).
The next trade strategy is patient, 7x (flat), where the trader makes 7 small trades, each of equivalent size. They extract the most margin from the pool (0.2045) and leave the pool with the highest Impermanent Loss, around the size of the XYK Impermanent Loss.
The final trade strategy, 7x (up), is also patient, but starting with small trades and doubling in size. The trader makes similar numbers to 7x (down) in size. However, during the first 6 trades the entire opportunity could have been taken by any other trader.
There will be other trading strategies, but the ones discussed above seem most likely.
Various Price Changes
The team re-visited the case of arbitrage across several different price changes and used the 7x (down) trading strategy, since this seems to be the safest (and most effective) trading strategy in the face of competition. The team took Balancer’s example of a pool with 100 DAI and 1 Ether as the scenario.
This was repeated for target prices of 105, 110, 120, 150, 200 and 400.
It can be seen that in all cases the Impermanent Loss for CLP pools is less than that for XYK pools. The exact relationship will be derived at a future point in time.
Note: CLP in this analysis includes the Liquidity Fee, but does not include the Network Fee or Liquidity Incentives. Liquidity Incentives (block rewards from the Protocol Reserve) are around 20% in the first year, decreasing to 2% after ten years. In reality, Liquidity Incentives are likely to mask any perceived loss well into the first 3–5 years.
You can view the team’s calculations here: (Google Sheet Link).
Preventing Network Spam
The astute observer will note that slip-based fee models encourage small trades, however this does not take into account the following:
- Traders are in competition with each other, and those who do not quickly take the margin will lose it to the other
- The fixed Network Fee provides a baseline that forces traders to not undertake small trades
- THORChain will have mempool-selection technology that orders transactions based on fee-value, so high-value trades are processed first.
As such the Team don’t subscribe to the perspective that slip-based fee models will encourage inefficient trading, since traders are purely profit seeking. If a trader can lock in a margin, they will tend to make more and more aggressive trades to pursue profits. In the end, the liquidity providers benefit from the impatience of traders.
The team have revisited THORChain’s fee model and how it plays out with Impermanent Loss. Insight from the Balancer Team was invaluable in helping understand the unique problem of arbitrage across liquidity pools.
The team maintain the CLP slip-based fee model is more appropriate for public liquidity pools than the XYK + 30 BP fee model, since it has better value-capture and access-control mechanisms. The resource being demanded is liquidity, which is relative to transaction size and market depth, thus a liquidity-based fee makes more sense. By forcing market participants to be patient and share opportunities, pool prices inherit inertia and changes slow down. This makes them suitable to become price feeds without needing moving averages.
The team intend to validate all economic assumptions around THORChain, which include the liquidity fee, prior to mainnet with third-party input.
The team also thank the community for their commentary and engagement in learning more about this. Fernando Martinelli (CEO of BalancerLabs), alongside other members of the community, was able to review this article before being published. The team wish to contribute in a meaningful way to liquidity networks and bonded curves, so welcome further input and analysis.
The team will leave up the previous blog for historical purposes but will add a note articulating that the slip-based fee model does not remove Impermanent Loss in all scenarios.
To keep up to date, please monitor community channels, particularly Telegram and Twitter: