Thursday, March 30, 2023

FTX's Mythical Origin Story

 One of the biggest mysteries about the Sam Bankman-Fried (SBF) debacle has been how he initially vaulted into the wealth stratosphere. The standard story is that he made a fortune on the price discrepancies between bitcoin in Asia vs. the US exchanges in 2017. Even SBF critic CoffeeZilla accepts this narrative, making it seem like SBF was a great trader caught in an anomalous crash. Most people accept the story uncritically, and my favorite version is this.

It was a daring feat of arbitrage—SBF is the only trader known to have pulled this off in any meaningful way—one which quickly made him a billionaire and achieved the status of legend.

Alameda’s capture of the kimchi premium (and other trades like it) gave SBF the grubstake he needed for his next move: founding the crypto exchange FTX

Unsurprisingly, the narrative he promoted was a lie. The money Alameda made on the Kimchi premium was gone within a couple of months, and they generated zero profits before starting FTX in the spring of 2019. The most likely explanation for his ascent was the faking volume on his new exchange, which enabled him to bring in VC money. With prominent VC backers and an exchange, he could issue a token and sell those for more money, access customer deposits on FTX, and make stupid investments that would only work in the first half of a bubble. 

This highlights a persistent crypto problem. On the one hand, you have regulated exchanges that do not offer leverage, trade a limited number of coins, can expropriate, and restrict access via KYC, but are audited by independent third parties. On the other hand, you have unregulated exchanges that will give you 100-1 leverage in meme-coins and permissionless access but are trusted black boxes. It is what game theorists call a ‘separating equilibrium,’ and regulators should know they bear responsibility. Like prohibition laws, draconian crypto regulation encourages a large dangerous black market.

The Kimchi Premium Trade and Loss

Alameda was started in September 2017 by SBF, Tara Macaulay, and Gary Wang. All were members of the Effective Altruism movement living in the San Francisco bay area. SBF and MacAulay both had sinecures at the Centre for Effective Altruism, a charity headed by William MacAskill that focused on rationality and optimization (see his TED talk here). The focus is on utilitarianism ($1000 matters more for a poor person), marginalism (smaller projects have greater returns), and existential risks that threaten generations a thousand years in the future (e.g., the AI apocalypse). These abstract concerns tend to attract analytical atheists, your typical Ph.D.

MacAulay had a background in pharmacy and health economics. Gary Wang was a childhood friend of SBF and worked for Google as a software engineer on the site’s front end for booking airline flights. SBF was given an introduction by MacAskill to Jane Street in college, and afterward, there for a couple of years, where he traded a variety of ETFs, futures, currencies, and equities. While this often is used to portray SBF as a precocious trader, there is no evidence. Someone with two years of experience, even if working for Goldman or Citadel, is still very ignorant and has little discretion in their job. Not only the Alameda founders but all of the initial Alameda employees were enmeshed in the EA community, and none had significant finance or crypto experience.

While I can only speculate why SBF et al. thought they could make money as crypto investors, there is a plausible explanation. MacAskill, like many analytical futurists, was familiar with crypto. In 2017 bitcoin was booming, and as an asset with unprecedented global reach, the new exchanges worldwide were not well connected. Thus in May 2017, the price in Korea would occasionally reach a 50% premium over the US, a huge opportunity.


To arb this, one would need to make the following trades:

1. Buy bitcoin on Coinbase or Gemini with USD.

2. Send bitcoin to Japan

3. Sell bitcoin in Japan for yen

4. Sell yen for USD

5. Wire USD to Coinbase

6. Repeat

Wiring large amounts of money to a new account raises many red flags for regulators and compliance officers suspicious of money laundering, which is a cause for many severe regulatory fines. There are know-your-customer (KYC) rules, caps on withdrawals, citizen requirements, etc. This is where a trusted network pays off: a confidant with connections in Japan could handle one side of the transaction, and another in the US handling the connections to the US financial institutions.

MacAskill must have realized his tight-knit EA community was well-suited for this task. It had access to capital, as a funding report suggests around $10B in funding committed as of 2017. This capital is not spent immediately, and simple utilitarian logic implies that it would be a good thing if they could make arbitrage profits to fund more charities. The EA community in San Francisco was not only close but from all over the world, and young. This would allow them to place trusted people in various countries, which is necessary to set up banking accounts to arbitrage these country premiums.  

Many financial dynasties were founded on a kinship network that reduced transaction costs. For example, when Mayer Rothschild sent his five sons to the major capitals of Europe around 1800, this allowed them to move capital much more quickly than those doing business merely backed by their reputation and civil law. Trust removes the delay in drafting contracts because you can be confident that the recipient of your money will not just disappear. Similarly, the EA community was small enough, and a shared vision of the ultimate good is a great foundation for trust. They could then get people into Korea or Japan to execute an arbitrage unavailable to anyone without a presence in both nations. As the opportunity was temporary, the speed generated by the trust was crucial.

As this Kimchi premium was the only trade mentioned by SBF before January 2018, it seems the obvious motivator, and MacAskill created the team to profit off this specific mispricing, internalizing his experience placing people at Jane Street and then waiting for their donations.

While the bitcoin premium disappeared when Alameda started in October 2017, it returned in December. Alameda tried to get around Korean capital controls, but this proved impossible,  which is why it was so anomalously large. Japan, however, was different. An EA colleague in Japan set up a bank account at a Japanese regional bank. Once SBF executed the arbitrage successfully with a small amount of money ($50k), he had a proof-of-concept that anyone could understand. At that point, wealthy EA members Luke Ding and Jaan Tallinn invested $50 to $100 million to capture this trade (see here and here for lower and upper bounds).

Given round-trip transaction costs were probably at least 2%, and it would take at least two business days to complete the transaction, estimates that Alameda made $10 to $30 million seem reasonable. Note that while the premium reached 15%, its average that month was only 5%. As Ding and Tallinn had given Alameda virtually all of its capital for these initial trades, they could demand an outsized percentage of the profits on these initial trades because Alameda was acting merely as a broker as opposed to a discretionary trader at that point. Everyone knew what needed to be done.

Alameda may have made several million dollars in January, but it was soon gone. Bitcoin fell by 40% by April, Etherum by 60%, and other coins more than that. SBF was blamed for several losses in that period, such as:

A long ETH position

OTC shitcoin trades

A botched XRP trade

Transferring a USDT to a bitcoin address

SBF was not merely a bad programmer, an incoherent advocate of crypto principles, but an incompetent trader.

With these failures and the Japanese premium over, big funders Ding and Tallinn had seen enough and demanded their money back in March, leaving Alameda with little capital. Most Alameda insiders blamed SBF, so in April, MacAulay and others offered to buy SBF out for $1M, but he refused, so they left to start their own firm, Pharos Capital (aka Lantern). As most trading firms pay bonuses annually, it is doubtful Alameda has a large bonus pool because leaving forfeits one’s bonus. Further, as a co-founder, SBF would have had legal ownership of a sizeable amount of the bonus pool, so any buy-out would have to include a premium over that.

In October 2018, another Alameda trader, Victor Xu, left to join Pharos. If Alameda made a boatload from April through October 2018, it is unlikely that Xu would have left then instead of waiting until the following year to get his bonus. This all suggests Alameda had virtually zero accumulated profits at the end of 2018, after the Kimchi trade that most think funded FTX.

Throughout 2018, SBF’s focus was on raising money to start FTX. In January 2019, Alameda  sponsored an event at Binance Blockchain Week in Singapore, promising 20% returns “risk-free.’ Somehow he got the money to start FTX, which began trading on May 1. FTX reported $50 million daily trading by June 11, which grew steadily. Volume reportedly rose steadily until it hit $300 million daily on July 5, two months after inception (see here). They had only ten employees.

