QQuant, Built

Act VI · Market Microstructure

Part 39 of 43

Crypto and DeFi

Undergraduatestarts at this level68 min of film 13 chaptersprerequisites: Part 22, Part 38

A liquidity pool has no dealer, only a formula. When the price doubles, what has the person who funded it lost?

Crypto is the series' natural experiment in market design: every structure of the previous four parts rebuilt in public, with the data free. A constant-product pool quotes any size from one equation, and the provider's loss against simply rebalancing is derived exactly: it accrues at a rate of volatility squared over eight, and it is paid to arbitrageurs. Concentrated liquidity multiplies both the fee and the loss. The order of transactions in a block is itself worth money. Perpetual futures hold their price to the spot with a funding payment, which creates a carry trade with collateral risk. Stablecoins are money-market funds and run like them.

What you need. Parts 22 and 38.

What you will be able to do

Undergraduate

  • Explain how a constant-product market maker sets prices and what impermanent loss is.
  • Explain a perpetual future's funding rate, and why a stablecoin can run.

Master's

  • Derive impermanent loss and loss-versus-rebalancing; value a concentrated position.
  • Compute the cash-and-carry return on a perpetual net of funding and collateral costs; solve for the profit of a sandwich attack.

PhD

  • Prove the loss-versus-rebalancing formula (Milionis, Moallemi, Roughgarden and Zhang), its exact discrete form, and its version with fees and discrete blocks.

Industry

  • Assess a crypto strategy for the risks its return series does not show: venue, custody, collateral, liquidation, legal.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 23 min · Master's 56 min · PhD 68 min · Industry 31 min.

  1. 0An LP's loss when the price doublesUndergraduate3 min
  2. 1Blockchains and exchangesUndergraduate4 min
  3. 2Automated market makersUndergraduate5 min
  4. 3What liquidity providers loseMaster's5 min
  5. 4Concentrated liquidityMaster's5 min
  6. 5Order is worth moneyMaster's4 min
  7. 6Perpetual futuresMaster's5 min
  8. 7Carry accounting and collateral riskMaster's6 min
  9. 8Stablecoins and runsUndergraduate6 min
  10. 9Venues, funds and the cross-sectionIndustry4 min
  11. 10Rule 39: count the risks the returns do not showIndustry4 min
  12. For the researcher: loss-versus-rebalancingPhD12 min
  13. Recap, desk questions, problemsAll tracks5 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.

An LP's loss when the price doublesUndergraduate3 min

Crypto and decentralised finance: markets that never close, exchanges that are programs, futures that never expire, and dollars that are tokens. The closing part of Act six.

A desk question. Supply equal initial values of ether and dollars to a fee-free constant-product pool, continuously arbitraged to an external price. The ether price doubles. Relative to holding the initial assets, the pool is about five point seven percent behind. That is a valid endpoint comparison. Loss-versus-rebalancing answers a different question: how much value the pool loses against a self-financing portfolio that follows its token holdings at external market prices.

Three questions organize the part. On ether's twenty twenty-three minute grid, the sum of exact losses divided by each step's starting pool value is 2.66 percent; squared log increments over eight give 2.66. These are local normalized sums, not a return on fixed initial capital. With a fee, the simulator reports arbitrage profit relative to fee-free discrete LVR. Its real-price comparison is descriptive, without proving that fat tails caused a discrepancy from a Brownian approximation. Finally, carry has a funding and basis ledger, but margin, custody and venue stresses survive a price hedge. We use chosen accounting examples, without historical carry strategy results.

Why it matters. Crypto links spot tokens, leveraged contracts, stablecoins and investment funds, so failures can cross instruments and venues. Public blockchains expose transactions and contract state, but private order flow, off-chain exchange quotes and economic identities can remain hidden. This is a useful laboratory with incomplete observations. The House's proposed desk needs to connect market risk with custody, smart contracts, collateral and redemption access. A public ledger does not make all of those risks observable or remove intermediaries.

Where this sits. Parts thirty-five to thirty-eight built the dealer, the book, the executor and the market maker. This part finds each of them again in crypto, and closes Act six before Act seven turns to the system as a whole: risk, leverage and crises.

A selected timeline through twenty twenty-five. Nakamoto's Bitcoin paper appeared in twenty oh eight; Mt. Gox failed in twenty fourteen; Ethereum launched in twenty fifteen; BitMEX introduced its perpetual in twenty sixteen. Uniswap launched in twenty eighteen. Flash Boys two point oh appeared as a preprint in twenty nineteen and at the security conference in twenty twenty, when decentralized finance expanded. Concentrated liquidity arrived in twenty twenty-one. Terra and FTX failed in twenty twenty-two, when Ethereum also moved to proof of stake. USD coin lost its peg during the Silicon Valley Bank failure in twenty twenty-three. American spot Bitcoin exchange-traded products were approved in January twenty twenty-four; the GENIUS Act became law in July twenty twenty-five. Dates describe selected historical events, not a current regulatory certification.

The plan: blockchains, venues and custody; pools and two loss benchmarks; concentrated liquidity and a contextual-bandit simulation; ordering and transaction attacks; perpetual funding and carry accounting; stablecoin redemption and run mechanisms; then the assumptions and proof of loss-versus-rebalancing. We will distinguish exact accounting identities, continuous-price limits, simulated policies and descriptive market observations, because their evidence supports different conclusions.

In the House, a digital-assets desk opens, the last of the trading desks. Its first task is to learn which of its risks its returns will never show.

1Blockchains and exchangesUndergraduate4 min

Crypto markets trade on two kinds of venue at once: exchanges that look like the ones of Parts thirty-five to thirty-eight, and programs on a public ledger that need no exchange at all. Both run every hour of every day.

A blockchain is a public ledger. Anyone can read it and anyone can propose transactions, which are gathered into blocks. Each block commits to the one before it, so changing the past means redoing everything since. And programs live on it too. A trading pool is a contract that holds tokens and follows its formula, with no one in between.

Who writes the ledger. Bitcoin targets a block about every ten minutes; proof-of-work chain selection follows cumulative work among valid chains. Since the September twenty twenty-two Merge, Ethereum uses proof of stake and twelve-second slots, some of which can be missed. Finality requires validator votes and can be delayed. Gas measures computation. Inclusion pays a protocol base fee and priority fees under the applicable rules, rather than one undifferentiated auction. Builders and proposers influence inclusion and order, subject to transaction validity and their arrangements.

Two venue families. Centralized venues generally hold customer assets and match orders in off-chain books; products and custody arrangements vary. Decentralized venues execute through contracts. Automated market makers are one design, but on-chain order books and hybrid designs also exist. Users retain keys until execution while pooled assets remain exposed to contracts and any administrative controls. Stablecoins, bridges and arbitrageurs connect venues. Public settlement does not eliminate custody, oracle, contract or execution risk.

A market with continuous calendar time. A non-leap year has eight thousand seven hundred sixty hours; a six-and-a-half-hour stock session over two hundred fifty-two days gives about sixteen hundred thirty-eight. Actual venues can halt or become inaccessible. Weekend liquidity varies by venue, period and product; a historical comparison does not establish a constant half-volume rule. For comparable independent daily increments, volatility scales with the square root of three hundred sixty-five calendar days. Serial dependence, jumps and changing liquidity require a richer model. A calendar convention alone does not predict when the largest move will occur.

And the plumbing. A centralised crypto exchange is broker, venue and clearing house at once, roles that Parts twenty-one and thirty-five kept apart. Margin is marked continuously and positions are liquidated by machine, Part two's margin account. If a liquidation cannot be filled, the exchange's insurance fund pays; when it runs out, profitable positions on the other side are cut, which is called auto-deleveraging.

The failure that defined the risk: FTX, in November twenty twenty-two, as reported and as later established at trial. FTX's own token, FTT, opened the month at about 26 dollars on Binance. A news report questioned the balance sheet of its affiliated trading firm, Alameda, much of it held in FTT; Binance said it would sell its own FTT. Withdrawals stopped on the eighth, and the token fell to about 1.23 dollars. Customer assets had been used by the affiliate; its founder was convicted of fraud in November twenty twenty-three.

Three lessons. Venue risk is not in the returns: a strategy run on FTX looked normal until the day it was gone, and no backtest contains that day. Collateral is the exposure: margin and spot held at a venue are lost with it, so the House caps them by venue, the way Part twenty-one priced counterparty exposure. And a balance sheet built on the issuer's own token is worth what that token fetches in a fire sale.

The cash leg needs its own exposure map. Reserve-backed tokens such as tether and USD coin offer specified redemption rights, usually subject to customer eligibility and issuer terms. Deposits, bills and repo can support reserves, but legal claims, access timing and other liabilities matter. The token is not automatically an insured bank deposit. BTCUSDT is a bitcoin quote in tether, not directly in dollars. Treat quote-currency exposure separately from the token being traded and verify the actual issuer's terms.

Pause and predict. A pool holds five thousand ether and ten million dollars, so its price is two thousand. A trader buys five hundred ether from it, paying a fee of three tenths of a percent. What is the average price paid?

2Automated market makersUndergraduate5 min

And the answer to the pause: about 2,229 dollars per ether on average, 11 percent above the pool's starting price. A pool has no order book, only a formula, and the formula charges more for every additional unit. This chapter takes the formula apart.

The fee-adjusted constant-product swap. A pool has token reserve x and numeraire reserve y. Without fees, swaps follow a fixed product. Its infinitesimal pre-fee token price is y over x, the negative slope of the reserve curve. If gross token input is delta x and input fee is f, only one minus f times delta x enters the invariant, giving the displayed output. In a native fee-retaining pool, the actual reserve product grows as fees accumulate. The lecture's arbitrage simulator instead keeps its curve fixed and accounts for fees outside it. Those are distinct conventions, so its results are not a complete replay of native Uniswap fee compounding.

A pool of 5,000 ether and 10 million dollars of a dollar stablecoin, so a price of two thousand. A buyer of ether moves the point up the curve: ether leaves, dollars arrive, and the slope, the price, rises. A seller moves it back down. The curve never runs out: it simply asks a higher price for every further unit, without limit.

What the curve charges. Ten ether cost 0.5 percent above the starting price: mostly the fee. A hundred, 2.3 percent; five hundred, a tenth of the pool, 11 percent; and a thousand, a fifth of the pool, 25 percent. Slippage grows faster than size, because the trade walks along a curve that steepens. It is Part thirty-six's order book, with the depth set by a formula instead of by makers.

The general form. A constant-function market maker accepts any trade that keeps an invariant fixed, with convex level sets. Its price is the slope of the level set. Balancer's weighted pools keep a fixed share of their value in each token. And Curve's stableswap, for assets meant to trade at par, is almost a straight line near the peg, so stablecoin swaps barely move the price, and bends sharply when the peg is lost.

How the pool's price stays right. The pool does not know the market price; it only knows its reserves. When ether rises on a centralised exchange, the pool still quotes the old price. Arbitrageurs buy the cheap ether from the pool and sell it elsewhere, until the pool's price, net of its fee, matches the market. Every such trade is made against a stale price, like the sniped quotes of Part thirty-eight: the arbitrageur's profit is the liquidity providers' loss.

A pool can be used as a price input, but the observation rule matters. For a fee-free fixed-product move that multiplies pool price by r, the token reserve falls by root r and the numeraire reserve rises by root r. Gross input is not the attacker's net loss or profit. Arithmetic TWAP averages prices over time. Averaging log prices and exponentiating gives a geometric time average instead; an integral of log price alone is not either price-level average. Flash loans require atomic repayment. They can relax upfront capital needs, but fees, gas, impact, competing arbitrage and oracle safeguards still matter. An attack's profitability needs a full transaction and valuation model.

What a liquidity provider gives up. At price P the constant-product pool holds the square root of k over P of the token, and is worth two root k P. Simply holding the starting assets would be worth the start times r plus one, where r is the price ratio. Their ratio, minus one, is the impermanent loss: two root r over one plus r, minus one. If ether doubles, the pool is worth 5.7 percent less than holding: the desk question's answer. A halving costs exactly the same.

The whole curve. Small for small moves, symmetric in the logarithm of the price, and 20 percent at a fourfold move either way. It is called impermanent because it vanishes if the price returns to where it started. That name is the problem: it depends only on where the price ends, not on the path, so it says nothing about how much the pool paid to arbitrageurs along the way, or whether the fees covered it.

Pause and predict. In twenty twenty-three ether rose from about twelve hundred dollars to twenty-three hundred. A constant-product pool was arbitraged to Binance's price every minute. What share of its value did it lose to arbitrageurs, against a portfolio that held the same ether but traded at market prices?

3What liquidity providers loseMaster's5 min

On the minute grid, the sum of exact step losses divided by each step's starting pool value is 2.7 percent. This changing-denominator sum is not a total return on initial capital. Impermanent loss compares the endpoint with holding initial assets; loss-versus-rebalancing uses a different self-financing benchmark. We need both comparisons and their assumptions.

Three portfolios. Hold: the starting assets, kept. The pool, which sells the token as it rises and buys as it falls, at its own stale price. And the rebalancing portfolio of Jason Milionis, Ciamac Moallemi, Tim Roughgarden and Anthony Lee Zhang: the same holdings as the pool at every instant, but every adjustment made at the market price.

