Skip to content

Commit e924752

Browse files
authored
update docs (#78)
1 parent 0ac9895 commit e924752

28 files changed

+54
-39
lines changed

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Defines **pure interfaces** with no internal state. These are the contracts your
2626

2727
* `Engine`: orchestrates startup and shutdown
2828
* `NLevelOrderBook`: in-memory order book with tick-aligned price levels
29-
* `CandleAggregator`: aggregates trades into fixed-interval OHLCV candles
29+
* `BarAggregator`: aggregates trades into fixed-interval OHLCV bars
3030
* `SymbolRegistry`: maps `(exchange:symbol)` pairs to compact `SymbolId`
3131
* `EventBus`: Disruptor-style ring buffer for high-throughput event delivery
3232
* `BookUpdateEvent`, `TradeEvent`: pooled, reusable market data structures

docs/components/book/bus/trade_bus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bool configureTradeBusForPerformance(TradeBus& bus, bool enablePerformanceOptimi
1919
|----------|-------------------------------------------------------------------------|
2020
| Payload | Direct delivery of `TradeEvent` instances (no wrapping or pooling). |
2121
| Pattern | Disruptor-style ring buffer with lock-free sequencing. |
22-
| Usage | Used by connectors, aggregators (e.g., `CandleAggregator`), and strategies.|
22+
| Usage | Used by connectors, aggregators (e.g., `BarAggregator`), and strategies.|
2323
2424
## Factory Functions
2525

docs/components/book/events/trade_event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ struct TradeEvent {
2525
2626
## Notes
2727
28-
* Used by `CandleAggregator`, PnL trackers, and all signal generation components.
28+
* Used by `BarAggregator`, PnL trackers, and all signal generation components.
2929
* Designed for ultra-low-latency delivery; no heap allocation involved.
3030
* Stateless container — no logic beyond encapsulation.

docs/components/book/trade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ struct Trade
3232
## Notes
3333

3434
* Emitted via `TradeEvent` through `TradeBus`.
35-
* Serves as input for candle aggregation, PnL tracking, flow analysis, and latency metrics.
35+
* Serves as input for bar aggregation, PnL tracking, flow analysis, and latency metrics.
3636
* `instrument` allows immediate filtering without a registry lookup in hot paths.
3737
* Uses `UnixNanos` (int64_t nanoseconds) for precise exchange timestamps.

docs/components/common.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Built on top of the `Decimal` template for safe, precise arithmetic.
7272
| ---------- | ----- | -------------------------------------------- |
7373
| `Price` | 1e-6 | Decimal representation of price. |
7474
| `Quantity` | 1e-6 | Decimal quantity (e.g. number of contracts). |
75-
| `Volume` | 1e-6 | Price × Quantity, used in candle bars etc. |
75+
| `Volume` | 1e-6 | Price × Quantity, used in bars etc. |
7676

7777
All three types use `Decimal<Tag, 1'000'000, 1>` internally, ensuring:
7878

docs/components/engine/abstract_subsystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public:
2727
## Notes
2828

2929
* Methods have default empty implementations, allowing derived classes to override only what they need.
30-
* Used by core modules like `CandleAggregator`, `Strategy`, `ExecutionTracker`, `SymbolRegistry`, etc.
30+
* Used by core modules like `BarAggregator`, `Strategy`, `ExecutionTracker`, `SymbolRegistry`, etc.
3131
* Lifecycle is typically orchestrated by the engine or test harness.
3232
* No assumptions about threading — start/stop are always externally coordinated.
3333

docs/components/engine/event_dispatcher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct EventDispatcher<pool::Handle<T>> {
2424
| ----------------- | ------------------------------------------------------------- |
2525
| `BookUpdateEvent` | `IMarketDataSubscriber::onBookUpdate()` |
2626
| `TradeEvent` | `IMarketDataSubscriber::onTrade()` |
27-
| `CandleEvent` | `IMarketDataSubscriber::onCandle()` |
27+
| `BarEvent` | `IMarketDataSubscriber::onBar()` |
2828
| `OrderEvent` | `IOrderExecutionListener::onOrderFilled()` via `dispatchTo()` |
2929
| `pool::Handle<T>` | Unwraps and forwards to `EventDispatcher<T>` |
3030

docs/components/strategy/abstract_strategy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public:
1717
1818
| Inherits From | Responsibilities |
1919
|----------------------|----------------------------------------------------------|
20-
| `IMarketDataSubscriber` | Receives `TradeEvent`, `BookUpdateEvent`, `CandleEvent`. |
20+
| `IMarketDataSubscriber` | Receives `TradeEvent`, `BookUpdateEvent`, `BarEvent`. |
2121
| `ISubsystem` | Enables coordinated `start()` / `stop()` during engine run. |
2222
2323
## Implementation

docs/explanation/architecture.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ flowchart TD
3333
subgraph EventBuses[Event Buses - Disruptor Ring Buffers]
3434
TB[TradeBus]
3535
BB[BookUpdateBus]
36-
CB[CandleBus]
36+
CB[BarBus]
3737
end
3838
3939
subgraph Aggregators
40-
CA[CandleAggregator]
40+
CA[BarAggregator]
4141
end
4242
4343
subgraph Strategies
@@ -102,10 +102,11 @@ All buses use the Disruptor pattern (see [The Disruptor Pattern](disruptor.md)):
102102
|-----|------------|---------|
103103
| `TradeBus` | `TradeEvent` | Individual trades |
104104
| `BookUpdateBus` | `pool::Handle<BookUpdateEvent>` | Order book snapshots/deltas |
105-
| `CandleBus` | `CandleEvent` | OHLCV candles |
105+
| `BarBus` | `BarEvent` | OHLCV bars |
106106
| `OrderExecutionBus` | `OrderEvent` | Order state changes |
107107
108108
Key characteristics:
109+
109110
- Lock-free ring buffer
110111
- Single producer, multiple consumers
111112
- Consumers run in dedicated threads
@@ -127,6 +128,7 @@ public:
127128
```
128129

129130
Connectors:
131+
130132
- Parse exchange-specific wire protocols
131133
- Convert to FLOX event types
132134
- Publish to event buses
@@ -145,11 +147,13 @@ public:
145147
```
146148

147149
From `IMarketDataSubscriber`:
150+
148151
- `onTrade(const TradeEvent&)`
149152
- `onBookUpdate(const BookUpdateEvent&)`
150-
- `onCandle(const CandleEvent&)`
153+
- `onBar(const BarEvent&)`
151154

152155
From `ISubsystem`:
156+
153157
- `start()`
154158
- `stop()`
155159

@@ -168,9 +172,10 @@ public:
168172
```
169173

170174
Subsystems include:
175+
171176
- Event buses
172177
- Strategies
173-
- Aggregators (e.g., CandleAggregator)
178+
- Aggregators (e.g., BarAggregator)
174179
- Execution trackers
175180
- Custom components
176181

@@ -185,6 +190,7 @@ auto id = registry.getSymbolId("binance", "BTCUSDT");
185190
```
186191

187192
Benefits:
193+
188194
- Fast comparison (integer vs string)
189195
- Compact event structures
190196
- Consistent across components
@@ -238,6 +244,7 @@ bus.setupOptimalConfiguration(EventBus::ComponentType::MARKET_DATA);
238244
```
239245

240246
This:
247+
241248
- Pins consumer threads to isolated cores
242249
- Sets real-time scheduling priority
243250
- Enables NUMA-aware core assignment

docs/explanation/integration-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ tradeBus->subscribe(metrics.get(), /*optional=*/true);
139139
**Common subscribers:**
140140
141141
- Trading strategies
142-
- Data aggregators (candles, VWAP)
142+
- Data aggregators (bars, VWAP)
143143
- Metric collectors
144144
- Risk modules
145145
- Loggers

0 commit comments

Comments
 (0)