This was sufficient to get $8MM in funding from well-known crypto VCs Race Capital, FBG, Consensus Labs, and Galois Capital in late July. FTX launched its token on July 31 with an initial market cap of $30 million. By the end of 2019, SBF convinced Binance head CZ to invest $100 million for a 20% stake.

At that point, FTX had enough money to capture the crypto bull market starting in June 2020. Through the end of 2021, bitcoin would rise by 400%, Etherum by 1500%, and new coins like Solana and Shiba Inu would rise 10-fold. Thus, the subsequent growth of FTX is straightforward, as Alameda/FTX was investing in small coins and funding new projects.  

The volume stats FTX presented to VCs in July 2019 were almost surely fake. If you search on Google or Reddit for “FTX Exchange” before July 5, you find almost nothing. How could an exchange generate such volume without notice on the entire internet?

Just before FTX pitched the VCs in July, it released a white paper on fake trading, summarized like a press release by several media sites (see Forbes). This would make total sense if FTX was faking their trades, as they realized fake volume was a common tactic because it was feasible and effective. In creating their own fake trading statistics, they would necessarily learn to avoid fake trading signatures, as several reports had examined this phenomenon back then. Common tactics included regurgitating the trading tape from larger exchanges with minor modifications, implausibly small bid-ask spreads, having most trades post within a bid-ask spread, etc. A white paper on fake trading would have been the ultimate complementary good for someone engaging in fake trading stats.

Accusing others of doing something wrong before even being accused is disarming. Non-psychopathic people think no one would be so bold as to do what they campaign against. However, it happens all the time. For example, the government-led disinformation campaign on social media was done under the pretext of fighting disinformation. Their tendentious definitions of truth, or ‘higher truths,’ revealed them as the primary disseminators of disinformation.

It’s an SBF staple to inadvertently reveal his scammy tactics with the overconfidence typical of narcissistic fraudsters. In his April 2022 Bloomberg interview, he explained yield farming in a way that, as Matt Levine noted, was a classic Ponzi scheme. SBF responded, ‘that’s one framing of this,’ as if it was not a Ponzi if it had not collapsed. CoffeeZilla made a YouTube video on that bizarre interview that, in retrospect, is quite humorous. I suspect this same Ponzi mindset was behind the initial VCs and CZ’s interest in 2019. While I am long-run bullish on crypto given government fiat incentives, one has to admit the current crypto community is a hive of scum and villainy on par with Mos Eisley.

The EarnToGive Alignment Problem

EA community was instrumental in creating the SBF train wreck. Not only did it supply all of the initial personnel and capital, but their wealthy and well-connected leaders would also give investors much reassurance. Further, the EA vision, applied to entrepreneurship, creates a classic misalignment of incentives. It centers on a profound flaw in their ‘earn to give’ and ‘80000 hours’ initiatives, promoted most conspicuously by MacAskill and Sam Harris, who were both big SBF supporters all the way through November 2022 (I think they are both innocent, but this naivete should disqualify them from administering a large charity ).  

Earning to give involves deliberately pursuing a high-earning job or investment strategy as an instrumental goal to maximize their ultimate goal, ‘total welfare,’ the present value of the utility of billions of people over the infinite future. The EA conceit is that you can be a superstar, lawyer, entrepreneur, or investor while seeing it purely in instrumental terms. Anything not directly helping others, like giving food to the starving, or preventing existential risks like an AI apocalypse, is irrelevant in itself. It’s fine to be a well-paid rodeo cowboy or disc jockey, but only as a means to a much more ennobling end. The emphasis makes it highly unlikely one will excel at lawyering, investing, etc.

Almost everyone knows that their ultimate objective is not their day job. The difference is that the status or importance of most jobs is virtually indefensible within the EA worldview. In a traditional family, the loving wife of a great attorney loves not only that her husband’s income supports their family, but she feels pride in his excellence at his craft. The husband can then focus on his job, knowing that it not only supports his family but generates appreciation from those he loves most, as well as clients and colleagues. This helps him to focus and apply himself, making him an excellent attorney.

In a modern economy, the division of labor makes it virtually impossible to see how our jobs move the needle. It takes faith in the market, where the division of labor prices services at their marginal value, to believe that if you are well-paid for doing something, it adds to world utility, even if it is not as transparent as handing food to a starving child, or getting a million likes for a TED talk on saving the planet. Though this does not work perfectly, it works naturally, undirected, better than any centralized plan.

Abstract thinkers have always had a problem appreciating the value of various professions in an economy. Socialists thought that one could do without the entire field of finance and advertising. What did they produce? It has been a good thing that most people respond to market forces instead of intellectuals when choosing professions.

The earn-to-give ethos degrades all instrumental fields, those not contributing directly to the magical EA objective function. Given the nature of most people’s jobs, pride in their work would reflect a pathetic unworldliness. If you, and those you love, consider your job as important as a Clown Car driver, it’s inconceivable you will become elite in that field.

It is not rational to expect to make outsized returns on an avocation. In a competitive economy, builders of great companies not only have a vision but pay attention to details, the way that John D. Rockefeller implemented efficiencies in oil refining using meticulous cost-benefit analysis and understanding scale efficiencies. Rockefeller was a devout Christian and preferred fellow teetotaling Baptists like himself as partners, so he did not ignore his ultimate objective at work. However, he had confidence that doing one’s job well, whatever it was, was a great way to serve God. Most people not focused on abstract conceptions of world utility have no pangs of guilt doing something they find profitable and interesting. That allows them to focus and become great at it.

In contrast, the only people who boldly proclaim their EarnToGive attitude is consistent with extra-normal profitability are fools and frauds, like SBF.

Friday, March 24, 2023

Uniswap LP Profitability Update

 Most crypto traders are confused by the Impermanent Loss (IL) generated in Uniswap’s Automated Market Maker (AMM). The question below posed on the Uniswap Reddit page is an earnest query that, unfortunately, generated the same answer quality a Medieval doctor would have offered on how to prevent scurvy. 

Impermanent loss is an unavoidable consequence of the liquidity provider’s (LP’s) negative convexity. If you could avoid this cost via hedging, options would not have an option premium; they would be priced at intrinsic value. Methods to avoid this loss by providing liquidity to pools with two volatile tokens like ETH and WBTC, or pools with three or more coins, make the IL less conspicuous instead of removing it. 

Crypto enthusiasts must understand that LPs generally lose money in AMMs due to IL. It is difficult enough to predict the future, but knowing the present is a lot more straightforward and provides the basis for any prediction. 

Deriving the IL for an AMM

I will start first with a basic derivation of IL for a constant product AMM. I will apply this to the ETH-USD pair, but these formulas apply to any token pair. 

We start with the formulas for ETH and USD pool tokens. Liquidity is both an intuitive and technical term within the AMM, and p here would apply the price of ETH in terms of USD. 

The value of this LP pool position at any time is given as follows.

Substituting for the token amounts given the above pool equations, we get can derive this simply in terms of the price and liquidity for an LP.

Taking the derivative of the LP’s pool value with respect to the price, we get the delta

The derivative of the delta, or second derivative of the pool value, is thus

Given this gamma in the AMM pool, we can apply this to the Black-Scholes formula for convexity cost (gamma/2 times variance), which gives us

The convexity cost equals the option premium via an equilibrium argument where profits are zero: if they were positive, it would not be an equilibrium because sellers would enter the market; if profits were negative, sellers would exit. This argument is used in the famous Black-Scholes equation. 

