Struct LiquidityTier
pub struct LiquidityTier {
pub id: u32,
pub name: String,
pub initial_margin_ppm: u32,
pub maintenance_fraction_ppm: u32,
pub base_position_notional: u64,
pub impact_notional: u64,
pub open_interest_lower_cap: u64,
pub open_interest_upper_cap: u64,
}Expand description
LiquidityTier stores margin information.
Fields§
§id: u32Unique id.
name: StringThe name of the tier purely for mnemonic purposes, e.g. “Gold”.
initial_margin_ppm: u32The margin fraction needed to open a position. In parts-per-million.
maintenance_fraction_ppm: u32The fraction of the initial-margin that the maintenance-margin is, e.g. 50%. In parts-per-million.
base_position_notional: u64The maximum position size at which the margin requirements are not increased over the default values. Above this position size, the margin requirements increase at a rate of sqrt(size).
Deprecated since v3.x.
impact_notional: u64The impact notional amount (in quote quantums) is used to determine impact bid/ask prices and its recommended value is 500 USDC / initial margin fraction.
- Impact bid price = average execution price for a market sell of the impact notional value.
- Impact ask price = average execution price for a market buy of the impact notional value.
open_interest_lower_cap: u64Lower cap for Open Interest Margin Fracton (OIMF), in quote quantums. IMF is not affected when OI <= open_interest_lower_cap.
open_interest_upper_cap: u64Upper cap for Open Interest Margin Fracton (OIMF), in quote quantums. IMF scales linearly to 100% as OI approaches open_interest_upper_cap. If zero, then the IMF does not scale with OI.
Trait Implementations§
§impl Clone for LiquidityTier
impl Clone for LiquidityTier
§fn clone(&self) -> LiquidityTier
fn clone(&self) -> LiquidityTier
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for LiquidityTier
impl Debug for LiquidityTier
§impl Default for LiquidityTier
impl Default for LiquidityTier
§fn default() -> LiquidityTier
fn default() -> LiquidityTier
§impl Message for LiquidityTier
impl Message for LiquidityTier
§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.§impl Name for LiquidityTier
impl Name for LiquidityTier
§const NAME: &'static str = "LiquidityTier"
const NAME: &'static str = "LiquidityTier"
Message.
This name is the same as it appears in the source .proto file, e.g. FooBar.§const PACKAGE: &'static str = "dydxprotocol.perpetuals"
const PACKAGE: &'static str = "dydxprotocol.perpetuals"
., e.g. google.protobuf.§fn full_name() -> String
fn full_name() -> String
Message.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.§impl PartialEq for LiquidityTier
impl PartialEq for LiquidityTier
impl StructuralPartialEq for LiquidityTier
Auto Trait Implementations§
impl Freeze for LiquidityTier
impl RefUnwindSafe for LiquidityTier
impl Send for LiquidityTier
impl Sync for LiquidityTier
impl Unpin for LiquidityTier
impl UnwindSafe for LiquidityTier
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].