Searcharxiv⌕ Search

arXiv subjects

Ciamac C. Moallemi

Publications and source records attributed to Ciamac C. Moallemi.

At least 19 recordsLinked to original sources

Automated Market Making and Loss-Versus-Rebalancing

Automated Market Makers (AMMs) are both liquidity sources and investment vehicles for market participants. This paper analyzes the risks and returns of liquidity provision (LP) investments in AMMs. In a continuous-time model, we show that LP returns decompose into a beta-like component reflecting market risk exposure, and an alpha-like component reflecting microstructural forces: accrued fees minus losses to arbitrageurs. Applying our decomposition to the Uniswap v2 ETH-USDC pool, we find that over 99.991\% of LP return variance is driven by beta exposure to market risk

q-fin.MF↗

Uniform-Loss Automated Market Making for Prediction Markets

Automated market makers (AMMs) for prediction markets descend from market scoring rules, where a mechanism operator subsidizes a market to aggregate beliefs about uncertain events. The existing literature has focused on bounding the total worst-case loss to the subsidizer, but has not addressed how that loss is distributed across price states or over time. We use the framework of loss-versus-rebalancing (LVR) to study this distribution and introduce \textit{uniform AMMs}, defined by the property that instantaneous LVR is proportional to pool value and independent of the current token price. In a static setting, we show that for a broad class of \textit{win-martingales} -- processes that converge to 0 or 1 at a fixed resolution time -- there exists a pricing function that achieves uniform LVR under that process, and conversely, that any sufficiently regular pricing function induces a win-martingale under which it is uniform. We then extend the framework to dynamic liquidity management, showing that liquidity levels can be adjusted over time to implement a prescribed target expected cumulative loss schedule. This theory is illustrated with canonical examples of win-martingales and pricing functions. Our results can inform AMM designers and liquidity providers on how the inevitable cost of subsidizing price discovery can be shaped and controlled across both price and time.

q-fin.TR↗

Quantifying Sub-Optimality in Routing for Automated Market Makers

We provide a large-scale empirical audit of DEX routing using 2.98 million WETH-USDC swaps on Ethereum. Comparing realized routes with optimized benchmarks, we measure an average shortfall of 2.02 bps per trade or \$24 million. To attribute losses, we introduce three reproducible optimal benchmarks: a Support-Constrained Optimum (SCO) that evaluates split quality conditional on the pools actually used; a Full-Venue Optimum (FVO) that considers all available pools to quantify the value of broader pool access; and a Gas-Aware FVO (G-FVO) that augments FVO with gas costs to capture the trade-off between additional pool usage and gas expenditure. Computing these benchmarks at scale is enabled by a bisection-based algorithm for optimal routing across multiple pools for the same token pair. Two regularities emerge. First, information timeliness is crucial: moving from execution-time state to one-block lagged state optimization significantly raises mean shortfall and additional delays further degrade performance, albeit with diminishing increments; evaluated on the same stale snapshots, realized routes lie closer to optimal, indicating timing-mismatch as a key component. Second, inefficiency is heterogeneous and heavy-tailed: small trades suffer higher percentage losses, while a few extreme outliers dominate the aggregate dollar shortfalls. Finally, we demonstrate that sandwiching attacks drive a significant fraction of routing sub-optimality. Our benchmark protocol and algorithm offer a rigorous, reproducible basis for evaluating and improving information-timely, gas-aware routing.

q-fin.TR↗

Risk-Based Auto-Deleveraging