This method of estimating the convexity cost is to determine the option value of an option. 

 Convexity Cost = option premium

This does not mean a convexity payout equals its cumulative convexity cost in every case. A single option payout represents one observation like a draw from a normal distribution reflects the distribution. 

 ATM straddle payoff = N(optionPremium, spayout)

For an AMM LP position, which is like an ATM straddle, the convexity cost is the expected IL instead of an actual IL. This is also the IL a good market maker should approximate, in that good LPs hedge their delta risk, and hedging does not change the expected IL, but minimizing its variance reduces capital costs.

 Convexity Cost = E(IL)

With the convexity cost function for an AMM, we can apply the daily volume and liquidity data from Uniswap’s pools and the actual daily volatility for the assets to calculate the average daily profitability for the LPs of these pools. I used daily liquidity and volume data from two of the most prominent Uniswap pools. I calculated the daily variance using the daily price and minute-downsampled price data daily. I then present the monthly average daily data to see if it’s trending. This is in the table below.

Uniswap ETH-USDC Pool Profitability

Monthly data contain average daily values. Average daily volatility was taken from down-sampled minute data. Gross Margin is (revenue-convexity cost)/revenue. Liquidity and volume data are from Uniswap’s Ethereum mainnet. Data through March 21.


This table shows that LPs have consistently lost more money via their IL than they made in trading fees. Worse, there is no trend. 

The best explanation for the persistence of LPs despite losing money is that they are not calculating the option cost. This would explain the lack of growth, as smart money is not entering this new market. 

Why are LPs so Stupid?

One reason the LP convexity cost is not appreciated is that it is not a direct cash charge. Instead, it’s cost relative to a pair of assets, as opposed to a simple USD value, which is uncommon. Consider the LP’s pool value, which can be represented as a linear function of the square root of the ETH price. 

In comparison, the value of their initial deposit is a linear function of price, given an initial deposit of x USD and y ETH.

The value of the initial deposit and the LP function are equal initially. However, as the LP value function is concave, and the initial portfolio value is linear, we know the LP’s future pool value will always be less than the initial portfolio pairs. The value of the LP position as a function of the ETH price is an increasing concave line tangent to the value of the LP’s initial deposit, as seen in the figure below. In equilibrium, fees should compensate for this predictable loss. 

The daily IL is imperceptible without proper accounting. For example, the daily ETH price volatility is around 4%, and half of an LP’s pool value is from ETH, while the IL averages around 0.03%. Further, the benchmark is ambiguous. When the price of ETH rises, the LP’s pool value also rises (segment D in the figure below), just less than it would have if not in the pool (segments C+D). When ETH prices decline, the pool position declines (A+B), but so would their original portfolio (A), though less so. To appreciate the option they are implicitly selling, they would have to look at their position relative to an initial position that most only remember at its USD value. 

IL Cost Superficially Ambiguous

LPs ignorance is not remedied by more academic studies of LP profitability. Almost all focus on the realized IL of actual LPs assuming none of them hedged. This is like testing option returns by looking at the returns on options independent of the hedge, which no institutional option market maker does (I used to work for one). For example, a significant study by Topaze Blue (Loesch et al., 2021) found that Uniswap pools generated $199.3M in fees over a period that incurred $260M in IL, and 49.5% of LPs lost money. Such a takeaway obscures the profound fact that the LPs lose money because it is tempting to think that those LPs with clever tactics were among the half that made money, and all one has to do is figure out what those tactics are. 

Realized ILs will equal the convexity cost over many years, but the realized IL will have much greater volatility in small samples. This is related to why option sellers hedge their positions: reduced volatility reduces risk, which reduces required capital. If option market makers hedge their portfolios, those researching option expenses should use estimates as if the option was hedged. That is implicit in comparisons of implied to future volatility.

Why Realized IL is a Bad Metric 

To help see the relative efficiency of these two approaches for estimating IL, I estimated the small-sample properties of both approaches using a Monte Carlo simulation. As I present about 600 daily Uniswap pool observations in my Uniswap LP profitability table above, I generated the price paths over 20 periods of 30 days to get a sense of the sample volatility. I recorded the mean and volatility of the two ways of measuring IL: realized IL based on starting and ending price, and convexity cost based on daily volatility. 

Monthly Realized IL in Monte Carlo 

I assumed fixed liquidity and had an initial price of 100. As I am interested in comparing one approach to the other, the specific numbers are irrelevant as long as they are the same for both approaches. We are looking at the relative differences generated by these IL estimation methods. The monthly realized IL in the samples can be simplified to the following (they are mathematically identical).

Monthly Convexity Cost

For the convexity cost approach, I used the basic formula derived above, that is:

Applying this using time series of price and volatility generated the following formula for each monthly estimate. 

These two formulas were applied to one million simulations to estimate means and standard 

Monte Carlo Estimation of Uniswap LP Costs

ETH minute-down-sampled data from July 2021-March 2023 were used to estimate daily volatility. These daily volatility estimates generated a heteroskedastic random price time series. 20 sets of 30-day realized IL and convexity costs. Both approaches assumed a liquidity=1000 and an initial price of 100.

The absolute numbers do not matter, but the relative ones do. The results above show these approaches have approximately equal mean estimates for the IL, as expected. However, the sample IL approach had a three times larger standard deviation. Intuitively this makes sense because the convexity cost approach uses daily prices to estimate the next day’s price variance, information any hedger would use when managing their convex positions. In contrast, the realized IL approach uses only the start and end prices. As with many options results, many ways exist to prove and intuit these findings. results. The bottom line is that the convexity cost formula dominates the sample IL approach to estimating expected IL (something a good hedge can lock in). 

There should not be much doubt that LPs are consistently losing money. Those LPs fortunate not to lose money in the TopazeBlue study were simply random draws that were below average instead of clever. 

I don’t want to pick on TopazeBlue. Still, if one of the most prominent studies of ILs is misleading, it is understandable most LPs, who are not quants, will not see that LPs lose money outside of random shocks that obscure this loss when not hedged. The lack of LP profitability also explains why well-capitalized groups are not adding liquidity to these AMM pools. 

Solutions Are Generally Lame

One hope for these AMMs is that volume increases substantially. We can see both the 0.05% and 0.30% Uniswap ETH-USDC pools generate losses, but the lower-fee pool losses are considerably greater. Thus, one potential solution would be to eliminate the 0.05% pool, which would drive the ETH-USDC traders to the 0.30% pool. That might help, but I do not see how it could be mandated.

Most other standard solutions are less promising. Note that given these pools lose money, no amount of capital efficiency helps, which includes yield stacking. If you can take your LP tokens as collateral elsewhere, that doesn’t make them profitable; it just means you are leveraging your money-losing investment. A stock that loses 12% a year is not turned into a good buy at 10-to-1 leverage. 

The more common lousy solution is to use the reasoning Sam Bankman-Fried outlined in his interview with Matt Levine. These AMMs add payout via convolution, such as bonus points paid in a new token which get multiplier points when staked for a year. Staking reduces the selling pressure, allowing insiders to maintain a price that does not reflect the total market value of the tokens. These are classic crypto grifter tactics: the 2017 Bitconnect Ponzi scheme took in bitcoin and paid out insane yields in its own coin and promised even higher returns if users staked their funds for a year. Surprise! Once new users stopped coming and bitcoin stopped rising, Bitconnect disappeared and left everyone with its worthless coins (eventually, $17MM of $2.4B was recovered!). 

