{"id":"daycount-year-fraction","version":"1.0.0","description":"Year fraction between two ISO dates under ISDA 30/360, 30E/360, ACT/360, ACT/365F, ACT/ACT ISDA or ICMA, and NL/365.","supported_operations":["day count fraction between dates","year fraction 30/360","actual/actual ISDA year fraction","act/365 fixed day count","act/360 day count fraction","ICMA actual/actual coupon period fraction","30E/360 day count","number of days 30/360 between two dates","nl/365 year fraction excluding leap day","חישוב שיטת ספירת ימים בין שני תאריכים"],"unsupported_operations":["money interest or accrued amounts (use interest-accrual-compute)","business-day adjustment or holiday calendars","calendar differences in years, months and days","act/act AFB, act/365L and other conventions not listed"],"semantics":["Dates are strict ISO YYYY-MM-DD real calendar dates in years 1900 to 2200; start_date must be on or before end_date, else invalid_input. A zero-length span gives year_fraction 0.","30-360-isda (ISDA 4.16(f)): D1 = 30 if 31; D2 = 30 if 31 and D1 is 30 after adjustment; no February rule. 30-360-us (SIA/NASD): last-day-of-February rules first (both February ends: D2 = 30; start February end: D1 = 30), then D2 = 30 if 31 and D1 >= 30, and D1 = 30 if 31. 30e-360 (ISDA 4.16(g)): 31 becomes 30 on both dates. The fraction is (360*(Y2-Y1) + 30*(M2-M1) + (D2-D1))/360.","30e-360-isda (ISDA 4.16(h)) requires maturity_date: D1 = 30 when start_date is the last day of its month, D2 = 30 when end_date is the last day of its month unless end_date equals maturity_date and falls in February; the fraction is days/360.","act-360: actual days/360. act-365f: actual days/365 regardless of leap years. nl-365: (actual days minus the 29 February dates d with start_date < d <= end_date)/365.","act-act-isda (ISDA 4.16(b)): days of the span inside each calendar year over 366 for a leap year and 365 otherwise, summed exactly; start included, end excluded.","act-act-icma (ISDA 4.16(c), ICMA Rule 251) requires frequency (1, 2, 4 or 12) and reference_date: notional period boundaries are reference_date shifted by -j*(12/frequency) months for every integer j, each computed from reference_date and clamped to the month length (month ends when reference_date is a month end); the fraction is the sum over overlapped periods of overlap days/(frequency*period days).","frequency and reference_date are accepted only with act-act-icma and maturity_date only with 30e-360-isda; supplying them for another convention, or omitting a required one, is invalid_input.","numerator and denominator are the exact reduced rational as decimal integer strings. day_count is the convention day numerator (360-basis days for the 30/360 family, actual or NL days otherwise); actual_days is the plain calendar difference.","year_fraction is the exact rational rounded once to rate_scale fractional digits with rounding. Defaults when omitted: rate_scale 12, rounding half-up (half away from zero); the other modes are half-even, half-down, up, down, ceiling and floor. Output never contains -0.","Any string input over 64 UTF-8 bytes is limit_exceeded, checked before parsing; a lone surrogate is invalid_input. Exact BigInt arithmetic only; no clock, locale or floating point."],"limits":{"max_string_bytes":64,"max_span_years":301},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["start_date","end_date","convention"],"properties":{"start_date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","maxLength":10},"end_date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","maxLength":10},"convention":{"type":"string","enum":["30-360-isda","30-360-us","30e-360","30e-360-isda","act-360","act-365f","act-act-isda","act-act-icma","nl-365"]},"frequency":{"type":"integer","enum":[1,2,4,12]},"reference_date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","maxLength":10},"maturity_date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","maxLength":10},"rate_scale":{"type":"integer","minimum":0,"maximum":12},"rounding":{"type":"string","enum":["half-up","half-even","half-down","up","down","ceiling","floor"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["year_fraction","numerator","denominator","day_count","actual_days","convention"],"properties":{"year_fraction":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$"},"numerator":{"type":"string","pattern":"^(0|[1-9][0-9]*)$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"},"day_count":{"type":"integer","minimum":0},"actual_days":{"type":"integer","minimum":0},"convention":{"type":"string","enum":["30-360-isda","30-360-us","30e-360","30e-360-isda","act-360","act-365f","act-act-isda","act-act-icma","nl-365"]}}},"examples":[{"input":{"start_date":"2003-11-01","end_date":"2004-05-01","convention":"act-act-isda","rate_scale":6},"output":{"year_fraction":"0.497724","numerator":"66491","denominator":"133590","day_count":182,"actual_days":182,"convention":"act-act-isda"}},{"input":{"start_date":"2020-01-10","end_date":"2020-04-20","convention":"act-act-icma","frequency":2,"reference_date":"2020-07-15","rate_scale":8},"output":{"year_fraction":"0.27732322","numerator":"9287","denominator":"33488","day_count":101,"actual_days":101,"convention":"act-act-icma"}},{"input":{"start_date":"2019-02-28","end_date":"2019-03-31","convention":"30-360-us","rate_scale":6},"output":{"year_fraction":"0.083333","numerator":"1","denominator":"12","day_count":30,"actual_days":31,"convention":"30-360-us"}}],"execute_url":"/v1/tools/daycount-year-fraction/versions/1.0.0/execute"}