Ether in twenty twenty-three, a constant-product pool with no fee, arbitraged to Binance's price every ten minutes. Holding the starting assets ended at 1.454 of the start. The rebalancing portfolio, at 1.413. The pool, at 1.381: below both, and the gap to the rebalancing portfolio widens steadily, through calm and rally alike.

Take differences in units of initial value. Pool minus hold is -0.073; divide this gap by terminal hold value to recover the standard relative impermanent-loss percentage. Pool minus the common-initial-value rebalancing portfolio is -0.032. On this grid, the benchmark holds the pool's previous-step token amount over each external price move, without fees. Rebalancing minus hold is -0.041, an exposure difference. Hedging it in practice adds funding, execution, collateral and timing costs; the accounting decomposition alone does not make those costs disappear.

Why use this benchmark? With common initial wealth, the self-financing rebalancing portfolio follows the pool's token holdings while trading at the external price. In an ideal continuous, frictionless model, offsetting that token exposure isolates the loss term. The continuous loss depends on the whole path through volatility and the pool's curvature; an endpoint alone does not determine it. With jumps or discrete trading, finite-step terms matter. Arbitrage profits, fees and ordering payments are related but distinct ledgers. Their equality needs a specified mechanism and common units, rather than a general claim that every measured loss has one recipient.

For a smooth fee-free constant-product pool arbitraged continuously against a continuous semimartingale price, the local loss rate is variance over eight times current pool value. Realized squared log increments on ether's selected twenty twenty-three grid give a volatility scale of 46 percent. Their sum divided by eight is 2.66 percent. The sum of exact discrete losses normalized by each starting pool value is 2.66 percent. Close numbers describe a small-increment relation on this sample; they neither establish a continuous price model nor represent a compounded LP return.

Sampling matters. On this one price history, the local normalized loss sums on minute, five-minute, hourly and daily grids range from 2.55 to 2.77 percent. Each grid uses different endpoints and misses its within-step price path. These similar totals are a sample finding, not a theorem that arbitrage frequency is irrelevant. Microstructure noise, jumps, omitted intraperiod variation and fee bands can change the comparison. The continuous variance formula is a limit under specified assumptions.

A useful first hurdle matches units. In an ideal token-hedged, fee-free reference calculation, fees must offset loss-versus-rebalancing plus all hedge and operating costs. A constant fee times turnover measured against the same contemporaneous capital gives fee yield. Dividing the sample's normalized loss sum by a three-tenths-percent fee gives about 9 capital turns for the year, or 2.4 percent per calendar day if spread evenly. This is a rough changing-capital turnover hurdle, not a validated fixed-initial-capital break-even strategy. Fee bands change trades and holdings; arbitrage fees must be reconciled with their own loss ledger.

The same thing in Part eleven's language. A pool's value is concave in the price: it is short gamma, like a written straddle. A hedged option seller pays half gamma times variance, and a hedged liquidity provider pays exactly that. Its fees play the role of the option's time decay. Providing liquidity to a pool is selling volatility.

Pause and predict. Choose a multiplicative range from P divided by one point zero five to one point zero five times P. At its geometric centre, how many times as much liquidity per dollar does it provide as a full-range constant-product position? What happens to local loss per dollar while the position is in range? Distinguish this centre comparison from its realized fee income over a whole path.

4Concentrated liquidityMaster's5 min

And the answer to the pause: about 41 times as much liquidity per dollar, and so about 41 times the loss to arbitrage per dollar, as long as the price stays inside the range. Concentration is leverage on the same short-volatility position.

Uniswap's third version, in twenty twenty-one. A provider chooses a price range and supplies liquidity only inside it. Inside, it behaves like a constant-product pool with a larger virtual reserve, holding x of the token, and y of dollars. Outside the range it stops trading and earns nothing: below it, it is all token; above it, all dollars.

A position on ether between 1,600 and 2,500 dollars. Below the range it holds only ether, so its value falls one for one with ether. Inside, the value bends: concave, short gamma, the pool's signature. Above, it has sold all its ether and holds only dollars: the upside is capped. It is a covered call, written continuously.

How much liquidity a dollar buys at the geometric centre. A range from P over w to P times w has efficiency one over one minus w to the minus one half relative to full range at the same price. For w equal to one point zero one, about 201 times; for one point one, 21; for two, 3.4. The lower bound is a reciprocal, not a symmetric percentage discount. At equal active liquidity and identical fee allocation, local fee exposure scales too. Real income also depends on volume, competition, time in range and execution costs.

Leaving a range changes the position. Each sample day resets its centre to the first observed ether price. For bounds P divided by one point zero one and P times one point zero one, at least one sampled minute lies outside on 89 percent of days; 32 percent of sampled observations are outside on average. With w equal to one point zero five, these become 13 percent of days and 2.3 percent of sampled time. A daily-mean share gives each day equal weight. Unobserved intraminute exits are missed; these are not continuous barrier-hit probabilities. Re-centering involves trades and costs.

Concentration changes local curvature. In range, the continuous fee-free loss rate is sigma squared times liquidity times square root of price, divided by four. It vanishes outside the active range in this model. At the geometric centre, divide by the concentrated position's smaller capital value to get the efficiency multiple of the full-range local loss rate. Fee income has the same local multiple only under comparable active-liquidity allocation and volume. Over a path, price location, range exits, competing liquidity and re-centering costs change the result. A local scaling argument does not prove narrow ranges are globally better.

A contextual-bandit illustration in a chosen simulated world. Annual volatility is 45 or 120 percent with a persistent latent regime. Each day chooses withdrawal or a freshly centred multiplicative range; current action does not control tomorrow's regime or observation. The state is a bucket of yesterday's noisy realized-volatility estimate. Reward is an assumed exogenous daily fee yield times centre efficiency and in-range share, less simulated loss-versus-rebalancing divided by initial daily capital and a reset charge. It is a stylized benchmark-relative reward, not a total executable LP return. The model omits hedge financing, fee competition and realistic transaction costs.

After four thousand simulated days, what it learned, in basis points of capital a day. After a calm day, the narrow range is worth about +33; the wider ones much less. After a stormy day every range loses, the narrow one most, and withdrawing, worth zero, is best. The middle state almost never occurs, because the two regimes are far apart.

Evaluation uses two thousand fresh simulated days and common daily random seeds across actions. In this chosen run the narrow fixed action averages -30 basis points of benchmark-relative reward a day. Other fixed actions and withdrawal provide the displayed baselines. The learned policy averages +17, versus +21 for a regime-informed action selected using extra Monte Carlo samples. These are one training and evaluation design, with serially dependent regimes, not evidence of live skill or a confidence interval. The oracle has more information and a separate selection budget; it is not an equally informed competitor.

What this experiment supports. Fee yield is chosen externally and scales by a simple efficiency factor, rather than arising from traders competing across ranges. Two well-separated regimes and a lagged volatility bucket make the prediction problem easier than a real market; one seeded training run does not quantify training uncertainty. The learner estimates conditional one-step action values, with sample-mean updates and no continuation-value term. This is a contextual bandit, not a general long-horizon liquidity-management policy. Its positive benchmark-relative reward depends on its assumed world and does not establish an investment return.

Pause and predict. A trader buys a hundred thousand dollars of ether from Chapter two's pool and accepts up to one percent of slippage. Someone who can order the block's transactions sees the order first. How much can they take?

5Order is worth moneyMaster's4 min

In the chosen largest-feasible-front-run calculation, the hundred-thousand-dollar trade at one-percent tolerance produces candidate profit of 700 dollars. The victim's token shortfall valued at the initial two-thousand-dollar reference is 987 dollars. Those quantities use different price and counterfactual conventions; their difference is not automatically the pool's fee income. We will inspect the transaction ledger and the attack sizing rule before interpreting its output.

How a trade reaches the ledger. A user signs a swap; it waits in a public pool of pending transactions; searchers write bundles of trades around it; builders assemble whole blocks and bid for the right to have them included; the proposer takes the highest bid. Since twenty twenty-two most Ethereum blocks have been built this way, as reported. The value of choosing what goes in a block, and in what order, is called maximal extractable value.

A chosen sandwich on a million-dollar purchase with one-percent tolerance. The attacker buys first, moving the curve. The victim then executes within its minimum-output constraint. The attacker sells its token back. The returned candidate profit is 10,604 dollars, before gas, builder payments and execution competition. Victim shortfall, valued at the initial external reference, is 9,066 dollars. The bisection maximizes feasible front-run size within a bound; it has not separately proved that this size maximizes profit.

The sizing constraint. The victim sets a minimum output relative to an unattacked quote; lower tolerance can reduce one opportunity but can also increase failed transactions. This implementation uses bisection to find the largest front-run input that keeps the victim feasible, capped at one hundred times victim input. It is not a general profit optimizer. An attacker can also choose not to attack, so a negative raw candidate is not a rational attack profit. Gas, priority payments, liquidity competition, private routing and other strategies would change the attainable outcome. Tolerance times trade size is only a rough scale, not an exact extraction identity.

The raw candidates in this chosen pool. All four ten-thousand-dollar candidates have negative profits under the largest-feasible sizing rule. That does not prove every alternative attack is unprofitable or that a small trade is safe. At one-percent tolerance, the hundred-thousand-dollar candidate returns 700 dollars. At three percent, the million-dollar candidate returns 31,740. These are gross simulator outputs under a fixed curve with input fees outside it. The no-attack option, gas, transaction order uncertainty and competing searchers must be included before an economic decision.

Three kinds of extractable value, first catalogued by Philip Daian and coauthors in Flash Boys two point oh, in twenty twenty. Arbitrage, between pools and against centralised exchanges, the largest kind, as studies of on-chain data reported. Liquidations: lending protocols pay a bonus to whoever first repays an under-collateralised loan, and the race for it is a race for position in the block. And sandwiches and just-in-time liquidity: trading around another user's swap, a pure transfer from that user.

Keep the ledger and its recipients separate. In this simulator, the pool's own rebalancing-minus-curve gap equals its arbitrage profit plus outside-curve fees, before gas and other participants. This is not a claim that a fee-free reference loss stays unchanged. Searchers, builders and proposers may compete over transaction surplus under their respective arrangements. Bidding can transfer surplus when the auction and competition assumptions support it, but concentration, private information, execution costs and market power change the allocation. Neither a largest-source ranking nor a universal fraction bid away follows from the small simulation.

Mechanism choices have limits. Tighter output bounds and private submission can reduce exposure to public-mempool sandwiches, but private intermediaries may still observe or reorder orders and can fail to execute them. Batch settlement and uniform clearing rules can remove some within-batch sequencing advantages for eligible orders, subject to solver, routing and settlement rules. This does not eliminate all forms of extractable value. Auctions of arbitrage rights and dynamic fees aim to reallocate surplus to providers; their net effect depends on competition, implementation and welfare measurement. The small simulator here does not prove a universal guarantee.

Pause and predict. A perpetual future never expires, so nothing forces its price to meet spot at a date. What keeps Bitcoin's perpetual within a few basis points of spot, and who pays for it?

6Perpetual futuresMaster's5 min

And the answer to the pause: funding. Every eight hours, holders on one side pay the other, and the payment grows with the perpetual's premium over spot. Longs pay when it trades above, which on Bitcoin has been most of the time: about 13 percent a year on average since twenty twenty.

Funding transfers cash between contract sides. In the sampled eight-hour contract convention, a positive settlement rate makes longs pay shorts on settlement notional. Actual products can use other intervals and caps. A sufficiently positive premium can raise funding, discouraging longs. A negative spot-perpetual premium does not automatically imply negative funding: the clamped interest term can keep it positive near zero. Perpetuals have no scheduled expiry, so linkage to spot depends on funding incentives, arbitrage constraints and contract rules, rather than a guaranteed terminal convergence date.

The simplified rule in matching eight-hour units. The venue's premium index is a contract-defined index, not simply the difference of hourly closing prices. Funding equals average premium plus the interest-minus-premium term clamped between minus and plus five basis points, under the stated historical convention and before any other caps. If the absolute premium-minus-interest difference is at most five basis points, the rate equals the one-basis-point interest term. Product-specific intervals, index construction, caps and rules must be checked separately. This chosen representation is not a certification of today's venue terms.

A separate continuous-funding model. The long's gains are d F minus kappa times F minus S, times dt. Under a pricing measure, its zero-value gains have zero drift, and spot has drift r minus q. Assume constant coefficients, a linear contract and matching continuous-time units. Try F equal to a constant multiple of S, then equate that multiple times r minus q with kappa times the multiple minus one. This gives F equal to kappa S divided by kappa minus the quantity r minus q, requiring kappa greater than r minus q and a transversality condition to exclude bubbles. This model is distinct from the venue's discrete clamped rule.

Translate the interest term carefully. One basis point every eight hours gives ten point nine five percent a year by simple notional annualization, using three settlements a day and three hundred sixty-five days. That is neither compounding nor a return on committed strategy capital. Near zero premium, the simplified clamp can preserve this positive rate, so a short receives it at those settlements. Future rates, basis moves, financing, fees, margin and venue losses remain variable; there is no fixed contractual yield from merely buying spot and shorting the perpetual.

Six years of Bitcoin's funding, every ninth settlement, annualised. A dense line at about eleven percent: the interest term, whenever the premium is small. Spikes far above it in the bull market of twenty twenty-one, when leveraged longs paid over a hundred percent a year for their exposure. And spells below zero, in the crashes of twenty twenty-one and twenty twenty-two, when shorts paid.

Describe the frozen sample by year. Bitcoin's mean settlement rate, simply annualized, is 31 percent in twenty twenty-one and 4 in twenty twenty-two; 22 percent of twenty twenty-two settlements are negative. Across the sampled six years, 37 percent of rates fall within the code's tolerance of the one-basis-point base. Mean simple annualized rates are 13 percent for Bitcoin and 15 for ether. The twenty twenty-five Bitcoin mean is 5 percent, with 17 percent near the base. Changing rates alone do not identify crowding, a policy change or the cause of a premium shift.

An observable proxy, not an exact rule replication. Each selected point pairs a funding settlement with an average of hourly perpetual-to-spot close ratios from the preceding pre-settlement hours. The code permits some missing observations and uses candle-open timestamps for closes. Correlation with funding is 0.81. Applying the simplified clamp to that proxy gives correlation 0.86. The official impact-price premium index, weights, caps and exact observation clocks differ, so correlation does not validate the venue's full calculation or prove a causal mechanism. Display filtering removes points outside the plotted window.

Who pays, and why. Positive funding is the price of leverage: what leveraged longs pay for exposure they could not finance in spot, an interest rate set by crypto's own demand for leverage. It is also a gauge of sentiment, high in rallies and negative in crashes, and forced liquidations cluster at its extremes. And it is the running cost that Part two's margin account paid through the crash of March twenty twenty.

Pause and predict. In the frozen ether sample, the mean settlement rate has a simple notional annualization of 15 percent. A desk proposes to buy one unit of spot and short one linear perpetual unit. Which price exposures cancel in the matched-unit ledger, and which funding, basis, margin, custody and execution risks remain? State the capital denominator before turning any payment into a return.

7Carry accounting and collateral riskMaster's6 min

The answer to the pause is that funding can turn negative, basis can move, and margin can be exhausted before a spot gain can be transferred. Match one unit of spot against one unit of a linear perpetual. Common price movement largely cancels, but the basis and funding remain. We will work through chosen accounting examples and venue stresses. They demonstrate mechanisms, without reporting a fitted carry strategy, an opened hold-out or an approved trading book.

Write the ledger in dollars for one maintained unit. The spot earns its price change and the short perpetual loses the perpetual's price change. Their sum is minus the change in basis, perpetual minus spot. Add each funding rate times the settlement notional, then subtract commissions, spreads, borrowing and transfer costs. This convention is for a linear contract and a fixed unit quantity. Inverse contracts, changing quantities and collateral denominated in a volatile coin require different ledgers.

Choose spot and perpetual prices of one hundred, and cash collateral equal to one third of the short's notional. Buying the spot uses one hundred dollars; margin uses thirty-three dollars and a third. Total committed capital is therefore one hundred thirty-three and a third before a liquidity buffer. A funding rate of one hundredth of a percent pays one cent on the one-hundred-dollar short, or zero point zero zero seven five percent of committed capital. Margin is committed cash, while a buffer increases the denominator further.

Use that same chosen funding settlement. Funding pays one cent, but the perpetual's premium widens from zero to twenty cents. The matched price legs lose twenty cents, regardless of whether both market prices rose or fell together. Net profit before other costs is minus nineteen cents, about minus fourteen basis points of the original capital. The size of a small funding payment does not bound a temporary basis move, and perpetual convergence has no fixed expiry date.

Now choose a negative funding rate of two hundredths of a percent. On one hundred dollars of perpetual notional, the short pays two cents instead of receiving funding. The long spot does not reimburse that payment. A decision made from a trailing average cannot lock in future rates. Contract caps, settlement intervals, mark conventions and collateral eligibility can also change. Historical average funding is a description of past payments, rather than a contractual yield available at entry.

Choose a combined entry charge of fifteen basis points of spot notional, and the same again to leave. Entry costs fifteen cents, exit another fifteen, for thirty cents in all. If the one-cent funding payment stayed unchanged and basis did not move, thirty settlements would merely cover those charges. This simple count excludes financing, slippage, transfer delays and the time value of money. A quoted annualized funding number hides both the notional used for costs and the capital needed to earn it.

Choose a rally from one hundred to one hundred fifty on both legs. The spot gains fifty and the perpetual short loses fifty before funding and costs, so the economic price hedge still balances. But fifty of variation loss exceeds the original thirty-three dollars of collateral if the accounts cannot transfer gains promptly. Actual liquidation depends on maintenance margin, marks, collateral value and venue rules, so this example is a cash-flow stress rather than an exact liquidation threshold. A balance-sheet hedge does not supply intraday liquidity.

Suppose, as a chosen stress, only the thirty-three dollars of margin is held at a venue and that exposure has zero recovery. The loss is a quarter of the initial one hundred thirty-three dollars of capital. That is an accounting scenario, not a default probability or a forecast of legal recovery. If the spot is also held there, the exposure may be much larger; close-out claims, netting and rehypothecation change it again. Position size needs an exposure map as well as a return estimate.

Custody outside the trading venue may reduce one form of venue exposure. It does not automatically let the trader post collateral, recall it instantly or spend an unrealized spot gain. Those rights depend on contracts and operations. Multiple venues can fail together or suspend transfers together, especially when they share banks or a stablecoin. Larger buffers lower some liquidation risks but tie up more capital. A useful stress combines correlated venue loss, adverse basis and delayed collateral movement instead of assuming each happens in isolation.

A research protocol begins before seeing evaluation outcomes. Specify the contract, funding clock, capital denominator, fee model, transfer rules, signal information and venue eligibility. Select only on past information, count every configuration, and reserve an untouched evaluation window. Delisting and venue failure belong in the design, with assumptions made visible. An accounting illustration cannot supply historical performance evidence or be described as an independently validated investment strategy.

Why might someone pay the other side? Demand for leveraged directional exposure and limits on arbitrage capital can support positive funding, but that explanation is a hypothesis to test. A matched-unit book still bears basis, funding-reversal, collateral, venue, stablecoin, operational and legal risks. Their relative importance depends on the actual arrangement. A smooth return series can miss a rare loss and cannot by itself justify a large position. Proposed limits should be tested against both cash-flow stresses and enforceable custody rights.

Pause and predict. Choose a token with eight percent of its reserves temporarily inaccessible at a failed bank, and suppose the remaining ninety-two percent is immediately worth par. Under zero recovery, simple asset accounting gives ninety-two cents per token before any other claims or costs. Now suppose the market quote is eighty-eight cents. Does that quote identify insolvency, illiquidity, or neither? State what you would need to know about redemption access, reserve valuation, the quote currency and the timing before deciding.

8Stablecoins and runsUndergraduate6 min

The previous question cannot be decided from a market quote alone. Reserve valuation, other liabilities, redemption rights, the quote currency and access timing all matter. The USDC episode illustrates reserve and redemption uncertainty during a bank failure. Authorities announced protection for Silicon Valley Bank depositors on March twelfth, twenty twenty-three, with access starting Monday the thirteenth. That chronology does not by itself identify every cause of a token's recovery.

Three kinds. Backed by dollars, like tether and USD coin: the issuer holds deposits, bills and repo, and redeems tokens for approved customers. Backed by crypto, like DAI: loans against more than their value in other tokens, liquidated automatically when collateral falls. And backed by a twin: Terra's UST, redeemable for a dollar's worth of a second token that the protocol itself printed.

A run mechanism inspired by Diamond and Dybvig. Suppose tokens promise par redemption, subject to their actual legal rights. Choose reserves with liquid fraction ell and a fire-sale haircut d on the rest. Full liquidation then raises ell plus one minus ell times one minus d per token, below par if both illiquidity and the haircut are positive. Sequential service can create incentives to redeem early, but proving a run equilibrium also needs preferences, timing, withdrawal technology and a specified game. This haircut table is accounting, not a solved Diamond-Dybvig model or proof that every illiquid stablecoin must run.

Use the chosen reserve stress table. If all assets are immediately liquid at par and there are no other claims or costs, aggregate reserves cover one dollar per token. That arithmetic does not rule out operational failure or other run motives. With eighty percent liquid and a twenty-percent haircut on the rest, liquidation value is ninety-six cents. It indicates a shortfall under this stress. The last-get field in the unchanged original repeats aggregate liquidation value; it does not solve a last depositor's payoff or establish an equilibrium. Recoveries, access rights and the order of payments need their own model.

USD coin against tether on Binance in March twenty twenty-three. The frozen observations begin at the same minute as their sample low, 0.882; the earlier decline is therefore unobserved here. This is a venue quote in tether, not a direct dollar redemption price. Circle reported three point three billion dollars at Silicon Valley Bank after its March tenth failure. There are 33 hours' worth of sampled minute closes below point nine eight, not necessarily one uninterrupted spell. The first later close above point nine nine five appears about 52 hours after the observed low. The official March twelfth depositor announcement is context, not an identified causal estimate.

Compare a chosen reserve calculation with the observed quote. Treat eight percent as bank exposure and assume every other reserve is worth par, without other claims or costs. Even zero recovery on that exposure then leaves ninety-two cents per token in the scenario. The sample quote of 0.88 tether is lower, but it does not prove a liquidity-only explanation or establish ninety-two cents as a universal lower bound. Quote-currency risk, inaccessible reserves, uncertainty, trading constraints and legal redemption rights can all matter. Reserve accounting and immediate market execution are different objects.

What normally holds the peg is Part thirty-eight's ETF arbitrage. Below a dollar, buy tokens and redeem them with the issuer. Above, deposit dollars, mint and sell. But only approved customers can, and only when banks are open; as Richard Lyons and Ganesh Viswanath-Natraj showed, the peg is only as tight as access to that window.

Terra, in May twenty twenty-two. The protocol swapped one UST for a dollar's worth of newly minted LUNA, its twin. Below a dollar, arbitrageurs burn UST, receive LUNA, and sell it. That floods the market with LUNA and pushes its price down, so each further redemption mints even more LUNA. The defence feeds on itself. Demand for UST rested largely on a lending protocol, Anchor, that paid close to twenty percent on deposits, as reported.

On Binance, hour by hour. UST began the month at a dollar and lost the peg on the ninth; by the time trading stopped it was near 0.25. LUNA, at about 78 dollars on the first, fell by more than six orders of magnitude in a week, as the redemptions printed it by the trillion. Tens of billions of dollars of market value were gone, as reported.

Three lessons. A coin backed by a token its own system prints is backed by confidence, and when confidence goes, both go together. Contagion: lenders exposed to Terra and to each other failed through the summer, as reported, and FTX followed in November, Part forty-one's spiral in miniature. And the law: Terraform Labs and its founder were found liable for fraud by an American jury in twenty twenty-four. The December twenty twenty-four SEC release records that civil outcome; civil findings and criminal proceedings are separate.

Historical legal milestones need dates and scope. The European Union's MiCA rules for asset-referenced and e-money tokens generally began applying on June thirtieth, twenty twenty-four, with other provisions and transitions on different schedules. The United States GENIUS Act became Public Law one nineteen twenty-seven on July eighteenth, twenty twenty-five. It specifies permitted reserve assets and an implementation framework; enactment is distinct from its conditional effective date and later rules. These historical sources do not certify current compliance, insurance or instantaneous liquidity. A liquid asset can still be inaccessible during a redemption or banking interruption.

Pause and predict. In early twenty eighteen, Bitcoin cost tens of percent more in South Korea than in the United States, for weeks. Why did arbitrageurs not close the gap?

9Venues, funds and the cross-sectionIndustry4 min

And the answer to the pause: capital controls. An arbitrageur must buy in one country and sell in the other, and then move the money back; Korea's limits on moving won abroad, and on foreign accounts at its exchanges, made the second leg slow and costly. A market without a closing bell can still have borders.

Igor Makarov and Antoinette Schoar's study of crypto arbitrage. Within a country, exchanges in the same currency stayed close, because coins and cash move easily between them. Across borders, gaps were large and lasting: premiums in Korea that peaked above forty percent in early twenty eighteen. And the gaps rose together when buying pressure rose. What was scarce was arbitrage capital that could cross the border, not information.

Where the price is made. Part thirty-five's information shares found Bitcoin's price discovered mostly on the perpetual, where leverage is cheapest. Pools on chain rarely lead; Chapter three's arbitrageurs carry the price to them. And on weekends crypto keeps trading while Chicago's futures and the funds are closed, so the listed products open on Monday wherever crypto went.

Before the funds, a trust. Grayscale's Bitcoin trust created shares but never redeemed them. Without Part thirty-eight's creation and redemption, nothing tied its price to the bitcoin it held: it traded at premiums for years, and at a discount of close to half its value in twenty twenty-two, as reported. All the while its holders paid a fee of two percent a year on the full value.