Many people in crypto have gotten wealthy using crypto-Ponzi tactics, and these aspiring SBFs fund many crypto projects, researchers, and journalists. These serial entrepreneurs are typical hucksters who know the right buzzwords and can hide behind the inherently complicated nature of blockchains and smart contracts. They do not drive serious innovation, just the next Dentacoin, Celsius, or Augur. 

Tactics that are either foolish (leverage) or scammy (worthless rewards to pump usage metrics) try to elide the existential LP problem in AMMs, which are the basis for DeFi. People in crypto need to know about persistent LP unprofitability before they can and will address the underlying problem. 

Wednesday, March 22, 2023

Why Trusted Blockchains Cannot Support CLOBs

Today's most efficient and liquid exchanges are central limit order books (CLOBs). It is a computerized system that aggregates and matches buy and sell orders for a particular financial asset, such as a stock, currency pair, or commodity, in real time. In a CLOB, market participants can place their orders to buy or sell a specific asset, and these orders are then listed in the book according to their price and time priority. The system automatically matches buyers and sellers at the best available price, filling limit orders that arrive first (i.e., price-time priority). Orders outside the current market price sit on the book as resting limit orders, available for traders until they are canceled.

A Limit Order Book

While these represent the gold standard, they require a degree of low latency (i.e., speedy) that is only attainable because they are centralized (ergo, CLOB and not LOB). This allows market makers to physically place servers running their market-making algorithms next to the exchange servers, allowing communications within milliseconds. Any decentralized trading platform cannot directly compete with these platforms as a price discovery mechanism.

To understand why a CLOB cannot work on a blockchain, it is helpful to understand the economics that drives its equilibrium. A CLOB has three types of traders: uninformed, informed, and market makers. The informed invest in data, models, and hardware to identify temporary mispricings and use their comparative advantage to snipe stale limit orders. The uninformed are ignorant for rational and irrational reasons: they may want to buy a car (liquidity traders) or are delusional and trading on irrelevant information (unintentional noise traders). As informed and uninformed traders do not show up simultaneously, market makers arise to provide liquidity continually by posting resting limit orders to buy and sell.

In equilibrium, all groups generate benefits equal to their costs. The informed trader’s costs—investments in hardware and statistical algorithms—are balanced by revenue from adversely selecting stale market maker limit orders. Uninformed traders pay the market maker by crossing the spread, benefiting from convenient, quick trading. Market makers post knowing they will trade with both types of traders, setting limit orders such that the revenue from uninformed balances that they lose to the informed.

There are many scenarios where low latency is costly, but one applied to a market maker providing resting limit orders should suffice. A market maker places a two-sided order to buy or sell 100 shares of XYZ stock trading at a bid-ask price of $20.17-$20.18, its current bid price, $20.17. Assume the stock will move up or down $0.05 before you can cancel that order. If you get filled, it will only be because it is now trading at $20.12-$20.13, meaning you bought at $20.17 and can sell now at $20.12; you lost $0.05; if the price went up $0.05, you would probably not be filled on your $20.17 order to buy. This is called ‘adverse selection,’ where conditional upon getting filled, you paid too much or sold too low. It generates a loss profile for market makers like for those selling straddles or a liquidity provider’s impermanent loss.

The effect of higher latency on a central limit order book is a classic example of Akerloff’s ‘Market for Lemons’ (Quarterly Journal of Economics, 1970). [1] In that paper, he analyzes markets where parties with asymmetric information separate, so the only viable transactions are those with a negative value, and the market collapses (i.e., no trades).

The lemon’s problem applied to limit order books is the following. High latency leads to market makers suffering higher adverse selection as it amplifies the relative speed advantage of informed traders, causing market makers to increase their spreads. Higher spreads discourage uninformed traders. With fewer uninformed traders, the market maker widens his bid-ask spread further to protect against adverse selection by the informed traders by making more profit per uninformed trade. This discourages more uninformed traders, creating a positive feedback loop until none are left.

Another way to think about the necessity of liquidity traders focuses on the zero-sum nature of trading without them. With no liquidity traders, the remaining participants are then playing the unattractive game of trying to outsmart and out-speed others who have made the same commitment. The Milgrom-Stokey ‘no-trade theorem’ (Journal of Economic Theory, 1982) states that if all the traders in the market are rational, all the prices are rational. Thus anyone who makes an offer must have valuable and accurate private information, or else they would not be making the offer. Similarly, Grossman and Stiglitz’s ‘Impossibility of Informationally Efficient Markets’ (American Economic Review, 1982) shows how without liquidity traders, no one has an incentive to put information into markets because the other rational traders infer what he knows via his market demand. There are no trades because every order is presumed to be informed and thus unprofitable for the other side.

A deficiency of liquidity traders creates a positive feedback loop that causes markets to ultimately unravel. There will not be enough liquidity traders to support an active set of market makers, who need the uninformed retail flow to offset their losses to the informed traders. The high spreads and meager volume on decentralized limit order book exchanges are consistent with this result (e.g., Augur).

One can imagine the layer 2 blockchains will eventually become fast and secure, preventing this problem. However, even in this case, miners or validators can sequence transactions with some discretion. It takes 60 milliseconds for light to travel from Tokyo to San Francisco, creating a large lower bound to this discretionary time window. Successful market makers on modern CLOBs have reaction speeds of 5 milliseconds, implying the feasibility of front-running such a system with impunity (see Aquilina, Budish, and O’Neill, 2020).

A CLOB has price-time priority, so it fills limit orders first by price, and within a given price using first-in-first-out logic. Even without a minimum tick size, the sequencers could front-run limit orders by posting orders conditional upon the price in the newer orders. There is no way for the layer 2 validators to agree on the time sequence of transactions if it is configured to prevent censorship, which would require a globally distributed set of validators. Given the disproportionate advantage of being first on limit order books, the unavoidable sequencing discretion makes transparent competition impossible, enabling and encouraging corruption.

Low-latency chains like Solana, meanwhile, are centralized, which invariably leads to corruption via Acton’s Law. This centralization is not obvious, as many have more validators than Bitcoin or Ethereum (e.g., EOS has 21), but this Nakamoto coefficient is meaningless because the validators on low latency blockchains have to work together, and they are invariably controlled by a central agent. When a blockchain representative proclaims a bald-faced lie about a foundational crypto principle, its developers fall down the slippery slope, leading to more lying and, ultimately, a cesspool of deception. In markets dominated by unaccountable insiders, we should expect every sort of malicious trading tactic (e.g., FTX pumped its Serum token via its low-latency Project Serum exchange on Solana). This leaves blockchain CLOBs only for tokens with no alternatives, like in markets for NFTs and shitcoins.

[1] In this application, the market maker trading with informed traders generates a loss, like a lemon car, hoping to offset this with his trades with ‘peach’ cars (gains). In 70’s slang, a ‘lemon’ is a bad type, as opposed to a good type, e.g., a ‘peach.’ 

Friday, March 17, 2023

Perp Funding Rate Farce Continues


Recent 20% crypto movements have demonstrated again that perp markets continue to gouge their customers. I have written about this several times before, but as it is economically significant, corrupt, and continues unabated, I figured it would be worth revisiting. Alas, reading my old posts, I can see how I muddled my point, perhaps explaining why I am a lone wolf on his issue, so I hope this is clearer. 

The funding rate mechanism used to link perp prices with spot prices is a farce in that it does not and cannot tie a synthetic price with a spot price via arbitrage, and in practice, it is used to defraud its users. As a practical matter, the perp price is a Schelling point in that its obvious target is the spot price, and the funding rate is just there to make traders feel comfortable that it is not merely a Schelling point. The fact that there is a vague relation to an equilibrating mechanism is good enough for most traders, as they are happy to use centralized platforms like BitMex and DyDx. As in those cases, many users are happy to have access to perps as long as it seems fair.