Auto-deleveraging (ADL) mechanisms are a critical yet understudied component of risk management on cryptocurrency futures exchanges. When available margin and other loss-absorbing resources are insufficient to cover losses following large price moves, exchanges reduce positions and socialize losses among solvent participants via rule-based ADL protocols. We formulate ADL as an optimization problem that minimizes the exchange's risk of loss arising from future equity shortfalls. In a single-asset, isolated-margin setting, the \emph{minimax leverage} policy -- minimizing the maximum leverage among participants -- is optimal for all monotone risk measures. This policy has a transparent structure: positions are reduced first for the most highly levered accounts, and leverage is progressively equalized via a water-filling (or ``leverage-draining'') rule. The policy is distribution-free, wash-trade resistant, Sybil resistant, and path-independent. It provides a canonical and implementable benchmark for ADL design and clarifies the economic logic underlying queue-based mechanisms used in practice. We further study the multi-asset, cross-margin setting, where the ADL problem becomes genuinely multi-dimensional: the exchange must allocate reductions across accounts with portfolios exposed to correlated price moves. Under the expected loss objective, asset-level shadow prices separate the problem across accounts, yielding a scalable numerical method. Naive gross leverage misleads here, ignoring within-portfolio hedging. When prices are driven by a single risk factor, the optimal policy is again water-filling, but in a factor-adjusted leverage, so better-hedged portfolios are deleveraged less. We apply the framework to the October~10, 2025 Hyperliquid ADL event. Relative to the exchange's realized allocation, our risk-minimizing allocations achieve lower expected shortfall.

q-fin.RM↗

OS-Pruner: Pruning Chains-of-Thought of Reasoning Models via Optimal Stopping

Large Language Models (LLMs) have achieved remarkable success in complex reasoning tasks through Chain-of-Thought (CoT) prompting. However, these models often exhibit "computational overthinking," generating redundant reasoning steps that increase latency and cost without improving accuracy. Recent studies suggest that CoT trajectories can be significantly pruned, yet existing methods often rely on forcing a static thinking budget, heuristic filtering, sub-optimal early exit via classification, or expensive re-training. In this paper, we introduce OS-Pruner, a lightweight plug-in framework that formulates chain-of-thought pruning as an optimal stopping problem. Given a reasoning prefix, OS-Pruner learns whether further reasoning is worth its token cost by optimizing an explicit utility that trades off final-answer accuracy against generated length. Our novel formulation enables the model to dynamically assess the sufficient point of termination for a reasoning chain. OS-Pruner is designed to be lightweight during both training and inference, and to provide users with fine-grained control over the reasoning-effort vs. accuracy trade-off. On diverse reasoning benchmarks and base models, OS-Pruner achieves 20-60\% reduction in generation length with minimal accuracy sacrifice.

cs.AI↗

Volatility in Prediction Markets: A Structural Approach

Forward-looking volatility forecasts are central inputs to derivatives pricing, market making, risk management, and volatility-linked trading strategies, with ARCH and GARCH models serving as the canonical workhorses. Such models are natural in standard asset markets, where prices are positive-valued stochastic processes and volatility is typically inferred from return dynamics. Prediction markets have a different structure: prices are bounded probabilities, payoffs are binary, and contracts resolve at known deadlines. We develop and estimate a volatility model tailored to binary prediction markets. The model combines two economic mechanisms: a Wright-Fisher deadline-resolution component, capturing how remaining binary uncertainty is forced to resolve over time, and a Glosten-Milgrom order-flow component, capturing volatility from informed trading as reflected in spreads and volume. Using a large panel of Kalshi contracts, we show that these structural variables carry substantial forecasting power. Plain ARCH/GARCH benchmarks are dominated by structural specifications; combining the structural model with residual GARCH dynamics gives the best overall forecasts. The model also provides an interpretable measurement framework: volatility is highest near fifty-fifty prices, rises near resolution, and varies across categories with the timing and discreteness of information arrival. Economics contracts are closer to smooth deadline-resolution dynamics, while sports contracts exhibit more event-concentrated, jump-like behavior. Across major categories, category-specific fitting does not systematically improve out-of-sample performance, suggesting that the structural specification transfers beyond the pooled headline result.

q-fin.TR↗

Latency Advantages in Common-Value Auctions

