Contract-role sign: +1 for a claim (asset side), -1 for an obligation.
Generic over the amount type so the same formula serves the executable
(Float) and the relational (ℝ) models.
Equations
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_RPA = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_RPL = -1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_LG = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_ST = -1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_BUY = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_SEL = -1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_RFL = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_PFL = -1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_RF = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_PF = -1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_CLO = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_CNO = 1
- Actus.Util.Conventions.sign Actus.Protocol.ContractRole.CR_COL = 1
Instances For
Last calendar day of d's month.
Equations
- Actus.Util.Conventions.endOfMonth d = { day := Actus.Util.Date.daysInMonth d.year d.month, month := d.month, year := d.year }
Instances For
Is d the last day of its month?
Equations
Instances For
An anchor triggers the EOM convention when it is the last day of a month that is shorter than 31 days (§3.3).
Equations
- Actus.Util.Conventions.eomApplies anchor = (Actus.Util.Conventions.isEndOfMonth anchor && decide (Actus.Util.Date.daysInMonth anchor.year anchor.month < 31))
Instances For
Apply the end-of-month convention to a generated schedule time d, given
the schedule's anchor. Only relevant for month-or-longer cycles; the
caller passes that decision via cycleIsMonthly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Is d a business day under calendar cal? CLDR_NC (and the absence of a
calendar) treats every calendar day as a business day.
Equations
Instances For
Next business day on/after d (fuel-bounded; a week is always enough).
Latest business day on/before d.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Actus.Util.Conventions.shiftPreceding.go cal 0 x = x
Instances For
Apply a business-day convention to the event date. The shift/calculate distinction (SC* vs CS*) affects only which date the year-fraction is computed from, not the resulting event date, so both collapse here.
Equations
- One or more equations did not get rendered due to their size.
- Actus.Util.Conventions.applyBDC Actus.Protocol.BusinessDayConvention.BDC_NULL cal d = d
- Actus.Util.Conventions.applyBDC Actus.Protocol.BusinessDayConvention.BDC_SCF cal d = Actus.Util.Conventions.shiftFollowing cal d
- Actus.Util.Conventions.applyBDC Actus.Protocol.BusinessDayConvention.BDC_CSF cal d = Actus.Util.Conventions.shiftFollowing cal d
- Actus.Util.Conventions.applyBDC Actus.Protocol.BusinessDayConvention.BDC_SCP cal d = Actus.Util.Conventions.shiftPreceding cal d
- Actus.Util.Conventions.applyBDC Actus.Protocol.BusinessDayConvention.BDC_CSP cal d = Actus.Util.Conventions.shiftPreceding cal d
Instances For
Does the convention shift before calculating (SC*)? Such conventions
move the schedule date first, so calculations use the shifted date. The
calculate-then-shift family (CS*) and NULL do not.
Equations
- Actus.Util.Conventions.isShiftFirst Actus.Protocol.BusinessDayConvention.BDC_SCF = true
- Actus.Util.Conventions.isShiftFirst Actus.Protocol.BusinessDayConvention.BDC_SCMF = true
- Actus.Util.Conventions.isShiftFirst Actus.Protocol.BusinessDayConvention.BDC_SCP = true
- Actus.Util.Conventions.isShiftFirst Actus.Protocol.BusinessDayConvention.BDC_SCMP = true
- Actus.Util.Conventions.isShiftFirst x✝ = false
Instances For
Apply EOM, then — for shift-then-calculate (SC*) conventions — the
business-day shift, so that calculations downstream use the shifted date.
For CS* conventions the shift is deferred to settlementDate (the schedule
keeps the unshifted date so accruals are computed on it).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The business-day on which a schedule time settles. For CS* conventions
this applies the deferred shift (the event is stamped on the business day
while accruals used the unshifted date); for SC* the shift already
happened in applyConventions, and NULL/none never shift.
Equations
- One or more equations did not get rendered due to their size.