pub struct PerpCtx {
pub mark_px: Dec,
pub mid_px: Option<Dec>,
pub oracle_px: Dec,
pub prev_day_px: Dec,
pub funding: Dec,
pub open_interest: Dec,
pub day_ntl_vlm: Dec,
pub day_base_vlm: Option<Dec>,
pub premium: Option<Dec>,
pub impact_pxs: Option<Vec<Dec>>,
}Expand description
What a perp is doing now. The venue writes midPx, premium and impactPxs as null on a
market with no book.
Fields§
§mark_px: Dec§mid_px: Option<Dec>§oracle_px: Dec§prev_day_px: Dec§funding: DecHourly, as a fraction of the position’s value.
open_interest: DecIn the base asset.
day_ntl_vlm: DecQuote volume over the last day.
day_base_vlm: Option<Dec>Base volume over the last day.
impact_pxs: Option<Vec<Dec>>Implementations§
Source§impl PerpCtx
impl PerpCtx
Sourcepub fn reference(&self) -> Dec
pub fn reference(&self) -> Dec
The price a market order is bounded from: the mid, else the mark.
Sourcepub fn day_change(&self) -> Option<Dec>
pub fn day_change(&self) -> Option<Dec>
The mark’s change over the day in percent, to two places. None without a previous day’s
price.
Sourcepub fn open_interest_value(&self) -> Option<Dec>
pub fn open_interest_value(&self) -> Option<Dec>
The open interest at the mark, in the quote.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PerpCtx
impl<'de> Deserialize<'de> for PerpCtx
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
impl Eq for PerpCtx
impl StructuralPartialEq for PerpCtx
Auto Trait Implementations§
impl Freeze for PerpCtx
impl RefUnwindSafe for PerpCtx
impl Send for PerpCtx
impl Sync for PerpCtx
impl Unpin for PerpCtx
impl UnsafeUnpin for PerpCtx
impl UnwindSafe for PerpCtx
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.