> ## Documentation Index
> Fetch the complete documentation index at: https://ormaprotocol.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Orma: Credit Measurement for XLS-65 Lending Vaults

> Orma reads vault solvency from XRPL ledger state, scores it across six dimensions, and publishes grades on-chain. Enforce access with XLS-70 credentials.

Orma is a credit measurement, publication, and enforcement layer for XLS-65 lending vaults and XLS-66 loans on the XRP Ledger. It reads every vault from public ledger state — never from transaction metadata diffs — scores solvency across six independent dimensions, publishes those scores on-chain as native XLS-47 Oracle objects and inside each share token's own metadata, and lets any independent third party gate vault deposits through XLS-70 credentials. The result is a credit signal that no single party controls and that the ledger itself enforces.

<Note>
  Orma runs entirely on **XRPL Devnet** (`wss://s.devnet.rippletest.net:51233`, network id 2). XLS-65 vaults and XLS-66 lending are not yet enabled on Mainnet, so the measurement and gating layers cannot be pointed at production assets today. XLS-47 Price Oracles and XLS-70 credentials are already live on Mainnet — those components have a production path; the vault underneath them does not.
</Note>

<CardGroup cols={2}>
  <Card title="Introduction" icon="book-open" href="/introduction">
    Learn why naive NAV reads 1.000000 when the held value is 0.803922, how the two manager levers work, and what Orma does about them.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Clone the repo, prove the toolchain, start the reader against four live Devnet facilities, and call your first API endpoint — all in under five minutes.
  </Card>

  <Card title="API Reference" icon="code" href="/api/overview">
    Every route Orma serves, with request parameters, full JSON response shapes, and captured examples from live Devnet state.
  </Card>

  <Card title="Use Cases" icon="lightbulb" href="/use-cases">
    Four worked cases: choosing between two managers, pricing a pledge of vault units, attracting capital by being measured, and gating deposits on-chain.
  </Card>
</CardGroup>

## How to get started

<Steps>
  <Step title="Start the reader">
    Clone the repository and run `node src/index.mjs` from the repo root. The reader auto-discovers the four baked Devnet facilities and starts polling each vault every four seconds. The API comes up on `http://localhost:8787`.

    ```bash theme={null}
    node src/index.mjs
    ```
  </Step>

  <Step title="Call your first endpoint">
    Fetch the full vault list. Orma sorts results by `gradeNumeric` ascending — worst first — so the most dangerous facility surfaces at the top regardless of whether its manager has declared a loss yet.

    ```bash theme={null}
    curl -s http://localhost:8787/api/vaults \
      | jq -r '.vaults[] | "\(.grade)\t\(.navDivergenceBps)bp\t\(.label)"'
    ```
  </Step>

  <Step title="Read the score">
    Pull the detailed valuation for any vault. The response includes both the naive NAV (what a metadata-diffing indexer would compute) and the held NAV (assets net of recognised loss, divided by units outstanding), plus a full `notchTrace` explaining every grade step.

    ```bash theme={null}
    curl -s http://localhost:8787/api/vaults/864C5A2DDCED78C6198B0703169D533B747A56E5F9398D832033F79E37E8C835/nav
    ```
  </Step>

  <Step title="Gate deposits (optional)">
    If you want to enforce a grade threshold at deposit time, check whether a vault is behind a permissioned domain. An independent vault owner can name Orma's credential issuer in their domain; after that the ledger itself refuses deposits from uncredentialed accounts.

    ```bash theme={null}
    curl -s http://localhost:8787/api/vaults/4A5A8E3716D52E334AEB077ADB09456EF4A941CC26021A8EAD37F95B00190DF5/gate
    ```
  </Step>
</Steps>
