--- title: imdUSD documentation delivery section: reference order: 6 audience: integrators sources: - src/CDPVault.sol:32-1075 - src/ParameterizedVault.sol:25-225 - src/Parameters.sol:38-348 - src/SwarmFeed.sol:26-329 - src/Treasury.sol:36-323 - docs/abi/ParameterizedVault.json:1 - docs/NAMING.md:1-72 - docs/MAINNET-RUNBOOK.md:194-290 - docs/INTERNAL-AUDIT-2026-10-04.md:1-279 - docs/RESEARCH-PARAMS-2026-10-04.md:1-182 - https://diataxis.fr/reference/ - https://diataxis.fr/explanation/ - https://docs.liquity.org/v2-documentation/risk-disclosure - https://www.aave.com/docs/aave-v3/concepts/reserve - https://raw.githubusercontent.com/sky-ecosystem/mcd-docs-content/master/smart-contract-modules/rates-module/jug-detailed-documentation.md --- # imdUSD documentation delivery This delivery answers how integrators read and call the launch vault, what governance can change, how issuance and redemption work, and what the supplied evidence does and does not establish. It contains eleven Markdown pages plus this delivery record. Source behavior takes precedence over prose, comments and dated assessments. No tracked file is modified; output remains untracked for collection. ## Pages - Reference: [Contracts and addresses](reference/contracts-and-addresses.md), [Vault functions](reference/vault-functions.md), [Events and errors](reference/events-and-errors.md), [Oracle and question binding](reference/oracle-and-question-binding.md), [Reading state](reference/reading-state.md). - Governance: [Parameters](governance/parameters.md), [Timelock and proposals](governance/timelock-and-proposals.md), [Network health](governance/network-health.md). - Economics: [Monetary policy](economics/monetary-policy.md), [Swarm evidence](economics/swarm-evidence.md), [Risks and open questions](economics/risks-and-open-questions.md). Links to overview, guide and keeper pages assume these files are rendered beside the supplied `web/content/docs` sibling set. Those pages were read first and left unchanged. The naming homage remains in their overview, linked from the contract reference; this job adds no duplicate overview. ## Research performed before drafting The linked primary documentation was opened before writing. Practices adopted are our application of its organization, not claims that imdUSD inherits another protocol's mechanisms. - [Diátaxis reference](https://diataxis.fr/reference/): organize reference around the machinery, use repeatable entries, and link to procedures rather than mixing them into every API entry. The vault inventory therefore includes every ABI entry with exact signatures, conditions and effects. - [Diátaxis explanation](https://diataxis.fr/explanation/): explain why mechanisms fit together and where their implications stop. Economics pages separate issuance, backing, fees and risk rather than becoming transaction tutorials. - [Liquity risk disclosure](https://docs.liquity.org/v2-documentation/risk-disclosure): separate collateral, oracle, liquidation and contract risks, with consequences for affected users. The risk page pairs implemented guards with residual exposure; it does not copy Liquity's safeguards into imdUSD. - [Aave reserve documentation](https://www.aave.com/docs/aave-v3/concepts/reserve): explain each risk parameter's purpose and governance context. Our parameter table distinguishes meaning, units, change route and enforced bounds, and separates derived values from governed values. - [MakerDAO/Sky Jug reference](https://raw.githubusercontent.com/sky-ecosystem/mcd-docs-content/master/smart-contract-modules/rates-module/jug-detailed-documentation.md): separate contract details, authorization, fee mechanisms, integration pitfalls and failure modes. This informed explicit permission and checkpoint documentation. imdUSD uses its own linear fee implementation. The former Maker documentation URL redirected to the [Sky developer landing page](https://developers.skyeco.com/); the detailed primary Markdown source was opened instead. The pinned Better Interface reference informed sentence-case headings, descriptive links, consistent vocabulary and explicit error recovery. Its UI rendering, motion, colors and interactive controls are outside this Markdown-only deliverable. The pinned eth-security reference informed checks of signature domains, replay, permissions, decimals, reentrancy and oracle assumptions; a checklist pattern was not treated as a confirmed exploit. Guidance attribution: Better Interface by Jakub Krehel, MIT, pinned commit `267330e1adfc66a718fb65fa6918c1f06d0a689e`; its included Impeccable documentation guidance by Paul Bakaus, Apache-2.0, pinned commit `9d715cc4f5564a990ca8345abfdd5df6dc9b41c8`; ethskills security by Austin Griffith, MIT, pinned commit `06ea4efa0807`. The supplied adapters, references and licenses were read as task inputs. No substantial guide text or code is reproduced in these pages. ## Repository sources and method Behavior sources: `src/CDPVault.sol`, `ParameterizedVault.sol`, `Parameters.sol`, `Governed.sol`, `Treasury.sol`, `ImdUSD.sol`, `SwarmFeed.sol`, `PriceFeed.sol`, `NhiFeed.sol`, `SpotFeed.sol`, `UsdPriceFeed.sol`, `SharePriceFeed.sol`, `SwarmWorkOracle.sol`, `WorkOracleFactory.sol`, `SwarmRelay.sol`, and their interface/configuration references. Inherited library error definitions come from the vendored OpenZeppelin `Address`, `Math`, `SafeERC20` and `ReentrancyGuard` sources. ABI inventories come from `docs/abi/ParameterizedVault.json` and `docs/abi/CDPVault.json`. Signatures, return fields, event indexing and custom error arguments were generated from JSON and checked against source declarations and overrides. `docs/ABI.md` was inspected as supporting prose, not accepted over source or ABI exports. Context and evidence: `README.md`, `docs/NAMING.md`, runbook section 6 and relevant operational sections, both `docs/AUDIT-*` records, `docs/INTERNAL-AUDIT-2026-10-04.md`, `docs/RESEARCH-PARAMS-2026-10-04.md`, and `docs/DOCS-JOB-A-2026-10-05.md`. Evidence boundaries were cross-checked against `test/InHouse.t.sol`, `test/QuestionBinding.t.sol` and `oracle/question-prefix.mjs`; discovery behavior against `web/src/history.ts`. Page front matter supplies path and line citations. The founding document was not used as a source, including where a Solidity comment points to it. Question meaning was read from the source-pinned document bytes. Every contract address is the required placeholder. Every economic calibration and bound is withheld as `(under consideration)`, including fixed settings, governance delay, NHI weights, fee sensitivity and collateral-counting limits. Raw-unit scales, ABI types, technical panel floors and block-span validation rules remain explicit so integrations can be described correctly. These are technical representation/verification rules, not recommended economic settings. Historical audit test counts remain counts of evidence, not parameter values. ## Disagreements found and how they are handled 1. **Runbook share collateral versus implemented wiring.** `docs/MAINNET-RUNBOOK.md:28-43,269-290` assumes share collateral and a share-only reserve. `ParameterizedVault.sol:38-58,152-164` creates an IMD/ETH-to-USD adapter and no share adapter or wrapping entry point. `CDPVault.lock/free/cash` transfer the configured token directly. Pages follow the IMD route and leave `TODO(collateral-integration)` rather than claiming wrappers exist. 2. **Share units versus Treasury units.** `SharePriceFeed.sol:15-27,58-65` quotes per 1e18 raw share units; `Treasury.sol:179-185` expects per whole token and divides by token decimals. The runbook's proposed direct share-reserve arrangement needs normalization for non-18-decimal shares. This is a source-level integration mismatch, not a claim of an observed funded loss. 3. **Two Treasuries.** Runbook section 6 deploys a standalone prerequisite and a vault-created sibling. `ParameterizedVault.feeRecipient()` returns the latter, irrespective of the base fee-recipient constant. Both are distinguished in the inventory; standalone does not govern the vault reserve. 4. **Single-agent work description.** Runbook section 3 says work issuance serves one pinned agent. `SwarmWorkOracle.sol:135-191` serves controller-authorized claims from agent tally roots. Pages describe that code; launch availability remains `(under consideration)`. 5. **Reporter and ABI prose.** Runbook section 4 and `docs/ABI.md` discuss a reporter path and reporter ABI entries absent from the concrete feed source and exported launch ABI. Pages describe attestation-only updates for the concrete leaves. No reporter recovery is promised. 6. **Denomination and governance prose in `docs/ABI.md`.** It describes debt in the primary feed's ETH unit, reserve conversion through ETH/USD, optional parameter binding and a reduced set of proposal kinds. `ParameterizedVault` denominates debt/reserve value in USD, creates its own `Parameters`, and `Parameters.Change` includes `Wage` and `Gap`. The complete generated ABI and implemented overrides govern this reference. 7. **Old error/event narratives versus exports.** `docs/ABI.md` includes feed reporting events and omits parts of redemption and expanded governance. The generated vault reference uses only the exported entries checked against source. `Cash.compBurned` remains an exact ABI field name and is explained as imdUSD, without renaming it. 8. **Runbook “every action” freshness claim.** Runbook sections 4 and 7 imply no action works before feed seeding. `lock`, `wipe` and debt-free `free` have no explicit freshness gate. Pages state those exceptions while retaining token/dependency failure caveats. 9. **Work staleness comments versus execution.** Factory/work-oracle comments suggest stale tallies grant nothing new. `recordRoot`, `claim`, `mintingRights` and `consumeRights` do not check work-feed age. Accepted roots and claimed rights persist; vault pricing guards still govern `earn`. 10. **Dollar-price freshness comments.** Comments in `ParameterizedVault.reserveValue` and `UsdPriceFeed` suggest an unusable/stale leg always gives a zero read. `UsdPriceFeed.latestValue` can return a positive well-formed stale or future-dated observation; `isStale` is the separate gate. Registered unrelated healthy assets can still contribute to `reserveValue`. Reference pages require both value and freshness reads. 11. **Question-window recency claim.** `SwarmFeed._requireQuestion` comments and root README suggest advancing `toBlock` rules out ancient observations. The code enforces order, span and advancement, but no live-head distance or `blockHash` check. Pages make this narrower claim. 12. **Relayer security comments.** `SwarmRelay.sol:10-21` describes relayer pinning as preserving question-selection trust. The relay admits everyone; concrete leaf question binding supplies the check. `SwarmFeed`'s unbound branch only checks a nonzero relayer, as the internal audit explains. The risk is attributed to unbound configurations, not asserted against the bound launch leaves. 13. **Share-feed failure and yield comments.** `SharePriceFeed` comments broadly promise raw staticcalls for both legs and imply a wrapper rate only rises. Only the share conversion uses the defensive raw call; `assetFeed.latestValue/isStale/maxAge` are typed calls and can propagate failure. Neither adapter proves yield or a monotone exchange rate. No such guarantee is repeated. 14. **Parameter binding/bounds comments.** Some `Parameters`/`Governed` comments discuss a live-debt floor at application, but `_validate` intentionally permits `line` below outstanding debt. Constructor-created `Parameters` is linked by the vault's construction; standalone `Parameters` construction merely rejects a zero vault argument. Pages do not infer stronger standalone authentication or a debt floor. 15. **Research recommendations versus source.** The parameter research recommends separate borrowing/liquidation thresholds, stronger price recovery, a no-new-debt starting condition and altered fixed settings. The source uses one `mat`, permits stale re-anchoring, rejects a zero `line`, and exposes no proposal for the fixed curves or gross bonus. Pages label the report analysis, not selected values or available operations. 16. **Sibling redemption/backing guarantee.** `web/content/docs/guides/redeem.md` says retained fees raise backing per imdUSD for everyone left. `CDPVault._securedCollateralValue` can reduce counted collateral when debt is cancelled; internal audit section 1.4 expressly records that the view is not monotone. Economics pages distinguish retained economic value from that conservative view. The sibling text was not edited. 17. **Sibling unconditional redemption wording.** Overview and redemption pages say the channel stays open under a backing shortfall. That is true of the absence of a backing-ratio halt, but not a guarantee of executable redemption. Freshness, divergence, candidate ratio/capacity and nonzero-output guards remain. The new pages qualify the statement. 18. **Sibling “average” terminology.** Overview and keeper pages call the primary an average. Its source-pinned question specifies a median of 13 samples, not an arithmetic mean or on-chain time-weighted average. Reference and evidence pages use the precise statistic. 19. **Sibling feed floor placeholders.** The relay guide withholds panel floors and spans with economic settings. This reference explicitly states the source's technical panel counts and window bounds to meet the integration/evidence requirement, while withholding economic ages and deviation tolerances. 20. **Sibling work display shorthand.** The terminal guide calls the work figure a cumulative task count. `SwarmWorkOracle.latestValue` is a Merkle root; cumulative task counts are per-agent leaf/claim data. Reading-state documentation prevents formatting a root as a tally. 21. **Sibling unconditional stranded-chip claim.** The keeper-economics page says a chip credited to the relay can never be recovered. A direct `bite` strands that reward, but a `relayAndBite` where the relay is the marker includes the marker portion in the keeper's payout. The new risk text scopes the claim to directly paid rewards. 22. **Zero debt and failures in sibling descriptions.** The overview says every position holds excess collateral; `lock` supports debt-free deposits and price moves can make debt positions unsafe. The manage guide also presents an exhaustive short `lock` error list, although libraries and dependencies can fail. New pages use requirements on operations rather than an invariant over all positions and include propagated failures. 23. **Configuration comments versus deployed-vault behavior.** `src/DeploymentConfig.sol:22-26` says an unusable ETH/USD leg never reaches liquidation, but `ParameterizedVault._pricingStale` halts price-dependent liquidation when that leg is stale. The configuration commentary also describes economic constants as permanently unchangeable, while `ParameterizedVault` overrides those governed by `Parameters`. Its simple work-ceiling comment uses total debt without the transaction-start cap and loss subtraction implemented by `backedDebt`. Authority constants must be reconciled with runbook section 6 before deployment: the factory literal is explicitly a placeholder, and the supplied records do not certify launch wiring. No address is inferred from those literals. Dated audits contain names and deployment assessments that do not specify the delivered interface. They are used only for their identified evidence and risks. Claims of fixes are paired with source mechanisms, not converted into a whole-system security guarantee. The runbook and internal audit's per-leaf live-attestation verification gap is preserved rather than assumed completed by generator tests. ## Every TODO left - `TODO(collateral-integration)` — contracts-and-addresses: resolve share wrapping/wiring, denomination and raw-share/whole-token normalization; do not announce that arrangement as implemented. - `TODO(question-binding-evidence)` — oracle-and-question-binding and swarm-evidence: attach exact per-leaf canonical documents, live service signatures, domain recovery, deployed getter comparisons and acceptance receipts. - `TODO(oracle-funding)` — oracle-and-question-binding, monetary-policy and risks-and-open-questions: fill the Intake/Treasury payment route, assets, authorities, budget/replenishment, failures, relay reimbursement, gas and monitoring responsibility once implemented. Address and economic-value placeholders are intentional publication conventions. They are not assertions of deployment or governance selection. Open economic measurements in the evidence/risk pages remain questions, not invented results. ## Local validation and limits The documentation checker in `test/scratch/check_docs.py` verifies the exact output paths, front-matter keys and types, page ordering, source-path/line existence, relative links against the combined sibling tree, exact ABI inventory and event indexing, and prohibited address/wording patterns. Source declaration checks compare the source's public/external functions, public getters, events and errors to the two vault ABI files. A manual pass reviews numeric literals as units, technical verification rules or dated evidence rather than economic values. No contracts or configuration were changed. No dependencies were installed, no network transaction or oracle purchase was made, and no contract test suite, fork test or security analyzer was run. External documentation was browsed for organization; historic research observations were not independently remeasured. Site rendering is a separate step, so browser layout, accessibility and link routing after rendering remain unverified. The local checks establish document structure and inventory coverage, not independent behavioral or security certification. Validation result: `python3 test/scratch/check_docs.py` passed for all 12 required Markdown files, 61 vault functions, 11 events, 31 custom errors, 110 repository citations and 46 relative links. Both vault ABI function/getter inventories agree with the source declarations, and explicit function input types and event indexing agree. The tracked-file diff and staged diff are empty; every deliverable remains untracked.