> ## 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

> Trigger a TCT Risk ALM analysis on a deal and retrieve duration, convexity, NII sensitivity, VaR, and stress test results.

<Steps>
  <Step title="Trigger an ALM Analysis">
    Pass the `deal_id` to analyse. The job runs asynchronously and returns a job reference immediately.

    <CodeGroup>
      ```bash cURL 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" }'
      ```

      ```json Response theme={null}
      {
        "success": true,
        "data": {
          "job_id": "clxalm001",
          "deal_id": "clx1a2b3c4d5e6f7g8h9",
          "status": "PROCESSING"
        }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Retrieve the Analysis Report">
    Fetch the completed report by `job_id`. Includes all metric categories.

    | 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   |
    | `var_metrics`      | Value-at-Risk at 95% and 99% confidence         |
    | `stress_tests`     | Portfolio impact under defined stress scenarios |

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

      ```json Response theme={null}
      {
        "success": true,
        "data": {
          "job_id": "clxalm001",
          "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
            },
            "var_metrics": {
              "var_95": 210000,
              "var_99": 340000
            },
            "stress_tests": [
              { "scenario": "rate_shock_300bps", "impact": -480000 },
              { "scenario": "credit_stress",     "impact": -310000 }
            ]
          }
        }
      }
      ```
    </CodeGroup>
  </Step>
</Steps>
