Enum Class DayCount
- All Implemented Interfaces:
Serializable,Comparable<DayCount>,Constable
An interest payment is notional × rate × yearFraction, and the
SAME two calendar dates produce different year fractions under different
conventions: 2024-01-15 → 2024-07-15 is 182 days, which is 0.5056 under
ACT/360 (money markets: USD deposits, SOFR), 0.4986 under ACT/365
(GBP money markets, many swap fixed legs), and exactly 0.5 under 30/360
(US corporate bonds, which pretend every month has 30 days so coupons
come out round). On a $100m swap leg at 5%, picking the wrong convention
moves the payment by tens of thousands of dollars — a booking error that
surfaces as an unexplained break on settlement day, not a model error.
The rule in practice: the convention is part of the INSTRUMENT (read
the term sheet), never a system-wide default. That is why
BondPricer and the curve utilities take a DayCount
argument instead of assuming one. 30/360's end-of-month adjustments
(the 31st treated as the 30th when the start is on the 30th) are the US
Bond Basis variant; other markets use slightly different 30/360 flavors
— stated here so nobody "fixes" the adjustment against ISDA 30E/360.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionActual days / 360 — money markets (USD LIBOR/SOFR style).Actual days / 365 (fixed) — GBP money markets, many swaps.ACT/ACT ISDA — government bonds and ISDA swap legs; leap-year exact.US (Bond Basis) 30/360 — corporate and agency bonds. -
Method Summary
Modifier and TypeMethodDescriptionstatic DayCountReturns the enum constant of this class with the specified name.static DayCount[]values()Returns an array containing the constants of this enum class, in the order they are declared.abstract doubleyearFraction(LocalDate start, LocalDate end) Year fraction fromstart(inclusive) toend(exclusive).
-
Enum Constant Details
-
ACT_360
Actual days / 360 — money markets (USD LIBOR/SOFR style). -
ACT_365
Actual days / 365 (fixed) — GBP money markets, many swaps. -
THIRTY_360
US (Bond Basis) 30/360 — corporate and agency bonds. -
ACT_ACT_ISDA
ACT/ACT ISDA — government bonds and ISDA swap legs; leap-year exact.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
yearFraction
-