feature(Notebooks): Add timestamp-aggregation exchange-vs-true notebook - #41
Open
almostintuitive wants to merge 2 commits into
Open
feature(Notebooks): Add timestamp-aggregation exchange-vs-true notebook#41almostintuitive wants to merge 2 commits into
almostintuitive wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
timestamp-aggregation.pyfetches every Aperiodic metric (OHLCV, 9 trade metrics, 3 L1 metrics) under bothtimestamp='exchange'andtimestamp='true'for Binance BTC perpetuals (5m, May 2025) and ranks all numeric columns by how much they shift between the two clocks.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.APERIODIC_API_KEY— the sharedDEMO-KEYpreview endpoint doesn't servetimestamp='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.timestamp='true'currently returns no data for L2 buckets.Test plan
.ipynbviajupytext+jupyter nbconvert, scrubbed the injected key, verified withgitleaks detect --no-git🤖 Generated with Claude Code