Towards Event-Aware Forecasting in DeFi: Insights from On-chain Automated Market Maker Protocols

arXiv cs.LG / 4/23/2026

📰 NewsDeveloper Stack & InfrastructureModels & Research

Key Points

  • The paper argues that AMM pricing in DeFi is driven primarily by on-chain events (like swaps) that change reserve ratios, making event-level analysis essential for understanding how prices form.
  • It introduces a new dataset with 8.9 million on-chain event records across four AMM protocols (Pendle, Uniswap v3, Aave, and Morpho), including fine-grained transaction-type labels and block timestamp annotations.
  • The authors propose an event-aware modeling approach by introducing an Uncertainty Weighted Mean Squared Error (UWM) loss that adds a block-interval regression term to a Time-Point Process (TPP) objective using homoscedastic uncertainty weighting.
  • Experiments across eight advanced TPP architectures show that the UWM loss cuts time prediction error by an average of 56.41% while preserving event-type prediction accuracy, providing a benchmark for event-aware forecasting in AMMs.
  • The dataset and source code are released publicly to support further research on modeling the discrete, event-driven nature of on-chain price discovery.

Abstract

Automated Market Makers (AMMs), as a core infrastructure of decentralized finance (DeFi), uniquely drive on-chain asset pricing through a deterministic reserve ratio mechanism. Unlike traditional markets, AMM price dynamics is triggered largely by on-chain events (e.g., swap) that change the reserve ratio, rather than by continuous responses to off-chain information. This makes event-level analysis crucial for understanding price formation mechanisms in AMMs. However, existing research generally neglects the micro-structural dynamics at the AMMs level, lacking both a comprehensive dataset covering multiple protocols with fine-grained event classification and an effective framework for event-aware modeling. To fill this gap, we construct a dataset containing 8.9 million on-chain event records from four representative AMMs protocols: Pendle, Uniswap v3, Aave and Morpho, with precise annotations of transaction type and block height timestamps. Furthermore, we propose an Uncertainty Weighted Mean Squared Error (UWM) loss function, which incorporates the block interval regression term into the traditional Time-Point Process (TPP) objective function by weighting the uncertainty with homoscedasticity. Extensive experiments on eight advanced TPP architectures demonstrate that this loss function reduces the time prediction error by an average of 56.41\% while maintaining the accuracy of event type prediction, establishing a robust benchmark for event-aware prediction in the AMMs ecosystem. This work provides the necessary data foundation and methodological framework for modeling the discreteness and event-driven characteristics of on-chain price discovery. All datasets and source code are publicly available. https://github.com/yosen-king/Deep-AMM-Events