pub struct PrincipalProtectedNote {
pub principal: f64,
pub spot: f64,
pub strike: f64,
pub maturity: f64,
pub rate: f64,
pub volatility: f64,
pub participation_rate: f64,
pub cap: Option<f64>,
}Expand description
Principal-protected note with participation in upside
Fields§
§principal: f64Principal amount (guaranteed)
spot: f64Underlying spot price
strike: f64Strike price
maturity: f64Time to maturity
rate: f64Risk-free rate
volatility: f64Volatility
participation_rate: f64Participation rate in upside
cap: Option<f64>Cap on returns (optional)
Implementations§
Source§impl PrincipalProtectedNote
impl PrincipalProtectedNote
Sourcepub fn new(
principal: f64,
spot: f64,
strike: f64,
maturity: f64,
rate: f64,
volatility: f64,
participation_rate: f64,
cap: Option<f64>,
) -> IntegrateResult<Self>
pub fn new( principal: f64, spot: f64, strike: f64, maturity: f64, rate: f64, volatility: f64, participation_rate: f64, cap: Option<f64>, ) -> IntegrateResult<Self>
Create a new principal-protected note
Sourcepub fn fair_participation_rate(&self, target_price: f64) -> IntegrateResult<f64>
pub fn fair_participation_rate(&self, target_price: f64) -> IntegrateResult<f64>
Calculate fair participation rate given note price
Trait Implementations§
Source§impl Clone for PrincipalProtectedNote
impl Clone for PrincipalProtectedNote
Source§fn clone(&self) -> PrincipalProtectedNote
fn clone(&self) -> PrincipalProtectedNote
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 moreAuto Trait Implementations§
impl Freeze for PrincipalProtectedNote
impl RefUnwindSafe for PrincipalProtectedNote
impl Send for PrincipalProtectedNote
impl Sync for PrincipalProtectedNote
impl Unpin for PrincipalProtectedNote
impl UnwindSafe for PrincipalProtectedNote
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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