pub struct Market { /* private fields */ }Expand description
What the ticket knows of one market, from the meta the caller read: its asset id, its grid,
and for a perp its leverage ceiling and whether it takes cross margin. HIP-4 outcomes have
orders of their own in crate::markets::outcomes.
Implementations§
Source§impl Market
impl Market
Sourcepub const fn perp(
asset: Asset,
sz_decimals: u32,
max_leverage: u32,
allows_cross: bool,
) -> Option<Market>
pub const fn perp( asset: Asset, sz_decimals: u32, max_leverage: u32, allows_cross: bool, ) -> Option<Market>
A perp, main dex or HIP-3: its szDecimals and maxLeverage in
meta, and whether it takes cross (not onlyIsolated, and no
marginMode that forbids it). None for an id that names no perp.
Sourcepub const fn spot(asset: Asset, sz_decimals: u32) -> Option<Market>
pub const fn spot(asset: Asset, sz_decimals: u32) -> Option<Market>
A spot pair, by its base token’s szDecimals in spotMeta. None
for an id that names no pair.
pub const fn asset(&self) -> Asset
pub const fn grid(&self) -> Grid
Sourcepub const fn max_leverage(&self) -> Option<u32>
pub const fn max_leverage(&self) -> Option<u32>
None on spot, which takes no leverage.
pub const fn allows_cross(&self) -> bool
Trait Implementations§
impl Copy for Market
impl Eq for Market
impl StructuralPartialEq for Market
Auto Trait Implementations§
impl Freeze for Market
impl RefUnwindSafe for Market
impl Send for Market
impl Sync for Market
impl Unpin for Market
impl UnsafeUnpin for Market
impl UnwindSafe for Market
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,
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.