FloatingRateNote

Struct FloatingRateNote 

Source
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

Source

pub fn builder() -> FloatingRateNoteBuilder

Creates a new builder for FloatingRateNote.

Source

pub fn index(&self) -> &RateIndex

Returns the reference rate index.

Source

pub fn sofr_convention(&self) -> Option<&SOFRConvention>

Returns the SOFR convention if applicable.

Source

pub fn spread_bps(&self) -> Decimal

Returns the spread in basis points.

Source

pub fn spread_decimal(&self) -> Decimal

Returns the spread as a decimal rate.

Source

pub fn maturity_date(&self) -> Date

Returns the maturity date.

Source

pub fn get_issue_date(&self) -> Date

Returns the issue date.

Source

pub fn frequency(&self) -> Frequency

Returns the payment frequency.

Source

pub fn day_count(&self) -> DayCountConvention

Returns the day count convention.

Source

pub fn cap(&self) -> Option<Decimal>

Returns the cap rate if any.

Source

pub fn floor(&self) -> Option<Decimal>

Returns the floor rate if any.

Source

pub fn settlement_days(&self) -> u32

Returns the settlement days.

Source

pub fn reset_lag(&self) -> i32

Returns the reset lag in business days.

Source

pub fn set_current_rate(&mut self, rate: Decimal)

Sets the current reference rate.

Source

pub fn current_rate(&self) -> Option<Decimal>

Returns the current reference rate if set.

Source

pub fn effective_rate(&self, index_rate: Decimal) -> Decimal

Calculates the effective coupon rate after applying cap/floor.

Source

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.

Source

pub fn accrued_interest_with_rate( &self, settlement: Date, index_rate: Decimal, ) -> Decimal

Calculates accrued interest with a given reference rate.

Source

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 fixings
  • period_start - Start of the interest period
  • period_end - End of the interest period
§Returns

The compounded rate for the period (annualized).

Source

pub fn sofr_simple_average( &self, daily_rates: &[(Date, Decimal)], period_start: Date, period_end: Date, ) -> Decimal

Calculates simple average SOFR for a period.

Source

pub fn identifier(&self) -> String

Returns an identifier string for display.

Source

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 date
  • forward_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());
}
Source

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.

Source

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 date
  • store - Index fixing store with historical rates
§Returns

Accrued interest amount, or zero if fixings are unavailable.

Trait Implementations§

Source§

impl Bond for FloatingRateNote

Source§

fn identifiers(&self) -> &BondIdentifiers

Returns the bond’s identifiers (ISIN, CUSIP, etc.).
Source§

fn bond_type(&self) -> BondType

Returns the bond type classification.
Source§

fn currency(&self) -> Currency

Returns the bond’s currency.
Source§

fn maturity(&self) -> Option<Date>

Returns the maturity date. Read more
Source§

fn issue_date(&self) -> Date

Returns the issue date.
Source§

fn first_settlement_date(&self) -> Date

Returns the first settlement date.
Source§

fn dated_date(&self) -> Date

Returns the dated date (when interest starts accruing). Read more
Source§

fn face_value(&self) -> Decimal

Returns the face/par value per unit.
Source§

fn frequency(&self) -> Frequency

Returns the coupon payment frequency.
Source§

fn cash_flows(&self, from: Date) -> Vec<BondCashFlow>

Generates all cash flows from the given date forward. Read more
Source§

fn next_coupon_date(&self, after: Date) -> Option<Date>

Returns the next coupon date after the given date.
Source§

fn previous_coupon_date(&self, before: Date) -> Option<Date>

Returns the previous coupon date before the given date.
Source§

fn accrued_interest(&self, settlement: Date) -> Decimal

Calculates accrued interest as of the settlement date. Read more
Source§

fn day_count_convention(&self) -> &str

Returns the day count convention for accrual calculations.
Source§

fn calendar(&self) -> &CalendarId

Returns the payment calendar.
Source§

fn redemption_value(&self) -> Decimal

Returns the redemption value per unit at maturity (typically 100).
Source§

fn has_matured(&self, as_of: Date) -> bool

Returns true if the bond has matured as of the given date.
Source§

fn years_to_maturity(&self, from: Date) -> Option<f64>

Returns the years to maturity from the given date.
Source§

fn requires_model(&self) -> bool

Returns true if this bond type requires a pricing model.
Source§

impl Clone for FloatingRateNote

Source§

fn clone(&self) -> FloatingRateNote

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FloatingRateNote

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FloatingRateNote

Source§

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 FloatingCouponBond for FloatingRateNote

Source§

fn rate_index(&self) -> &RateIndex

Returns the reference rate index.
Source§

fn spread_bps(&self) -> Decimal

Returns the spread over the reference rate in basis points.
Source§

fn reset_frequency(&self) -> u32

Returns the reset frequency (payments per year).
Source§

fn lookback_days(&self) -> u32

Returns the number of lookback days for the rate fixing.
Source§

fn floor(&self) -> Option<Decimal>

Returns the floor rate if any (as decimal).
Source§

fn cap(&self) -> Option<Decimal>

Returns the cap rate if any (as decimal).
Source§

fn next_reset_date(&self, after: Date) -> Option<Date>

Returns the next reset date after the given date.
Source§

fn fixing_date(&self, reset_date: Date) -> Date

Returns the fixing date for a given reset date.
Source§

fn spread(&self) -> Decimal

Returns the spread as a decimal (e.g., 0.0050 for 50 bps).
Source§

fn current_coupon(&self, reference_rate: Decimal) -> Decimal

Calculates the coupon for the current period given the reference rate.
Source§

impl Serialize for FloatingRateNote

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> BondAnalytics for T
where T: Bond + ?Sized,

Source§

fn yield_to_maturity( &self, settlement: Date, clean_price: Decimal, frequency: Frequency, ) -> BondResult<YieldResult>

Calculates yield to maturity from clean price. Read more
Source§

fn yield_to_maturity_with_convention( &self, settlement: Date, clean_price: Decimal, frequency: Frequency, convention: YieldConvention, ) -> BondResult<YieldResult>

Calculates yield to maturity with a specific yield convention.
Source§

fn dirty_price_from_yield( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates dirty price from yield. Read more
Source§

fn clean_price_from_yield( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates clean price from yield.
Source§

fn macaulay_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates Macaulay duration analytically. Read more
Source§

fn modified_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates modified duration from Macaulay duration. Read more
Source§

fn effective_duration( &self, settlement: Date, ytm: f64, frequency: Frequency, bump_bps: f64, ) -> BondResult<f64>

Calculates effective duration using numerical bumping. Read more
Source§

fn convexity( &self, settlement: Date, ytm: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates analytical convexity. Read more
Source§

fn effective_convexity( &self, settlement: Date, ytm: f64, frequency: Frequency, bump_bps: f64, ) -> BondResult<f64>

Calculates effective convexity using numerical bumping. Read more
Source§

fn dv01( &self, settlement: Date, ytm: f64, dirty_price: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates DV01 (dollar value of 01 - one basis point). Read more
Source§

fn dv01_notional( &self, settlement: Date, ytm: f64, dirty_price: f64, notional: f64, frequency: Frequency, ) -> BondResult<f64>

Calculates DV01 for a specific notional amount.
Source§

fn estimate_price_change( &self, settlement: Date, ytm: f64, dirty_price: f64, yield_change: f64, frequency: Frequency, ) -> BondResult<f64>

Estimates price change for a given yield shift. Read more
Source§

fn parse_day_count(&self) -> BondResult<DayCountConvention>

Parses the day count convention string to enum. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,