Documentation

Actus.Contract.Common

@[reducible, inline]

Shared contract terms = the dictionary ContractTerms over α.

Equations
Instances For

    A blank Float contract: every optional attribute undefined, sensible defaults for the required ones. Build concrete contracts with record-update syntax, e.g. { defaultTerms with notionalPrincipal := some 1000.0, … }.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Actus.Contract.Terms.nt {α : Type} [Amount α] (ct : Terms α) :
      α
      Equations
      Instances For
        def Actus.Contract.Terms.ipnr {α : Type} [Amount α] (ct : Terms α) :
        α
        Equations
        Instances For
          def Actus.Contract.Terms.fer {α : Type} [Amount α] (ct : Terms α) :
          α
          Equations
          Instances For
            def Actus.Contract.Terms.pprd {α : Type} [Amount α] (ct : Terms α) :
            α
            Equations
            Instances For
              def Actus.Contract.Terms.ptd {α : Type} [Amount α] (ct : Terms α) :
              α
              Equations
              Instances For
                def Actus.Contract.Terms.pyrt {α : Type} [Amount α] (ct : Terms α) :
                α
                Equations
                Instances For
                  def Actus.Contract.Terms.rrsp {α : Type} [Amount α] (ct : Terms α) :
                  α
                  Equations
                  Instances For
                    def Actus.Contract.Terms.rrmlt {α : Type} [Amount α] (ct : Terms α) :
                    α

                    Rate multiplier defaults to 1 (identity) when absent.

                    Equations
                    Instances For
                      def Actus.Contract.Terms.rrnxt {α : Type} [Amount α] (ct : Terms α) :
                      α
                      Equations
                      Instances For
                        def Actus.Contract.Terms.scied {α : Type} [Amount α] (ct : Terms α) :
                        α
                        Equations
                        Instances For
                          Equations
                          Instances For
                            def Actus.Contract.clampHi {α : Type} [Amount α] (c : Option α) (x : α) :
                            α

                            Apply an optional upper bound: min x c when present, else x.

                            Equations
                            Instances For
                              def Actus.Contract.clampLo {α : Type} [Amount α] (fl : Option α) (x : α) :
                              α

                              Apply an optional lower bound: max x f when present, else x.

                              Equations
                              Instances For
                                structure Actus.Contract.State (α : Type) :

                                Shared contract state variables (ACTUS dictionary short names). Md/Sd are serial day numbers on the Time axis; the monetary/rate variables have the generic amount type α.

                                Instances For
                                  def Actus.Contract.instReprState.repr {α✝ : Type} [Repr α✝] :
                                  State α✝Std.Format
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[implicit_reducible]
                                    instance Actus.Contract.instReprState {α✝ : Type} [Repr α✝] :
                                    Repr (State α✝)
                                    Equations

                                    The risk-factor observations the lending STF/POF formulas depend on. curs is the settlement-currency factor X^CURS(t); marketRate is Oʳᶠ(RRMO, t); prepayment is Oᵉᵛ(CID, PP, t); yf s t is the year fraction Y(s, t) (a convention observation — see the module header).

                                    • curs : Protocol.Timeα
                                    • marketRate : Protocol.Timeα
                                    • prepayment : Protocol.Timeα
                                    • annuityYfs : Protocol.TimeList α

                                      Year fractions of the principal-redemption periods remaining as of a reset time, used to recompute the ANN annuity amount A (§3.8).

                                    • scalingIndex : Protocol.Timeα

                                      Scaling index Oʳᶠ(SCMO, t) driving the SC scaling multipliers.

                                    • marketRateOf : StringProtocol.Timeα

                                      Market rate by market-object code: Oʳᶠ(m, t). Used by composite contracts (SWAPS) to resolve each leg's own rate-reset series.

                                    • dividends : List (Protocol.Time × α)

                                      Observed dividend stream Oᵉᵛ(DV) — (date, amount) pairs (STK).

                                    • creditEvents : List (Protocol.Time × String × String)

                                      Observed credit events Oᵉᵛ(CE) — (event time, contract id, performance state) triples. Drives credit-enhancement payouts (CEG / CEC).

                                    • exerciseDate : Option Protocol.Time

                                      Observed exercise time Oᵉᵛ(CID) — the latest XD event, which closes an open-maturity contract (a CLM "call"). none ⇒ no exercise observed.

                                    • Year fraction Y(s, t) between two Time points.

                                    • maturityEOD : Bool

                                      Maturity / termination given as end-of-day (23:59:59): the event settles and accrues to the next midnight while the schedule structure uses the written date (§2.8).

                                    • terminationEOD : Bool
                                    • purchaseEOD : Bool
                                    Instances For

                                      Trivial environment: unit fx factor, no market rate, no prepayment.

                                      Equations
                                      Instances For

                                        Y(s, t) for the contract's day-count convention, with s,t on the Time axis (converted back to calendar dates via ofEpochDay).

                                        Equations
                                        Instances For