> ## Documentation Index
> Fetch the complete documentation index at: https://developer.9squid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ALM Analytics

ALM (Asset-Liability Management) analytics give you deep risk metrics on any deal — duration, convexity, NII sensitivity, EVE analysis, gap analysis, VaR, and stress test results. This recipe shows how to trigger a run and retrieve the report.

## Overview

```
1. POST /originator/analytics/alm      → trigger ALM analysis job
2. GET  /originator/analytics/alm/:id  → retrieve the completed report
```

***

## Step 1 — Trigger an ALM Analysis

Pass the `deal_id` you want to analyse. The job runs asynchronously and returns a job reference immediately.

```bash theme={null}
curl -X POST https://api.9squid.com/v1/api/originator/analytics/alm \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{ "deal_id": "clx1a2b3c4d5e6f7g8h9" }'
```

**Response**

```json theme={null}
{
  "success": true,
  "data": {
    "job_id": "clxalm001",
    "deal_id": "clx1a2b3c4d5e6f7g8h9",
    "status": "PROCESSING"
  }
}
```

***

## Step 2 — Retrieve the Analysis Report

Poll or fetch by `job_id` once the job completes. The full report includes all metric categories.

```bash theme={null}
curl https://api.9squid.com/v1/api/originator/analytics/alm/clxalm001 \
  -H "Authorization: Bearer <your_token>"
```

**Response**

```json theme={null}
{
  "success": true,
  "data": {
    "job_id": "clxalm001",
    "deal_id": "clx1a2b3c4d5e6f7g8h9",
    "status": "COMPLETED",
    "report": {
      "duration_metrics": {
        "macaulay_duration": 4.2,
        "modified_duration": 3.9,
        "dollar_duration": 1850000
      },
      "convexity": 18.3,
      "nii_sensitivity": {
        "shock_up_100bps": -125000,
        "shock_up_200bps": -260000,
        "shock_down_100bps": 118000
      },
      "eve_analysis": {
        "base": 4200000,
        "shock_up_200bps": 3850000,
        "shock_down_200bps": 4510000
      },
      "gap_analysis": { },
      "var_metrics": {
        "var_95": 210000,
        "var_99": 340000
      },
      "stress_tests": [
        { "scenario": "rate_shock_300bps", "impact": -480000 },
        { "scenario": "credit_stress", "impact": -310000 }
      ]
    }
  }
}
```

***

## Report Sections

| Section            | What it tells you                                   |
| ------------------ | --------------------------------------------------- |
| `duration_metrics` | Price sensitivity to interest rate moves            |
| `convexity`        | Curvature of the price-yield relationship           |
| `nii_sensitivity`  | Net Interest Income change under rate shocks        |
| `eve_analysis`     | Economic Value of Equity under rate scenarios       |
| `gap_analysis`     | Repricing mismatches between assets and liabilities |
| `var_metrics`      | Value-at-Risk at 95% and 99% confidence             |
| `stress_tests`     | Portfolio impact under defined stress scenarios     |

***

## When to Run ALM

* After a deal passes QC and before approval — confirms the risk profile meets investment criteria
* When interest rate assumptions change — re-run to refresh duration and NII sensitivity
* As part of ongoing portfolio monitoring — track convexity and VaR over time

***

## What's Next

* [Pool Analytics](/workflows/pool-analytics) — inspect the underlying loan pool statistics for the deal
* [Run Selection Criteria](/workflows/run-selection-criteria) — validate eligibility rules before running ALM
* [API Reference — ALM Analytics](/api-reference/originator-analytics/analyticscontroller_runalmanalysis) — full request schema and response shape