One can forgive the perp funding rate scam as its foundational white lie facilitated a much-needed market. In 2016, short or leverage bitcoin was impossible, but there were no exchanges to do this. All one could do was swap one token for another and generate an unleveraged long position. There were no stablecoins or wrapped Bitcoin. BitMex, a centralized unregulated exchange that only took bitcoin deposits, created the first popular perpetual swap, aka ‘perp.’

Instead of an expiration date and settlement in a perp market, a perp anchors its price to the spot via a funding rate mechanism. When the perpetual contract’s price exceeds the spot price, the story is that this implies longer than short demand. The long traders pay short traders a fee proportional to this price premium to equilibrate the market. Crypto funding rates prevent continuing divergence in the price in perp and spot markets.

The perp premium is the percent difference between the perp and spot prices. The spot price could be from external markets like Coinbase, or for centralized perps, from spot markets on their exchange:

PerpPremium = PerpPrice/SpotPrice - 1

The funding rate is like the future expiring once daily, as this premium is applied to 24 hours based on the perp premium. One can apply it to 8-hour windows or anything else, but the standard is to apply the simple premium above and divide it by the number of periods within a day.

For example, suppose you short a BTC perpetual future trading 10% above the underlying index all day. In that case, it’s perp premium—then you will receive a total funding payment of 10% over that day to compensate for the fact that, unlike traditional futures markets, there is no expiry or settlement, as it is perpetual. This sounds reasonable, but to understand why this is not, you must first understand the theory of how funding rates work in swap markets or how basis rates work in futures markets.

The basis in futures markets acts as a funding rate in swap markets, defined as the difference between the futures and spot prices. The chart below shows the horizontal time axis moving from a current futures price to its delivery/expiry date if the black line represents the current spot price.

The basis is the difference between the futures and spot price. It can be positive or negative depending on whether the futures price is above or below the spot price. The funding rate is implicit in the amortization of the basis over time, in that, at expiration, the spot price equals the futures price, so the basis is sure to be zero at that time.

There is no basis for swap markets; a funding rate is applied daily, acting precisely like the basis in futures markets. Swap accounts trade at spot prices, facilitated by broker margin. Here the basis goes from being implicit to explicit.

LongSwapPnL  = Notional (p(t+1)/p(t) - 1 - FundingRate)

Funding rates in prime broker swap accounts are charged daily and determined independently of the spot prices, like how a bank sets interest rates. For equity swap accounts common among hedge funds, they are generally a fixed markup to the Fed Funds rate, such as adding 25 basis points when a customer borrows USD to go long and subtracting 25 basis points when a customer goes short (which lends USD to the broker).

Thus far, the similarity of swap funding rates and the futures’ basis to the perp funding rate seems plausible. Two academic articles are generally referenced when presenting perps. The first is by Gehr (1988), which describes how gold was traded at the Chinese Gold and Silver Exchange Society of Hong Kong (CGSE) in the 1980s. This was when trading was not possible around the clock, and there was no internet, so a price had little volatility outside the trading day. The CGSE was unique because its futures market was undated, i.e., perpetual. The market settled daily and held a 30-minute auction to determine the funding rate. Those long gold compare the cost of paying storage and interest on the spot vs. the funding rate; those short gold futures take delivery if they feel the funding rate is too low. This funding rate was added to the spot price to create a new closing price used in the subsequent day’s pnl.

The effect on prices and cash flows in the CGSE futures market was as follows. If the market price closed at 100.00, and the funding rate was determined to be 0.01% over the next day, the cost basis for the next day’s PNL is 100.01. If the price stayed constant at 100.00 each day, the longs would lose 0.01 because the daily pnl would be 100.00 – 100.01 on a long position, where 100.00 is the spot close, and 100.01 is the previous day’s futures close. The traded price would never be 100.01; it would just be used in the daily calculation of the trader’s pnl on the next trading day.

Nobel laureate Robert Shiller (1993) proposed a perpetual futures contract for single-family homes. Unlike a stock index or a commodity, the underlying asset, housing, is challenging to create into a futures commodity because it is not homogeneous like a commodity. Quality varies considerably by location and structure, creating a lemons problem. Shiller proposed a rental index to create a rental return proxy for a housing price index. He proposed a statistical model that correlated with real estate’s average rental return, net of depreciation. This rental return would then be paid by the short to the long.

s(t+1) = f(t+1) - f(t) + d(t+1) – r×f(t)

In the equation above, s is the daily margin change in a trader’s account;  f is the perpetual futures price, r is an interest rate adjustment, and d is determined outside the market. While this is interesting, the difficulty in generating a robust rental index for d is probably why this has never been implemented. The market was supposed to trade at a spot price that did not reflect the daily funding charge, d, only its present discounted value. However, rental income, like macroeconomic profit, is challenging to estimate via macroeconomic indicators, and most macroeconomic models work poorly out-of-sample, generating considerable uncertainty for potential traders.

Nonetheless, the estimation method implied that this funding rate would move slowly, like interest rates. There was never the suggestion that the market price reflects the spot price and the funding rate, as there is no spot price in this hypothetical, never-realized market.

The perp premium funding rate charge is like Gehr’s funding rate charge added to the market’s spot price after trading. It is also like the d(t+1) term in Shiller’s model. Thus, at 30k feet, the connection between the perp premium and the funding rate seems consistent. However, the average synthetic/spot price ratio is not determining the funding rate in either of these mechanisms, as it is for perps.

In crypto perps, the modal daily funding rate and perp premium is 0.03%, which annualizes to 11%. This is a significant funding rate compared to interest rates that have been near zero over the period where perps have existed. A 0.10% perp premium would imply a massive 36.5% funding rate paid by longs to shorts. The average transaction costs for the most liquid US equities, which are more efficient than any crypto market, are estimated at around 0.1%. This is consistent with Gemini tic data that show a 0.15% standard deviation in the price change from one trade to the next (reflecting a bid-ask bounce).

The perp premium incenting trades at any instant is below the transaction cost, given not just the fees but gas and the effective bid-ask spread, which is paid twice over a round trip. If one were frequently trading, as the price-setting arbitrageurs tend to do, extreme funding rates would be less than a round-trip in transaction costs. For example, a 50% funding rate would imply a 0.006% funding payment for a one-hour position, considerably less than their transaction costs.

Additionally, the perp premium applied to longs and shorts is based on the average perp premium in the future. Even if one could know exactly one’s perp premium at the time of trade and transaction costs were zero, it would tell the long-term traders little about what it would be in the future. If one targets positions held for a month, the current perp premium at the trade time is irrelevant.

Supposedly, with all the perp premium’s economic insignificance for motivating short- and long-term traders, we expect the market to determine the funding rate by inspiring people to buy and sell perps based on current perp/spot premium movements of 0.02%. This is why it is a farce; it is absurd.

This leads to why the perp premium is consistently positive (payments from longs to shorts) and frequently rises to 40% after crypto prices jump, as it did this week. Market makers dominate price setting, and all perp markets are effectively centralized and run by unidentified and unaccountable coalitions of insiders. They can target 0.03% or 0.13% above the current spot index. No independent auditors regulate an immutable tape of trades with objective time stamps (as the once-perceived compliance-oriented FTX demonstrated). Anything that can be gamed will be gamed, and perp markets can be gamed.

