Bitstamp¶
Bitstamp-specific components: event loading, trade reading from companion
trades.csv, CSV writing, and BitstampFormat as the default pipeline format.
Modern workflows pair orders.csv with trades.csv (for example from
scripts/collect_bitstamp_btcusd.py). The pipeline resolves
trades.csv from the same directory as the orders.csv path passed to
Pipeline.run.
BitstampLoader ¶
Load raw limit-order events from a Bitstamp-format CSV.
Satisfies the :class:~ob_analytics.protocols.EventLoader protocol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
PipelineConfig
|
Pipeline configuration. |
None
|
load ¶
Read source CSV and return a cleaned events DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str or Path
|
Path to a Bitstamp-format CSV with columns |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Cleaned events with columns |
BitstampTradeReader ¶
Build trades from the companion trades.csv produced by
scripts/collect_bitstamp_btcusd.py.
Reads each row from <source_dir>/trades.csv and projects it into
the canonical trades schema, joining against the events frame to
resolve buy_order_id / sell_order_id into event_id and
original_number references.
Satisfies the :class:~ob_analytics.protocols.TradeSource protocol.
BitstampWriter ¶
Write pipeline events back to Bitstamp-format CSV.
Satisfies the :class:~ob_analytics.protocols.DataWriter protocol.
write ¶
Write the events DataFrame to a Bitstamp-format CSV.
When data also carries a "trades" frame, a companion
trades.csv is written next to dest in capture format, so that a
subsequent :class:BitstampTradeReader can reconstruct trades when the
orders.csv is re-read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict of str to DataFrame
|
Must contain an |
required |
dest
|
str or Path
|
Output CSV file path. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The written events CSV path. |
BitstampFormat
dataclass
¶
Format descriptor for Bitstamp-style CSV data.
Conforms structurally to the :class:~ob_analytics.protocols.Format
Protocol — no inheritance required.