Orderbook feature pipeline and strategy#81
Open
daronoh wants to merge 3 commits into
Open
Conversation
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.
Polymarket orderbook data pipeline (dataset/polymarket_orderbook/): end-to-end pipeline to collect and featurise Polymarket orderbook data. Three stages orchestrated by run_pipeline.py:
Parser — converts polymarket_markets_1y.jsonl → markets.parquet / tokens.parquet / filtered_token_ids.parquet, filtering to the top N markets by volume
Fetch — async fetcher that hits the Dome API to collect raw orderbook snapshots per token, stored as raw_orderbook/ob_<token_id>.parquet (alternatively can download a precollected set of orderbook data from google drive)
Feature generation — builds feat_orderbook/feat_<token_id>.parquet per token with snapshot-level features: best bid/ask, spread, depth (top-3 and total), order imbalance, mid-price deltas, and time-to-expiry
OrderbookAlpha (alpha/OrderbookAlpha.py): IAlpha implementation that time-aligns the pre-computed orderbook snapshots to OHLCV candles via a backward merge_asof.
OrderbookImbalanceStrategy (strategy/OrderbookImbalanceStrategy.py): baseline trading strategy using OrderbookAlpha.