In financial applications, latency advantages -- the ability to make decisions later than others, even without the ability to see what others have done -- can provide individual participants with an edge by allowing them to gather additional relevant information. For example, a trader who is able to act even milliseconds after another trader may receive information about changing prices on other exchanges that lets them make a profit at the expense of the latter. To better understand the economics of latency advantages, we consider a common-value auction with a reserve price in which some bidders may have more information about the value of the item than others, e.g., by bidding later. We provide a characterization of the equilibrium strategies, and study the welfare and auctioneer revenue implications of the last-mover advantage. We show that the auction does not degenerate completely and that the seller is still able to capture some value. We study comparative statics of the equilibrium under different assumptions about the nature of the latency advantage. Under the assumptions of the Black-Scholes model, we derive formulas for the last mover's expected profit, as well as for the sensitivity of that profit to their timing advantage. We apply our results to the design of blockchain protocols that aim to run auctions for financial assets on-chain, where incentives to increase timing advantages can put pressure on the decentralization of the system.

econ.TH↗

Outbidding and Outbluffing Elite Humans: Mastering Liar's Poker via Self-Play and Reinforcement Learning

AI researchers have long focused on poker-like games as a testbed for environments characterized by multi-player dynamics, imperfect information, and reasoning under uncertainty. While recent breakthroughs have matched elite human play at no-limit Texas hold'em, the multi-player dynamics are subdued: most hands converge quickly with only two players engaged through multiple rounds of bidding. In this paper, we present Solly, the first AI agent to achieve elite human play in reduced-format Liar's Poker, a game characterized by extensive multi-player engagement. We trained Solly using self-play with a model-free, actor-critic, deep reinforcement learning algorithm. Solly played at an elite human level as measured by win rate (won over 50% of hands) and equity (money won) in heads-up and multi-player Liar's Poker. Solly also outperformed large language models (LLMs), including those with reasoning abilities, on the same metrics. Solly developed novel bidding strategies, randomized play effectively, and was not easily exploitable by world-class human players.

cs.AI↗

Tail-Optimized Caching for LLM Inference

Prompt caching is critical for reducing latency and cost in LLM inference: OpenAI and Anthropic report up to 50-90% cost savings through prompt reuse. Despite its widespread success, little is known about what constitutes an optimal prompt caching policy, particularly when optimizing tail latency, a metric of central importance to practitioners. The widely used Least Recently Used (LRU) policy can perform arbitrarily poor on this metric, as it is oblivious to the heterogeneity of conversation lengths. To address this gap, we propose Tail-Optimized LRU, a simple two-line modification that reallocates KV cache capacity to prioritize high-latency conversations by evicting cache entries that are unlikely to affect future turns. Though the implementation is simple, we prove its optimality under a natural stochastic model of conversation dynamics, providing the first theoretical justification for LRU in this setting, a result that may be of independent interest to the caching community. Experimentally, on real conversation data WildChat, Tail-Optimized LRU achieves up to 27.5% reduction in P90 tail Time to First Token latency and 23.9% in P95 tail latency compared to LRU, along with up to 38.9% decrease in SLO violations of 200ms. We believe this provides a practical and theoretically grounded option for practitioners seeking to optimize tail latency in real-world LLM deployments.

eess.SY↗

Automated Market Making and Arbitrage Profits in the Presence of Fees

We consider the impact of trading fees on the profits of arbitrageurs trading against an automated market maker (AMM) or, equivalently, on the adverse selection incurred by liquidity providers (LPs) due to arbitrage. We extend the model of Milionis et al. [2022] for a general class of two asset AMMs to introduce both fees and discrete Poisson block generation times. In our setting, we are able to compute the expected instantaneous rate of arbitrage profit in closed form. When the fees are low, in the fast block asymptotic regime, the impact of fees takes a particularly simple form: fees simply scale down arbitrage profits by the fraction of blocks which present profitable trading opportunities to arbitrageurs. This fraction decreases with an increasing block rate, hence our model yields an important practical insight: faster blockchains will result in reduced LP losses. Further introducing gas fees (fixed costs) in our model, we show that, in the fast block asymptotic regime, lower gas fees lead to smaller losses for LPs.

