DeFiMath v3.5.0 — Extended boundaries
Three input ceilings widened to the actual mathematical limit of each function.
Same precision, same gas, no API change.
What's new
sqrt—SQRT_UPPER_BOUNDraised from2^80 · 1e18 ≈ 1.21e42to
⌊(2²⁵⁶ − 1) / 1e18⌋ + 1 ≈ 1.158e59(~10¹⁷× wider). New ceiling is the
exact boundary where the FP18 scaling stepx · 1e18would overflow uint256.Options&Binary—MAX_EXPIRATIONraised from 2 years to
32 years (32 * SECONDS_IN_YEAR + 1).timeToExp = 1,009,152,000
(exactly 32 y) is now accepted; anything above reverts with
TimeToExpiryUpperBoundError.MAX_RATE = 400%and every other input
bound is unchanged.
Why 32 y on Options & Binary
The hard math limit is scaledRate = rate · timeYear < EXP_UPPER_BOUND ≈ 135.3.
At rate = MAX_RATE = 4, that gives a horizon ceiling of 135.3 / 4 ≈ 33.8 y.
32 y sits ~5 % under that — wide enough for every realistic long-dated product,
with margin against precision degradation at the corner.
At the worst combined corner (rate = 400 %, vol = uint64.max ≈ 1844 %,
T = 32 y), both scaledRate = 128 and scaledVol = vol · √T ≈ 104 stay
under 135.3.
Precision at the extended corners
Worst observed absolute error across the new extended-bound sweep (4 y, 8 y,
30 y, 50 y horizons; 1000 % vol; 200 % rate; far-OTM and deep-ITM strikes)
on a $1,000-spot call: 5.9 × 10⁻¹² $ — over 20× under the standard
MAX_OPTION_ABS_ERROR = 1.3 × 10⁻¹⁰ threshold.
Install
npm install defimath-lib@3.5.0
Full release notes: https://defimath.com/news/2026-06-27-defimath-v3-5-0-released/
Diff: v3.4.0...v3.5.0