Trait Adl

Source
pub trait Adl {
    // Required methods
    fn validate_adl(
        &self,
        oracle: &Oracle,
        is_long: bool,
        max_staleness: u64,
    ) -> Result<(), CoreError>;
    fn latest_adl_time(&self, is_long: bool) -> Result<i64, CoreError>;
    fn update_adl_state(
        &mut self,
        oracle: &Oracle,
        is_long: bool,
    ) -> Result<(), Error>;
}
Expand description

Trait for defining operations related to auto-deleveraging.

Required Methods§

Source

fn validate_adl( &self, oracle: &Oracle, is_long: bool, max_staleness: u64, ) -> Result<(), CoreError>

Validate if the ADL can be executed.

Source

fn latest_adl_time(&self, is_long: bool) -> Result<i64, CoreError>

Latest ADL time.

Source

fn update_adl_state( &mut self, oracle: &Oracle, is_long: bool, ) -> Result<(), Error>

Implementors§