On average, market makers on standard CLOBs have net zero positions on their assets. On perp exchanges, however, the market makers are generally short because it is much easier for these insiders to hedge their short exchange positions with long positions off the exchange [exchanges have different options depending on the nature and size of other markets on their exchanges, so exceptions exist]. A short hedge would require large amounts of capital on another exchange, generating significant operational risk from regulatory attack surfaces and hackers. This allows the perp market makers a significant extra return on the capital needed for market making.

Theoretically, the perp funding rate should be insignificant, if not zero. Neither USDC nor ETH has a dividend on the blockchain. The cost of carry for USDC and ETH are identical. ETH may have an interest rate if one considers the benefits of staking, but this rate is stable and around 4%, implying a negative funding rate (i.e., longs would get paid to compensate for forgone interest). There are no supply shocks in tokens to generate option value, such as when oil tankers are full. There is nothing like a draught destroying a corn harvest that generates a convenience yield for those with corn inventories. To the extent there is hedging pressure generated by natural long or short ETH, the only natural positions are stakers and miners who are perforce long, implying a negative funding rate (they would pay traders to take their naturally long risk).

Nothing in the theory of futures basis rates or funding rates implies the large and variable funding rates we observe in perp markets. Standard efficient markets theory, the law of iterated expectations, implies current sentiment is reflected in spot prices, not forward curves. This is why funding rates are generally independent of asset prices, as with equity swap markets or auto loans.

To the extent there is a correlation between the basis and price movements on standard exchanges, it is unlike the perp markets. In crypto, perp funding rates are generally high when the price has risen, as they did this week, but generally do not go much below zero when the price has declined. This is the opposite of what occurs in commodity markets, where jumps in oil prices correspond to negative funding rates, and big declines correspond to positive funding rates.

Crypto perp funding rates are best explained by insider manipulation. When prices generate windfall profits to long perp traders, they do not mind 50% annualized funding rates the following day, which amounts to a mere 0.14% daily charge. It’s like how big winners in Vegas often give the dealer a big tip: house money. The 50% funding rate premium on perps relative to the regulated and more transparent CME in February 2021 reflects insiders taking what they can from abused customers. Market makers, generally short, receive the funding rate windfall; the game is rigged as heads-they-win big, tails-they-win-a-little.

The theory that explains the positive return/funding-rate correlation is a typical story that is clear, simple, and wrong. It makes no sense when you get into the details. Like the explanation that price increases come from 'more buyers than sellers,' the idea that long demand shows up in futures price premiums has never made sense.

The perp funding rate reflects insider manipulation of customers, a crypto-crypto cost that, if eliminated, would create a superior exchange for those wanting leverage. Some of these exchanges are under quasi-regulatory control, which would be a good issue for regulators to rectify, as it is indefensible, and there is a lot of data out there. 

Tuesday, November 01, 2022

How to Eliminate Impermanent Loss



Impermanent loss (IL) is like an exogenous tax on the suppliers in automated market makers (AMMs). While liquidity providers (LPs) can hedge their IL, this tactic merely reduces its variance. Worst of all, it exceeds the fee revenue in most AMMs, which is not a long-run equilibrium. Fortunately, there is a straightforward way to significantly reduce the IL while maintaining the autonomy of these algorithmic trading contracts. A contract with the functionality described below is on the Goerli testnet and can be accessed here (its verified code is revealed here). I gave away my previous musing on extending Uniswap’s AMM to handle perps and stablecoins, but this one is copyrighted and has a patent pending.1

The key to removing IL is having the liquidity providers (LPs) dominate price-discovery trades on their pools. In practice, an AMM’s arbitrageurs are not the LPs, and we commonly model the IL assuming the LP passively leaves his position alone or hedges on Binance. However, if the LP collective drives the net price changes on their pools, its net position is unaffected, as the change in the LP position mirrors the price-setting trades. If the LP's net position does not change, it avoids adverse selection, and its IL is zero.

The simplest case

Consider a constant product AMM where Bob is the only LP and its only trader.2 I will use the leveraged AMM I described earlier here. In this AMM, traders and LPs can leverage their positions, and when they do so, the borrowed tokens are debited from their ETH or USD accounts. This nets an LP's pool positions with subsequent trades, generating a cross-margining effect. Further, this lowers the operational risk created by having to transact on different platforms, often off the Ethereum main chain.

Assume LP Bob is levered at 20:1, so the pool tokens implied by Uniswap v2 math are 20 times greater than his actual token amounts invested. While this approach generates an unrestricted range, leverage enables it to be as capital efficient as a Uniswap v3 restricted range pool; 20:1 leverage is about what one gets with a v3 range with price bounds +/- 10% from the current price. For example, Bob adds 1.0 ETH to become an LP in this LAMM, and the current ETH price is 1296 USD. There is 20x leverage for LPs, so his pool ETH is 20.3

With 20x LP leverage, this implies liquidity of 720 via

  • poolETH = liquidity /sqrt(price)
  • sqrt(1296)= 36
  • poolETH = 20
  • liquidity = 20*36 = 720
Given this liquidity, we calculate the pool USD
  • PoolUSD = liquidity * sqrt(price) = 720 * 36 = 25,920
With poolUSD of 25,920 and 20x leverage, he will need to deposit 1,296 in USD.His trading accounts will reflect his initial ETH and USD deposits and the borrowed amounts in his pool positions.
  • Initial trade account ETH = ETH deposit – poolETHborrowed = 1 – 20 = – 19
  • trade account USD = USD deposit – poolUSDborrowed = 1,296 – 25,920 = – 24,624
LP Bob’s net ETH position is 1.0, his initial ETH deposit. This is the sum of his pool ETH and trade account ETH. His liquidity number and the square root of price imply his pool positions, so these change as the AMM’s price changes. Bob’s subsequent trades are credited and debited in his trade accounts.
  • pool ETH = liquidity/sqrt(price)
  • trade account ETH = initial ETH deposit – initial poolETH + subsequent trades
  • pool USD = liquidity*sqrt(price)
  • trade account USD = initial USD deposit – initial poolUSD + subsequent trades
  • Net tokens = pool tokens + trade account tokens
In Figure 1 below, all price movements are caused by Bob's trades that are added to his trade account, where his ETH purchases reduce his ETH debt. These increases are precisely offset by declines in the contract's pool ETH position, which in this case means Bob's pool ETH position, leaving Bob’s net ETH position unchanged. With his net ETH and USD positions unchanged, his IL is zero. Intuitively this should make sense because he cannot lose money trading with himself, regardless of the algorithm.
Figure 1

Arbitrage Trading and Price Discovery

Price discovery happens on the cheapest and lowest latency exchanges. If you know the price of ETH is going up, your best strategy for capturing this price movement would be to buy on a low-latency exchange first and then send an order to a blockchain AMM. Sending trades to a blockchain AMM and a centralized exchange simultaneously would generate the same result, as the blockchain trade would appear at least ten seconds after your Binance trade went through. It would make no sense to send a large buy on the blockchain first and then send a large buy order to Binance after it gets processed because that would only allow others to front-run your second trade.

Many people think that since there is so much volume on Uniswap, it is likely that ETH price discovery is happening on these blockchain AMMs. If Uniswap had comparable latency, this would make sense, but the latency difference is 100-fold at minimum. If we remember that way back in 2009, firms spent $300 million building a more direct cable from Chicago to New York to save four milliseconds; even the centralized blockchains like Solana are orders of magnitude slower than standard centralized exchanges. 

Ultimately, this is an empirical issue. Figure 2 below shows that 80% of the time, Uniswap prices are within Gemini prices by 0.1%. More importantly, for my argument, we see that when the Uniswap price diverges from the Gemini price, the Uniswap price moves towards the Gemini price and not vice versa.

Figure 2

Uniswap 0.05% ETH/USDC Pool

Gemini/Pool premium vs. Future Gemini & Pool Price Changes

Data from the second quarter of 2022. I took the Gemini minute-downsampled prices, paired them with the next Uniswap price, and then looked at the price 3 minutes later.

To give LPs an arbitrage-trader advantage, we let LPs trade for free on the contract, while everyone else would have to pay a fee, such as 0.2%. Traders paying the fee need the AMM's price to deviate by 0.2% from the 'true price' to consider an arbitrage trade, while the LP is incented to arbitrage trade well below that level (above unlisted costs like those from gas). If LPs traded each time the Binance/Gemini price deviated by 0.2% from the AMM, the non-LP traders would never see an arbitrage opportunity and be relegated to liquidity trading.4

An efficient exchange needs arbitrage traders setting prices. The LP should not pay arbitrageurs anything in AMMs because price discovery for latent exchanges is not subtle: arb the AMM with Binance/Gemini prices. Non-LP arbitrage profits add a significant cost to an essential party in the exchange, a cost that must eventually get charged to liquidity traders in a sustainable AMM. When the arbitrageur and arbitragee are the same entity, this eliminates a significant deadweight cost, which is always a good thing.

A simple fee exemption would be sufficient to make this work if there was only one LP, but with multiple LPs, we need more rules to prevent some LPs from dominating arbitrage trading.

Consider the case where Bob and Alice are LPs. In figure 3 below, Bob has twice the liquidity as Alice, and Bob trades twice as much as Alice, and the result is that both end up with the same net ETH at the new price. There will be slight IL because Bob's USD change is not exactly twice that of Alice, but this is generally insignificant (or at least second-order).5 

Figure 3

LPs Bob and Alice trade proportional to their liquidity

Data to the right are units of ETH

In contrast, in Figure 4 below, only one LP trades, resulting in significant net ETH position changes for both LPs. While some LPs would be averse to generating a change in their net ETH position, some would appreciate the profit as worth the risk. Without some sort of restriction, LPs with superior blockchain connectivity would dominate arbitrage trading, leaving those without bleeding-edge access susceptible to the standard IL.

Figure 4

Only One LP Trades Alice Trades

We need to add conditions to prevent low-latency LPs from dominating arbitrage. A simple rule based on the LP’s current net ETH position compared to their initial net ETH position can do this because when LPs trade proportional to their liquidity, their net ETH position is constant. Therefore the LPs can buy for free only if their net ETH position is less than 100% of their initial ETH position and can sell for free only if they have more than 100% of their initial net ETH position. This incents LPs to arbitrage price changes only when it reduces their IL, so aggressive LPs will get a ‘time out’ when they trade too much.

An LP’s net ETH position relative to her initial net ETH reflects her relative arbitrage trading, assuming she does not add or subtract ETH exogenously. To make the LP’s net ETH position reflect their relative trading, we need to restrict LPs from depositing or withdrawing ETH from their accounts while they provide liquidity, as otherwise, their net ETH position would not reflect their relative trading.

Managing LP Liquidity

In a standard constant product AMM, when the price moves the pool amounts of one of the tokens decrease. In an AMM with 20:1 leverage, the LPs would generate negative net token positions when prices move by about 10%. While traders could supply sufficient tokens for trading in the short run for this AMM to continue operating, it is not an equilibrium for a sustainable pool.

To mitigate this risk, the liquidators can remove an LP’s liquidity when they have a negative net position in either ETH or USD. This constraint will bind well before the LP becomes insolvent.6 An LP liquidation is comparatively benign in that it merely removes liquidity and nets the pool tokens with the ex-LP's trade account debts, so no trades are dumped onto this market.

An LP arbitraging the pool would not need to get tokens elsewhere and deposit them into the pool to avoid liquidation. If the LPs were not arbitraging the pool, they would be forced to wrangle up tokens to deposit into the pool, which requires more capital, trading expense, and operational risk. This wrangling is avoided when they can trade on the same contract where they provide liquidity. Ideally, the LPs trade proportionate to their liquidity and never need to rebalance their pool using outside tokens.

A hack to this system would be for a 'just in time' liquidity provision and trade. Carlos could add liquidity, make a trade, then remove liquidity, all in one block. Such transactions are parasitic and need to be discouraged. Therefore we penalize LPs who remove liquidity within a week, so anyone just wishing to trade will find the tactic of 'add liquidity/trade/remove liquidity' unattractive.7

Liquidity trader Imbalances

If the LPs generate 100% of the net trades needed to move the AMM price, the non-LP trades must be zero-sum. If there is a temporary excess demand in one direction, the LPs can handle this in two ways.

First, they can arbitrage the price premium generated by the excess net liquidity trading and accept the resulting net ETH position change. For example, excess non-LP buys push the AMM price above its true price, and an LP can sell on the AMM, generating an arbitrage profit. The downside is the LP now has a net short position relative to her initial net ETH position, which may generate an unacceptable risk.

Alternatively, the LPs can do nothing. Non-LP demand pushing the AMM price to a premium over its true price will cause the LPs to become short ETH relative to their initial ETH position, but being short an overpriced asset is not a bad situation. On average, at some point, non-LPs will arbitrage the AMM price, pushing it down, and restoring the LP position to its initial neutral condition. If, for some reason, users prefer to buy ETH with leverage on this AMM, generating a persistent price premium on the AMM, that is not so much a problem as an equilibrium. This is purely an empirical issue but easily soluble.

Active LPs

This strategy is subtly different than hedging one’s LP position. In classical option hedging, it is assumed the hedger is a price taker, and such hedging reduces risk but does not change the expected loss for a position with negative convexity. In contrast, if the hedger effectively sets the price as an informed trader, they eliminate this convexity cost. The LP fee advantage combined with the latency of blockchain AMMs allows the LPs to trade like market wizards.

If LPs are expected to arbitrage their pools, this implies access to arbitrage bots that monitor centralized exchanges and the blockchain. The LP’s informational advantage only exists within the price-premium window of the fee amount, which requires an algorithm, APIs, and web3 capabilities. They need the ability to react to 0.2% price deviations at all hours of the day. The high latency of the blockchain works to the AMM’s benefit here, as it makes it possible for an LP arb-bot to implement a simple algorithm based on centralized exchange prices.

While such a setup is straightforward, many LPs will need assistance. One solution is that someone can provide a contract that acts as a vault and manages an arbitrage bot for that vault. The capital supplier and vault owner can then split fee revenue in some mutually agreeable way. Alternatively, the contract can allow LPs to designate other accounts to make arbitrage trades on their account but not withdraw or do anything else. This would allow an LP to hire arb-bots that can seamlessly add their account to an algorithm, tapping the various LPs depending on their individual net ETH position. The arb-bot would need a fee, but as there are economies of scale in creating and running such a program, it would generate mutual gains from trade.

It should be no surprise that active traders can game passive LPs in an AMM. Over the past century, the riskless real interest rate has been less than 1%. It is not an equilibrium for passive investors to make 5%+ without risk or effort, and many pools advertise 10% or even 100% returns for passive LPs. If investors want such returns, they will either have to create an arb-bot or find an arb-bot partner, and to expect otherwise is fanciful. Over time, those with the better arb-bots will dominate. Market making has never been only about providing capital. In centralized limit order books, the market makers always post two-sided markets—a bid and ask—which are adjusted continuously. These are highly competitive markets, and every competitive market requires a significant investment of capital and time, as well as a little alpha.

The inherent latency advantage will make AMMs derivative markets for the foreseeable future. When secure L2 solutions come around with latency comparable to centralized exchanges, traditional centralized limit order books can be used.

