Skip to content

feature(Notebooks): Add timestamp-aggregation exchange-vs-true notebook - #41

Open
almostintuitive wants to merge 2 commits into
mainfrom
feature/timestamp-aggregation-notebook
Open

feature(Notebooks): Add timestamp-aggregation exchange-vs-true notebook#41
almostintuitive wants to merge 2 commits into
mainfrom
feature/timestamp-aggregation-notebook

Conversation

@almostintuitive

Copy link
Copy Markdown
Contributor

Summary

  • New notebook timestamp-aggregation.py fetches every Aperiodic metric (OHLCV, 9 trade metrics, 3 L1 metrics) under both timestamp='exchange' and timestamp='true' for Binance BTC perpetuals (5m, May 2025) and ranks all numeric columns by how much they shift between the two clocks.
  • Empirical findings (verified with a live run): slippage columns (especially slippage_bps_buy_sell_ratio) shift the most, L1 order-book snapshot fields shift moderately, and bar-aggregate metrics (OHLCV, flow, impact, tick direction, returns, etc.) barely move — because summing over hundreds of trades per bar averages away the millisecond-scale clock gap.
  • Notebook requires a full APERIODIC_API_KEY — the shared DEMO-KEY preview endpoint doesn't serve timestamp='true' at all (confirmed empirically), and the notebook fails fast with a clear message if only the demo key is available. This is called out at the top of the notebook and in the README table.
  • L2 metrics are probed and excluded from the ranking since timestamp='true' currently returns no data for L2 buckets.
  • README's notebook table updated with the new entry.

Test plan

  • Ran the notebook end-to-end locally with a real API key (output verified, key never committed/printed)
  • Generated and executed the matching .ipynb via jupytext + jupyter nbconvert, scrubbed the injected key, verified with gitleaks detect --no-git
  • CI export/execute workflow passes on this branch

🤖 Generated with Claude Code

almostintuitive and others added 2 commits July 28, 2026 22:05
Ranks every metric by how much it shifts between exchange-reported and
local-arrival timestamps, so readers can see empirically which metrics
need consistent clock choice (slippage, L1 snapshots) and which are
robust to it (bar aggregates).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant