pub struct HedgingInstrument {Show 13 fields
pub id: String,
pub instrument_type: HedgeInstrumentType,
pub notional_amount: Decimal,
pub currency: String,
pub currency_pair: Option<String>,
pub fixed_rate: Option<Decimal>,
pub floating_index: Option<String>,
pub strike_rate: Option<Decimal>,
pub trade_date: NaiveDate,
pub maturity_date: NaiveDate,
pub counterparty: String,
pub fair_value: Decimal,
pub status: InstrumentStatus,
}Expand description
A hedging instrument (derivative contract).
Fields§
§id: StringUnique instrument identifier
instrument_type: HedgeInstrumentTypeType of derivative
notional_amount: DecimalNotional / face amount
currency: StringPrimary currency
currency_pair: Option<String>Currency pair for FX instruments (e.g., “EUR/USD”)
fixed_rate: Option<Decimal>Fixed rate (for swaps, forwards)
floating_index: Option<String>Floating rate index name (e.g., “SOFR”, “EURIBOR”)
strike_rate: Option<Decimal>Strike rate for options
trade_date: NaiveDateTrade date
maturity_date: NaiveDateMaturity / expiry date
counterparty: StringCounterparty name
fair_value: DecimalCurrent fair value (mark-to-market)
status: InstrumentStatusCurrent lifecycle status
Implementations§
Source§impl HedgingInstrument
impl HedgingInstrument
Sourcepub fn new(
id: impl Into<String>,
instrument_type: HedgeInstrumentType,
notional_amount: Decimal,
currency: impl Into<String>,
trade_date: NaiveDate,
maturity_date: NaiveDate,
counterparty: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, instrument_type: HedgeInstrumentType, notional_amount: Decimal, currency: impl Into<String>, trade_date: NaiveDate, maturity_date: NaiveDate, counterparty: impl Into<String>, ) -> Self
Creates a new hedging instrument.
Sourcepub fn with_currency_pair(self, pair: impl Into<String>) -> Self
pub fn with_currency_pair(self, pair: impl Into<String>) -> Self
Sets the currency pair.
Sourcepub fn with_fixed_rate(self, rate: Decimal) -> Self
pub fn with_fixed_rate(self, rate: Decimal) -> Self
Sets the fixed rate.
Sourcepub fn with_floating_index(self, index: impl Into<String>) -> Self
pub fn with_floating_index(self, index: impl Into<String>) -> Self
Sets the floating rate index.
Sourcepub fn with_strike_rate(self, rate: Decimal) -> Self
pub fn with_strike_rate(self, rate: Decimal) -> Self
Sets the strike rate.
Sourcepub fn with_fair_value(self, value: Decimal) -> Self
pub fn with_fair_value(self, value: Decimal) -> Self
Sets the fair value.
Sourcepub fn with_status(self, status: InstrumentStatus) -> Self
pub fn with_status(self, status: InstrumentStatus) -> Self
Sets the status.
Sourcepub fn remaining_tenor_days(&self, as_of: NaiveDate) -> i64
pub fn remaining_tenor_days(&self, as_of: NaiveDate) -> i64
Returns the remaining tenor in days from the given date. Returns 0 if the instrument has already matured.
Trait Implementations§
Source§impl Clone for HedgingInstrument
impl Clone for HedgingInstrument
Source§fn clone(&self) -> HedgingInstrument
fn clone(&self) -> HedgingInstrument
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 HedgingInstrument
impl Debug for HedgingInstrument
Source§impl<'de> Deserialize<'de> for HedgingInstrument
impl<'de> Deserialize<'de> for HedgingInstrument
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 Serialize for HedgingInstrument
impl Serialize for HedgingInstrument
Source§impl ToNodeProperties for HedgingInstrument
impl ToNodeProperties for HedgingInstrument
Source§fn node_type_name(&self) -> &'static str
fn node_type_name(&self) -> &'static str
Entity type name (snake_case), e.g.
"uncertain_tax_position".Source§fn node_type_code(&self) -> u16
fn node_type_code(&self) -> u16
Numeric entity type code for registry, e.g.
416.Source§fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
Convert all fields to a property map with camelCase keys.
Auto Trait Implementations§
impl Freeze for HedgingInstrument
impl RefUnwindSafe for HedgingInstrument
impl Send for HedgingInstrument
impl Sync for HedgingInstrument
impl Unpin for HedgingInstrument
impl UnsafeUnpin for HedgingInstrument
impl UnwindSafe for HedgingInstrument
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