Example Spreadsheet

The spreadsheet below shows how a sequence of random prices affects three AMM participants' net ETH position and demand functions. There are two LPs and one non-LP. In each period, the true price changes randomly via a random walk. The LPs then generate their desired ETH trades based on the current price on the AMM, the true price, and their current net ETH position relative to their original net ETH position. The non-LP trades randomly or targets the price if the AMM deviates from the true price by more than the fee.

You can see how the mechanism works if you play around with it. I find such simple models helpful for my intuition.


The essential rules for an IL-free AMM are as follows. They apply to a leveraged AMM so that the contract can monitor the LP’s net ETH position, given that the LP has both pool positions implied by his liquidity and a trade account reflecting trades against the aggregate pool. The trade account for an LP starts as a negative number, reflecting the ETH borrowed to go into the pool; however, the initial net position for an LP is positive.

  • Standard accounts pay a fee to trade
  • LP accounts qualify for a discounted fee if a trade moves the account's net ETH position towards its net ETH position at the time of initiating a liquidity position.
    • LP’s currentNetETH < LP’s initialNetETH, buy only for zero fee
    • LP’s currentNetETH < LP’s initialNetETH, sell only for zero fee
  • Restrictions
    • LPs cannot add or withdraw tokens from their accounts while providing liquidity.
    • Withdrawals less than several days after initiating liquidity position pay a fee on pool USD removed


Impermanent Loss Significance

IL is a significant problem for AMMs, but it is commonly ignored for two reasons. First, it is not a direct cost in that it is reflected in receiving back more of the less valuable token and less of the more valuable token. A pool with initial token amounts of ETH(0) and USD(0) will change over time to ETH(t) and USD(t). The mathematics of AMMs imply ETH(t) and USD(t) are functions of the price such that if the price of ETH rises, the LP will have less ETH and more USD, and the inverse (see more on this here).

IL(t) = p(t)*(ETH(t) – ETH(0)) + (USD(t) – USD(0))

More importantly, the main reason an LP position value changes comes from the variation in the token price unrelated to IL. Note that the IL formula above highlights it is just capturing the adverse selection of an LP’s pool positions, not the total pnl. If the token quantities are constant, the IL is zero, but the position value will change dramatically due to the change in the ETH price.

Figure 5 below shows the relative magnitudes of the total change in value for an LP vs. the IL for an unrestricted (i.e., v2) ETH/USDC pool. It is common to ignore second-order costs like these.

Figure 5

While the IL expense is relatively small, it is still significant. This is more conspicuous in the concentrated liquidity ranges offered in Uniswap v3 because a 10%+/- range uses only 5% of the capital in v2, which implies the IL becomes 20 times more prominent relative to the base price pnl changes.

If you do not calculate the loss, it is easy to ignore, and AMM promoters are not inclined to mention costs if they are not forced to.  For example, a Bankless newsletter listed the top yield-farming opportunities but did not mention IL. Ribbon presents its option writing pools by listing the option premium as if it were a dividend. Uniswap’s pool portal conspicuously presents the fee revenue but nothing about the IL.  When people do not mention a cost, it is no surprise they underprice it.

The major Uniswap pools generate ILs greater than their fee revenue, a net loss. This is easy to measure. Fee income is simple: fee times the volume traded. The IL payoff is very similar to a short straddle, which has negative convexity in that the second derivative of the LP position is negative. Specifically, we call this second derivative gamma, which for an LP position is defined as

Options theory tells us that the convexity cost is the price variance divided by two times gamma. This cost over time is called theta, which represents the expected option decay needed to offset the option seller’s gamma.

Applying this formula to Uniswap pools reveals a consistent negative pnl for LPs in that their fee income does not outweigh their convexity costs. The chart at the top of this post shows the average daily liquidity and volume for the popular ETH/USDC Uniswap v3 pool. Note it is generating a slight positive pnl this month because ETH volatility has been lower than average (data are through October 9).

A persistent systemic option underpricing has happened before. Convertible bonds are standard corporate bonds with an option, usually an out-of-the-money call with a long maturity. Before around 2005, it was common for these bonds to price their option below the price of explicit stand-alone options on stocks. These underpriced options allowed hedge funds focused on convertible bonds to generate significant Sharpe ratios for decades.

The driver of this underpricing was caused by a lack of transparency and bad incentives. The option value was rarely estimated independently, but the option value allowed the bond to have a lower explicit interest rate. If the company's stock price fell, the option expired worthless. In that scenario, the company was clearly better off for having sold the worthless options, and management would highlight the money they saved by issuing convertible bonds. If the company's stock price rose so that the option was in the money, shareholders were sufficiently distracted by their above-average returns that they did not criticize management.

Eventually, investment banks made it easier to isolate the options component of these bonds, and the options were priced efficiently via arbitrage. A simple convertible bond hedge fund strategy no longer generates a 1.5+ Sharpe ratio. We should expect something similar in AMMs. Currently, LPs are selling underpriced options, which creates an opportunity for those who can offer that same revenue for that service at a lower cost.

AMM Volume Not What it Appears

The net loss to LPs leads one to suspect that the impressive AMM volume is not a sign of a vibrant trading tool as it is a mechanism for savvy investors to fleece LPs who ignore their IL. As an analogy, consider the Defi exchange dYdX, which recorded a huge volume in late 2021. This was mainly driven by people taking advantage of their rewards program. Activity on their exchange was rewarded with tokens worth more than the fees generated, creating an arbitrage opportunity for throwing in some ETH and trading back and forth. Once the rewards system stopped, volume on the dYdX platform declined by over 95%.

Some believe fees from arbitrage traders generate net revenue, but this is wrong because arbitrage is purely voluntary, and they only do it to make positive profits. The arbitrageur profits are just the other side of IL. Thus the relative volume differential between the ETH/USD pools with different fees is proportional to the fee difference: six times the fee generates one-sixth the volume. The marginal trader seems to be the pool arbitrageurs, who need to make a profit to cover costs outside the pool, such as fees on centralized exchanges and capital costs (significant because they cannot be netted).


I do not yet have a master plan for applying this, so contact me for suggestions. I think it would form the foundation for a decentralized perp and stablecoin contract without frictions created by unnecessary governance tokens or funding rates.


I will ignore LP fee revenue in this explanation because I merely want to focus on the IL, and fees complicate the examples while providing no additional insight. I will also assume a simple ETH/USD pool, though it generalizes to any pair of tokens.


LP leverage is not as dangerous as trader leverage. A trader leveraging 20x would be wiped out when the price moves 5%, while for an LP, it would take a 50%+ move if the LP did not trade.


If LPs monopolize arbitrage trading on the AMM, everyone else who trades there would be 'liquidity' traders. These traders just want to alter their crypto exposure for myriad reasons unrelated to its current price premium to centralized exchanges (eg, need cash for a vacation or a long-term investment decision). These uninformed traders are also called 'noise' traders because 'white noise' refers to a mean zero random variable.


Even if the LPs trade strictly proportional amounts of ETH, that will not necessarily imply their USDC changes will also be strictly proportional. The USDC amounts exchanged as a price move depends on whether the LP traded early in the sequence or later.  As a practical matter, however, the resulting IL volatility is negligible: an order of magnitude lower and mean-zero (opposed to strictly negative).


There are edge cases where an LP can become insolvent while never having a negative token balance, basically, terrible directional trading. However, it’s highly improbable.


The minimum time is not obvious—a day, a week—but the key is making it more attractive to put on a position directly instead of doing so disguised as an LP.