Risk sentinel
Before every plan, a deterministic rule engine checks each venue for incidents, rate spikes, liquidity crunches and TVL flight. It can only lower a venue's cap or force an exit, never raise exposure.
On this page
What it does#
The sentinel runs at the start of every keeper cycle, once per venue. It reads the venue's live rate, utilisation and TVL, compares them with the last 7 days of history and a hand-maintained incident list, and returns a verdict:
| Verdict | Effect on the venue's cap | What the planner does |
|---|---|---|
| ok | None | Normal planning |
| caution | Multiplied by 0.75 or 0.5, depending on the rule | Cuts any excess above the lowered cap at once; no new funds |
| pause | Set to 0 | Exits the whole position at once; no new funds |
Exits ordered by the sentinel bypass every churn limit: no cooldown, cost check or turnover budget can delay them. After a venue has been flagged, it cannot receive new funds for 24 hours, even if its verdict returns to ok sooner.
Rules#
The rule engine is called rules-v1. Each rule that fires produces a finding:
| Rule | Caution | Pause (exit) |
|---|---|---|
| Incident on the venue | haircut: cap × 0.5; watch: cap × 0.75 | exclude |
| Utilisation | ≥ 95%: cap × 0.5 | ≥ 99% |
| APY spike against the 7-day median | ≥ 3×: cap × 0.5 | ≥ 5× |
| APY collapse against the 7-day median (median at least 1%) | ≤ 0.25×: cap × 0.5 | none |
| Implausibly high APY for a USDC venue | ≥ 40%: cap × 0.5 | none |
| TVL change over 7 days (TVL a week ago at least $100k) | ≤ −15%: cap × 0.75 | ≤ −30% |
| No live rate feed (registry fallback APY) | cap × 0.5 | none |
| Rate data older than 60 minutes | cap × 0.75 | none |
When several rules fire, the worst verdict wins and the lowest cap multiplier applies. A few guards keep noise out:
- The spike and collapse rules need at least 3 history points in the last 7 days and a median of at least 0.25%.
- The spike, collapse, absolute and TVL rules never run on fallback numbers.
- The absolute-APY rule does not fire on top of a spike finding for the same rate.
Incidents#
Some risks never show up in a rate. The keeper carries a short, hand-maintained list of incidents with three severities: exclude (pause, cap 0), haircut (realised or likely loss, cap halved) and watch (cap cut by a quarter). An incident applies to every strategy on its venue, or only to listed strategies, from its start date until an optional end date.
- Drift
- Severity
- exclude
- Since
- April 2026
- Note
- Exploited; excluded from all tiers
- Project 0
- Severity
- haircut
- Since
- January 2026
- Note
- Applied a haircut to depositors; treated as impaired
A real exit#
On 7 October 2026 at 23:55 UTC, Kamino's OnRe market reported 100% utilisation: every USDC lent out, so a withdrawal could be blocked. The utilisation rule returned pause and the keeper exited the whole Rapids position in the same cycle:
{
"tier": "rapids",
"kind": "derisk",
"summary": "Derisked Kamino RWA: moved 25,000 USDC to Jupiter Lend and idle, expected APY 5.53% to 4.29%",
"sentinel": {
"model": "rules-v1",
"verdict": "pause",
"score": 0.8,
"note": "2 of 6 venues flagged: Kamino RWA pause (utilization 100.0%, withdrawals may be blocked); Perena caution (no live rate feed, using registry fallback APY)"
},
"rationale": {
"legs": [
{ "kind": "derisk", "from": "Kamino RWA", "to": "idle", "amount": 24999.69, "note": "sentinel pause: cut Kamino RWA to 0.0% cap" },
{ "kind": "deploy", "from": "idle", "to": "Jupiter Lend", "amount": 5003.51, "gainUsd": 15.09, "costUsd": 0.51, "note": "idle above the 5% buffer" }
],
"frozen": ["Kamino RWA", "Perena", "Solstice", "Exponent"]
}
}The position went to idle first, and the part above the 5% buffer was redeployed into the best-scoring unfrozen venue in the same cycle. Kamino RWA then stayed frozen for at least 24 hours.
Optional LLM second opinion#
When the keeper has an OpenRouter API key, it can also ask a language model whether to keep, reduce or exit each venue, given a plain summary of the same signals. The merge is monotone: the model can make a verdict stricter or a cap lower, but never the reverse. If the model errors, times out or answers nonsense, the rules result stands. This is off in production; the live keeper runs rules-v1 alone.
What it can and cannot do#
| It can | It cannot |
|---|---|
| Lower a venue's cap for this cycle, down to zero | Raise any cap, or exceed the on-chain strategy cap |
| Force an immediate exit to the vault's idle account | Move funds anywhere other than idle and whitelisted strategies |
| Freeze a venue against new funds for 24 hours | Pause the protocol; only the admin can |
| Explain every verdict in the decision log | See exploits or depegs that no rate, TVL or incident reflects |
The sentinel is part of the keeper. If the keeper stops, nobody exits a failing venue until it is back, and the program has no on-chain circuit breaker of its own. The on-chain strategy caps still bound how much any one venue can hold. See Security.
Changes in the next keeper release#
These changes are built and tested on a branch and will replace the behaviour above when the keeper is next deployed.
- Data holds instead of verdicts. A venue with no live feed, or a quote older than 60 minutes, is put on hold rather than flagged: it keeps what it has, gets no new funds and is not drained by yield moves. Today a feed outage counts as a caution, which halves the venue's cap, forces an exit of the excess and freezes re-entry for 24 hours.
- Hysteresis. A non-immediate finding acts only once it has fired on every cycle for 30 minutes (caution) or 10 minutes (pause); a gap of more than 45 minutes restarts the clock. While it is confirming, the venue is on hold. A confirmed finding clears only below relaxed thresholds (for example utilisation 93% and 97%, spikes 2.5× and 4×, TVL −12% and −25%), so a signal sitting on a threshold cannot flip the verdict every cycle.
- Immediate findings stay immediate. Incidents, NAV depegs and 99% utilisation still exit on the cycle they appear.
- NAV drawdown rule. For USD*, eUSX and PTs: 0.2% below backing or the high-water exchange rate halves the cap, 1% exits.
- Chain-cap exits. Exposure above a chain cap is cut at once, like a strategy cap breach, starting with the lowest-yielding venue. With today's caps this cannot trigger; it guards against future changes.
- TVL is only compared within one data source, because DefiLlama and Kamino measure TVL differently.
apps/keeper/src/sentinel.ts, apps/keeper/src/sentinel/rules.ts, apps/keeper/src/incidents.ts and apps/keeper/src/rebalancer.ts. If the code and this page disagree, the code wins.