{
  "schemaVersion": "1.0.0",
  "recordId": "DN-TBILL",
  "methodologyVersion": "DN-TBILL-v1.0",
  "recordType": "documented-formula-calculator",
  "sourceReviewDate": "2026-11-29",
  "canonicalUrl": "https://decentralised.news/treasury-bill-discount-vs-investment-yield-2027",
  "execution": "Pure local JavaScript; no network, account access, order submission or input collection.",
  "inputFields": {
    "kind": "TBILL",
    "rootId": "dn-nexus-tbill",
    "execution": "local browser arithmetic, no upload/network/storage",
    "fields": [
      "faceValue",
      "discountRate",
      "days",
      "yearDays"
    ],
    "controls": [
      {
        "key": "faceValue",
        "label": "Face value, USD",
        "type": "text",
        "default": "10000"
      },
      {
        "key": "discountRate",
        "label": "Bank-discount quote, percent",
        "type": "text",
        "default": "4.5"
      },
      {
        "key": "days",
        "label": "Actual days to maturity",
        "type": "text",
        "default": "91"
      },
      {
        "key": "yearDays",
        "label": "Investment-year basis",
        "type": "select",
        "options": [
          "365",
          "366"
        ],
        "default": "365"
      }
    ],
    "inputPolicy": "Required plain nonnegative decimal strings with up to six decimal places. Face is a USD 100 multiple from 100 to 1e9, term an integer from 1 through 366 and year basis 365 or 366. Positive implied rounded purchase price required.",
    "knownAnswerCases": 7,
    "invalidInputCases": 6,
    "module": "utils/nexusTbill.mjs",
    "export": "calculateTbill"
  },
  "formulas": {
    "pricePer100": "100*(1-(discountRatePercent/100)*days/360)",
    "shortInvestmentRate": "((100-pricePer100)/pricePer100)*yearDays/days",
    "longerInvestmentEquation": "pricePer100*(1+(days-yearDays/2)*(i/yearDays))*(1+i/2)=100",
    "longerStableRoot": "2*H/(b+sqrt(b*b+4*a*H)); H=(100-p)/p; a=days/(2*yearDays)-0.25; b=days/yearDays",
    "hypotheticalReinvestment": "(1+H)^(yearDays/days)-1"
  },
  "rounding": "Nonnegative per-100 price rounded half up to six decimals using integer arithmetic; purchase cash rounded half up to cents. Ratios calculated with IEEE754 and rounded for display.",
  "sources": [
    {
      "url": "https://treasurydirect.gov/marketable-securities/understanding-pricing/",
      "title": "TreasuryDirect: Understanding Pricing and Interest Rates",
      "checkedOn": "2026-11-29",
      "supportedClaims": [
        "Bill purchase-price formula from face value, discount quote and actual days divided by 360."
      ]
    },
    {
      "url": "https://www.ecfr.gov/current/title-31/subtitle-B/chapter-II/subchapter-A/part-356/appendix-Appendix%20B%20to%20Part%20356",
      "title": "31 CFR Appendix B to Part 356, section VI: Treasury bill formulas",
      "checkedOn": "2026-11-29",
      "supportedClaims": [
        "Distinct short- and longer-bill investment-rate formulas; investment-year basis; per-100 price precision."
      ]
    },
    {
      "url": "https://www.treasurydirect.gov/instit/annceresult/press/preanre/2024/R_20240226_4.pdf",
      "title": "Treasury auction results: 91-day bill, 26 February 2024",
      "checkedOn": "2026-11-29",
      "supportedClaims": [
        "Historical fixture: CUSIP 912797HS9, 5.255% discount, 98.671653 price, 5.400% investment rate; issue 2024-02-29 and maturity 2024-05-30."
      ]
    },
    {
      "url": "https://www.treasurydirect.gov/indiv/help/treasurydirect-help/faq/",
      "title": "TreasuryDirect FAQ: Treasury bills",
      "checkedOn": "2026-11-29",
      "supportedClaims": [
        "Price to six decimal places and cash purchase rounded to nearest penny; USD 100 purchase multiples."
      ]
    },
    {
      "url": "https://www.federalreserve.gov/datadownload/Review.aspx?filetype=csv&label=include&lastobs=7&layout=seriescolumn&rel=H15&series=c3ec77dedd37c9aa112f71c9eba34b50",
      "title": "Federal Reserve H.15: series metadata",
      "checkedOn": "2026-11-29",
      "supportedClaims": [
        "Distinct Treasury-bill secondary-market discount-basis and Treasury constant-maturity investment-basis series."
      ]
    }
  ],
  "dateRule": "Explicit reader-selected yearDays. The article explains issue-to-maturity actual days and year-after-issue basis with a historical leap-day fixture. The tool does not derive dates.",
  "limitations": [
    "Not live rates or executable quotes",
    "No fees, tax, FX, early sale or future reinvestment rates",
    "Scope is nonnegative discount quotes and declared Treasury auction convention, not every broker secondary-market convention",
    "No eligibility or product recommendation",
    "Fixtures validate selected arithmetic; they are not model/trading performance data"
  ],
  "artifacts": {
    "module": "calculator.mjs",
    "fixtures": "fixtures.json",
    "verifier": "verify.mjs",
    "instructions": "README.md"
  }
}
