solana-risk-engine 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/rugcheck.js +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-risk-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Explainable risk analysis for Solana tokens and wallets: creator control, real holder concentration, inflated liquidity, impostor tokens, funder clusters and PnL. Zero dependencies, runs in Node and the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/rugcheck.js
CHANGED
|
@@ -7,8 +7,22 @@ import { pool } from "./util.js";
|
|
|
7
7
|
// which on-chain data does not show without decoding each DEX's binary layout (Raydium, Orca, Meteora
|
|
8
8
|
// and pump.fun all differ). It is an extra, never a requirement: on failure these return null and the
|
|
9
9
|
// rest of the analysis is exactly the same.
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// RugCheck sometimes answers lpLockedPct 0 for a pool that is ~100% locked (5 of 40 calls on a
|
|
11
|
+
// Raydium CPMM token, 2026-10-26; a watched token flipped high/medium every check). A low value is
|
|
12
|
+
// therefore asked again up to twice and the highest answer wins: a pool that really is unlocked
|
|
13
|
+
// reads low every time, so only the false alarm goes away.
|
|
14
|
+
export const LP_RECHECK_BELOW = 60;
|
|
15
|
+
export async function rugcheckSummary(client, mint) {
|
|
16
|
+
const url = RUGCHECK + mint + "/report/summary";
|
|
17
|
+
let best = await client.softJson(url, 6000);
|
|
18
|
+
for (let i = 0; i < 2 && lowLp(best); i++) {
|
|
19
|
+
const again = await client.softJson(url, 6000);
|
|
20
|
+
if (again && typeof again.lpLockedPct === "number" && again.lpLockedPct > best.lpLockedPct) best = again;
|
|
21
|
+
}
|
|
22
|
+
return best;
|
|
23
|
+
}
|
|
24
|
+
function lowLp(rc) {
|
|
25
|
+
return !!rc && typeof rc.lpLockedPct === "number" && rc.lpLockedPct < LP_RECHECK_BELOW;
|
|
12
26
|
}
|
|
13
27
|
|
|
14
28
|
// Full report (~700 KB, so ask once per holder search, never per token of a wallet): who created the
|