Read exactly what was computed. GBTC's market close divided by Binance's Bitcoin daily close is normalized to one near the end of twenty twenty-two. The ratio rose during twenty twenty-three; the August court decision and January approval are dated context. Near January tenth, twenty twenty-four, the ratio is 74 percent above that chosen base. This is not a measured NAV discount: the calculation omits bitcoin entitlement per share, fee erosion and synchronized valuation clocks. The labels do not identify the court decision's causal price effect. Conversion changed redemption access, while fees can change bitcoin per share over time.

Spot Bitcoin exchange-traded products began United States trading in January twenty twenty-four after the January tenth approval order. Approval and first trading are different dates, and not every approved product launched together. For IBIT, daily volume times closing price is 1.0 billion dollars on the first observed day. Its mean is 1.4 billion over the selected twenty twenty-four observations. This is a close-times-volume turnover proxy, not exact traded dollar value or fund inflow. Creation and redemption terms, cash funding, costs and current eligibility must be checked against actual product documents; listing approval is not investment approval.

Research on token returns. Liu, Tsyvinski and Wu study crypto market, size and momentum factors in their chosen samples; factor fit is an empirical result rather than a universal pricing law. Liu and Tsyvinski report distinctive exposures, momentum and attention relationships for their period. Market composition, survivorship, trading costs and subsequent structural change limit extrapolation. A predictive model from another part is not independent validation of this desk. We do not use sealed strategy outcomes here, and descriptive cross-sectional patterns do not establish implementable net alpha or justify an additional market trial.

Firms, from the public record. In a settled order of December twenty twenty-four, the SEC found that Tai Mo Shan, an affiliate of Jump Trading, had bought UST in May twenty twenty-one in a way that misled investors about the peg's mechanism; it agreed to pay about a hundred and twenty-three million dollars without admitting or denying the findings. For token market making, examine compensation, options, inventory and conflicts. Quoted volume alone does not establish independent executable liquidity. A venue can combine custody, execution, collateral and clearing. Map legal claims and operational dependencies before calling these functions diversified.

Pause and predict. The House opens a digital-assets desk to run Chapter seven's carry book and to provide liquidity in pools. Which three limits should its rule set before the first trade?

10Rule 39: count the risks the returns do not showIndustry4 min

The answer to the pause. First, venues: a cap on the collateral any one exchange holds, because the carry book's real tail is the venue. Second, dollars: a cap on any one stablecoin, because issuer, reserve and redemption risks can concentrate in the cash leg. Third, pools: provide liquidity only where fees beat the measured loss to arbitrage, with the token exposure hedged.

Chapter ten. The proposed thirty-ninth rule is to measure the risks that a return series may omit. A digital-assets desk needs separate market, collateral, contract, custody and redemption controls. The examples in this lecture motivate a research checklist, rather than certify a strategy or approve capital.

Read the sheet with its units. The ether loss number is a sum normalized by each step's pool value; realized variance over eight is its small-step comparison, not an independent estimate of a fixed-capital return. The fee simulation uses a separate fee-free denominator. Concentrated-range efficiency is a local centre comparison, while sampled out-of-range days use minute observations. Funding is a simple annualization of settlement rates, not a financed strategy return. The venue loss is a chosen zero-recovery accounting stress. The USDC quote is against tether on one venue. None of these figures alone establishes a deployable desk.

Proposed venue controls. Custody outside a trading venue may reduce direct exposure, but posting and recalling collateral require an enforceable agreement and tested operations. Keeping margin close to a minimum can increase liquidation risk. Set exposure caps and liquidity buffers across correlated venues, banks and stablecoins; a successful small withdrawal does not prove solvency or guarantee future access. Review ownership, liabilities, audits, legal segregation, netting and recovery rights. A proof of reserves without liabilities is insufficient evidence of solvency.

Contracts. On chain, the code is the counterparty, and exploits of bridges and protocols have taken hundreds of millions of dollars at a time, as reported. The House uses only audited contracts with long records and much at stake, and caps exposure to each. And it checks what price each protocol reads, because a manipulable oracle can be drained with a flash loan.

Operations. No single person can move funds: several signers, or keys split by multi-party computation, with limits per transaction. The market never closes, so neither do the limits: automated checks and an on-call trader every hour of the week. And Part thirty-four's compliance applies on chain: sanctions screening of addresses, and a record of every transaction.

Chapter three's simulator at its core. In each block, if the pool's price net of the fee is above the market, an arbitrageur sells it the token until the band's edge; if below, buys; and inside the band, nothing happens.

Three source lines with distinct scope. The first is the exact fee-free one-step constant-product gap. The second is the continuous local loss rate under its price and regularity assumptions. The third uses proportional fee in a Poisson-block trade-probability approximation; the stationary log-band expression uses minus log one minus fee instead. These unchanged library lines are shown as implementation excerpts, not interchangeable universal formulas.

Chapter five's attack: the attacker's purchase, the victim's, and the attacker's sale; the front-run is the largest that keeps the victim within its limit.

And Chapter six: Binance's funding rule, the premium plus a clamped interest term, and the perpetual's no-arbitrage multiple of spot.

The tools this part adds. Pools, what pools lose, and ordering and perpetuals. And the thirty-ninth rule. The House values every pool position against rebalancing, at the frequency of arbitrage and with fat tails. It caps the collateral at any one venue and the exposure to any one stablecoin. And it sizes carry by the loss of a venue, not by its Sharpe ratio.

The rule against three cases. A pool advertised by its fee yield: ask for its loss to arbitrage, because fees without it are half the account. A basis fund with a Sharpe ratio of four: ask where the collateral sits, in which stablecoin, and what one venue's failure would cost. A stablecoin paying twenty percent: ask what backs it and who pays the yield.

For the researcher: loss-versus-rebalancingPhD12 min

For the researcher. Chapter three measured the loss of a pool to arbitrageurs. This chapter proves the formula behind it, due to Jason Milionis, Ciamac Moallemi, Tim Roughgarden and Anthony Lee Zhang; derives the exact discrete version; proves how fees and block times decide what arbitrageurs keep; and checks each result by simulation and on ether's real prices.

Specify the model before the proof. Let price be a positive continuous semimartingale. The displayed driftless diffusion is a useful special case; a drift term would cancel from the loss identity too. Assume predictable locally integrable holdings and sufficient local smoothness of pool value. With instantaneous fee-free arbitrage, the pool chooses the minimum external-price value on its feasible curve, with a well-defined minimizing holding. Its marked value is price times token holdings plus numeraire holdings. Start the self-financing rebalancing portfolio at exactly the same value and let its gains be token holdings times the price increment. Expectation statements require additional martingale and integrability conditions.

Lemma one uses the pool's value function. It is the infimum over a price-independent feasible set of affine functions of the external price. An infimum of affine functions is concave. If the minimizing token holding is unique and the value function differentiable, the envelope theorem gives V prime equal to that holding. Without uniqueness, supergradients replace a single derivative and the smooth proof needs modification. The geometry explains the sign; it does not by itself guarantee all the regularity needed for Itô's formula.

Lemma two. The second derivative is the slope of the holdings, and concavity makes it negative or zero. A pool sells the token as its price rises and buys as it falls: it always trades against the move. That is the whole source of the loss.

The pathwise identity. With common initial wealth, smooth concave pool value and instantaneous fee-free arbitrage, rebalancing minus pool value equals minus one half the integral of V double prime against the continuous price's quadratic variation. For the displayed diffusion that is the integral of sigma squared P squared over two times the absolute derivative of token holdings. It is nondecreasing under these assumptions. It depends on the path and its price levels, not only the endpoint. Jumps introduce additional concavity gaps, and fee bands use different holdings; neither is covered by simply reusing the smooth continuous rate.

Apply Itô's formula, locally if necessary. The pool change is V prime times d P plus one half V double prime times d quadratic variation of P. Replace V prime by token holdings. Concavity makes V double prime nonpositive wherever it exists. The benchmark's gains are those same holdings times d P, so their entire stochastic integral cancels, including any finite-variation drift. Integrate from a common initial value. What remains is a nonnegative finite-variation process. It need not be deterministic; its coefficient can depend on the realized price path. A true-martingale expectation claim needs integrability beyond this local identity.

Two local rates. Constant-product value is twice square root of k P, whose second derivative gives sigma squared V over eight. A concentrated position gives sigma squared L square root of P over four while strictly in range, and zero outside. Its first derivative is continuous at the boundaries; a piecewise smooth Itô formula applies without an extra local-time term from a derivative jump. At fifty percent annual volatility the instantaneous normalized full-range loss rate is three point one two five percent per year. That is a rate relative to current value, not the realized annual return or a fee-inclusive strategy forecast.

An exact discrete accounting check. Start a fee-free constant-product pool at external price P zero. The benchmark holds its initial token quantity through one price step and starts at the same value. Subtract the pool's value change from that holding's gains. The result is starting pool value over two times square root of the price ratio minus one, squared, for any positive ratio. For a conditionally martingale lognormal ratio with variance parameter sigma squared delta t, its conditional expectation is starting value times one minus exp of minus sigma squared delta t over eight. Divide by delta t and shrink the step to obtain the local continuous rate. A finite price doubling alone does not specify the variance parameter.

Check one: simulation. Four hundred thousand steps of a lognormal price, and a pool traded to the market at every step. The exact identity, summed step by step, matches the simulated loss to rounding. And the continuous formula is within 0.03 percent.

A different check examines one-step moments. The unchanged calculation resets its generator and rescales the same four million standard-normal draws for each variance, while keeping the number of draws fixed. Step sigma falls from one to one eighth. The Monte Carlo column estimates the expected normalized one-step loss divided by sigma squared over eight. The closed expectation ratio is one minus exp of minus sigma squared over eight, divided by sigma squared over eight, approaching one as step variance shrinks. This is a moment comparison with sampling error. It is not a nested Brownian path, a fixed-horizon refinement experiment, or proof of pathwise convergence.

Check two: a concentrated position. A range from sixty to a hundred and sixty along the same kind of path, in range 16 percent of the time. The simulated loss and the theorem's rate, switched off outside the range, agree within 0.6 percent.

Check the discrete data comparison. On ether's twenty twenty-three minute closes, the sum of step losses divided by changing starting pool values is 2.66 percent, versus 2.66 percent for squared log increments over eight. Monthly normalized loss sums range from 0.10 to 0.42 percent in this sample. Exact discrete accounting needs positive prices and the stated rebalancing convention; interpreting squared log increments through the continuous rate uses a small-step approximation and continuous-price assumptions. Minute closes omit within-minute moves and can include market noise. Similar rounded totals do not independently validate those assumptions or establish an executable return.

Now use a separate stationary reset model. Mispricing z is log external price over pool price. Between blocks, assume z has driftless Brownian increments of scale sigma. This is a log-price assumption, distinct from a martingale price level. For proportional input fee f, the exact symmetric log half-band is gamma equal to minus log one minus f. The small-fee approximation replaces gamma by f. Blocks arrive independently at Poisson rate lambda. A block outside the band resets z to the nearest edge. Inside, nothing resets it. Fixed blocks, log drift, jumps, discrete liquidity and transaction costs change this model.

The stationary law for the stated reset model. Inside the band, zero drift and symmetry reduce the stationary equation to a second derivative of zero, giving constant density c. Outside, Poisson resets remove density at rate lambda, giving exponential tails with rate a equal to square root of two lambda divided by sigma. Continuity and probability-flux balance connect the tails to the interior at both edges. Normalization gives c equal to one over twice gamma plus twice over a. Independent Poisson arrivals see stationary time averages, so the pre-block outside probability is one over one plus a gamma. This is exact for this stationary driftless-log reset model; substituting proportional fee f for gamma is an approximation.

Separate probability from profit. In the driftless-log Poisson reset model, trade probability is one over one plus eta, with eta equal to log half-band times square root of two lambda over sigma. Replacing the log half-band by proportional fee is a small-fee approximation. Relating arbitrage profit to a fee-free continuous LVR rate is a leading-order result under the paper's regularity and scaling. A fee changes the pool's trades and holdings, so it does not leave every finite-sample benchmark loss unchanged. In our outside-curve fee simulator, fee-inclusive rebalancing shortfall can be reconciled with arbitrage profit, while fee-free discrete LVR is a different comparison denominator. No general exact invariance follows.

Check the simulator's Poisson-clock comparisons with their assumptions visible. The research histogram uses diffusion scale 0.002 per square root of one mean block unit. The plotted symmetric density assumes zero log drift, whereas the simulated exponential price has the negative half-variance log drift needed for a martingale level. Finite samples and window truncation also matter; close curves are an approximation check. At fee 0.3 percent, observed trade frequency is 0.322, versus 0.320 using the proportional-fee approximation. The separate multi-fee experiment chooses eighty percent annual volatility and mean twelve-second blocks. Profit divided by fee-free discrete LVR is a different statistic from trade frequency.

Change the block clock. Ethereum has twelve-second slots after the Merge, but some slots are missed and actual execution includes more than a clock. In the chosen fixed-block simulation at three-tenths-percent fee, arbitrage profit divided by fee-free discrete LVR is 0.087, versus 0.104 for the Poisson small-fee benchmark. Fixed times and exponential waiting times have different overshoot distributions, so agreement is not required. This descriptive comparison does not validate actual Ethereum execution or identify an exact universal ordering of all fee effects.

