Skip to main content

ReconcilePolicy

Struct ReconcilePolicy 

Source
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

Source

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.

Source

pub fn with_revert_burst(self, config: RevertBurstConfig) -> ReconcilePolicy

Enable consecutive revert burst detection.

Source

pub fn with_revert_gas(self, config: RevertGasConfig) -> ReconcilePolicy

Enable cumulative revert gas budget monitoring.

Source

pub fn with_volume_weighted( self, config: VolumeWeightedConfig, ) -> ReconcilePolicy

Enable volume-weighted average ratio (VWAR) reconciliation.

Source

pub fn with_drawdown(self, config: DrawdownConfig) -> ReconcilePolicy

Enable net capital slippage drawdown monitoring.

Source

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).

Source

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.

Source

pub fn fast_guard_config(&self) -> FastGuardConfig

Source

pub fn slow_guard_config(&self) -> SlowGuardConfig

Source

pub fn revert_burst_config(&self) -> Option<RevertBurstConfig>

Source

pub fn revert_gas_config(&self) -> Option<RevertGasConfig>

Source

pub fn volume_weighted_config(&self) -> Option<VolumeWeightedConfig>

Source

pub fn drawdown_config(&self) -> Option<DrawdownConfig>

Trait Implementations§

Source§

impl Clone for ReconcilePolicy

Source§

fn clone(&self) -> ReconcilePolicy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ReconcilePolicy

Source§

impl Debug for ReconcilePolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ReconcilePolicy

Source§

fn default() -> ReconcilePolicy

Returns the “default value” for a type. Read more
Source§

impl HaltPolicy for ReconcilePolicy

Source§

fn evaluate(&mut self, history: &ReconcileHistory) -> HaltDecision

Given the full (sim, realized) history so far, decide whether to halt.
Source§

impl PartialEq for ReconcilePolicy

Source§

fn eq(&self, other: &ReconcilePolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReconcilePolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.