# Apr can be rounded down for small _annualizedInterest in case of low decimals debtToken

In Term Structure's Vault, interest accrual divides by 365 days causing APR to round to zero for small annualizedInterest with 6-decimal debtTokens.

- Payout: Contest reward
- Severity: high
- Program: Term Structure
- Credited: BengalCatBalu
- Disclosed: 2025-03-20
- Write-up quality: 6/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_term_structure_february2025.pdf#3.1.8
- Library page: https://bugbountylibrary.com/r/cantina%3Aterm_structure_february2025%3A3.1.8
- Tags: domain:web3 impact:funds-loss kind:contest platform:cantina sev:high tech:evm tech:solidity technique:source-review vuln:precision-loss

**Target:** Vault interest accrual (_accruedPeriodInterest) in TermMaxMarket
**Root cause:** _annualizedInterest shares decimals with ft/debtToken (6 for USDC), and interest = (_annualizedInterest * elapsed) / 365 days truncates to zero for small annualizedInterest and short elapsed intervals.
**Steps:**
1. Note ft, xt, debtToken share decimals via _deployTokens; assume USDC 6 decimals.
2. swapCallback computes deltaAnualizedInterest = (ftChanges * DAYS_IN_YEAR) / _daysToMaturity, so _annualizedInterest has 6 decimals.
3. With _annualizedInterest = 5e6 and elapsed < 20s, interest = (5e6 * elapsed) / 31536000 rounds to 0.
4. Repeated frequent interactions keep accrued interest at zero, losing APR for the vault.
**How found:** Reviewer observed that ft/xt/debtToken decimals match, traced _annualizedInterest dimensionality through swapCallback, then checked the division in _accruedPeriodInterest and realized truncation to zero for small values and short intervals.
**Exploitation:** Not an attack; frequent small-interval interactions cause interest truncation to zero, systematically under-accruing yield to the vault.
**Insight:** When a stored rate shares token decimals, check every downstream multiplication/division for truncation at realistic small magnitudes and short elapsed windows—especially with 6-decimal tokens.
