findates
Financial date arithmetic for Rust.
findates handles the unglamorous but essential layer that every financial
application depends on: business day calendars, date adjustment conventions,
day count fractions, and schedule generation. It is designed to be lightweight,
composable, and independent of larger quantitative finance frameworks.
Installation
[]
= "0.1"
Optional serde support:
= { = "0.1", = ["serde"] }
Usage
use NaiveDate;
use basic_calendar;
use ;
use Schedule;
use algebra;
// Adjust a Saturday to the next business day (Monday)
let cal = basic_calendar;
let saturday = from_ymd_opt.unwrap;
let monday = adjust;
// Generate a semi-annual schedule
let anchor = from_ymd_opt.unwrap;
let end = from_ymd_opt.unwrap;
let dates = new
.generate
.unwrap;
// [2023-01-01, 2023-07-01, 2024-01-01]
// Compute a day count fraction
let dcf = day_count_fraction.unwrap;
Features
- Business day calendars with weekend and holiday sets, union and intersection
- Standard financial adjustment rules for non-business dates
- Day count fraction calculations covering the most common market conventions
- Frequency-based schedule generation with lazy infinite iterators
- Optional
serdesupport for all types
For the full list of supported conventions, adjustment rules, and frequencies see the documentation.
Design
Core operations are pure functions — no hidden state, no side effects.
Schedules are lazy iterators; dates are only computed when needed. All date
types are chrono::NaiveDate. Timezone-aware dates are out of scope —
financial date arithmetic operates on calendar dates without reference to
time of day.
Dependencies
findates uses chrono as its date representation.
All public functions accept and return chrono::NaiveDate. If your codebase
uses the time crate, conversion at the boundary is
currently required. Broader date type interoperability is planned for a future
release.
Non-goals
findates is not a pricing library, a risk engine, or a Rust replacement for
QuantLib. It is a foundation layer — the date arithmetic that everything
else sits on top of.
License
Licensed under either of MIT or Apache-2.0 at your option.