Use ether's actual minute-close path as an external input to the unchanged fee simulator. At three-tenths-percent fee, simulated arbitrage profit divided by the fee-free discrete loss sum is 0.30; relative to the displayed leading-order Brownian comparison it is about 2.3 times as large. That discrepancy is descriptive. Jumps, volatility clustering, log drift, sampling, finite fees and a changed pool state can all affect it. The close data do not isolate fat tails as the cause or prove that a Brownian theorem applies unchanged to this market. Fees are paid outside a fixed curve here and token fees are immediately valued in numeraire; native retained-fee compounding, gas and execution competition are omitted.

What the accounting suggests. Compare LP performance with both holding and a clearly defined self-financing rebalancing benchmark. Under a continuous fee-free model, the loss is a curvature-weighted quadratic-variation integral; real fee-inclusive trading needs its own ledger. Fee and auction design can change trading incentives, activity and allocation. Neither a static fee nor an auction is proved to recover a fixed universal amount by the examples here. A perpetual hedge adds funding, basis, collateral and execution costs. Fees minus idealized LVR is one component, rather than a complete net LP investment return.

Where this sits. Milionis, Moallemi, Roughgarden and Zhang defined LVR and proved the rate; Milionis, Moallemi and Roughgarden added fees and blocks. Agostino Capponi and Ruizhe Jia studied the fee's trade-off between providers and arbitrageurs, and Andreas Lehar and Christine Parlour who provides liquidity on Uniswap. And Angeris, Chitra and coauthors developed the convex geometry of these markets, their oracles and their routing.

Three research directions, framed by the cited literature rather than claimed absent from all later work. Extend fee-band comparisons to jumps, state-dependent volatility and execution costs; separate their effects empirically instead of attributing every residual to tails. Compare dynamic fees and auctions of arbitrage rights with strategic participants and measurable LP welfare. Study routing among many pools with different fees and ranges, including liquidity migration and competition. Existing papers address parts of these questions; the lecture's simplified simulator does not settle the general problems or establish the latest frontier.

Pause and predict. A constant-product pool's volatility doubles, with the fee and the block rate unchanged. What happens to its loss-versus-rebalancing, and to the share of it arbitrageurs keep, if eta was one?

Recap, desk questions, problemsAll tracks5 min

Six definitions and measurements. Custodial venues and contracts on chain have different exposures. A fee-adjusted swap invariant differs from a reserve product that grows with retained fees. Holding and self-financing rebalancing answer different questions. The ether figures are changing-denominator normalized sums, compared with a small-step squared-log relation. Concentration scales local curvature, while realized fee income also depends on time in range and competition. The learned provider is a contextual-bandit experiment in an assumed world, without a claim of live investment performance.

Seven interpretation checks. A largest-feasible attack is not automatically profit-optimal. A simple funding annualization is not a strategy return on committed capital. Matched-unit carry still has basis, funding, collateral, venue and execution risks. The quarter-capital venue loss is a chosen zero-recovery stress. A USDC quote in tether is not a direct dollar redemption valuation. The stationary fee-band probability and the leading-order profit comparison have distinct assumptions. Finally, the proposed House rule organizes research and exposures; the lecture supplies no deployment or capital approval.

Three connections. The familiar tools return in new mechanisms: a pool follows a swap rule, a perpetual has a funding clock and a reserve-backed token has issuer and redemption risks. Choose the benchmark for the question. Holding and self-financing rebalancing measure different gaps, and a real hedge adds costs. Market returns alone need not reveal custody, contracts, collateral transfers or redemption access. A research design needs those operational exposures alongside its price model, without assuming any one reported return series is complete.

The part on one card. Impermanent loss. The LVR rate and its constant-product form. The exact one-step loss. The capital efficiency of a range. The trade probability with fees and blocks, and arbitrage profit. And the perpetual's no-arbitrage price.

How this part connects. Backwards: Part thirty-eight's stale quote is a pool's stale price, Part eleven's short gamma is a provider's, Part twenty-two's carry is funding, and Part two's margin account is the perpetual's. Sideways: Part twenty-one's counterparty risk is venue risk, and Part nine's futures are the perpetual's dated cousins. Forwards: Part forty measures risk in a market with fat tails and no close, Part forty-one's spirals ran through crypto in twenty twenty-two, and Part forty-two's machines include its bots.

Three pool questions. Price doubles in a fee-free constant-product pool: relative to terminal holding value the gap is minus five point seven two percent. The continuous rebalancing gap is a curvature-weighted quadratic-variation integral with common initial wealth and regularity assumptions. Narrowing a range scales local curvature, but cannot guarantee better net performance when volume, competition, exits and costs also change.

Three institutional questions. Funding incentives help link a perpetual to spot, subject to constraints and the contract's rules. Matched-unit carry retains basis, funding, margin, custody and venue risks. A stablecoin quote below a reserve stress does not identify its cause. Reserve valuation, other claims, redemption rights, timing and quote currency all matter. The notes give the assumptions behind each answer.

The research pause is conditional on the model. At the same price and pool state, doubling instantaneous sigma quadruples the fee-free local LVR rate. A realized whole-path loss need not be exactly four times. In the stationary driftless-log Poisson model, eta halves from one to one half, so trade probability rises from one half to two thirds. The leading-order profit comparison would scale by sixteen thirds relative to the original arbitrage profit, if its additional regularity and asymptotic approximation apply. It is not an exact finite-fee statement about all LP losses or fees.

Twelve problems with complete bilingual solutions. Six basic problems cover relative impermanent loss, an exact curve trade, local dollar loss rates, a discrete doubling, multiplicative range efficiency and the exact log fee band. Four advanced problems distinguish simple funding return on committed capital, the continuous perpetual model, a fully specified failure-payoff calculation and sequential liquidation accounting. Two qualifying problems prove the continuous and discrete LVR identities with regularity and a jump extension, then derive the stationary reset density with flux balance, its probability limits and the conditions needed for profit comparisons. Each answer states its units and assumptions.

Where this comes back. Part forty measures risk in markets with fat tails and no close. Part forty-one follows leverage and liquidity spirals, of which crypto's twenty twenty-two was a chain. Part forty-two builds the machines that trade, quote and order blocks. And Part forty-three asks whether anyone can beat the market.

The notes connect the textbook chapters with primary papers and their assumptions, including the loss-versus-rebalancing identity and fee-band model. Computed ordinary outputs, chosen accounting examples and cited historical facts have distinct labels. The market samples do not turn the idealized simulator into a verified executable strategy, and historical legal milestones do not certify current product terms.

Act six has built the tools to study dealers, books, execution, market making and on-chain mechanisms. The digital-assets desk remains a proposed research design with unresolved operational and investment validation. Next, Act seven studies the system. Part forty measures risk with value at risk and expected shortfall, and asks how to tell whether a risk model works.

Where it goes next. Runs, leverage and liquidations are the general subject of Part 41.

Key results

The part's results in one place, for revision.

Constant product\[x\,y=k,\qquad P=\frac{y}{x}\]
Impermanent loss\[\mathrm{IL}(r)=\frac{2\sqrt r}{1+r}-1\]
Loss versus rebalancing\[\frac{d\,\mathrm{LVR}}{dt}=\frac{\sigma^2}{8}\,V\]
Perpetual funding\[\text{funding}\approx\text{premium}+\operatorname{clamp}(\text{interest}-\text{premium})\]

Try it

Lab 39 · An AMM's liquidity provider: loss versus rebalancing

Run a constant-product pool against a simulated market for a year, with arbitrageurs trading it to the market price every block. Compare the provider's loss with the closed form sigma^2/8 per unit time, with impermanent loss, and with the fees a 0.3% pool collects from the same arbitrage.

Figure produced by Lab 39: An AMM's liquidity provider: loss versus rebalancing
Produced by the lab below, seed 0, in 0.6 s. Simulated data.
python -m videos.quant.labs 39 needs numpy, scipy, matplotlib, numba · download lab39.py · source on GitHub
Price moved by a factor          0.58: impermanent loss -3.66% of holding
Loss versus rebalancing, no fee  7.64% of the pool   (sigma^2/8 x time: 7.64%)
With a 0.3% fee                  arbitrageurs trade in 40.1% of blocks; fees collected 5.13% against a loss of 7.66%

Impermanent loss depends on where the price ends; loss versus rebalancing accrues every block whether or not it comes back. It is the price of quoting stale prices to arbitrageurs.
The code (53 lines; it asserts its own result)
"""Lab 39: what a liquidity provider in a constant-product pool loses, and what fees must repay."""

import numpy as np

from videos.quant import labs
from explainer.quant.house import defi, paths

TITLE = "An AMM's liquidity provider: loss versus rebalancing"
GOAL = ("Run a constant-product pool against a simulated market for a year, with arbitrageurs trading it to the "
        "market price every block. Compare the provider's loss with the closed form sigma^2/8 per unit time, with "
        "impermanent loss, and with the fees a 0.3% pool collects from the same arbitrage.")
TASKS = [
    "Lengthen the block from 12 seconds to 10 minutes. Who gets the difference?",
    "Concentrate the liquidity (L, pa, pb in defi.arb_pool) around the price. What scales, and by how much?",
    "Find the volume of uninformed trades that makes a 0.3% pool break even at 80% volatility.",
]


def run(seed=0):
    sigma, T, n = 0.8, 1.0, 100000
    t, S = paths.gbm(1.0, 0.0, sigma, T, n, 1, seed=seed)
    p = S[0]
    free = defi.arb_pool(p, fee=0.0, k=1.0)
    lvr = float(free["lvr"][-1])  # the pool's outputs are cumulative, one entry per block
    V0 = float(defi.cpmm_value(1.0, p[0]))
    theory = sigma ** 2 / 8 * np.mean(defi.cpmm_value(1.0, p)) * T
    il = float(defi.impermanent_loss(p[-1] / p[0]))
    fee = defi.arb_pool(p, fee=0.003, k=1.0)
    fees, lvr_fee = float(fee["fees"][-1]), float(fee["lvr"][-1])
    lab = labs.Lab()
    lab.row("Price moved by a factor", f"{p[-1] / p[0]:.2f}: impermanent loss {100 * il:.2f}% of holding")
    lab.row("Loss versus rebalancing, no fee", f"{100 * lvr / V0:.2f}% of the pool   (sigma^2/8 x time: {100 * theory / V0:.2f}%)")
    lab.row("With a 0.3% fee", f"arbitrageurs trade in {100 * fee['p_trade']:.1f}% of blocks; fees collected "
                               f"{100 * fees / V0:.2f}% against a loss of {100 * lvr_fee / V0:.2f}%")
    lab.note = ("Impermanent loss depends on where the price ends; loss versus rebalancing accrues every block "
                "whether or not it comes back. It is the price of quoting stale prices to arbitrageurs.")
    assert abs(lvr - theory) < 0.05 * theory and 0 < fees < lvr_fee <= lvr * 1.02

    fig, ax = labs.figure(2, size=(11, 4.2))
    r = np.linspace(0.2, 5, 300)
    ax[0].plot(r, 100 * defi.impermanent_loss(r), color=labs.LOSS)
    ax[0].plot(p[-1] / p[0], 100 * il, "o", color=labs.P)
    ax[0].set_xscale("log")
    ax[0].set(title="Impermanent loss against the price ratio", xlabel="final price / initial price", ylabel="% against holding")
    step = n // 1000
    ax[1].plot(t[::step], 100 * free["lvr"][::step] / V0, color=labs.LOSS, label="loss versus rebalancing (no fee)")
    ax[1].plot(t, 100 * sigma ** 2 / 8 * np.cumsum(defi.cpmm_value(1.0, p)) * (T / n) / V0, color=labs.P, ls="--",
               label="integral of sigma^2/8 x pool value")
    ax[1].plot(t[::step], 100 * fee["fees"][::step] / V0, color=labs.GAIN, label="fees at 0.3% (arbitrage only)")
    ax[1].set(title="A year in the pool, in % of its starting value", xlabel="years")
    ax[1].legend(fontsize=8)
    lab.fig = fig
    return lab

Now change it

  1. Lengthen the block from 12 seconds to 10 minutes. Who gets the difference?
  2. Concentrate the liquidity (L, pa, pb in defi.arb_pool) around the price. What scales, and by how much?
  3. Find the volume of uninformed trades that makes a 0.3% pool break even at 80% volatility.

Problems, with solutions

Try each problem before opening its solution; the last two of each set are at qualifying-exam level.

Desk questions, with solutions

  1. A fee-free constant-product doubling gives 2 sqrt(2)/3-1=-5.719% relative to terminal holding. It does not measure the same gap as common-initial-wealth rebalancing.
  2. Under the continuous assumptions above, LVR is -1/2 integral V'' d[P]; for constant product the local rate is sigma²V/8. With jumps, add concavity gaps.
  3. A narrower range increases centre liquidity and curvature per dollar. Net performance also depends on price location, exits, volume, competition and costs; high volatility alone does not supply a universal trading rule.
  4. Funding incentives help link perpetual and spot prices subject to constraints. The proportional continuous solution needs the separate constant-coefficient and transversality assumptions, not merely a funding payment.
  5. A matched-unit carry ledger retains funding, basis, margin, custody, venue, collateral-currency, execution and legal risks. The lecture uses chosen stresses, without historical strategy outcomes.
  6. A stablecoin quote alone does not identify illiquidity or insolvency. Inspect reserve valuation, other claims, redemption rights, access timing and quote currency.

