pub struct ReconcilePolicy { /* private fields */ }Expand description
The default HaltPolicy: the phantom-guard dual guard, optionally extended
with revert and capital-weighted risk guards.
Construct via ReconcilePolicy::default_dual_guard for the
whitepaper’s default thresholds, ReconcilePolicy::institutional_default
for revert-burst and volume-weighted protections, or ReconcilePolicy::new
for custom parameters.
Implementations§
Source§impl ReconcilePolicy
impl ReconcilePolicy
Sourcepub fn new(fast: FastGuardConfig, slow: SlowGuardConfig) -> ReconcilePolicy
pub fn new(fast: FastGuardConfig, slow: SlowGuardConfig) -> ReconcilePolicy
Build a policy with explicit guard configuration.
Per whitepaper Property 2, slow.threshold should be greater than
fast.threshold for the two guards to be non-redundant as stated.
§Panics
Panics if fast.window == 0 or slow.window == 0.
Sourcepub fn with_revert_burst(self, config: RevertBurstConfig) -> ReconcilePolicy
pub fn with_revert_burst(self, config: RevertBurstConfig) -> ReconcilePolicy
Enable consecutive revert burst detection.
Sourcepub fn with_revert_gas(self, config: RevertGasConfig) -> ReconcilePolicy
pub fn with_revert_gas(self, config: RevertGasConfig) -> ReconcilePolicy
Enable cumulative revert gas budget monitoring.
Sourcepub fn with_volume_weighted(
self,
config: VolumeWeightedConfig,
) -> ReconcilePolicy
pub fn with_volume_weighted( self, config: VolumeWeightedConfig, ) -> ReconcilePolicy
Enable volume-weighted average ratio (VWAR) reconciliation.
Sourcepub fn with_drawdown(self, config: DrawdownConfig) -> ReconcilePolicy
pub fn with_drawdown(self, config: DrawdownConfig) -> ReconcilePolicy
Enable net capital slippage drawdown monitoring.
Sourcepub fn default_dual_guard() -> ReconcilePolicy
pub fn default_dual_guard() -> ReconcilePolicy
The whitepaper’s default configuration: T_f = 0.50, k_f = 3,
T_s = 0.70, k_s = 20 (Section 7).
Sourcepub fn institutional_default() -> ReconcilePolicy
pub fn institutional_default() -> ReconcilePolicy
Institutional multi-guard policy enabling revert-burst ($k_{rev}=3$) and volume-weighted ratio ($T_{vw}=0.75, k_{vw}=20$) protections.
pub fn fast_guard_config(&self) -> FastGuardConfig
pub fn slow_guard_config(&self) -> SlowGuardConfig
pub fn revert_burst_config(&self) -> Option<RevertBurstConfig>
pub fn revert_gas_config(&self) -> Option<RevertGasConfig>
pub fn volume_weighted_config(&self) -> Option<VolumeWeightedConfig>
pub fn drawdown_config(&self) -> Option<DrawdownConfig>
Trait Implementations§
Source§impl Clone for ReconcilePolicy
impl Clone for ReconcilePolicy
Source§fn clone(&self) -> ReconcilePolicy
fn clone(&self) -> ReconcilePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ReconcilePolicy
Source§impl Debug for ReconcilePolicy
impl Debug for ReconcilePolicy
Source§impl Default for ReconcilePolicy
impl Default for ReconcilePolicy
Source§fn default() -> ReconcilePolicy
fn default() -> ReconcilePolicy
Source§impl HaltPolicy for ReconcilePolicy
impl HaltPolicy for ReconcilePolicy
Source§fn evaluate(&mut self, history: &ReconcileHistory) -> HaltDecision
fn evaluate(&mut self, history: &ReconcileHistory) -> HaltDecision
(sim, realized) history so far, decide whether to
halt.