pub enum OptionTerms {
CashPut {
strike: Strike,
},
CoveredCall {
strike: Strike,
},
CashSecuredPut {
strike: Strike,
},
CallSpread {
lower_strike: Strike,
upper_strike: Strike,
},
PutSpread {
lower_strike: Strike,
upper_strike: Strike,
},
}Expand description
The complete, hash-bound option terms carried by an RFQ, quote, position, or trade.
The tagged form prevents a physical option from carrying a second strike and prevents a spread from losing either strike during a wire round-trip.
Variants§
CashPut
Cash-settled put: wire strike K, execution legs (0, K).
CoveredCall
CashSecuredPut
CallSpread
PutSpread
Implementations§
Source§impl OptionTerms
impl OptionTerms
pub const fn is_spread(self) -> bool
Sourcepub const fn with_strike(self, strike: Strike) -> Self
pub const fn with_strike(self, strike: Strike) -> Self
Replace the physical strike (or spread lower strike), retaining the product and K2.
pub const fn position_type(self) -> PositionType
pub const fn strike(self) -> Strike
pub const fn upper_strike(self) -> Option<Strike>
Sourcepub const fn to_chain(self) -> ChainTerms
pub const fn to_chain(self) -> ChainTerms
Convert public economic terms to the contract’s four-product representation.
Sourcepub const fn from_chain(terms: ChainTerms) -> Self
pub const fn from_chain(terms: ChainTerms) -> Self
The sole normalization of a zero-lower chain put spread into a cash put.
pub fn from_chain_parts( product: ChainPositionType, strike: Strike, upper: Option<Strike>, ) -> Result<Self, SpreadError>
Trait Implementations§
Source§impl Clone for OptionTerms
impl Clone for OptionTerms
impl Copy for OptionTerms
Source§impl Debug for OptionTerms
impl Debug for OptionTerms
Source§impl<'de> Deserialize<'de> for OptionTerms
impl<'de> Deserialize<'de> for OptionTerms
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 OptionTerms
Source§impl Hash for OptionTerms
impl Hash for OptionTerms
Source§impl PartialEq for OptionTerms
impl PartialEq for OptionTerms
Source§impl Serialize for OptionTerms
impl Serialize for OptionTerms
impl StructuralPartialEq for OptionTerms
Auto Trait Implementations§
impl Forget for OptionTerms
impl Freeze for OptionTerms
impl RefUnwindSafe for OptionTerms
impl Send for OptionTerms
impl Sync for OptionTerms
impl Unpin for OptionTerms
impl UnsafeUnpin for OptionTerms
impl UnwindSafe for OptionTerms
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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