#[non_exhaustive]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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mark_px: DecThe mark price (markPx).
mid_px: Option<Dec>The mid price (midPx); None on a market with no book.
oracle_px: DecThe oracle price (oraclePx).
prev_day_px: DecThe mark price a day ago (prevDayPx).
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.
The premium over the oracle price that funding is computed from, as a fraction; None on a
market with no book.
impact_pxs: Option<Vec<Dec>>The impact bid and ask prices (impactPxs); None on a market with no book.
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>,
impl Eq for PerpCtx
impl StructuralPartialEq for PerpCtx
Auto Trait Implementations§
impl Forget for PerpCtx
impl Freeze for PerpCtx
impl Move 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
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
key and return true if they are equal.