Problems, with worked solutions

Twelve problems with complete solutions

Basic 1–6

  1. Relative impermanent loss at ratios 4 and 1/4.

    Solution

    Equal-value initial holdings have terminal hold value proportional to (1+r)/2 and pool value proportional to sqrt(r). Their ratio is 2 sqrt(r)/(1+r). At 4, it is 4/5; at 1/4 it is 1/1.25=4/5. Both relative losses are -20%. This assumes fee-free constant product and external arbitrage, with no deposits or withdrawals.

  2. **Buy 50 ETH from 1,000 ETH / \(2m, no fee.** A pool has 1,000 ETH and \\)2m. With no fee, find payment and average price for buying 50 ETH.

    Solution

    Initial k=2e9. Remaining token reserve is 950, so final numeraire reserve is 2e9/950=2,105,263.1579. Gross payment is $105,263.1579; average price is $2,105.2632/ETH, or 5.2632% above the initial marginal price. It is payment for exact output, with no fee or gas.

  3. Local LVR dollar rate. At current value $10m and annual sigma 80%, find the local LVR rate in dollars per year and per calendar day.

    Solution

    At current value $10m and annual sigma 0.8, sigma²V/8=$800,000/year; dividing by 365 gives $2,191.7808/calendar day. The local normalized annual rate is 8%. These are instantaneous-rate conversions at the specified current value and constant sigma. Future V changes, so this is not a realized annual dollar loss or investment return.

  4. One discrete doubling and quadratic variation.

    Solution

    With price ratio u=2, the exact gap is Delta LVR/V0=(sqrt(2)-1)²/2=(3-2sqrt(2))/2=0.08578644. A smooth deterministic path can double with zero quadratic variation, while a volatile path can have the same endpoint and positive quadratic variation. Thus a doubling alone does not specify a continuous-rate estimate. The plug-in (log 2)²/8=0.06005663 is a one-increment statistic, not identified quadratic variation of the unobserved path.

  5. Multiplicative range w=1.21. For \([P/1.21,1.21P]\), compute centre efficiency and the local in-range LVR multiple per dollar.

    Solution

    At the geometric centre, concentrated value is 2L sqrt(P)(1-1/sqrt(w)), compared with 2L sqrt(P) for equal full-range liquidity. Efficiency is 1/(1-1/1.1)=11. At that centre and equal capital, the local in-range LVR rate is 11 times the full-range rate. Real fee income and whole-path performance require additional assumptions; below/above the range the curvature vanishes in this model.

  6. Exact log band and probability. Driftless log price, mean Poisson block 12 s, sigma 5%/sqrt(day), input fee 0.3%: use \(\gamma=-\log(1-f)\) to find \(\eta\) and trade probability.

    Solution

    There are lambda=86400/12=7200 mean blocks/day. Sigma is 0.05/sqrt(day). Input fee f=.003 gives gamma=-log(.997)=.00300450902. Then a=sqrt(14400)/.05=2400, eta=a gamma=7.21082165 and P_trade=1/(1+eta)=0.12179049. Replacing gamma by f gives eta 7.2 and probability 0.12195122. The exact expression here refers to stationary driftless log Brownian mispricing with independent Poisson resets, not actual Ethereum or the martingale-level simulator.

Advanced 7–10

  1. Simple carry return under chosen constants. Chosen constant funding 0.01% per 8 h, fixed notional, one-third cash margin, zero basis/costs: find simple annual return on committed capital.

    Solution

    Let spot and perpetual start at 100, one unit held throughout, funding notional fixed at 100, funding .0001 per settlement, three settlements/day, no basis movement, financing, fees or default. Annual funding is 100*.0001*3*365=10.95. Committed capital is 100+100/3=133.3333; simple annual return is 10.95/133.3333=8.2125%. It is not compounded. A buffer raises capital; changing notionals, rates and costs change the answer.

  2. Continuous perpetual premium. Continuous funding: \(r-q=5\%\)/year, \(\kappa=3\)/day. Under constant coefficients and transversality, find \(F/S-1\).

    Solution

    Match units: kappa 3/day=1095/year, a=r-q=.05/year. With constant coefficients, pricing-measure spot drift a, zero-value linear gains and the no-bubble/transversality condition, drift balance for F=cS gives c a=kappa(c-1), so c=1095/1094.95. Premium is .05/1094.95=.00004566419, or .4566419 bp. The positivity condition kappa>a holds. Without the transversality condition this algebra does not establish uniqueness among arbitrary bubble solutions.

  3. Fully specified venue-failure payoffs. A one-year chosen book returns \(+10\%\) if no venue failure and \(-25\%\) if failure. Find the failure probability giving zero expected simple return.

    Solution

    If the one-year simple return is +.10 when no failure occurs and -.25 if failure occurs, then E R=(1-p).10-p.25=.10-.35p; zero mean gives p=2/7=28.5714%. Under an alternative model that earns +.10 even in a failure year and then loses .25, the expression is .10-.25p and the answer is 40%. These are different payoffs. If failure instead gives -1 under the original survival-only specification, the break-even p is .10/1.10=9.0909%, not 10%. No probability of any actual venue is inferred.

  4. Chosen liquidation coverage and service. Chosen liquidation: 70% liquid at par, other assets haircut 30%. Find aggregate coverage; under upfront liquidation and sequential par payouts, who is unpaid? Does this prove a run equilibrium?

    Solution

    With .70 liquid and .30 liquidated at .70 of par, aggregate proceeds are .70+.30*.70=.91 per token. Add the explicit mechanism that all assets are liquidated up front, no other claims/costs exist, and unit tokens are paid par in a fixed sequence until proceeds run out. The first 91% of token claims are paid fully and the last 9% receive zero (with a fractional marginal claim if indivisibility matters). This allocation is not the unchanged original's last_get field, which repeats aggregate coverage. Accounting does not prove a run equilibrium: preferences, beliefs, timing and actions are still missing.

