pub enum InstrumentAny {
Betting(BettingInstrument),
BinaryOption(BinaryOption),
CryptoFuture(CryptoFuture),
CryptoOption(CryptoOption),
CryptoPerpetual(CryptoPerpetual),
CurrencyPair(CurrencyPair),
Equity(Equity),
FuturesContract(FuturesContract),
FuturesSpread(FuturesSpread),
OptionContract(OptionContract),
OptionSpread(OptionSpread),
}
Variants§
Betting(BettingInstrument)
BinaryOption(BinaryOption)
CryptoFuture(CryptoFuture)
CryptoOption(CryptoOption)
CryptoPerpetual(CryptoPerpetual)
CurrencyPair(CurrencyPair)
Equity(Equity)
FuturesContract(FuturesContract)
FuturesSpread(FuturesSpread)
OptionContract(OptionContract)
OptionSpread(OptionSpread)
Implementations§
Source§impl InstrumentAny
impl InstrumentAny
pub fn get_base_quantity(&self, quantity: Quantity, last_px: Price) -> Quantity
Trait Implementations§
Source§impl Clone for InstrumentAny
impl Clone for InstrumentAny
Source§fn clone(&self) -> InstrumentAny
fn clone(&self) -> InstrumentAny
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 InstrumentAny
impl Debug for InstrumentAny
Source§impl<'de> Deserialize<'de> for InstrumentAny
impl<'de> Deserialize<'de> for InstrumentAny
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
Source§impl From<BettingInstrument> for InstrumentAny
impl From<BettingInstrument> for InstrumentAny
Source§fn from(v: BettingInstrument) -> InstrumentAny
fn from(v: BettingInstrument) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<BinaryOption> for InstrumentAny
impl From<BinaryOption> for InstrumentAny
Source§fn from(v: BinaryOption) -> InstrumentAny
fn from(v: BinaryOption) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<CryptoFuture> for InstrumentAny
impl From<CryptoFuture> for InstrumentAny
Source§fn from(v: CryptoFuture) -> InstrumentAny
fn from(v: CryptoFuture) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<CryptoOption> for InstrumentAny
impl From<CryptoOption> for InstrumentAny
Source§fn from(v: CryptoOption) -> InstrumentAny
fn from(v: CryptoOption) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<CryptoPerpetual> for InstrumentAny
impl From<CryptoPerpetual> for InstrumentAny
Source§fn from(v: CryptoPerpetual) -> InstrumentAny
fn from(v: CryptoPerpetual) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<CurrencyPair> for InstrumentAny
impl From<CurrencyPair> for InstrumentAny
Source§fn from(v: CurrencyPair) -> InstrumentAny
fn from(v: CurrencyPair) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<Equity> for InstrumentAny
impl From<Equity> for InstrumentAny
Source§fn from(v: Equity) -> InstrumentAny
fn from(v: Equity) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<FuturesContract> for InstrumentAny
impl From<FuturesContract> for InstrumentAny
Source§fn from(v: FuturesContract) -> InstrumentAny
fn from(v: FuturesContract) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<FuturesSpread> for InstrumentAny
impl From<FuturesSpread> for InstrumentAny
Source§fn from(v: FuturesSpread) -> InstrumentAny
fn from(v: FuturesSpread) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<OptionContract> for InstrumentAny
impl From<OptionContract> for InstrumentAny
Source§fn from(v: OptionContract) -> InstrumentAny
fn from(v: OptionContract) -> InstrumentAny
Converts to this type from the input type.
Source§impl From<OptionSpread> for InstrumentAny
impl From<OptionSpread> for InstrumentAny
Source§fn from(v: OptionSpread) -> InstrumentAny
fn from(v: OptionSpread) -> InstrumentAny
Converts to this type from the input type.
Source§impl Instrument for InstrumentAny
impl Instrument for InstrumentAny
Source§fn make_price(&self, __enum_dispatch_arg_0: f64) -> Price
fn make_price(&self, __enum_dispatch_arg_0: f64) -> Price
Creates a new Price
from the given value
with the correct price precision for the instrument.
Source§fn make_qty(
&self,
__enum_dispatch_arg_0: f64,
__enum_dispatch_arg_1: Option<bool>,
) -> Quantity
fn make_qty( &self, __enum_dispatch_arg_0: f64, __enum_dispatch_arg_1: Option<bool>, ) -> Quantity
Creates a new Quantity
from the given value
with the correct size precision for the instrument.
Source§fn calculate_notional_value(
&self,
__enum_dispatch_arg_0: Quantity,
__enum_dispatch_arg_1: Price,
__enum_dispatch_arg_2: Option<bool>,
) -> Money
fn calculate_notional_value( &self, __enum_dispatch_arg_0: Quantity, __enum_dispatch_arg_1: Price, __enum_dispatch_arg_2: Option<bool>, ) -> Money
Calculates the notional value from the given parameters.
The use_quote_for_inverse
flag is only applicable for inverse instruments.
§Panics
This function panics if instrument is inverse and not use_quote_for_inverse
, with no base currency.
Source§fn calculate_base_quantity(
&self,
__enum_dispatch_arg_0: Quantity,
__enum_dispatch_arg_1: Price,
) -> Quantity
fn calculate_base_quantity( &self, __enum_dispatch_arg_0: Quantity, __enum_dispatch_arg_1: Price, ) -> Quantity
Returns the equivalent quantity of the base asset.
fn into_any(self) -> InstrumentAny
fn id(&self) -> InstrumentId
fn symbol(&self) -> Symbol
fn venue(&self) -> Venue
fn raw_symbol(&self) -> Symbol
fn asset_class(&self) -> AssetClass
fn instrument_class(&self) -> InstrumentClass
fn underlying(&self) -> Option<Ustr>
fn base_currency(&self) -> Option<Currency>
fn quote_currency(&self) -> Currency
fn settlement_currency(&self) -> Currency
fn cost_currency(&self) -> Currency
fn isin(&self) -> Option<Ustr>
fn option_kind(&self) -> Option<OptionKind>
fn exchange(&self) -> Option<Ustr>
fn strike_price(&self) -> Option<Price>
fn activation_ns(&self) -> Option<UnixNanos>
fn expiration_ns(&self) -> Option<UnixNanos>
fn is_inverse(&self) -> bool
fn is_quanto(&self) -> bool
fn price_precision(&self) -> u8
fn size_precision(&self) -> u8
fn price_increment(&self) -> Price
fn size_increment(&self) -> Quantity
fn multiplier(&self) -> Quantity
fn lot_size(&self) -> Option<Quantity>
fn max_quantity(&self) -> Option<Quantity>
fn min_quantity(&self) -> Option<Quantity>
fn max_notional(&self) -> Option<Money>
fn min_notional(&self) -> Option<Money>
fn max_price(&self) -> Option<Price>
fn min_price(&self) -> Option<Price>
fn margin_init(&self) -> Decimal
fn margin_maint(&self) -> Decimal
fn maker_fee(&self) -> Decimal
fn taker_fee(&self) -> Decimal
fn ts_event(&self) -> UnixNanos
fn ts_init(&self) -> UnixNanos
Source§impl PartialEq for InstrumentAny
impl PartialEq for InstrumentAny
Source§impl Serialize for InstrumentAny
impl Serialize for InstrumentAny
Source§impl TryInto<BettingInstrument> for InstrumentAny
impl TryInto<BettingInstrument> for InstrumentAny
Source§impl TryInto<BinaryOption> for InstrumentAny
impl TryInto<BinaryOption> for InstrumentAny
Source§impl TryInto<CryptoFuture> for InstrumentAny
impl TryInto<CryptoFuture> for InstrumentAny
Source§impl TryInto<CryptoOption> for InstrumentAny
impl TryInto<CryptoOption> for InstrumentAny
Source§impl TryInto<CryptoPerpetual> for InstrumentAny
impl TryInto<CryptoPerpetual> for InstrumentAny
Source§impl TryInto<CurrencyPair> for InstrumentAny
impl TryInto<CurrencyPair> for InstrumentAny
Source§impl TryInto<Equity> for InstrumentAny
impl TryInto<Equity> for InstrumentAny
Source§impl TryInto<FuturesContract> for InstrumentAny
impl TryInto<FuturesContract> for InstrumentAny
Source§impl TryInto<FuturesSpread> for InstrumentAny
impl TryInto<FuturesSpread> for InstrumentAny
Source§impl TryInto<OptionContract> for InstrumentAny
impl TryInto<OptionContract> for InstrumentAny
Source§impl TryInto<OptionSpread> for InstrumentAny
impl TryInto<OptionSpread> for InstrumentAny
Auto Trait Implementations§
impl Freeze for InstrumentAny
impl RefUnwindSafe for InstrumentAny
impl Send for InstrumentAny
impl Sync for InstrumentAny
impl Unpin for InstrumentAny
impl UnwindSafe for InstrumentAny
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