LUNALUNATerra
$0.03
24h
+2.67%

Mathematical audit reveals Terra/Luna mechanism flaws

Bearish-30.92%

AI Summary

The author presents a detailed mathematical audit of the Terra/Luna whitepaper concluding the mechanism is fundamentally flawed and not globally stable, with redemption capacity bounded by Luna demand.

Decided to run my old AI benchmark of feeding the luna whitepaper into models and asking for mathematical errors with 5.6 Sol (mainly for the namesake). Result was quite interesting. @AcerFur mentioned the same with open problems, but it doesn't just go off of knowledge and actually thought through the issue. Claude Fable was also correct but hinged more on what happened in 2022. Model Response Mathematical audit of Terra Money: Stability and Adoption The paper contains a locally plausible arbitrage mechanism, but it does not establish the global solvency or dynamic stability required for a reliable currency. Its central weakness is that Terra’s redemption promise is backed by newly issued Luna, whose value is itself derived from confidence in Terra. The mechanism therefore transfers volatility rather than eliminating it. 1. Formalizing the peg mechanism Let UUU = supply of Terra stablecoins, QQQ = supply of Luna, pUp_UpU​ = market price of one Terra in its target fiat unit, pLp_LpL​ = market price of one Luna, V=pLQV=p_LQV=pL​Q = total market value of Luna. The protocol offers: 1 Terra⟷1 unit of fiat value in Luna.1\text{ Terra}\longleftrightarrow 1\text{ unit of fiat value in Luna}.1 Terra⟷1 unit of fiat value in Luna. When pU<1p_U<1pU​<1, an arbitrageur buys Terra cheaply, burns it, receives Luna, and sells the Luna. For a small transaction with no market impact, the profit is approximately π=1−pU.\pi=1-p_U.π=1−pU​. So the direction of the arbitrage is correct: below the peg, Terra supply contracts; above the peg, Terra supply expands. But the profit is actually π(x)=value realized from selling minted Luna−pUx,\pi(x)=\text{value realized from selling minted Luna}-p_Ux,π(x)=value realized from selling minted Luna−pU​x, where xxx is the amount redeemed. If Luna sales cause price impact, the realized value need not equal the oracle’s quoted value. Let PL(q)P_L(q)PL​(q) be the Luna price after qqq additional Luna have been issued. The total amount of fiat that can be obtained from selling qqq Luna is F(q)=∫0qPL(z) dz.F(q)=\int_0^qP_L(z)\,dz.F(q)=∫0q​PL​(z)dz. A contraction of xxx Terra is financeable only when there exists some qqq such that F(q)≥x.F(q)\geq x.F(q)≥x. Thus the peg requires not merely a quoted Luna price, but enough aggregate demand and market depth for newly issued Luna. The paper does not provide a lower bound on F(q)F(q)F(q). During a confidence crisis, the entire curve PL(q)P_L(q)PL​(q) can shift downward precisely when redemption capacity is most needed. 2. The endogenous-collateral problem Consider a generous model in which Luna’s total “franchise value” VVV—the present value of all future fees and other economic benefits—remains constant even during a redemption event. Before redemption, pL=VQ.p_L=\frac{V}{Q}.pL​=QV​. Suppose the protocol must redeem xxx Terra and issues qqq additional Luna. After dilution, the Luna price is pL′=VQ+q.p_L'=\frac{V}{Q+q}.pL′​=Q+qV​. For the newly issued Luna actually to be worth xxx, qpL′=x.qp_L'=x.qpL′​=x. Substitution gives qVQ+q=x,q\frac{V}{Q+q}=x,qQ+qV​=x, so q=xQV−x.\boxed{q=\frac{xQ}{V-x}}.q=V−xxQ​​. This equation has several important consequences. Redemption requires x0.q_{\text{mint}}-q_{\text{burn}} = \Delta U\left(\frac1{p_L'}-\frac1{p_L}\right)>0.qmint​−qburn​=ΔU(pL′​1​−pL​1​)>0. A complete expansion-contraction cycle can leave Luna with more supply than before, despite the earlier burn. The full face value of minted Terra should therefore not be treated as free fiscal revenue. It is closer to issuing a callable liability whose eventual cost depends on future Luna prices. This matters especially because Treasury spending removes resources that might otherwise provide resilience during later redemptions. 5. The oracle is robust to minorities, but not truth-guaranteeing The paper proposes stake-weighted median price voting, rewarding votes near the selected median and potentially slashing outlying votes. There is a valid robustness result: Normalize total voting stake to 111. Suppose adversarial stake is α\alphaα. If α<1/2\alpha<1/2α<1/2 and all honest observations lie in an interval [a,b][a,b][a,b], the weighted median must lie in [a,b][a,b][a,b]. If α≥1/2\alpha\geq1/2α≥1/2, the adversarial coalition can place the median essentially anywhere. So the median tolerates less than 50% malicious voting weight. But this is not the same as proving truthful reporting. Rewards are based on agreement with the median, not proximity to an independently verified market price. For any arbitrary number mmm, a profile in which everyone reports mmm can be self-consistent: reported median=m,\text{reported median}=m,reported median=m, and everyone reporting mmm receives the agreement reward. Thus false coordinated reports can also be equilibria. Slashing based on distance from the elected median is circular: a majority coalition can choose a false median and cause truthful minority reports to appear deviant. The claim that manipulators would always lose more through diminished stake value is also incomplete. Their gain can come from outside the protocol through: short positions, derivatives, leveraged trades, bribery, positions in competing assets. Those gains are not necessarily bounded by the value of their on-chain stake. 6. The mining-reward controller is not demonstrably stable The paper proposes ft+1=(1+g)Rt−1Rtft,f_{t+1} =(1+g)\frac{R_{t-1}}{R_t}f_t,ft+1​=(1+g)Rt​Rt−1​​ft​, bt+1=(1+g)Rt−1Rtbt,b_{t+1} =(1+g)\frac{R_{t-1}}{R_t}b_t,bt+1​=(1+g)Rt​Rt−1​​bt​, where ftf_tft​ is the transaction fee, btb_tbt​ is the Luna burn rate and RtR_tRt​ is unit mining reward. The “two levers” are mathematically collinear Both controls are multiplied by the same factor. Hence ft+1bt+1=ftbt.\frac{f_{t+1}}{b_{t+1}} = \frac{f_t}{b_t}.bt+1​ft+1​​=bt​ft​​. Unless clipping or additional omitted rules intervene, the ratio ft/btf_t/b_tft​/bt​ never changes. The system therefore has only one effective scalar control direction, not two independently adjustable levers. The simple closed loop can produce a two-cycle Suppose, for illustration, that the economy is constant and next period’s reward is proportional to the joint scale of the controls. If the controls are multiplied by ktk_tkt​, then Rt+1=ktRt,R_{t+1}=k_tR_t,Rt+1​=kt​Rt​, with kt=(1+g)Rt−1Rt.k_t=(1+g)\frac{R_{t-1}}{R_t}.kt​=(1+g)Rt​Rt−1​​. Therefore Rt+1=(1+g)Rt−1.\boxed{R_{t+1}=(1+g)R_{t-1}}.Rt+1​=(1+g)Rt−1​​. When g=0g=0g=0, Rt+1=Rt−1.R_{t+1}=R_{t-1}.Rt+1​=Rt−1​. Rather than converging to one target, rewards can alternate between two values: R0,R1,R0,R1,…R_0,R_1,R_0,R_1,\ldotsR0​,R1​,R0​,R1​,… With g>0g>0g>0, the two interleaved subsequences grow, but the alternation does not inherently disappear. Moving averages and implementation details may damp this, but the equation as presented is not a proof of asymptotic stability. Control limits make universal stabilization impossible Fees are capped, and burn rates satisfy 0≤bt≤1.0\leq b_t\leq1.0≤bt​≤1. Let XtX_tXt​ be transaction volume, fmax⁡f_{\max}fmax​ the maximum fee and BtB_tBt​ all other achievable miner benefits. A necessary condition for target reward Rˉt\bar R_tRˉt​ is approximately RˉtQt≤fmax⁡Xt+Bt.\bar R_tQ_t\leq f_{\max}X_t+B_t.Rˉt​Qt​≤fmax​Xt​+Bt​. During a sufficiently deep contraction, Xt→0.X_t\rightarrow0.Xt​→0. Moreover, when Terra demand is contracting, there may be little or no positive seigniorage from which to burn Luna. Thus BtB_tBt​ may also approach zero. No controller constrained by these revenue sources can guarantee a positive reward floor under arbitrary economic conditions. Miner profitability is modeled incompletely The paper writes miner profit per Luna as rewards per Luna minus unit mining cost. But validator economics should also include the cost and risk of stake capital: economic profit=Rt−rpL,t−operating cost−expected slashing loss,\text{economic profit} = R_t-rp_{L,t}-\text{operating cost} -\text{expected slashing loss},economic profit=Rt​−rpL,t​−operating cost−expected slashing loss, where rrr is the required return on capital. Even if RtR_tRt​ is smoothed, Luna’s price and dilution risk can remain extremely volatile. Stable rewards per token therefore do not imply stable demand to hold and stake the token. 7. The simulation does not establish robustness The figure on page 10 shows: highly volatile transaction volume, varying fees and burn rates, a smooth annual moving average of unit mining rewards. The paper describes a 93% simulated decline in transaction volume while the reward average continues smoothly upward. Several mathematical cautions apply. Moving averages mechanically remove volatility If weekly reward noise is independent with variance σ2\sigma^2σ2, a 52-week moving average has variance Var⁡(Rˉ52)=σ252.\operatorname{Var}(\bar R_{52})=\frac{\sigma^2}{52}.Var(Rˉ52​)=52σ2​. Its standard deviation is reduced by 52≈7.2.\sqrt{52}\approx7.2.52​≈7.2. So an annual-average curve will appear much smoother than weekly rewards even without an especially effective stabilization mechanism. One simulated path is not a stability proof A robustness demonstration would require, at minimum: complete equations for transaction demand and Luna price, price-impact assumptions, oracle delays and errors, strategic trader behavior, controller saturation, parameter sensitivity, multiple stochastic paths, explicit failure probabilities. The paper states that some implementation details are omitted. Consequently, the graph is not independently reproducible from the paper and cannot establish global stability. 8. The Treasury funding equation is flawed as written The proposed dApp weight is wt=(1−λ)TVt∗+λΔTVt∗Ft−1∗.w_t = (1-\lambda)TV_t^* + \lambda\frac{\Delta TV_t^*}{F_{t-1}^*}.wt​=(1−λ)TVt∗​+λFt−1∗​ΔTVt∗​​. Here TVTVTV is transaction volume and FFF is past funding. Dimensional inconsistency The first term has units such as [currency/time],[\text{currency}/\text{time}],[currency/time], while the second has units roughly [currency/time][currency]=[1/time].\frac{[\text{currency}/\text{time}]}{[\text{currency}]} = [1/\text{time}].[currency][currency/time]​=[1/time]. Quantities with different units should not be added directly. The problem cannot be fixed merely by normalizing final weights to sum to one. Suppose monetary values are changed from dollars to cents: TV↦100TV,F↦http://100F.TV\mapsto100TV,\qquad F\http://mapsto100F.TV↦100TV,F↦100F. Then TV∗↦100TV∗,TV^*\mapsto100TV^*,TV∗↦100TV∗, but ΔTV∗F∗↦100ΔTV∗100F∗=ΔTV∗F∗.\frac{\Delta TV^*}{F^*} \mapsto \frac{100\Delta TV^*}{100F^*} = \frac{\Delta TV^*}{F^*}.F∗ΔTV∗​↦100F∗100ΔTV∗​=F∗ΔTV∗​. The first criterion becomes 100 times more influential while the second remains unchanged. Thus the meaning of λ\lambdaλ depends on the arbitrary choice of monetary unit. Undefined and negative weights If Ft−1∗=0,F_{t-1}^*=0,Ft−1∗​=0, the efficiency term is undefined. If funding is merely very small, it can become arbitrarily large. If transaction volume is declining, ΔTVt∗<0,\Delta TV_t^*<0,ΔTVt∗​<0, then wtw_twt​ can be negative. A negative Treasury allocation is not meaningful unless the protocol defines clawbacks or penalties, which the equation does not. Transaction volume is manipulable Suppose a dApp’s funding is A(V)=BaVW+aV,A(V)=B\frac{aV}{W+aV},A(V)=BW+aVaV​, where BBB is the Treasury pool, VVV is the dApp’s reported volume, WWW is the total weight of other dApps, aaa converts volume into weight. Its marginal funding benefit is A′(V)=BaW(W+aV)2.A'(V)=\frac{BaW}{(W+aV)^2}.A′(V)=(W+aV)2BaW​. At low volume, A′(0)=BaW.A'(0)=\frac{Ba}{W}.A′(0)=WBa​. If the cost of generating one dollar of circular or wash volume is ccc, fake volume is profitable whenever BaW>c.\frac{Ba}{W}>c.WBa​>c. Because the same capital can be circulated repeatedly, gross transaction volume may be generated at a cost close to the protocol’s transaction fee. The funding mechanism therefore needs strong anti-wash-trading rules and should measure genuine value creation rather than gross turnover alone. A dimensionally coherent version would first normalize the two criteria separately, for example si=(1−λ)TVi∑jTVj+λmax⁡(0,ΔTVi/(Fi+ε))∑jmax⁡(0,ΔTVj/(Fj+ε)),s_i = (1-\lambda) \frac{TV_i}{\sum_jTV_j} + \lambda \frac{\max(0,\Delta TV_i/(F_i+\varepsilon))} {\sum_j\max(0,\Delta TV_j/(F_j+\varepsilon))},si​=(1−λ)∑j​TVj​TVi​​+λ∑j​max(0,ΔTVj​/(Fj​+ε))max(0,ΔTVi​/(Fi​+ε))​, although even this would still require gaming resistance. 9. Treasury spending is procyclical Treasury income comes primarily from seigniorage generated when Terra demand expands. In simplified form, Gt=(1−bt)max⁡(ΔUt,0).G_t=(1-b_t)\max(\Delta U_t,0).Gt​=(1−bt​)max(ΔUt​,0). During a contraction, ΔUt<0⟹Gt=0.\Delta U_t<0 \quad\Longrightarrow\quad G_t=0.ΔUt​<0⟹Gt​=0. Thus spending is highest when demand is already growing and disappears when demand is falling. This is procyclical, unlike conventional countercyclical fiscal policy. The claimed fiscal multiplier also creates a circular system. Suppose autonomous adoption growth is aaa, and each unit of Treasury spending generates mmm units of additional Terra demand: ΔU=a+mG.\Delta U=a+mG.ΔU=a+mG. Using G=τΔUG=\tau\Delta UG=τΔU during expansion gives ΔU=a+mτΔU,\Delta U=a+m\tau\Delta U,ΔU=a+mτΔU, and therefore ΔU=a1−mτ.\Delta U=\frac{a}{1-m\tau}.ΔU=1−mτa​. For mτ<1m\tau<1mτ<1, the feedback amplifies growth. As mτ→1m\tau\to1mτ→1, the model becomes highly sensitive. For mτ≥1m\tau\geq1mτ≥1, the simple equation has no stable finite expansion equilibrium. This is not necessarily fatal—real systems have saturation—but the paper does not model that saturation. 10. Multi-fiat swaps share liquidity, not solvency Let Terra have currencies indexed by iii, with supplies UiU_iUi​ and target values eie_iei​ in a common numeraire. Total stablecoin liability is L=∑ieiUi.L=\sum_i e_iU_i.L=i∑​ei​Ui​. An atomic swap from currency iii to jjj at the correct exchange rate satisfies ei dUi+ej dUj=0.e_i\,dU_i+e_j\,dU_j=0.ei​dUi​+ej​dUj​=0. Hence dL=0.dL=0.dL=0. The swap changes the denomination of the liability but does not reduce aggregate liabilities or create external backing. Atomic swaps can improve user liquidity and reduce exchange friction. They cannot mathematically “absorb” a system-wide demand shock. They may instead transmit a loss of confidence from one Terra denomination to the others because all are ultimately supported by the same Luna capitalization. Overall assessment ConceptAssessmentSmall-scale mint/burn arbitrageLocally sound, assuming accurate oracle prices and deep Luna liquidityGlobal peg defenceNot established; redemption capacity is bounded by demand for newly issued LunaLuna as volatility absorberTransfers and concentrates volatility; creates reflexive dilutionWeighted-median oracleRobust below 50% adversarial stake, but does not uniquely incentivize truthMining-reward controllerHeuristic; controls are collinear and convergence is not provedStable rewards in all conditionsMathematically impossible under bounded fees and vanishing activitySeigniorage-funded TreasuryTreats contingent liabilities too much like free revenue and is procyclicaldApp funding formulaDimensionally inconsistent, potentially negative or undefined, and gameableMulti-fiat swapsUseful for liquidity, but neutral with respect to aggregate solvencyPresented simulationIllustrative, not a mathematical robustness proof Verdict The central mechanism is conditionally sound for small deviations in normal markets: discounted Terra→redemption→lower Terra supply→restoring pressure.\text{discounted Terra} \rightarrow \text{redemption} \rightarrow \text{lower Terra supply} \rightarrow \text{restoring pressure}.discounted Terra→redemption→lower Terra supply→restoring pressure. But it lacks the condition needed for global soundness: Credible, liquid Luna risk capital > possible Terra redemption demand.\boxed{\text{Credible, liquid Luna risk capital} \;>\; \text{possible Terra redemption demand}.}Credible, liquid Luna risk capital>possible Terra redemption demand.​ Nothing in the protocol guarantees that inequality. Because Luna’s value depends on expected Terra adoption while Terra’s redemption value depends on Luna, a sufficiently large negative shock creates positive feedback: Terra redemptions→Luna issuance→Luna dilution→lower redemption capacity→more Terra redemptions.\text{Terra redemptions} \rightarrow \text{Luna issuance} \rightarrow \text{Luna dilution} \rightarrow \text{lower redemption capacity} \rightarrow \text{more Terra redemptions}.Terra redemptions→Luna issuance→Luna dilution→lower redemption capacity→more Terra redemptions. Accordingly, the paper offers a plausible local price-adjustment mechanism, but not a mathematically complete or globally stable monetary system.

More Views About LUNA