q-fin.MF↗

Proof of Sampling: A Nash Equilibrium-Based Verification Protocol for Decentralized Systems

This paper introduces the Proof of Sampling (PoSP) protocol, a Nash Equilibrium-based verification mechanism, and its application to decentralized machine learning inference through spML. Our protocol has a pure strategy Nash Equilibrium, compelling rational participants to act honestly. It economically disincentivizes dishonest behavior, making it costly for participants to compromise the network's integrity. In our spML protocol, we apply PoSP to decentralized inference for AI applications via a novel cryptographic protocol. The resulting protocol is much more efficient than zero knowledge proof based approaches. Moreover, we anticipate that the PoSP protocol could be effectively utilized for designing verification mechanisms within Actively Validated Services (AVS) in restaking solutions. We further expect that the PoSP protocol could be applied to a variety of other decentralized applications. Our approach enhances the reliability and efficiency of decentralized systems, paving the way for a new generation of decentralized applications.

cs.GT↗

A Framework for Combined Transaction Posting and Pricing for Layer 2 Blockchains

This paper presents a comprehensive framework for transaction posting and pricing in Layer 2 (L2) blockchain systems, focusing on challenges stemming from fluctuating Layer 1 (L1) gas fees and the congestion issues within L2 networks. Existing methods have focused on the problem of optimal posting strategies to L1 in isolation, without simultaneously considering the L2 fee mechanism. In contrast, our work offers a unified approach that addresses the complex interplay between transaction queue dynamics, L1 cost variability, and user responses to L2 fees. We contribute by (1) formulating a dynamic model that integrates both posting and pricing strategies, capturing the interplay between L1 gas price fluctuations and L2 queue management, (2) deriving an optimal threshold-based posting policy that guides L2 sequencers in managing transactions based on queue length and current L1 conditions, and (3) establishing theoretical foundations for a dynamic L2 fee mechanism that balances cost recovery with congestion control. We validate our framework through simulations.

cs.GT↗

am-AMM: An Auction-Managed Automated Market Maker

Automated market makers (AMMs) have emerged as the dominant market mechanism for trading on decentralized exchanges implemented on blockchains. This paper presents a single mechanism that targets two important unsolved problems for AMMs: reducing losses to informed orderflow, and maximizing revenue from uninformed orderflow. The ``auction-managed AMM'' works by running a censorship-resistant onchain auction for the right to temporarily act as ``pool manager'' for a constant-product AMM. The pool manager sets the swap fee rate on the pool, and also receives the accrued fees from swaps. The pool manager can exclusively capture some arbitrage by trading against the pool in response to small price movements, and also can set swap fees incorporating price sensitivity of retail orderflow and adapting to changing market conditions, with the benefits from both ultimately accruing to liquidity providers. Liquidity providers can enter and exit the pool freely in response to changing rent, though they must pay a small fee on withdrawal. We prove that under certain assumptions, this AMM should have higher liquidity in equilibrium than any standard, fixed-fee AMM.

q-fin.TR↗

Quantifying the Value of Revert Protection

Revert protection is a feature provided by some blockchain platforms that prevents users from incurring fees for failed transactions. We study the economic implications and benefits of revert protection in the context of priority gas auctions and maximal extractable value. We develop a model in which searchers bid for a top-of-block arbitrage opportunity under varying degrees of revert protection. This model applies to a broad range of settings, including bundle auctions on L1s and priority ordering sequencing rules on L2s. We quantify, in closed form, how revert protection improves equilibrium auction revenue, market efficiency, and blockspace efficiency.

cs.GT↗

What Drives Liquidity on Decentralized Exchanges? Evidence from the Uniswap Protocol

