MYRMIDONS
ALGORITHMIC STRATEGIES
← HOMEMYRMIDONS // DOCS
[ 04 // RISK ]

the risk engine.

The risk engine computes model-grade metrics on top of the MNEMON archive. METRON, a pure statistics library, provides the estimators. Orchestrators run the estimators every hour for each market. The results ship as a versioned static API. MNEMON records what happens. The risk engine estimates what can go wrong.

LIQUIDATION CAPACITY

LIF = min(1.15, 1 / (0.3·lltv + 0.7)) // Morpho liquidation bonus

maxSlippage = (1 − 1/LIF) − haircut // what a liquidator can absorb

capacity = max sellable within maxSlippage // DEX ladder + Core book depth

capacity_ratio divides the debt-clearing capacity (capacity / LIF) by the market's total borrow. It is the fraction of the whole book that liquidators can clear profitably in one sweep at current onchain liquidity. At 1.0 or above, the full book clears. Far below 1.0, a large liquidation event exceeds what the venues can absorb. Liquidations then stall, and lenders absorb the shortfall. capacity_ratio_grouped is the stress version: every market that shares the collateral sells into the same liquidity at the same time.

LOADING_RISK_API…
Latest capacity_ratio for the largest books, live from the API (log scale). Right of the 1x line, liquidators can clear the whole book in one sweep; markets with a zero or failed capacity row are not plotted.

BUFFER BREACH

A market's cushion is 1 − LLTV. This is the price drop that liquidates a borrower at the reference LTV. buffer_breach_freq_{1h,6h,24h} is the share of the last 30 days in which the collateral price fell through the whole cushion within the horizon. It measures the fat tail that volatility alone does not show. The measure is one-sided: price increases never count.

METRIC FAMILIES

FAMILYMETRICSWHAT IT MEASURES
VOLATILITYrealized_vol_7d · realized_vol_30d · ewma_vol_30dAnnualized, from hourly collateral prices; the EWMA has a 7d half-life
DRAWDOWNmax_drawdown_30d · worst_window_7d_30dMax peak-to-trough decline and worst cumulative 7d window, 30d lookback
BUFFER BREACHbuffer_breach_freq_1h · buffer_breach_freq_6h · buffer_breach_freq_24hShare of the horizon's returns that fell through the whole cushion (1 − LLTV)
UTILIZATIONavg_util_7d · avg_util_30d · occupancy_below_kink_30d · time_at_utilization_95_30d · time_at_utilization_99_30d · util_spell_median_h · util_spell_p90_h · util_spell_survival_24hTime-weighted mean utilization (7d/30d), time below the IRM kink, time above 95% and 99%, and u ≥ 0.95 spell statistics with Kaplan-Meier survival
CONCENTRATIONhhi · top1_supply_share · top3_supply_share · top1_borrow_share · top3_borrow_shareHerfindahl-Hirschman index of the lender book, and the share of each book held by its 1 and 3 largest addresses
RATESrate_spread_30dTime-weighted mean borrow-minus-supply APY over 30d
ORACLEdepeg_max_30d · depeg_spell_median_h · depeg_spell_p90_h · depeg_survival_24hMax oracle-vs-reference deviation and depeg spell statistics (|deviation| ≥ 5%)
LIQ CAPACITYcapacity_ratio · capacity_ratio_grouped · lif · max_slippage_usedThe liquidation-capacity row, also projected as standalone metrics

Every name above is queryable directly: /v1/risk/metrics/{metric}.json serves the latest value across all markets, and /v1/risk/markets/{market_id}/history/{metric}.json serves one market's full series. See the API section below.

Every value carries an as_of timestamp, a status, and provenance. A metric status is ok, no_data, or insufficient_history. A capacity status is ok, no_route, no_price, or fee_exceeds_margin: the last one means the swap fee alone exceeds the liquidator's margin, so the modeled capacity is zero. A failed computation is always a row with a null value, never a missing key. The as_of grid is hourly since 2026-08-20. Earlier history is daily.

ORACLE IDENTITY

Every market payload carries an oracle block: the oracle contract's address, kind, family, owner status, its four MorphoChainlinkOracleV2 feed slots and vault hooks, and shared_feed_markets — the number of tracked markets that read at least one of the same upstream feeds. This is identity data, not a computed metric. Oracle configuration on Morpho is immutable, so MNEMON probes each address once on-chain and the answer never goes stale. The block carries no model version and no history.

FIELDVALUESMEANING
kindoracle-resolved · oracle-custom · feed · oracle-broken · opaqueWhat the contract is. oracle-broken cannot price; opaque could not be identified
familymeta-deviation-timelock · curve-stableswap · constant-peg · customBespoke pricing mechanisms. A constant peg serves a hardcoded price with no live input
owner_statusnone · okok means the contract exposes an admin that can change what it serves — an upgradable feed is the real risk surface
modtprimary · backup · threshold · timelocksSteakhouse dual-oracle wrappers: serves the primary, fails over to the backup when they deviate past the threshold for the timelock
shared_feed_marketsintegerBlast radius: a compromised or broken upstream feed hits this many markets at once

The site names each feed's provider (Chainlink, RedStone, Pyth, Pendle, ...) from the feed's own on-chain description. The archive itself stays strict: a push feed that does not identify itself is served as unknown, never guessed. Oracles that compose a derived leg — an ERC4626 exchange rate, a Curve LP, a Pendle PT, a hardcoded peg — deviate from spot by construction. The site marks their deviation STRUCT and does not flag it as a depeg.

API

STABLE BY CONTRACT. The schema evolves by addition only (openapi.yaml, test-enforced). Every row carries a model_version. Pin the version you validated against.

The API is rebuilt each hour at :40 UTC. Markets are keyed on (chain_id, market_id) across all tracked chains. Click any endpoint to copy its full URL. The examples below are real responses, truncated.

DISCOVERY INDEX

Read this first. It lists the served market ids, the metric catalog (description, unit, and the latest params per metric), the endpoint templates, and a freshness block per metric (latest_as_of, expected_as_of, fresh).

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/index.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "generated_at": "2026-08-20T13:40:01Z",
  "markets": ["0x0a2e456ebd…", "…"],
  "metrics": {
    "hhi": {
      "description": "Herfindahl index of the lender book.",
      "unit": "index_0_1",
      "params": { "window_days": 30, "weights": "supply_assets" }
    },
    "…": "…"
  },
  "freshness": {
    "hhi": {
      "latest_as_of": "2026-08-20T10:00:00Z",
      "expected_as_of": "2026-08-20T12:00:00Z",
      "fresh": false
    },
    "…": "…"
  },
  "endpoints": { "index": "/v1/risk/index.json", "…": "…" }
}

