#[repr(C)]pub struct OnlineFeatures {Show 35 fields
pub version: u16,
pub flags: u16,
pub _pad0: [u8; 4],
pub microprice_1e9: u64,
pub ofi_1level_1e8: i64,
pub ofi_5level_1e8: i64,
pub mlofi_10_1e8: i64,
pub ofi_ewma_1e6: i64,
pub trade_sign_imbalance_1e6: i64,
pub trade_arrival_rate_1e3: u32,
pub vpin_1e4: u16,
pub _pad1: u16,
pub spread_regime: u8,
pub _pad2a: u8,
pub spread_zscore_1e3: i16,
pub cancel_rate_1e4: u16,
pub depth_imbalance_1e4: i16,
pub rv_1m_bps: u32,
pub rv_5m_bps: u32,
pub rv_1h_bps: u32,
pub _pad3: u32,
pub pred_dir_up_1e4: u16,
pub pred_dir_flat_1e4: u16,
pub pred_dir_down_1e4: u16,
pub pred_stress_normal_1e4: u16,
pub pred_stress_widening_1e4: u16,
pub pred_stress_crisis_1e4: u16,
pub pred_toxic_1e4: u16,
pub prediction_age_ms: u16,
pub fill_prob_bid_1e4: u16,
pub fill_prob_ask_1e4: u16,
pub queue_decay_rate_1e4: u16,
pub _fill_pad: u16,
pub feature_ts_ns: u64,
pub _reserved: [u8; 136],
}Expand description
Online microstructure features delivered by the CC data engine. Written to WASM memory before each algo callback. Old algos that never read 0x1A000 are unaffected (backward compatible).
Fields§
§version: u16ABI version (currently 1).
flags: u16Bit flags: bit 0 = vpin_valid.
_pad0: [u8; 4]§microprice_1e9: u64Microprice scaled 1e9.
ofi_1level_1e8: i64Order flow imbalance, top-of-book, scaled 1e8.
ofi_5level_1e8: i64Order flow imbalance, 5 levels, scaled 1e8.
mlofi_10_1e8: i64Multi-level OFI (10 levels), scaled 1e8.
ofi_ewma_1e6: i64OFI EWMA, scaled 1e6.
trade_sign_imbalance_1e6: i64Trade sign imbalance [-1e6, +1e6].
trade_arrival_rate_1e3: u32Trades/sec x 1000.
vpin_1e4: u16VPIN [0, 10000] — only valid when flags bit 0 is set.
_pad1: u16§spread_regime: u80=tight, 1=normal, 2=wide, 3=crisis.
_pad2a: u8§spread_zscore_1e3: i16Spread z-score x 1000.
cancel_rate_1e4: u16Cancel rate [0, 10000].
depth_imbalance_1e4: i16Depth imbalance [-10000, +10000].
rv_1m_bps: u321-minute realized vol in basis points.
rv_5m_bps: u325-minute realized vol in basis points.
rv_1h_bps: u321-hour realized vol in basis points.
_pad3: u32§pred_dir_up_1e4: u16Probability of up direction [0, 10000].
pred_dir_flat_1e4: u16Probability of flat direction [0, 10000].
pred_dir_down_1e4: u16Probability of down direction [0, 10000].
pred_stress_normal_1e4: u16Probability of normal stress [0, 10000].
pred_stress_widening_1e4: u16Probability of widening stress [0, 10000].
pred_stress_crisis_1e4: u16Probability of crisis stress [0, 10000].
pred_toxic_1e4: u16Probability of toxic flow [0, 10000].
prediction_age_ms: u16Age of prediction in ms.
fill_prob_bid_1e4: u16Fill probability on bid side [0, 10000].
fill_prob_ask_1e4: u16Fill probability on ask side [0, 10000].
queue_decay_rate_1e4: u16Queue decay rate [0, 10000].
_fill_pad: u16§feature_ts_ns: u64Feature computation timestamp in nanoseconds.
_reserved: [u8; 136]Reserved for future expansion.
Implementations§
Source§impl OnlineFeatures
impl OnlineFeatures
Sourcepub fn vpin_valid(&self) -> bool
pub fn vpin_valid(&self) -> bool
Whether the VPIN field is valid (flags bit 0).
Sourcepub fn microprice_f64(&self) -> f64
pub fn microprice_f64(&self) -> f64
Microprice as f64 (divide by 1e9).
Sourcepub fn ofi_1level_f64(&self) -> f64
pub fn ofi_1level_f64(&self) -> f64
OFI 1-level as f64 (divide by 1e8).
Sourcepub fn trade_sign_imbalance_f64(&self) -> f64
pub fn trade_sign_imbalance_f64(&self) -> f64
Trade sign imbalance as f64 in [-1.0, +1.0].
Trait Implementations§
Source§impl Clone for OnlineFeatures
impl Clone for OnlineFeatures
Source§fn clone(&self) -> OnlineFeatures
fn clone(&self) -> OnlineFeatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more