Skip to content

jayer777/oracle-latency-research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oracle-latency-research

Independent, empirical notes on latency, microstructure, and settlement risk in derivatives that clear against on-chain oracles — Chainlink Data Streams, Chainlink Price Feeds, and the preconfirmation layers of optimistic rollups.

This repository is the code companion to my research notes. It is falsification-first: each experiment either states a testable claim and measures whether it holds, or documents a methodology for measuring something the community has been asserting without data.

Current experiments

experiments/base_vs_binance_predictor.py

Tests whether Base L2 flashblock DEX prices lead the Binance BTCUSDT perpetual on 5-minute direction. Uses the top cbBTC/USDC Uniswap V3 pool on Base as a live on-chain reference and Binance 1-minute klines as a control, over a continuous multi-day window.

Result: No measurable lead. Base DEX price tracks Binance within ±3.2 bps standard deviation at the 4-minute horizon; sign-of-return win rates are 89.4% (Base) vs 89.9% (Binance) on the same 424 resolved windows. The preconfirmation layer on Base does not confer upstream BTC price discovery on this horizon.

Full dataset at data/base_vs_binance_results.json. Writeup with full context at the link above.

experiments/polymarket_queue_priority/

Tests whether passive maker-camping at the top of the book on Polymarket's oracle-resolved 5-minute binary CLOB reproduces the win rate of an 81% directional signal feeding the same architecture. It does not.

Result: Maker-fill WR collapses to ~13.9% — a 67pp inversion versus the signal — while a taker (IOC) architecture fed the same signal returns ~78% fill WR. Adverse selection on the rester side is severe enough to reverse the sign of the edge. Time-priority is real but unhelpful: the queue is populated by sub-second-turnover participants we cannot front-run.

Methodology, hypotheses, and implications in the experiment's README.

Tools

tools/base_flashblocks_observer.py

Sidecar process that subscribes to the public Base preconfirmation RPC (https://mainnet-preconf.base.org), polls pending flashblocks for Uniswap V3 and Aerodrome Swap events, and logs each event with a first-seen timestamp and the block's finalization lead time. Used to construct the per-pool price series in the experiment above.

Standalone, no dependencies beyond the Python standard library.

Methodology principles

  • Reproducibility over novelty. Every claim has a script, a dataset, and a rerun instruction. Results should be regenerable from public endpoints.
  • CEX tick data as the reference. Binance, Coinbase, and Deribit provide the economic ground truth for BTC, ETH, SOL; on-chain oracles and DEX prices are downstream and should be measured as such.
  • Publish the nulls. Most on-chain microstructure hypotheses that get discussed casually do not survive a clean test. The negative results are the useful ones.

Running

Python 3.10+, no external dependencies for the current experiments other than requests. See each script's docstring.

pip install requests
python experiments/base_vs_binance_predictor.py

The observer requires a day or two of collected swap data in data/base-flashblocks/swaps-YYYY-MM-DD.jsonl before the predictor can run — see the observer's docstring for collection details.

License

MIT. If you use the results in your own work, a citation is appreciated but not required.

Contact

Open to collaboration with protocols integrating oracle infrastructure, independent security researchers, and anyone publishing on-chain data openly.

About

Latency and settlement-risk measurements for oracle-settled derivatives. Falsification-first.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages