{
  "schema_version": "1.0.0",
  "record_id": "dn-next42-20261205-q42",
  "record_version": "1.0.0",
  "title": "Repaying an Aave delegated loan does not refill its borrowing allowance",
  "canonical_url": "https://decentralised.news/aave-credit-delegation-repayment-borrow-allowance",
  "evidence_type": "documentary_analysis_with_synthetic_worked_example",
  "source_review_date": "2026-12-05",
  "last_verified_utc": null,
  "observation_window": null,
  "methodology_url": "https://decentralised.news/aave-credit-delegation-repayment-borrow-allowance",
  "methodology_version": "1.0.0",
  "input_schema": {
    "columns": [
      "step",
      "event",
      "allowance_before_token_units",
      "allowance_after_token_units",
      "debt_before_token_units",
      "debt_after_token_units",
      "new_borrow_token_units",
      "repayment_token_units"
    ],
    "rows_file": "https://decentralised.news/data/dn-next42-20261205/v1/q42.csv"
  },
  "units": {
    "definition": "Units are named in the CSV columns, manuscript and calculation labels. Do not combine quantities without resolving their dimensions."
  },
  "sources": [
    {
      "id": 1,
      "title": "Aave V3 Credit Delegation",
      "url": "https://aave.com/docs/aave-v3/guides/credit-delegation",
      "reviewDate": "2026-12-05",
      "supports": "Delegator/delegatee roles, variable debt-token approval, collateral and account-mode borrowing conditions.",
      "evidenceType": "Official documentation"
    },
    {
      "id": 2,
      "title": "Aave V3 Origin DebtTokenBase",
      "url": "https://github.com/aave-dao/aave-v3-origin/blob/main/src/contracts/protocol/tokenization/base/DebtTokenBase.sol",
      "reviewDate": "2026-12-05",
      "supports": "Approval sets allowance; delegated consumption decreases it with amount/corrected-amount rules.",
      "evidenceType": "Primary implementation"
    },
    {
      "id": 3,
      "title": "Aave V3 Origin VariableDebtToken",
      "url": "https://github.com/aave-dao/aave-v3-origin/blob/main/src/contracts/protocol/tokenization/VariableDebtToken.sol",
      "reviewDate": "2026-12-05",
      "supports": "Delegated mint consumes borrowing allowance, while burn reduces scaled debt without replenishing allowance.",
      "evidenceType": "Primary implementation"
    }
  ],
  "calculations": [
    {
      "label": "Allowance after initial borrow",
      "expression": "1000-600",
      "expected": 400
    },
    {
      "label": "Debt after partial repayment",
      "expression": "600-300",
      "expected": 300
    },
    {
      "label": "Debt after second borrow",
      "expression": "300+400",
      "expected": 700
    },
    {
      "label": "Allowance after consuming remainder",
      "expression": "400-400",
      "expected": 0
    },
    {
      "label": "Repayment closes modeled principal",
      "expression": "700-700",
      "expected": 0
    }
  ],
  "example": {
    "synthetic": true,
    "description": "Original DN synthetic worked example. All scenario inputs are hypothetical; no live transaction, return, quote or account is represented. Separate Aave V3 delegation authority from outstanding debt: borrowing consumes allowance, repayment does not refill it and revocation does not erase debt.",
    "rows": [
      [
        1,
        "approve_1000",
        0,
        1000,
        0,
        0,
        0,
        0
      ],
      [
        2,
        "borrow_600",
        1000,
        400,
        0,
        600,
        600,
        0
      ],
      [
        3,
        "repay_300",
        400,
        400,
        600,
        300,
        0,
        300
      ],
      [
        4,
        "borrow_400",
        400,
        0,
        300,
        700,
        400,
        0
      ],
      [
        5,
        "repay_700",
        0,
        0,
        700,
        0,
        0,
        700
      ],
      [
        6,
        "approve_250",
        0,
        250,
        0,
        0,
        0,
        0
      ],
      [
        7,
        "borrow_100",
        250,
        150,
        0,
        100,
        100,
        0
      ],
      [
        8,
        "revoke_unused_authority",
        150,
        0,
        100,
        100,
        0,
        0
      ],
      [
        9,
        "repay_100",
        0,
        0,
        100,
        0,
        0,
        100
      ]
    ]
  },
  "limitations": [
    "Examples use declared invented inputs, not observed fills, customer outcomes, provider rankings or predictive backtests.",
    "Source-review date is not a measurement time, publication date of the source or assurance that terms will remain current.",
    "Documentation does not establish individual access, legal eligibility, service reliability or investment suitability."
  ],
  "falsification_or_recheck_triggers": [
    "Changed governing document or applicable software version.",
    "Evidence of different account, product, timing, unit or legal-entity scope.",
    "An arithmetic error or reproducible counterexample to the stated mechanism."
  ],
  "rights": {
    "original_DN_analysis": "Cite Decentralised News, the canonical URL and record version when reusing this worked example.",
    "third_party_sources": "Third-party material remains subject to its original terms. Linking does not grant redistribution rights."
  },
  "commercial_disclosure": "This article includes a link to DN’s own separately scoped research service. No provider purchase is required to use the example.",
  "corrections": []
}
