<kiyosi/instruments/autocallable/note.hpp>
#include <kiyosi/instruments/autocallable/note.hpp>KnockInObservationMode
enum class KnockInObservationModeMonitoring frequency for an autocallable knock-in barrier.
枚举值
every_trading_day— Observe on every trading day in the contract life.at_expiry— Observe only at expiry.
AutocallableBarrierState
enum class AutocallableBarrierStateBarrier events known before valuation.
枚举值
none— No barrier event has occurred.knocked_out— The note has already knocked out.knocked_in— The downside barrier has already been breached.
make_autocallable_observations
Result<std::vector<AutocallableObservation>> kiyosi::make_autocallable_observations(const std::vector<Date> &dates, const std::vector<double> &levels, std::optional<std::vector<double>> coupons=std::nullopt, std::optional<std::vector<double>> coupon_barriers=std::nullopt)Associates parallel inputs before note construction. Omitted coupon sequences use record defaults. Validates sequence lengths; contractual values and dates are validated by the note factory.
validate_autocallable_note
template <AutocallableProduct Note>
Result<void> kiyosi::validate_autocallable_note(const Note ¬e)Revalidates all terms of a complete product, including a moved-from observation schedule.
validate_autocallable_history
template <typename Note>
Result<void> kiyosi::validate_autocallable_history(const Note ¬e, const PricingContext &context)Validates the caller's history snapshot against events before valuation.
kiyosi::AutocallableNote
template <AutocallableTerms Terms>
class kiyosi::AutocallableNoteComplete immutable autocallable product, owning its validated construction terms. Valuation excludes cashflows settled before the valuation time. Principal, coupons and downside components use normalized payoff units and are added independently. Observation views borrow this note. Destruction, moving from, or assignment invalidates them. Convenience getters return owning copies independent of this note. Concurrent const access follows the library default; assignment must not overlap access.
成员
replace
Result<AutocallableNote> kiyosi::AutocallableNote<Terms>::replace(std::optional<AutocallableBarrierState> barrier_state) constReturns a validated owning copy with only the supplied history replaced. Preserves all contract terms and never changes this object, including on failure. History is caller-supplied; time consistency is checked during pricing. Concurrent calls and reads are safe without concurrent assignment or mutation. nullopt means unknown history; none means known absence of barrier events. Uses the same validation and error categories as the product factory.
AutocallableNote
kiyosi::AutocallableNote<Terms>::AutocallableNote(const AutocallableNote &)=defaultAutocallableNote
kiyosi::AutocallableNote<Terms>::AutocallableNote(AutocallableNote &&) noexcept=default~AutocallableNote
kiyosi::AutocallableNote<Terms>::~AutocallableNote()=defaultoperator=
AutocallableNote & kiyosi::AutocallableNote<Terms>::operator=(AutocallableNote &&) noexcept=defaultoperator=
AutocallableNote & kiyosi::AutocallableNote<Terms>::operator=(const AutocallableNote &other)Copies terms without changing this note if allocation fails.
knock_out_levels
std::vector<double> kiyosi::AutocallableNote<Terms>::knock_out_levels() constReturns an owning copy of the positive knock-out levels.
observation_dates
std::vector<Date> kiyosi::AutocallableNote<Terms>::observation_dates() constReturns an owning copy of the strictly ordered observation dates.
observations_view
std::span<const AutocallableObservation> kiyosi::AutocallableNote<Terms>::observations_view() const noexceptBorrows complete immutable observations with the lifetime documented above.
principal_ratio
double kiyosi::AutocallableNote<Terms>::principal_ratio() const noexceptReturns the non-negative normalized principal component.
effective_date
Date kiyosi::AutocallableNote<Terms>::effective_date() const noexceptReturns the first date of the note life.
expiry_date
Date kiyosi::AutocallableNote<Terms>::expiry_date() const noexceptReturns the final date of the note life.
barrier_state
std::optional<AutocallableBarrierState> kiyosi::AutocallableNote<Terms>::barrier_state() const noexceptReturns the prior barrier state, or nullopt for unknown history.
initial_spot
double kiyosi::AutocallableNote<Terms>::initial_spot() const noexceptReturns the positive reference spot.
upper_strike
double kiyosi::AutocallableNote<Terms>::upper_strike() const noexceptReturns the positive upper settlement strike.
lower_strike
double kiyosi::AutocallableNote<Terms>::lower_strike() const noexceptReturns the non-negative lower settlement strike.
knock_in_level
double kiyosi::AutocallableNote<Terms>::knock_in_level() const noexceptReturns the positive downside knock-in level.
knock_in_observation_mode
KnockInObservationMode kiyosi::AutocallableNote<Terms>::knock_in_observation_mode() const noexceptReturns the knock-in monitoring frequency.
coupon_rate
double kiyosi::AutocallableNote<Terms>::coupon_rate() const noexceptReturns the annualized conditional observation coupon.
maturity_coupon_rate
double kiyosi::AutocallableNote<Terms>::maturity_coupon_rate() const noexceptReturns the finite maturity coupon rate.
minimum_coupon_rate
double kiyosi::AutocallableNote<Terms>::minimum_coupon_rate() const noexceptReturns the finite maturity-coupon floor after knock-in.
knock_out_coupon_rates
std::vector<double> kiyosi::AutocallableNote<Terms>::knock_out_coupon_rates() constReturns an owning copy of the finite knock-out coupon rates.
coupon_barrier_levels
std::vector<double> kiyosi::AutocallableNote<Terms>::coupon_barrier_levels() constReturns an owning copy of the non-negative coupon barriers.
kiyosi::AutocallableObservation
struct kiyosi::AutocallableObservationOne contractual observation; its date, knock-out level, and coupon terms travel together.
成员
date
Date kiyosi::AutocallableObservation::dateknock_out_level
double kiyosi::AutocallableObservation::knock_out_levelcoupon_rate
double kiyosi::AutocallableObservation::coupon_rateSnowball knock-out annual coupon; zero for Phoenix.
coupon_barrier_level
double kiyosi::AutocallableObservation::coupon_barrier_levelPhoenix coupon threshold; zero for snowballs.