Calculate the defensive interval ratio (DIR), a liquidity ratio that measures how many days a company could continue to cover its operating expenses using only its existing defensive (most liquid) assets, without relying on additional revenue.

Unlike the current, quick, and cash ratios, which express liquidity relative to current liabilities, the defensive interval ratio expresses liquidity relative to the company’s actual daily cash burn rate, making it a more direct measure of how long a company could survive a sudden stop in incoming cash flow.

The formula is as follows:

\[\text{Defensive Interval Ratio} = (\text{Cash and Cash Equivalents} + \text{Short Term Investments} + \text{Accounts Receivable}) / \text{Daily Operating Expenses}\]

Where Daily Operating Expenses = (Cost of Goods Sold + Operating Expenses - Depreciation and Amortization) / Days, the daily cash expenditures (AccountingTools, Wall Street Prep). The cost of goods sold is included because the depreciation and amortization from the cash flow statement also covers the part charged to it, and because paying suppliers and production staff is the largest cash cost for most companies. Days is the length of the window the expenses cover: 365 for annual data, 365 / 4 for quarterly data, times trailing when the expenses are summed over several periods, so the ratio is in calendar days for any frequency.

Also known as: defensive interval period, basic defense interval.

Defensive Interval Ratio in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_defensive_interval_ratio as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AMGN", "GILD", "BIIB"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.ratios.get_defensive_interval_ratio()

Or, after setting up the Finance Toolkit MCP, ask:

For how many days could Amgen, Gilead and Biogen cover their operating expenses from their liquid assets from 2021 to 2025?

Which returns:

  2021 2022 2023 2024 2025
AMGN 315.9 406.808 410.687 332.729 326.593
BIIB 273.146 379.204 158.724 237.852 289.966
GILD 262.095 228.268 258.786 239.902 353.914

Parameters

get_defensive_interval_ratio accepts the following parameters.

ParameterTypeDescriptionExample
daysint | floatThe number of days in the window the expenses cover, used to turn them into daily expenditures. Defaults to None, which uses 365 for annual data and 365 / 4 for quarterly data, multiplied by trailing when set.360
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ratios. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
compoundboolWhether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False.False
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
trailingintThe number of periods to sum flows (income and cash flow statement items) over, with balance sheet items averaged over the same number of period ends. E.g. 4 with quarterly data gives the trailing twelve months (TTM) and 3 with annual data a three-year cumulative figure. Defaults to None, which uses single-period flows (per quarter and not annualized with quarterly data).4
Share