We study liquidity on decentralized exchanges (DEXs), identifying factors at the platform, blockchain, token pair, and liquidity pool levels with predictive power for market depth metrics. We introduce the v2 counterfactual spread metric, a novel criterion which assesses the degree of liquidity concentration in pools using the ``concentrated liquidity'' mechanism, allowing us to decompose the effect of a factor on market depth into two channels: total value locked (TVL) and concentration. We further explore how external liquidity from competing DEXs and private inventory on DEX aggregators influence market depth. We find that (i) gas prices, returns, and a DEX's share of trading volume affect liquidity through concentration, (ii) internalization of order flow by private market makers affects TVL but not the overall market depth, and (iii) volatility, fee revenue, and markout affect liquidity through both channels.

q-fin.TR↗

Loss-Versus-Fair: Efficiency of Dutch Auctions on Blockchains

Milionis et al.(2023) studied the rate at which automated market makers leak value to arbitrageurs when block times are discrete and follow a Poisson process, and where the risky asset price follows a geometric Brownian motion. We extend their model to analyze another popular mechanism in decentralized finance for onchain trading: Dutch auctions. We compute the expected losses that a seller incurs to arbitrageurs and expected time-to-fill for Dutch auctions as a function of starting price, volatility, decay rate, and average interblock time. We also extend the analysis to gradual Dutch auctions, a variation on Dutch auctions for selling tokens over time at a continuous rate. We use these models to explore the tradeoff between speed of execution and quality of execution, which could help inform practitioners in setting parameters for starting price and decay rate on Dutch auctions, or help platform designers determine performance parameters like block times.

q-fin.TR↗

Quantifying Price Improvement in Order Flow Auctions

This work introduces a framework for evaluating onchain order flow auctions (OFAs), emphasizing the metric of price improvement. Utilizing a set of open-source tools, our methodology systematically attributes price improvements to specific modifiable inputs of the system such as routing efficiency, gas optimization, and priority fee settings. When applied to leading Ethereum-based trading interfaces such as 1Inch and Uniswap, the results reveal that auction-enhanced interfaces can provide statistically significant improvements in trading outcomes, averaging 4-5 basis points in our sample. We further identify the sources of such price improvements to be added liquidity for large swaps. This research lays a foundation for future innovations in blockchain based trading platforms.

q-fin.TR↗

A Myersonian Framework for Optimal Liquidity Provision in Automated Market Makers

In decentralized finance ("DeFi"), automated market makers (AMMs) enable traders to programmatically exchange one asset for another. Such trades are enabled by the assets deposited by liquidity providers (LPs). The goal of this paper is to characterize and interpret the optimal (i.e., profit-maximizing) strategy of a monopolist liquidity provider, as a function of that LP's beliefs about asset prices and trader behavior. We introduce a general framework for reasoning about AMMs based on a Bayesian-like belief inference framework, where LPs maintain an asset price estimate. In this model, the market maker (i.e., LP) chooses a demand curve that specifies the quantity of a risky asset to be held at each dollar price. Traders arrive sequentially and submit a price bid that can be interpreted as their estimate of the risky asset price; the AMM responds to this submitted bid with an allocation of the risky asset to the trader, a payment that the trader must pay, and a revised internal estimate for the true asset price. We define an incentive-compatible (IC) AMM as one in which a trader's optimal strategy is to submit its true estimate of the asset price, and characterize the IC AMMs as those with downward-sloping demand curves and payments defined by a formula familiar from Myerson's optimal auction theory. We generalize Myerson's virtual values, and characterize the profit-maximizing IC AMM. The optimal demand curve generally has a jump that can be interpreted as a "bid-ask spread," which we show is caused by a combination of adverse selection risk (dominant when the degree of information asymmetry is large) and monopoly pricing (dominant when asymmetry is small). This work opens up new research directions into the study of automated exchange mechanisms from the lens of optimal auction theory and iterative belief inference, using tools of theoretical computer science in a novel way.

cs.GT↗