{
 "openapi": "3.0.3",
 "info": {
  "title": "DueWall Public API — tokenized credit maturities, terms & NAV",
  "description": "Free public JSON API for tokenized private credit (RWA): structured maturity events (schema v1.2, incl. paid/liquidated resolutions), human-verified liquidity terms per fund (JAAA, JTRSY, SPXA, NYHB, SIEM), daily on-chain NAV/price series (one point per UTC day per pool token), daily NET capital flows per fund (conservation-exact within the observed window, rules FLW3), and on-chain pool NAV and TVL/APY coverage. Every record carries its coverage grade (A/B/M — see /coverage/). Served as static JSON — CORS enabled, no key required, CC-BY 4.0 (attribution 'DueWall Labs (duewall.com)'). The forward-looking maturity calendar and the trading-side flow layer for tokenized credit.",
  "version": "1.0.0",
  "contact": {
   "name": "DueWall Labs",
   "email": "hello@duewall.com",
   "url": "https://duewall.com"
  },
  "license": {
   "name": "CC-BY-4.0 (data) / MIT (adapters)",
   "url": "https://duewall.com"
  }
 },
 "servers": [
  {
   "url": "https://duewall.com/api/v1",
   "description": "Production (static JSON, daily refresh)"
  }
 ],
 "paths": {
  "/events.json": {
   "get": {
    "summary": "All structured events",
    "description": "Maturity, maturity_resolution (outcomes), redemption_window and nav_report events. Every record carries source_url, verified_by, status.",
    "responses": {
     "200": {
      "description": "JSON array of events (schema v1.2)"
     }
    }
   }
  },
  "/terms.json": {
   "get": {
    "summary": "Liquidity terms per fund",
    "description": "Human-verified structured terms: min investment, settlement, fees, domicile, AUM.",
    "responses": {
     "200": {
      "description": "JSON array of terms records"
     }
    }
   }
  },
  "/pools.json": {
   "get": {
    "summary": "Pool NAV & TVL/APY snapshot",
    "description": "Centrifuge pool tokens (on-chain NAV) + DefiLlama RWA pools.",
    "responses": {
     "200": {
      "description": "JSON object by source"
     }
    }
   }
  },
  "/flows.json": {
   "get": {
    "summary": "Daily NET capital flows per fund (FLW3)",
    "description": "Per-fund daily net_shares / net_usd / tvl_usd from on-chain totalIssuance daily anchors; conservation telescopes exactly within the observed window; series starting mid-life are full-quality (all-time aggregates are floors); funds with structural resets carry tape_quality=degraded (trade-side observation, unrelated to fund grades) and are excluded from aggregates. Gross order split intentionally not published.",
    "responses": {
     "200": {
      "description": "JSON object (all funds + tape_quality trade-side field)"
     }
    }
   }
  },
  "/btc_lending.json": {
   "get": {
    "summary": "BTC/WBTC collateral lending markets (Aave V3 + Morpho Blue)",
    "description": "First-party protocol API data: per-market supply/borrow USD, utilization and LTV for BTC-family collateral markets. Morpho USD values are price-feed estimates with confidence>=0.9; price outliers flagged and excluded from totals. counts reports markets_total split into active_markets (supply or borrow > 0), empty_markets (zero on-chain balance) and excluded_markets (price outlier) — the three sum to markets_total; totals_usd covers active markets only.",
    "responses": {
     "200": {
      "description": "JSON object (counts + markets + totals + watchlist)"
     }
    }
   }
  },
  "/maturity_wall.json": {
   "get": {
    "summary": "Monthly on-chain maturity distribution",
    "description": "Maple sample: monthly aggregate of on-chain maturities (the 266/0 finding).",
    "responses": {
     "200": {
      "description": "JSON object"
     }
    }
   }
  },
  "/price_history.json": {
   "get": {
    "summary": "Daily on-chain token price & pool NAV series",
    "description": "One point per UTC day per Centrifuge pool token (price, NAV in USD). NAV-type oracle value, not a market traded price. Series since 2026-10-31; grows daily.",
    "responses": {
     "200": {
      "description": "JSON object keyed by pool_id:SYMBOL"
     }
    }
   }
  },
  "/index.json": {
   "get": {
    "summary": "DLI — DueWall Lending Index",
    "description": "Rules-based equal-weight NAV index of grade-A tokenized credit pools. Daily values since inception 2026-10-31=100, constituents, rules hash, governance covenants. Never backfilled.",
    "responses": {
     "200": {
      "description": "JSON object"
     }
    }
   }
  },
  "/spreads.json": {
   "get": {
    "summary": "Credit spread ladder",
    "description": "Yield minus 3M Treasury per tracked fund, labeled by yield basis (realized NAV / advertised APY) and coverage grade. Includes grade-level ladder medians.",
    "responses": {
     "200": {
      "description": "JSON object"
     }
    }
   }
  },
  "/dcr.json": {
   "get": {
    "summary": "DCR — DeFi Credit Rate (R1 reference-rate leg)",
    "description": "Sky Savings Rate measured exactly from the on-chain sUSDS accumulator, daily. Rules-hashed, covenants inherited from DLI. Reference series.",
    "responses": {
     "200": {
      "description": "JSON object"
     }
    }
   }
  },
  "/meta.json": {
   "get": {
    "summary": "API metadata",
    "description": "Version, generation date, record counts, license.",
    "responses": {
     "200": {
      "description": "JSON object"
     }
    }
   }
  }
 }
}