{"id":"interest-accrual-compute","version":"1.0.0","description":"Simple or compound (periodic or continuous) interest over a term in years or a dated span with a day-count basis.","supported_operations":["simple interest on a principal","compound interest calculator","continuous compounding interest","interest for a number of days actual/360","future value of a lump sum with compounding","interest accrued between two dates","how much interest on a deposit at an annual rate","ending balance after compound interest","חישוב ריבית פשוטה או דריבית על סכום"],"unsupported_operations":["annuities, loan payments or level-payment schedules (use tvm-solve)","converting a rate between compounding conventions without an amount","bond accrued interest with coupon periods","act-act-icma and 30e-360-isda day counts","tax, withholding or fees"],"semantics":["Decimal strings only: principal > 0 (up to 20 integer and 20 fractional digits) and annual_rate a decimal fraction with -1 < annual_rate <= 100 (0.05 means 5 percent; \"5\" means 500 percent). A JSON number for a decimal field is invalid_input.","Time is either years (decimal from 0 to 1000) or start_date, end_date and convention together (dates ISO, years 1900 to 2200, start_date <= end_date); both forms, neither, or a partial date group is invalid_input. Date conventions are 30-360-isda, 30-360-us, 30e-360, act-360, act-365f, act-act-isda and nl-365 with the exact rules of daycount-year-fraction; t is that exact rational.","method simple: interest = principal * annual_rate * t, exact; compounding must be absent. method compound requires compounding: an integer m from 1 to 365 or \"continuous\". Periodic: ending = principal * (1 + annual_rate/m)^(m*t) with a fractional exponent m*t allowed; continuous: ending = principal * e^(annual_rate*t).","interest and ending_amount are each rounded once from the exact values (interest = exact ending - principal), so ending_amount can differ from principal plus the rounded interest by one unit in the last place under directed rounding. Fractional exponents and continuous compounding use a 40-digit BigInt engine accurate to better than 1e-35 relative before rounding.","effective_annual_rate = (1 + annual_rate/m)^m - 1 (periodic, exact), e^annual_rate - 1 (continuous), null for simple; year_fraction is t. Defaults when omitted: scale 2, rate_scale 10, rounding half-up (half away from zero); the other modes are half-even, half-down, up, down, ceiling, floor. Outputs never contain -0.","A periodic term with m*t above 100000 is limit_exceeded (checked before computing); an exact ending amount of 1e20 or more is not_computable with details.reason overflow. Any string over 64 UTF-8 bytes is limit_exceeded, checked before parsing.","Disclaimer: arithmetic calculation only; not financial, tax, legal, or investment advice."],"limits":{"max_string_bytes":64,"max_compounding_periods":100000,"max_years":1000},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["principal","annual_rate","method"],"properties":{"principal":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"annual_rate":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"method":{"type":"string","enum":["simple","compound"]},"compounding":{"oneOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"string","enum":["continuous"]}]},"years":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"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","act-360","act-365f","act-act-isda","nl-365"]},"scale":{"type":"integer","minimum":0,"maximum":12},"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":["interest","ending_amount","year_fraction","effective_annual_rate"],"properties":{"interest":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"ending_amount":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"year_fraction":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","maxLength":64},"effective_annual_rate":{"type":["string","null"],"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$"}}},"examples":[{"input":{"principal":"1500","annual_rate":"0.043","method":"compound","compounding":4,"years":"6"},"output":{"interest":"438.84","ending_amount":"1938.84","year_fraction":"6.0000000000","effective_annual_rate":"0.0436983575"}},{"input":{"principal":"1000000","annual_rate":"0.05","method":"simple","start_date":"2020-01-15","end_date":"2020-04-14","convention":"act-360"},"output":{"interest":"12500.00","ending_amount":"1012500.00","year_fraction":"0.2500000000","effective_annual_rate":null}},{"input":{"principal":"1000","annual_rate":"0.05","method":"compound","compounding":"continuous","years":"2.5","scale":6,"rate_scale":8},"output":{"interest":"133.148453","ending_amount":"1133.148453","year_fraction":"2.50000000","effective_annual_rate":"0.05127110"}}],"execute_url":"/v1/tools/interest-accrual-compute/versions/1.0.0/execute"}