Qualifying 11–12

  1. Continuous LVR, boundaries, a discrete step and jumps. (qual) Under explicit regularity and common initial wealth, prove the continuous LVR identity, concentrated boundary case, exact CPMM step gap and conditional lognormal expectation. Add the jump concavity gap.

    Solution

    Take a price-independent feasible set C. Its infimum of affine functions is concave. Under attainment, a unique minimizing risky holding and differentiability, the envelope theorem gives 'V'=x*; under local C² regularity V''=x*'<=0. Let P be a positive continuous semimartingale and x*(P) predictable and locally P-integrable. Define R0=V(P0)andR=R0+integral x*(P)dP. Local Itô gives dV=xdP+.5 V'' d[P], hence R-V=-.5 integral V'' d[P]>=0`. A drift in P cancels with the entire xdP term. This is a pathwise identity; turning local stochastic integrals into zero-mean true martingales requires additional integrability.

    For constant product, V=2 sqrt(kP), x*=sqrt(k/P) and V''=-sqrt(k)/(2P^(3/2)); under d[P]=sigma²P²dt, the rate is sigma² sqrt(kP)/4=sigma²V/8. In a concentrated range, x*=L(P^-1/2-pb^-1/2), so its derivative is -L/(2P^(3/2)) in range, zero outside; the rate is sigma²L sqrt(P)/4 inside. V' is continuous at both boundaries and locally absolutely continuous, allowing the piecewise smooth Itô extension without derivative-jump local time.

    For one fee-free step, write u=P1/P0. The benchmark gain is x0(P1-P0)=V0(u-1)/2; pool change is V0(sqrt(u)-1). Their difference is V0(u+1-2sqrt(u))/2=V0(sqrt(u)-1)²/2. If conditionally log u ~ N(-v/2,v) with v=sigma²dt, then E u=1 and E sqrt(u)=exp(-v/8), giving E[gap|F0]=V0(1-exp(-v/8)). Dividing by dt and letting dt shrink recovers the local rate. The expectation condition is not supplied by a single observed endpoint.

    For a positive càdlàg semimartingale, under sufficient Itô-with-jumps regularity and left-limit predictable holdings, add sum_s [V(Ps-)+V'(Ps-)*Delta Ps - V(Ps)] to -.5 integral V'' d[P]^c. Concavity makes each bracket nonnegative. The purely continuous variance integral alone therefore misses jump losses. Feasible trading, fees and delayed arbitrage would require a different model.

  2. Stationary edge-reset model and limits. (qual) For driftless Brownian log mispricing and independent Poisson edge resets, derive the stationary density, flux balance, normalization and \(P_{trade}\). Distinguish log-band/input fee and probability/profit limits.

    Solution

    Let z follow dz=sigma dW between independent Poisson times of rate lambda, and reset to sgn(z) gamma when a block sees |z|>gamma; otherwise do nothing. Assume sigma,lambda,gamma>0 and stationarity/ergodicity. Write density rho. Inside the band, the stationary adjoint equation is .5 sigma²rho''=0; symmetry and zero interior probability current imply constant c. Outside, .5 sigma²rho''-lambda rho=0; integrable tails are c exp[-a(|z|-gamma)], where a=sqrt(2lambda)/sigma, continuous at both edges.

    At +gamma, reset inflow is lambda integral_gamma^infinity rho dz=lambda c/a. The derivative jump is rho'(gamma+)-rho'(gamma-)=-ac; integrating the adjoint equation across the edge gives .5 sigma²(-ac)+lambda c/a=0, because a²=2lambda/sigma². The negative edge is symmetric. Finite Brownian diffusion spends zero calendar time at an individual edge, so no stationary atom is needed. Normalization gives 2gamma c+2c/a=1. Independent Poisson arrivals see the stationary pre-arrival distribution, hence P_trade=2c/a=1/(1+a gamma).

    For proportional input fee f, exact symmetric log half-band is gamma=-log(1-f), with gamma=f+O(f²). The simple probability is exact for the stated driftless-log reset model, not for arbitrary price drift or fixed blocks. At fixed positive lambda, gamma down to 0 gives probability 1. At fixed positive gamma, lambda to infinity gives probability asymptotic to sigma/(gamma sqrt(2lambda)), tending to 0. These are probability limits. Claims that arbitrage profit vanishes or fees recover a fee-free reference require the separate profit formulas, demand-curve growth bounds and asymptotic regime; they do not follow from P_trade alone. Taking gamma to zero and lambda to infinity jointly can yield different limits according to gamma*sqrt(lambda).

Reading and notes

The part's papers

from READING.md

  • Diamond, D., Dybvig, P. (1983). "Bank runs, deposit insurance, and liquidity." JPE.
  • Nakamoto, S. (2008). "Bitcoin: a peer-to-peer electronic cash system."
  • Buterin, V. (2014). "Ethereum: a next-generation smart contract and decentralized application platform."
  • Biais, B., Bisière, C., Bouvard, M., Casamatta, C. (2019). "The blockchain folk theorem." RFS.
  • Adams, H., Zinsmeister, N., Robinson, D. (2020). "Uniswap v2 core"; Adams, H., et al. (2021). "Uniswap v3 core"; Uniswap Labs (2023). "Uniswap v4 core" (whitepapers).
  • Angeris, G., Chitra, T. (2020). "Improved price oracles: constant function market makers." ACM AFT.
  • Daian, P., et al. (2020). "Flash Boys 2.0: frontrunning in decentralized exchanges, miner extractable value, and consensus instability." IEEE S&P.
  • Makarov, I., Schoar, A. (2020). "Trading and arbitrage in cryptocurrency markets." JFE.
  • Griffin, J., Shams, A. (2020). "Is Bitcoin really untethered?" Journal of Finance.
  • Liu, Y., Tsyvinski, A. (2021). "Risks and returns of cryptocurrency." RFS.
  • Cong, L. W., Li, Y., Wang, N. (2021). "Tokenomics: dynamic adoption and valuation." RFS.
  • Liu, Y., Tsyvinski, A., Wu, X. (2022). "Common risk factors in cryptocurrency." Journal of Finance.
  • Milionis, J., Moallemi, C., Roughgarden, T., Zhang, A. L. (2022). "Automated market making and loss-versus-rebalancing." arXiv.
  • He, S., Manela, A., Ross, O., von Wachter, V. (2022). "Fundamentals of perpetual futures." arXiv.
  • Qin, K., Zhou, L., Gervais, A. (2022). "Quantifying blockchain extractable value: how dark is the forest?" IEEE S&P.
  • Lyons, R., Viswanath-Natraj, G. (2023). "What keeps stablecoins stable?" J. International Money and Finance.
  • Liu, J., Makarov, I., Schoar, A. (2023). "Anatomy of a run: the Terra Luna crash." NBER WP.
  • Lehar, A., Parlour, C. (2025). "Decentralized exchange: the Uniswap automated market maker." Journal of Finance (verify).
  • Ackerer, D., Hugonnier, J., Jermann, U. (2024). "Perpetual futures pricing." Working paper (verify: venue).
  • Budish, E. (2025). "Trust at scale: the economic limits of cryptocurrencies and blockchains." QJE (verify).
  • SEC (2024). Order in the matter of Tai Mo Shan Limited (Terra USD).
  • Narayanan, A., Bonneau, J., Felten, E., Miller, A., Goldfeder, S. (2016). Bitcoin and Cryptocurrency Technologies. Princeton University Press.
  • Harvey, C. R., Ramachandran, A., Santoro, J. (2021). DeFi and the Future of Finance. Wiley.
  • Egorov, M. (2019). "StableSwap: efficient mechanism for stablecoin liquidity" (whitepaper).
  • Capponi, A., Jia, R. (2021). "The adoption of blockchain-based decentralized exchanges." Working paper.
  • Milionis, J., Moallemi, C., Roughgarden, T. (2023). "Automated market making and arbitrage profits in the presence of fees." arXiv.

Papers and sources

Primary sources and historical scope

Two guessed DOJ URLs returned 404 and are not evidence. The initial SEC press-release URL returned an unrelated Morgan Stanley release, the Circle URL redirected to a generic blog and the v2-whitepaper URL returned 404. These are retained as lookup failures, not used as evidence for the claims above. Source receipts retain response bytes and titles. Further bibliographic and frontier claims below are reading context unless specifically supported; this pass does not claim an exhaustive 2026 literature or legal update.

Papers and sources

Papers, chapter by chapter

  • ch. 1: Nakamoto (2008); Buterin (2014).
  • ch. 2: Adams et al., Uniswap v2/v3 whitepapers (2020, 2021); Angeris and Chitra (2020), ACM AFT; Egorov (2019), stableswap whitepaper.
  • ch. 3: Milionis, Moallemi, Roughgarden and Zhang (2022).
  • ch. 4: Adams et al. (2021); Lehar and Parlour (2025), JF (further reading; the lecture does not rely on an unverified theorem attribution).
  • ch. 5: Daian et al. (2020), IEEE S&P; Qin, Zhou and Gervais (2022), IEEE S&P.
  • ch. 6: He, Manela, Ross and von Wachter (2022); Ackerer, Hugonnier and Jermann (2024) (further reading; the lecture does not rely on an unverified theorem attribution).
  • ch. 7: matched-unit accounting and chosen collateral/venue stresses; no historical strategy outcome is used.
  • ch. 8: Diamond and Dybvig (1983), JPE; Lyons and Viswanath-Natraj (2023), J. International Money and Finance; Liu, Makarov and Schoar (2023), NBER WP.
  • ch. 9: Makarov and Schoar (2020), JFE; Liu and Tsyvinski (2021), RFS; Liu, Tsyvinski and Wu (2022), JF.
  • Research: Milionis, Moallemi, Roughgarden and Zhang (2022); Milionis, Moallemi and Roughgarden (2023); Capponi and Jia (2021).
Textbook audit
Textbook Sections Chapters
Harvey, Ramachandran and Santoro, DeFi and the Future of Finance (2021) DEXs, lending, stablecoins, risks 2, 5, 8
Narayanan, Bonneau, Felten, Miller and Goldfeder, Bitcoin and Cryptocurrency Technologies (2016) ledgers, consensus, custody 1
Data, scope and reproducibilityData access and reproducibility

Ten audited unchanged ordinary originals were each invoked once: amm, lvr, fees, v3, rl, mev, funding, stable, etf, research. All succeeded. Their exact output hashes are pinned in common.py; missing or changed caches fail before implicit computation. The original algorithms, every compute.py, and all 98 protected files remain unchanged.

compute_carry is excluded: its source registers a strategy, opens an envelope and records outcomes. Its cache/payload is not read, opened or scored. Hook, Carry, House and Outro use no historical carry-strategy values. The carry chapter instead states chosen accounting assumptions. Existing registrations remain 23,561 through Part 39 and 23,562 globally; they are not new work authorized by this review.

The pre-dispatch audit enumerated 494 possible immutable public keys. This closure is a list of possible dependencies, not a claim that each original read every key. Public archive checks use the unchanged checker under a persistent pre-check barrier. Ten inherited rejected keys remain barred; no refresh, failed-key retry, substitute fit, registry mutation or new market trial occurred.

Public samples include ETHUSDT minute candles in 2023; BTC/ETH spot and perpetual hourly candles with funding settlements through December 2025; USDCUSDT, USTUSDT, LUNAUSDT and FTTUSDT event samples; GBTC/IBIT Yahoo bars and BTC daily closes. These public observations are distinct from a sealed strategy experiment.

For current exact caches, run final QA from the repository root only after the relevant construction/language checks:

EXPLAINER_TTS=silent python tools/qa_series.py quant39 --cached-only --resume
EXPLAINER_TTS=silent python tools/qa_series.py quant39 --lang zh --cached-only --resume
EXPLAINER_TTS=silent python tools/qa_series.py quant39 --motion --cached-only --resume
python tools/lecture_length.py quant39 --floor 50

Do not run the default all-item computation: it includes the excluded carry original. The exact caches must match their approved hashes. A fresh machine needs an independently audited ordinary-only restoration under immutable-manifest checks; changing historical data is not a repair for a rejected key.

Data, scope and reproducibilityMathematical and empirical conventions

Holding is a different benchmark from rebalancing. A fee-free equal-value constant-product position has terminal value 2 sqrt(r)/(1+r) times the value of holding its starting assets. Standard relative impermanent loss divides the terminal gap by terminal holding value. The chart's pool-minus-hold gap in initial-value units uses a different denominator.

Let V(P)=inf_{(x,y) in C}(Px+y) for a price-independent feasible set. It is concave. If the minimizing risky holding is unique and V differentiable, V'(P)=x*(P). Start a self-financing benchmark at R_0=V(P_0) with dR=x*(P)dP. For a positive continuous semimartingale, sufficient local smoothness and predictable locally integrable holdings give

[ R_t-V(P_t)=-\frac12\int_0^t V''(P_s),d[P]_s\ge0. ]

For dP=mu_t P dt+sigma_t P dW, the entire x*dP term cancels, including drift. The loss is finite variation but can remain random through price/volatility. Expectation claims require true-martingale and integrability conditions. With V=2 sqrt(kP), the local rate is sigma² V/8. Concentrated holdings give sigma² L sqrt(P)/4 in range and zero outside. Their first derivative is continuous at range boundaries, so piecewise smooth Itô does not add a local-time term from a derivative jump. Jumps instead contribute nonnegative concavity gaps, as Problem 11 derives.

A sum of local fractions is not an investment return. The ETH measurement sums loss_i/V_{i-1}. Its comparison sums squared log increments divided by eight. Both use changing values or local increments; neither equals a compounded LP return on initial capital. Sampling omits within-step paths. Similar rounded monthly totals do not prove a continuous-price model, frequency invariance or executable profit.

The simulator's fee ledger is specific. arb_pool keeps k or L fixed, puts input fees outside the invariant and immediately values token fees in numeraire. It omits retained-fee compounding, gas, competing arbitrageurs, execution uncertainty and native protocol details. Its own fee-inclusive rebalancing shortfall can be reconciled with arbitrage profit; fee-free discrete LVR is a different denominator. Fees change trades and holdings, so general finite-sample loss invariance is not implied.

The fee-band theorem has a different drift convention. Write input fee f, exact log half-band gamma=-log(1-f), and a=sqrt(2 lambda)/sigma. Under driftless Brownian log mispricing and independent Poisson edge resets, the stationary pre-block trade probability is 1/(1+a gamma). Replacing gamma by f is a small-fee approximation. The cited paper's symmetric analysis assumes zero log drift (price drift mu=sigma²/2), whereas the simulator uses martingale-level GBM (mu=0, log drift -sigma²/2). Fixed and Poisson clocks also differ. Its ARB comparison with continuous fee-free LVR is an asymptotic result requiring regularity, fast blocks and, when curvature at displaced edges is replaced by current curvature, a small-band approximation. Trade frequency alone does not prove the profit identity. Empirical discrepancies do not isolate fat tails as their cause.

The refinement output is one-step moment evidence. The unchanged original resets its RNG, rescales the same four million normal draws and keeps their number fixed for each m. It estimates the mean normalized step loss relative to s²/8, compared with (1-exp(-s²/8))/(s²/8). It does not construct nested fixed-horizon Brownian paths or establish pathwise convergence. The original's misleading comment remains unchanged; the lecture corrects its interpretation.

Concentration and learning. Ranges are [P/w,Pw], not symmetric plus/minus percentages. Centre efficiency is 1/(1-w^-1/2); local fee scaling additionally needs comparable volume and liquidity allocation. Daily sampled exits miss intraminute crossings and do not measure continuous first passage. The learner uses lagged noisy volatility buckets in a two-regime contextual bandit, an external chosen fee yield, centre efficiency, sampled in-range share, benchmark-relative LVR and reset costs. Actions do not control tomorrow's state. One seeded training run and common evaluation seeds do not quantify training uncertainty. The oracle receives regime information and extra Monte Carlo action selection. Reward is not a total executable LP return; simple 365-times reward annualization is not compounding.

Oracle observations. Arithmetic TWAP averages price levels; averaging log prices and exponentiating yields a geometric time average. For a fee-free fixed-product move with price ratio r>=1, reserves obey x1=x0/sqrt(r), y1=y0sqrt(r); gross numeraire input y0(sqrt(r)-1) is not net manipulation profit. Flash loans require atomic repayment and do not remove fees, gas, price impact, competition or oracle safeguards.

Ordering. Sandwich bisection finds the largest feasible front-run size inside a bound, not a separately verified profit maximum. A negative raw candidate does not prove every attack unprofitable; no-attack is an available action. Victim token shortfall valued at the initial reference differs from attack profit; their difference is not automatically fee income. Private routes and batches address some ordering incentives, without eliminating all MEV.

Funding and carry. The empirical premium is based on selected prior hourly closes, with candle-open timestamps, missing-observation allowances and a display filter. It is not the official impact-price premium index. A simple eight-hour rate annualization is not a financed capital return. The continuous proportional solution F/S=kappa/(kappa-(r-q)) assumes constant coefficients, matching time units, a linear zero-value contract, kappa>r-q and transversality. It is separate from a discrete clamped venue rule. Matched spot/perpetual units leave basis, future funding, financing, collateral liquidity, venue and legal risks.

Stablecoin and fund measurements. The USDC/USDT sample begins at its observed low: the earlier fall is left-censored. The count below 0.98 is an aggregate minute count, not necessarily one spell; recovery is the first later sampled close above 0.995. The quote is in tether, not direct dollars. An 8% reserve-exposure stress does not prove a 0.92 market-price floor or a liquidity-only explanation. The haircut table repeats aggregate liquidation coverage; it does not solve the last redeemer's payoff or a run equilibrium. GBTC close divided by a BTC daily close, normalized at one base date, is not NAV discount without share entitlement, fee erosion and synchronized clocks. IBIT close times volume is a turnover proxy, not exact dollar volume or inflow.

Chapter notesChapters and measurement scope
Scene Subject and evidence
Hook Equal-value constant-product holding comparison; the distinct rebalancing benchmark
Chains Public settlement, different venue designs, consensus, custody and liquidation
AMM Fee-adjusted swaps, reserves, marginal price, arbitrage, oracles and impermanent loss
LVR Common-initial-wealth benchmarks, local loss fractions and sampling sensitivity
Concentrated Multiplicative ranges, local efficiency, sampled exits and a contextual bandit
MEV Transaction order and bounded largest-feasible sandwich candidates
Perps Settlement transfers, a premium proxy and a separate continuous-funding price model
Carry Chosen funding/basis ledger, committed capital, margin liquidity and venue stresses
Stable Reserve haircut accounting, USDC/USDT observations, Terra and historical legal context
Market Venue segmentation, a normalized GBTC/BTC market-price ratio and turnover proxies
House Proposed exposure controls and source excerpts from the unchanged library
Research Continuous/discrete LVR proof, one-step moments and a stationary log-band reset model
Outro Six desk questions, twelve fully solved problems in 6/4/2 grouping, forward links

中文讲义

本讲的中文说明、交易台问题与习题解答(与英文版对应)。

导言第39部分:加密货币与去中心化金融

本部分区分精确记账恒等式、连续价格极限、指定模拟和市场描述。十三个场景覆盖链与交易场所、自动做市、再平衡基准损失、集中流动性、交易排序、永续资金费、基差与保证金、稳定币、基金及研究证明。数字资产交易台是研究提案,不代表部署或资本批准。当前科学修订尚需新的双语构建与最终视觉审阅,历史构建记录不构成当前批准。

Desk questions, with solutions交易台六问
  1. 无费常数乘积池价格翻倍,相对期末持有价值落后5.719%;再平衡损失回答另一问题。
  2. 连续再平衡损失是 -1/2 integral V'' d[P];常数乘积局部速率为 sigma²V/8,跳跃另加凹性缺口。
  3. 缩窄区间放大局部曲率;成交量、竞争、出界、重置及对冲成本会改变净表现。
  4. 资金费激励联系永续与现货,但比例连续价格解需要单独假设与横截条件。
  5. 匹配单位不能消除基差、资金费、保证金、托管、稳定币、执行与场所风险。
  6. 单个稳定币报价不能识别偿付能力或流动性,应审查储备、其他请求权、赎回权、时间及计价币。
Problems, with worked solutions十二道题及完整解答

基础题1–6

  1. 价格比4与1/4的相对无常损失。 初始等价值资产的持有终值正比于 (1+r)/2,池终值正比于 sqrt(r),比例为 2sqrt(r)/(1+r)。r=4时为4/5;r=1/4时也为4/5,因此均为-20%。假设无费用、外部套利、没有新增或撤回流动性。

  2. 买出50 ETH的精确付款。 初始储备1000 ETH与200万美元,k=20亿。剩950 ETH,计价币储备变为 20亿/950=2,105,263.1579。付款105,263.1579美元,平均2105.2632美元/ETH,比初始边际价格高5.2632%。没有手续费或gas。

  3. 局部美元损失速率。 当前价值1000万美元、年波动率0.8,局部速率为 .64*1000万/8=80万美元/年,除以365得2191.7808美元/日;局部归一化速率为8%/年。未来池价值变化,因此不是全年实际美元损失或投资回报。

  4. 单步翻倍与二次变差。 精确比率为 (sqrt(2)-1)²/2=(3-2sqrt(2))/2=.08578644。光滑确定路径可以翻倍但二次变差为零;另一波动路径可同终点而二次变差为正。单一翻倍不能确定连续公式中的方差。代入 (log2)²/8=.06005663只是单增量统计量,不是未观测路径二次变差。

  5. w=1.21的中心效率。 集中价值为 2Lsqrt(P)(1-1/sqrt(w));同L全区间为 2Lsqrt(P)。资本效率 1/(1-1/1.1)=11。中心、等资本、区间内的局部损失速率放大11倍;全程费用与收益仍需额外条件,区间外曲率为零。

  6. 费用带与交易概率。 平均12秒一块,对应每天lambda=7200。sigma=.05/平方根日;f=.003,精确gamma=-log(.997)=.00300450902。a=sqrt14400/.05=2400,eta=7.21082165,概率=.12179049。以f近似gamma时eta=7.2、概率=.12195122。精确性限于平稳、对数无漂移、泊松边缘重置模型,不适用于任意真实链或水平鞅模拟。

进阶题7–10

  1. 指定常资金费与资本口径。 现货与永续各100、保持一单位,结算名义额固定100,费率每8小时.0001,每天三次,无基差、融资、费用或违约。年收入 100*.0001*3*365=10.95。资本 100+100/3=133.3333,简单年收益8.2125%,不复利。额外缓冲、名义额或费率变化会改变结果。

  2. 连续永续溢价。 kappa=3/日=1095/年,a=r-q=.05/年。在定系数、定价测度漂移a、零价值线性收益与无泡沫横截条件下,设F=cS,漂移平衡 ca=kappa(c-1),故c=1095/1094.95。溢价 .05/1094.95=.00004566419,即.4566419基点。kappa>a成立;单凭代数并不能排除任意泡沫解。

  3. 明确场所失败支付后再求概率。 若一年不失败收益+.10,失败收益-.25,则期望 .10(1-p)-.25p=.10-.35p,零期望给p=2/7=28.5714%。若失败年也先赚+.10再损失.25,则变为 .10-.25p,答案40%;它是另一个支付模型。若原模型失败收益改为-1,则p=.10/1.10=9.0909%,不是10%。不推断任何实际场所失败概率。

  4. 指定清算与顺序偿付。 .70流动资产按面值、.30资产折价30%,总回收 .70+.30*.70=.91。再明确:全部资产预先清算、无其他索取或成本,按固定顺序每份足额支付直到款项用完。前91%份额全额、后9%为零;不可分份额可有一个边际部分支付。该结果不是原始计算中重复总覆盖率的last_get字段。缺少偏好、信念、时间和行动,不能据此证明挤兑均衡。

资格题11–12

  1. 连续LVR、边界、单步与跳跃。 价格独立可行集上的仿射函数下确界V是凹函数;若最小点存在唯一且可微,包络定理给 V'=x*;局部C²时 V''=x*'<=0。P为正连续半鞅,持仓可预测且局部可积。令共同初值 R0=V(P0),R=R0+integral x*dP。局部Itô给 dV=x*dP+.5V''d[P],相减得到非负 R-V=-.5integral V''d[P]。整个x*dP包含的漂移也消去;这是逐路径恒等式,期望为零的随机积分还需真鞅及可积条件。

    Solution

    常数乘积:V=2sqrt(kP),x*=sqrt(k/P),V''=-sqrt(k)/(2P^(3/2)),代入 d[P]=sigma²P²dt 得速率 sigma²sqrt(kP)/4=sigma²V/8。集中仓位区间内 x*=L(P^-1/2-pb^-1/2),导数 -L/(2P^(3/2)),区间外为零,故区间内速率 sigma²Lsqrt(P)/4。一阶导数边界连续且局部绝对连续,分段光滑Itô无需导数跳跃局部时项。

    单步令u=P1/P0,再平衡收益为 V0(u-1)/2,池价值变化 V0(sqrt(u)-1),差为 V0(sqrt(u)-1)²/2。若条件 log u~N(-v/2,v),v=sigma²dt,则Eu=1、Esqrt(u)=exp(-v/8),所以条件期望 V0(1-exp(-v/8));除以dt并缩小时段得到局部连续速率,单个终点不提供该分布假设。

    若P为正的右连续有左极限半鞅,在足够的含跳Itô正则性和左极限可预测持仓下,除连续部分 -.5integral V''d[P]^c 外加 sum[V(Ps-)+V'(Ps-)*DeltaPs-V(Ps)]。每项由凹性非负。仅连续方差积分遗漏跳跃损失;费用、延迟套利和交易可行性需改模型。

  2. 平稳边缘重置密度。 在独立泊松率lambda的块之间,z满足 dz=sigma dW,遇块且|z|>gamma则重置到对应±gamma,否则不动。sigma、lambda、gamma均正,假设平稳遍历。带内平稳伴随方程 .5sigma²rho''=0,对称性与零内概率流给常数c;带外 .5sigma²rho''-lambda rho=0,可积尾为 c exp[-a(|z|-gamma)],a=sqrt(2lambda)/sigma,边界密度连续。

    Solution

    正边界重置流入 lambda integral_gamma^infty rho=lambda c/a,导数跳跃为-ac。跨边界积分方程给 .5sigma²(-ac)+lambda c/a=0,因为a²=2lambda/sigma²;负边界对称。布朗扩散在单一点的日历占用时间为零,无需平稳原子。归一化 2gamma c+2c/a=1。独立泊松到达看到到达前平稳时间分布,因此概率 2c/a=1/(1+a gamma)。

    输入费用f对应精确对数带宽gamma=-log(1-f)=f+O(f²)。公式精确性属于此无对数漂移模型,不属于任意漂移或固定块。固定lambda、gamma趋零时概率趋1;固定gamma、lambda趋无穷时概率渐近sigma/(gamma sqrt(2lambda))趋零。这只是概率极限,利润趋零或费用回收参考损失还需单独利润公式、需求曲线增长界及渐近条件。若共同取极限,结果取决于gamma*sqrt(lambda)的路径。

For the researcher定义与研究假设

持有初始资产与自融资再平衡是不同基准。标准无常损失以期末持有组合价值作分母;以初始价值为单位画出的“池减持有”差额不是同一个百分比。令 V(P)=inf_C(Px+y),可行集不依赖价格,则 V 凹。若最小点唯一且 V 可微,包络定理给出 V'=x*。从共同初值 R0=V(P0) 出发,定义 dR=x*dP。对正连续半鞅、局部光滑价值函数及可预测、局部可积持仓,

R_t-V(P_t)=-1/2 integral V''(P_s)d[P]_s >=0。

价格漂移随整个 x*dP 项消去;剩余过程有限变差,但不必确定。取期望还需真鞅及可积条件。常数乘积池的局部速率是 sigma²V/8;集中仓位区间内为 sigma²L sqrt(P)/4,区间外为零。边界一阶导数连续,没有导数跳跃产生的额外局部时项。价格跳跃要另加凹性差额。

ETH结果累加每一步损失除以当步初始池价值,是分母变化的局部损失比率之和,不是初始资本总收益。平方对数增量除以八是小步长比较;相近的四舍五入结果不证明连续价格模型、频率不变性或可执行利润。

费用模拟保持 k 或 L 不变,费用放在曲线外,输入代币费用即时按计价货币估值。原生池内费用复投、gas、竞争、执行不确定性均未建模。含费模拟自己的再平衡缺口与套利利润可作记账核对;无费离散损失是另一个分母,不能推出有限样本损失不变。

费用带证明假设对数价格无漂移、独立泊松出块和边缘重置。输入费率 f 的精确对数半带宽为 gamma=-log(1-f);用 f 代替 gamma 是小费用近似。对称论文模型的价格漂移为 sigma²/2,使对数漂移为零;模拟却用价格水平为鞅的GBM,对数漂移为 -sigma²/2。固定时钟也不同于泊松时钟。利润与无费连续损失的比较是另需正则性、快速出块及相应小带宽近似的渐近关系;交易概率本身不能证明利润恒等式。真实样本残差不单独识别厚尾成因。

所谓细化输出实际上每次重置随机数发生器,重新缩放相同四百万个标准正态数,每组数量不变;它比较单步矩,不是固定期限嵌套布朗路径。区间是 [P/w,Pw],不是对称正负百分比。局部中心效率不保证全程收益。分钟观测的出界天数漏掉分钟内穿越。学习器是滞后波动桶状态的上下文赌博机,奖励依赖指定费用收入、活跃比例、基准相对损失与重置成本,不是完整LP投资回报。单个训练种子不能量化训练不确定性,预知状态的比较对象还使用额外模拟预算。

夹子攻击的二分法寻找有上界的最大可行抢跑规模,未单独验证利润最优。负候选值不证明所有攻击都亏损;不攻击始终是可选行动。受害者按初始参考价估值的代币缺口与攻击利润口径不同,其差不是自动等于手续费。

永续合约的小时收盘价溢价代理不是官方冲击价格指数;简单年化资金费不是投入资本收益。连续比例价格公式要求常系数、时间单位一致、线性零价值合约、kappa>r-q及排除泡沫的横截条件,与离散限幅规则分开。匹配单位仍有基差、未来资金费、融资、抵押品流动性、交易场所与法律风险。

USDC/USDT样本起点就是样本低点,早期下跌被左截断;低于0.98的分钟数是累计量,不一定连续;恢复是之后第一次收盘价超过0.995。USDT报价不是直接美元赎回价值。8%储备暴露的算术不证明0.92价格下界或纯流动性解释。清算表不是末位赎回者收益或挤兑均衡。GBTC/BTC归一化市价比缺少每份币权、费用侵蚀和同步时钟,不能称净值折价;IBIT收盘价乘成交量是成交金额代理,不是精确金额或净流入。

预言机还须区分算术时间均价与对数平均后的几何均价。无费固定乘积价格乘r时,储备为x0/根号r及y0根号r;总输入不是操纵净利润。闪电贷需原子偿还,不消除费用、gas、冲击、竞争或预言机保护。

Papers and sources原始资料与法律日期

英文资料表链接到已核对的LVR与费用论文、Flash Boys 2.0、Uniswap v3白皮书、美联储2023年3月12日声明、SEC2024年1月10日批准令、MiCA和GENIUS法案正文。GENIUS于2025年7月18日成法;生效日是成法18个月后与指定最终规则公布120天后的较早者,不能把成法与全面适用混为一谈。MiCA稳定币条款一般自2024年6月30日适用,其他条款及过渡另有安排。本段不认证当前合规、保险、产品资格或穷尽2026年前沿。失败或误指向的资料查找不作为论据。

Review log of the earlier QA passes on this part: docs/qa/quant/part39.md.

Data, scope and reproducibility数据与复现边界

十个获准的常规原始计算各调用一次且均成功:amm、lvr、fees、v3、rl、mev、funding、stable、etf、research。common.py 固定成功输出的字节哈希;缺失或变化的缓存不能触发隐式重算。所有 compute.py、金融算法及98个受保护文件保持原样。carry 原始计算会登记策略、打开封存样本并记录结果,因此被排除;不读取其缓存或载荷,不打开或评分。开场、交易台、结尾不使用历史套利策略收益。

本次没有刷新数据、重试已拒绝的不可变键、替代历史拟合、登记试验或改变注册表。第39部分累计计数仍为23,561,全局为23,562。494个可能公开数据键是依赖闭包,不表示每个原始计算都读过全部键。十个继承的拒绝键继续禁止。上述英文命令只检查精确已批准缓存;默认全项目计算包含被排除的 carry,不应运行。

Build the film

python -m videos.quant.quant39.compute      # the part's numbers, into .cache/quant39
python tools/make.py quant39                # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant39 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/quant/quant39. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.