ALL MARKETS

One document with every market. Each entry carries the latest value per metric plus the liq_capacity row. This is the endpoint to poll for a dashboard: one request per hourly cycle covers the whole universe.

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/markets.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "generated_at": "2026-08-20T13:40:01Z",
  "markets": {
    "0x0a2e456ebd…": {
      "chain_id": 999,
      "liq_capacity": {
        "as_of": "2026-08-20T09:00:00Z",
        "capacity_ratio": 6.4235,
        "capacity_ratio_grouped": 0.00427,
        "lif": 1.0262,
        "max_slippage_used": 0.0175,
        "status": "ok"
      },
      "metrics": {
        "buffer_breach_freq_1h": {
          "as_of": "2026-08-20T10:00:00Z",
          "value": 0.0,
          "status": "ok"
        },
        "…": "…"
      }
    },
    "…": "…"
  }
}

ONE MARKET

One market, latest values only. The same shape as one entry of markets.json, plus the provenance fields (model_versions, metron_version, schema_version).

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/markets/0x0a2e456ebd22ed68ae1d5c6b2de70bc514337ac588a7a4b0e28f546662144036.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "market_id": "0x0a2e456ebd…",
  "chain_id": 999,
  "liq_capacity": {
    "capacity_ratio": 6.4235,
    "capacity_ratio_grouped": 0.00427,
    "status": "ok"
  },
  "metrics": {
    "hhi": {
      "as_of": "2026-08-20T10:00:00Z",
      "value": 0.99999,
      "status": "ok"
    },
    "…": "…"
  },
  "model_versions": ["api-v0.2.0+metron-v1.3.0"],
  "metron_version": "1.3.0"
}

MARKET HISTORY

The full history for one market, grouped by metric. params and input_window describe the latest point; older points can differ across model_version bumps. Per-point provenance lives in the underlying tables.

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/markets/0x0a2e456ebd22ed68ae1d5c6b2de70bc514337ac588a7a4b0e28f546662144036/history.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "market_id": "0x0a2e456ebd…",
  "chain_id": 999,
  "metrics": {
    "buffer_breach_freq_1h": {
      "params": {
        "lltv": 0.915,
        "buffer": 0.085,
        "buffer_formula": "one_minus_lltv",
        "lookback_d": 30,
        "sampling": "hourly_last"
      },
      "input_window": {
        "start": "2026-07-21T10:00:00Z",
        "end": "2026-08-20T10:00:00Z"
      },
      "points": [{ "as_of": "…", "value": 0.0, "status": "ok" }, "…"]
    },
    "…": "…"
  }
}

METRIC HISTORY

One metric, one market, the full series. Points ascend by as_of. The grid is hourly since 2026-08-20 and daily before, so long series mix the two cadences.

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/markets/0x0a2e456ebd22ed68ae1d5c6b2de70bc514337ac588a7a4b0e28f546662144036/history/hhi.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "market_id": "0x0a2e456ebd…",
  "chain_id": 999,
  "metric": "hhi",
  "params": {
    "weights": "supply_assets",
    "snapshot": "latest_at_or_before_as_of_within_30d"
  },
  "points": [
    { "as_of": "2026-08-20T09:00:00Z", "value": 0.99999, "status": "ok" },
    { "as_of": "2026-08-20T10:00:00Z", "value": 0.99999, "status": "ok" }
  ]
}

ONE METRIC, ALL MARKETS

One metric across every market. Use it to rank or screen the universe. The liq_capacity fields (capacity_ratio, capacity_ratio_grouped, lif, max_slippage_used) are projected here as metrics too.

CURL
curl -s https://api.myrmidons-strategies.com/v1/risk/metrics/capacity_ratio.json
EXAMPLE RESPONSE (TRUNCATED)
{
  "metric": "capacity_ratio",
  "source": "liq_capacity",
  "generated_at": "2026-08-20T13:40:01Z",
  "markets": [
    {
      "market_id": "0x0309c02dab…",
      "as_of": "2026-08-20T09:00:00Z",
      "value": 0.0000664,
      "status": "ok"
    },
    {
      "market_id": "0x039503b630…",
      "as_of": "2026-08-20T09:00:00Z",
      "value": 0.0,
      "status": "fee_exceeds_margin"
    }
  ]
}
$ man risk · this page in the terminal