pub struct FloatingRateNote { /* private fields */ }Expand description
A floating rate note (FRN).
FRNs pay coupons that reset periodically based on a reference rate (such as SOFR, EURIBOR, or SONIA) plus a fixed spread.
§Features
- Support for all major reference rates (SOFR, €STR, SONIA, EURIBOR, etc.)
- SOFR compounding conventions (in arrears, simple average, Term SOFR)
- Caps and floors (rate collars)
- Lookback and lockout periods
- Full Bond trait implementation
Implementations§
Source§impl FloatingRateNote
impl FloatingRateNote
Sourcepub fn builder() -> FloatingRateNoteBuilder
pub fn builder() -> FloatingRateNoteBuilder
Creates a new builder for FloatingRateNote.
Sourcepub fn sofr_convention(&self) -> Option<&SOFRConvention>
pub fn sofr_convention(&self) -> Option<&SOFRConvention>
Returns the SOFR convention if applicable.
Sourcepub fn spread_bps(&self) -> Decimal
pub fn spread_bps(&self) -> Decimal
Returns the spread in basis points.
Sourcepub fn spread_decimal(&self) -> Decimal
pub fn spread_decimal(&self) -> Decimal
Returns the spread as a decimal rate.
Sourcepub fn maturity_date(&self) -> Date
pub fn maturity_date(&self) -> Date
Returns the maturity date.
Sourcepub fn get_issue_date(&self) -> Date
pub fn get_issue_date(&self) -> Date
Returns the issue date.
Sourcepub fn day_count(&self) -> DayCountConvention
pub fn day_count(&self) -> DayCountConvention
Returns the day count convention.
Sourcepub fn settlement_days(&self) -> u32
pub fn settlement_days(&self) -> u32
Returns the settlement days.
Sourcepub fn set_current_rate(&mut self, rate: Decimal)
pub fn set_current_rate(&mut self, rate: Decimal)
Sets the current reference rate.
Sourcepub fn current_rate(&self) -> Option<Decimal>
pub fn current_rate(&self) -> Option<Decimal>
Returns the current reference rate if set.
Sourcepub fn effective_rate(&self, index_rate: Decimal) -> Decimal
pub fn effective_rate(&self, index_rate: Decimal) -> Decimal
Calculates the effective coupon rate after applying cap/floor.
Sourcepub fn period_coupon(
&self,
period_start: Date,
period_end: Date,
index_rate: Decimal,
) -> Decimal
pub fn period_coupon( &self, period_start: Date, period_end: Date, index_rate: Decimal, ) -> Decimal
Calculates the coupon amount for a period given the index rate.
Sourcepub fn accrued_interest_with_rate(
&self,
settlement: Date,
index_rate: Decimal,
) -> Decimal
pub fn accrued_interest_with_rate( &self, settlement: Date, index_rate: Decimal, ) -> Decimal
Calculates accrued interest with a given reference rate.
Sourcepub fn sofr_compounded_in_arrears(
&self,
daily_rates: &[(Date, Decimal)],
period_start: Date,
period_end: Date,
) -> Decimal
pub fn sofr_compounded_in_arrears( &self, daily_rates: &[(Date, Decimal)], period_start: Date, period_end: Date, ) -> Decimal
Calculates SOFR compounded in arrears for a period.
This implements the ARRC standard methodology for calculating compounded SOFR over an interest period.
§Arguments
daily_rates- Vector of (date, rate) tuples for daily SOFR fixingsperiod_start- Start of the interest periodperiod_end- End of the interest period
§Returns
The compounded rate for the period (annualized).
Sourcepub fn sofr_simple_average(
&self,
daily_rates: &[(Date, Decimal)],
period_start: Date,
period_end: Date,
) -> Decimal
pub fn sofr_simple_average( &self, daily_rates: &[(Date, Decimal)], period_start: Date, period_end: Date, ) -> Decimal
Calculates simple average SOFR for a period.
Sourcepub fn identifier(&self) -> String
pub fn identifier(&self) -> String
Returns an identifier string for display.
Sourcepub fn cash_flows_projected<C>(
&self,
from: Date,
forward_curve: &C,
) -> Vec<BondCashFlow>where
C: RateCurveDyn + ?Sized,
pub fn cash_flows_projected<C>(
&self,
from: Date,
forward_curve: &C,
) -> Vec<BondCashFlow>where
C: RateCurveDyn + ?Sized,
Generates cash flows with projected rates from a forward curve.
This method projects coupon amounts using forward rates from the provided curve, applying the spread and any caps/floors.
§Arguments
from- Settlement dateforward_curve- Curve for projecting forward rates
§Returns
Vector of cash flows with projected coupon amounts.
§Example
let flows = frn.cash_flows_projected(settlement, &forward_curve);
for flow in flows {
println!("Date: {}, Amount: {}", flow.date(), flow.amount());
}Sourcepub fn required_fixing_dates(&self, from: Date) -> Vec<Date>
pub fn required_fixing_dates(&self, from: Date) -> Vec<Date>
Returns all fixing dates required for coupon calculations.
For overnight compounded rates (SOFR, SONIA), this returns all business days in each coupon period. For term rates (EURIBOR, Term SOFR), this returns only the fixing dates based on reset lag.
§Arguments
from- Settlement date (only returns dates for future periods)
§Returns
Vector of dates when index fixings are needed.
Sourcepub fn accrued_interest_from_store(
&self,
settlement: Date,
store: &IndexFixingStore,
) -> Decimal
pub fn accrued_interest_from_store( &self, settlement: Date, store: &IndexFixingStore, ) -> Decimal
Calculates accrued interest using rates from a fixing store.
For overnight compounded rates, this compounds the daily rates from period start to settlement. For term rates, uses the fixed rate for the period.
§Arguments
settlement- Settlement datestore- Index fixing store with historical rates
§Returns
Accrued interest amount, or zero if fixings are unavailable.
Trait Implementations§
Source§impl Bond for FloatingRateNote
impl Bond for FloatingRateNote
Source§fn identifiers(&self) -> &BondIdentifiers
fn identifiers(&self) -> &BondIdentifiers
Source§fn issue_date(&self) -> Date
fn issue_date(&self) -> Date
Source§fn first_settlement_date(&self) -> Date
fn first_settlement_date(&self) -> Date
Source§fn dated_date(&self) -> Date
fn dated_date(&self) -> Date
Source§fn face_value(&self) -> Decimal
fn face_value(&self) -> Decimal
Source§fn cash_flows(&self, from: Date) -> Vec<BondCashFlow>
fn cash_flows(&self, from: Date) -> Vec<BondCashFlow>
Source§fn next_coupon_date(&self, after: Date) -> Option<Date>
fn next_coupon_date(&self, after: Date) -> Option<Date>
Source§fn previous_coupon_date(&self, before: Date) -> Option<Date>
fn previous_coupon_date(&self, before: Date) -> Option<Date>
Source§fn accrued_interest(&self, settlement: Date) -> Decimal
fn accrued_interest(&self, settlement: Date) -> Decimal
Source§fn day_count_convention(&self) -> &str
fn day_count_convention(&self) -> &str
Source§fn calendar(&self) -> &CalendarId
fn calendar(&self) -> &CalendarId
Source§fn redemption_value(&self) -> Decimal
fn redemption_value(&self) -> Decimal
Source§fn has_matured(&self, as_of: Date) -> bool
fn has_matured(&self, as_of: Date) -> bool
Source§fn years_to_maturity(&self, from: Date) -> Option<f64>
fn years_to_maturity(&self, from: Date) -> Option<f64>
Source§fn requires_model(&self) -> bool
fn requires_model(&self) -> bool
Source§impl Clone for FloatingRateNote
impl Clone for FloatingRateNote
Source§fn clone(&self) -> FloatingRateNote
fn clone(&self) -> FloatingRateNote
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FloatingRateNote
impl Debug for FloatingRateNote
Source§impl<'de> Deserialize<'de> for FloatingRateNote
impl<'de> Deserialize<'de> for FloatingRateNote
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>,
Source§impl FloatingCouponBond for FloatingRateNote
impl FloatingCouponBond for FloatingRateNote
Source§fn rate_index(&self) -> &RateIndex
fn rate_index(&self) -> &RateIndex
Source§fn spread_bps(&self) -> Decimal
fn spread_bps(&self) -> Decimal
Source§fn reset_frequency(&self) -> u32
fn reset_frequency(&self) -> u32
Source§fn lookback_days(&self) -> u32
fn lookback_days(&self) -> u32
Source§fn next_reset_date(&self, after: Date) -> Option<Date>
fn next_reset_date(&self, after: Date) -> Option<Date>
Source§fn fixing_date(&self, reset_date: Date) -> Date
fn fixing_date(&self, reset_date: Date) -> Date
Source§fn current_coupon(&self, reference_rate: Decimal) -> Decimal
fn current_coupon(&self, reference_rate: Decimal) -> Decimal
Auto Trait Implementations§
impl Freeze for FloatingRateNote
impl RefUnwindSafe for FloatingRateNote
impl Send for FloatingRateNote
impl Sync for FloatingRateNote
impl Unpin for FloatingRateNote
impl UnwindSafe for FloatingRateNote
Blanket Implementations§
Source§impl<T> BondAnalytics for T
impl<T> BondAnalytics for T
Source§fn yield_to_maturity(
&self,
settlement: Date,
clean_price: Decimal,
frequency: Frequency,
) -> BondResult<YieldResult>
fn yield_to_maturity( &self, settlement: Date, clean_price: Decimal, frequency: Frequency, ) -> BondResult<YieldResult>
Source§fn yield_to_maturity_with_convention(
&self,
settlement: Date,
clean_price: Decimal,
frequency: Frequency,
convention: YieldConvention,
) -> BondResult<YieldResult>
fn yield_to_maturity_with_convention( &self, settlement: Date, clean_price: Decimal, frequency: Frequency, convention: YieldConvention, ) -> BondResult<YieldResult>
Source§fn dirty_price_from_yield(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
) -> BondResult<f64>
fn dirty_price_from_yield( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn clean_price_from_yield(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
) -> BondResult<f64>
fn clean_price_from_yield( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn macaulay_duration(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
) -> BondResult<f64>
fn macaulay_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn modified_duration(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
) -> BondResult<f64>
fn modified_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn effective_duration(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
bump_bps: f64,
) -> BondResult<f64>
fn effective_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, bump_bps: f64, ) -> BondResult<f64>
Source§fn convexity(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
) -> BondResult<f64>
fn convexity( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn effective_convexity(
&self,
settlement: Date,
ytm: f64,
frequency: Frequency,
bump_bps: f64,
) -> BondResult<f64>
fn effective_convexity( &self, settlement: Date, ytm: f64, frequency: Frequency, bump_bps: f64, ) -> BondResult<f64>
Source§fn dv01(
&self,
settlement: Date,
ytm: f64,
dirty_price: f64,
frequency: Frequency,
) -> BondResult<f64>
fn dv01( &self, settlement: Date, ytm: f64, dirty_price: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn dv01_notional(
&self,
settlement: Date,
ytm: f64,
dirty_price: f64,
notional: f64,
frequency: Frequency,
) -> BondResult<f64>
fn dv01_notional( &self, settlement: Date, ytm: f64, dirty_price: f64, notional: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn estimate_price_change(
&self,
settlement: Date,
ytm: f64,
dirty_price: f64,
yield_change: f64,
frequency: Frequency,
) -> BondResult<f64>
fn estimate_price_change( &self, settlement: Date, ytm: f64, dirty_price: f64, yield_change: f64, frequency: Frequency, ) -> BondResult<f64>
Source§fn parse_day_count(&self) -> BondResult<DayCountConvention>
fn parse_day_count(&self) -> BondResult<DayCountConvention>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.