Skip to content

Orderbook feature pipeline and strategy#81

Open
daronoh wants to merge 3 commits into
mainfrom
feat/orderbook-pipeline
Open

Orderbook feature pipeline and strategy#81
daronoh wants to merge 3 commits into
mainfrom
feat/orderbook-pipeline

Conversation

@daronoh
Copy link
Copy Markdown
Collaborator

@daronoh daronoh commented Apr 18, 2026

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.

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