Skip to content

Xylem-Group/paros

Repository files navigation

paros

CI License: MIT Prose: CC BY-NC-ND 4.0 Python 3.11+ Ruff

Xylem Group's applied research arm: prose notes, reproducible notebooks, governance specs, and benchmark data for FLP toxicity measurement, cascade detection, hedging across cascade regimes, and perp-venue parameter calibration. Sister repo to kos

Cross-venue BTC — the headline methodology demo

Hyperliquid BTC vs Binance USDT-M BTCUSDT, same 24h window. Mid path overlay, HL−BN basis in bps, 500-fill markout distribution per venue. Generated by notebooks/cross_venue_btc.ipynb.

Cross-venue BTC mid path and basis

Mean basis −0.65 bps, σ 6.95 bps over 24h — textbook cross-venue arbed BTC. The notebook also runs the markout sweep on each venue's mid path and overlays the IQR bands; this is the methodology behind the cross-venue benchmarks this repo will publish at scale.

VPIN on real Binance flow

Same headline treatment for VPIN: 2.47M BTCUSDT trades, volume-clock buckets, rolling toxicity, with Binance's 8-hour funding cycle marked. Generated by notebooks/vpin_btc_binance.ipynb.

VPIN on Binance BTCUSDT with funding markers

Empirical finding for liquid majors: the volume-clock × funding interaction documented in kos/vpin.py doesn't produce a measurable artifact on BTCUSDT (near-funding VPIN is lower than rest-of-day at 0.73× ratio). VPIN's volume-bucketing absorbs two-sided rebalancing that wall-clock metrics would flag as a spike. The artifact is likely venue- and asset-conditional; the same notebook on a long altcoin or smaller venue would be the next experiment.

How this repo relates to the rest

xylem-group-website/     ← canonical for prose. The website.
└── content/research/    ← read here as a website.

paros/                   ← THIS REPO. canonical for methodology.
├── notes/               ← mirror of site notes (synced one-way).
├── notebooks/           ← reproducible analyses, importing kos.
├── scripts/             ← data adapters + sync utilities.
├── governance/          ← parameter-calibration specs (planned).
├── benchmarks/          ← benchmark data + result tables (planned).
└── docs/img/            ← rendered hero plots committed for the README.

kos/                     ← the primitives library.
└── kos/{markout,vpin,if_stress}.py

Notes are written and edited on the site. They're mirrored here on demand via python scripts/sync_notes.py so the repo stays a self-contained research artifact you can clone, read offline, cite, and reproduce. The site is the moving target; this repo is the snapshot.

Quickstart

git clone git@github.com:Xylem-Group/paros.git
cd paros
uv sync --extra dev

# Run a real-data notebook (the headline demo):
uv run jupyter lab notebooks/cross_venue_btc.ipynb

Real-data notebooks fetch one day of Binance BTCUSDT aggTrades on first run (~80 MB, cached under ~/.cache/binance_archive/). HL data is read from /Users/andnasnd/hl-data — adjust DEFAULT_ROOT in scripts/data_hl.py for your mount.

Notebooks

Each notebook reproduces a method or applies it to real data. Synthetic-data reproductions are paired with prose notes; real-data demos cite the data sources up top.

Notebook Type Pairs with
notebooks/cross_venue_btc.ipynb real data — HL + Binance USDT-M headline cross-venue methodology
notebooks/vpin_btc_binance.ipynb real data — Binance USDT-M VPIN methodology + funding-event interaction
notebooks/markout_real_aave.ipynb real data — HL L2 (AAVE) sub-second markout walkthrough
notebooks/01_flp_markout_reproduction.py synthetic notes/flp-toxicity-framework.md
notebooks/02_if_stress_sweep.py synthetic notes/gov-param.md, notes/liquidation-engine-designs.md

Scripts

The data adapters in scripts/ are temporary homes for what will eventually live in sigflow-adapters:

  • data_hl.py — Hyperliquid silver-layer parquet loaders (asset contexts, L2 top of book)
  • binance_archive_fetch.py — Binance USDT-M public archive fetcher with local caching
  • data_sigflow.py — production-shaped adapter contract that sigflow's silver layer will satisfy
  • sync_notes.py — mirrors prose notes from the site

When sigflow-adapters lands its production connectors, the notebooks here swap to them with a one-line import change. The contract was designed for that.

Scope and limitations

  • HL L2 snapshot is partial. The local market_data parquet covers 0G, 2Z, AAVE — an artifact of how the snapshot was taken, not a pipeline limit. BTC/ETH sub-second microstructure is gated on a re-snapshot with a broader coin allowlist.
  • HL VPIN trade tape needs a parser. Trade fills live inside replica_cmds signed-action response bundles and aren't yet exposed as a flat tape. Cross-venue VPIN currently leans on Binance aggTrades.
  • Binance fetch is ad-hoc. binance_archive_fetch.py pulls directly from data.binance.vision. Production data flows through sigflow once its backfill lands.

Licensing

Two licenses, by content type — see NOTICE for the precise terms.

  • Code (notebooks, scripts) — MIT.
  • Prose (notes/) — CC BY-NC-ND 4.0 (mirrors the site).

About

FLP toxicity measurement framework, cascade detection, hedging benchmarks

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors