arXiv:2609.10407q-fin.TRSep 2026

Manuscript Offprint

arXiv:2609.10407

dexamine: A Python package for Uniswap event data on Ethereum

Magnus Hansson

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Decentralized exchanges record trading and liquidity provision on public blockchains, but empirical analysis requires interpreting these records and linking them to execution metadata. dexamine is a Python package that parses Uniswap v2 and v3 events on Ethereum. It converts transaction receipt logs into observations of trades and liquidity changes, with token quantities, pool state, transaction order, and gas information. The package separates data retrieval, contract metadata, protocol interpretation, and output construction. The repository provides recorded Ethereum responses and an offline reproducible example, and version 1 has been used to construct data for an empirical study of price discovery in decentralized markets.

Keywords: Ethereum; Uniswap; decentralized finance; market microstructure; research software

1 Introduction

Decentralized exchanges allow users to trade digital assets through programs executed on a blockchain. Uniswap v2 and v3 are automated market makers on Ethereum: trades change the balances of liquidity pools, and prices follow rules implemented by their contracts [1, 2]. Their public records provide data for empirical studies of trading and liquidity provision. However, these records describe contract execution and must be interpreted before they become economic observations.

Studies of decentralized exchange markets examine liquidity and trading costs as well as prices [3, 4]. Research on arbitrage and transaction ordering also shows why execution sequence and fees matter [5]. A transaction's position within a block, execution fees, and the pool state following a trade help describe the conditions under which it executed. One Ethereum transaction can contain several trades or liquidity events, each of which must remain distinguishable. A block timestamp alone does not recover their execution order.

Ethereum exposes blocks, transactions, and event logs through JSON-RPC. Constructing a dataset requires protocol-specific decoding, resolution of token metadata, conversion of integer quantities into token units, and joins between events and execution metadata. Repeating these transformations across projects creates opportunities for inconsistent units, signs, and ordering. dexamine implements them in a reusable Python library. The researcher supplies transaction positions, defined by block number and transaction index, together with a protocol selection and, optionally, a pool address, and receives records for the supported events.

Related tools address extraction and indexing at different levels. Ethereum ETL exports blockchain records and selected token data [6]. cryo supports bulk extraction into tabular formats and event decoding from supplied signatures [7]. Graph Node provides application-specific indexing and GraphQL queries through subgraphs and can be operated locally [8]. Its retained information depends on the chosen schema and mappings. TrueBlocks provides address-based transaction indexing [9]. These tools are discussed as related software; dexamine does not import or invoke them. Researchers can use external tools to select transactions before passing their positions to dexamine.

The contribution of dexamine is a common representation of Uniswap events joined to their execution metadata. Generic extraction tools still require these transformations, while a subgraph places them within an indexing service. A separate library allows researchers to reuse RPC and contract-access facilities while incorporating the protocol interpretation into their own pipelines. Transaction discovery, storage, and statistical estimation remain independent stages.

Version 1 of dexamine has been used for data construction in a study of price discovery in decentralized markets [10]. This application requires preserving the sequence of events and their associated pool information. Reusing a parser provides consistent treatment of token units, liquidity changes, and execution metadata across analyses.

The software, documentation, tests, and reproducible examples are available at https://github.com/HanssonMagnus/dexamine.