pub enum MarketEvent {
PositionOpened {
perp_id: B256,
mark_price: f64,
long_oi: f64,
short_oi: f64,
pos_id: U256,
is_maker: bool,
perp_delta: f64,
usd_delta: f64,
tick_lower: i32,
tick_upper: i32,
},
NotionalAdjusted {
perp_id: B256,
mark_price: f64,
long_oi: f64,
short_oi: f64,
pos_id: U256,
new_perp_delta: f64,
swap_perp_delta: f64,
swap_usd_delta: f64,
funding: f64,
trading_fees: f64,
},
PositionClosed {
perp_id: B256,
mark_price: f64,
long_oi: f64,
short_oi: f64,
pos_id: U256,
was_maker: bool,
was_liquidated: bool,
was_partial_close: bool,
exit_perp_delta: f64,
exit_usd_delta: f64,
net_margin: f64,
funding: f64,
},
IndexUpdated {
index: f64,
},
}Expand description
A decoded market event with human-readable f64 values.
Variants§
PositionOpened
A position was opened.
Fields
NotionalAdjusted
Notional was adjusted (swap).
Fields
PositionClosed
A position was closed (or liquidated).
Fields
IndexUpdated
Index price updated (from Beacon contract).
Trait Implementations§
Source§impl Clone for MarketEvent
impl Clone for MarketEvent
Source§fn clone(&self) -> MarketEvent
fn clone(&self) -> MarketEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarketEvent
impl Debug for MarketEvent
Source§impl<'de> Deserialize<'de> for MarketEvent
impl<'de> Deserialize<'de> for MarketEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MarketEvent
impl RefUnwindSafe for MarketEvent
impl Send for MarketEvent
impl Sync for MarketEvent
impl Unpin for MarketEvent
impl UnsafeUnpin for MarketEvent
impl UnwindSafe for MarketEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more