# RugCheck.xyz Scoring — Research Notes

Research summary on how rugcheck.xyz maps scores to risk qualifiers, for reference when tuning the liquidity scoring sub-component.

---

## Two Separate Qualifier Systems

### 1. `risks[].level` — Per-risk qualifiers (well-documented)

Each entry in the `risks[]` array carries a `level` string. Known values:

| Level | Meaning |
|---|---|
| `"DANGER"` | Critical red flag |
| `"WARN"` | Warning-level concern |
| `"INFO"` | Informational only |

These are the qualifiers used in `score_liquidity()` for the 3-pt sub-score (counts `DANGER`-level risks).

---

### 2. `score` / `score_normalised` — Overall token score (poorly documented)

Rugcheck provides no public documentation mapping these fields to named labels.

#### Raw `score`

Cumulative additive risk score. **Higher = worse.** Observed range: 0 to 75,000+.

Best-effort thresholds used in our scoring (`src/rugcheck.rs`):

| Raw `score` | Implied risk | Points awarded |
|---|---|---|
| < 200 | Low risk | +7 |
| 200–349 | Moderate risk | +5 |
| 350–499 | Elevated risk | +2 |
| ≥ 500 | High/Critical | +0 |

#### `score_normalised`

Appears to be derived from the raw score, scaled to approximately 0–100 where **higher = safer** (inverse of raw). No official documentation exists. A third-party OKX integration script that reverse-engineers rugcheck's UI suggests:

| `score_normalised` | Label | Color |
|---|---|---|
| ≥ 70 | Low Risk | Green |
| 40–69 | Medium Risk | Orange |
| < 40 | High Risk | Red |

`score_normalised` is **not used** in the current scoring logic. The raw `score` is the more reliable signal.

---

## Implementation Notes

- The "Good / Warning / Danger" labels shown in rugcheck's own UI are almost certainly derived from the raw risk scores of individual `risks[]` items, not from `score_normalised`.
- Our code ignores `WARN` and `INFO` level risks; only `DANGER` affects the score.
- `score_normalised` is deserialized but unused — kept for potential future use.

---

## Sources

- [Swagger UI (rugcheck API)](https://api.rugcheck.xyz/swagger/index.html)
- [OKX RugCheck Addon source (Greasy Fork)](https://greasyfork.org/en/scripts/551182-web3-okx-rugcheck-addon/code)
- [riglr-web-tools rugcheck.rs source](https://docs.rs/riglr-web-tools/latest/src/riglr_web_tools/rugcheck.rs.html)
- [ccan23/rugcheck Python wrapper (GitHub)](https://github.com/ccan23/rugcheck)
