solana-risk-engine 0.8.2 → 0.8.3
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/README.md +1 -1
- package/package.json +1 -1
- package/src/i18n/en.js +1 -0
- package/src/i18n/es.js +2 -0
- package/src/known.js +11 -0
- package/src/risk.js +1 -0
- package/src/tokens.js +8 -3
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Methods (all accept `{ onProgress(step, fraction) }`):
|
|
|
78
78
|
| `analyzeAddress(addr)` | `{ kind: "token" \| "wallet", ... }`, detected automatically |
|
|
79
79
|
| `analyzeHolders(mint)` | `{ rows, clusters, groups, hotGroups, creator, mode, ageDays, signals, ... }`. Young tokens (under 14 days) also trace busy wallets; a source over 100 tx/h counts as an exchange; a group over 10% (young) or 15% (mature) of the supply gives a `HOLD_GROUP` signal. With `{ base: true }` it also reads [SolFlag's wallet base](https://solflag.com/datos/base.json) (exchanges, launch farms, distributors and serial creators its collector has seen): known exchanges are recognised without measuring them, and rows and group sources get `known` / `knownSources`. Best with your own RPC. |
|
|
80
80
|
| `loadWalletBase([url])` | SolFlag's wallet base `{ wallets: { addr: { t, ph, n, roles } } }`, or `null` if it cannot be read. Kept 10 minutes. `knownType(base, addr)` gives a wallet's type. |
|
|
81
|
-
| `knownWallet(addr)` | `{ n, t }` for a wallet with a public name (exchange hot wallets of Binance, Coinbase, OKX, Bybit, Kraken and others, each checked against its Solscan label), or `null`. Concentration leaves these exchanges out of the count and names them (`ex`, `exn` in the signal data). |
|
|
81
|
+
| `knownWallet(addr)` | `{ n, t }` for a wallet with a public name (exchange hot wallets of Binance, Coinbase, OKX, Bybit, Kraken and others, each checked against its Solscan label), or `null`. Concentration leaves these exchanges and custodians (`t: "custodian"`, e.g. Fireblocks) out of the count and names them (`ex`, `exn` in the signal data). Market makers (`mm`, `mmn`) and the project's own wallets (`t: "project"`, with role `r`: treasury, issuer or creator; `pj`, `pjn`) are named but still counted. |
|
|
82
82
|
| `analyzeHolders(mint)` | `{ rows, clusters, groups, hotGroups, creator, mode, ageDays, signals, ... }`. Young tokens (under 14 days) also trace busy wallets; a source over 100 tx/h counts as an exchange; a group over 10% (young) or 15% (mature) of the supply gives a `HOLD_GROUP` signal. Best with your own RPC. |
|
|
83
83
|
| `connectionMap(mint, { createdAt })` | `{ mode, holders, sources, groups, nets, hub, creator, payer, signals }`: largest holders typed person / bot / exchange (over 100 tx/h) / pool, who gave each one its first SOL, groups sharing that source, RugCheck's token-transfer networks with their links. `young` (under 14 days) or `mature` decides what is traced and when it warns (`MAP_GROUP`, `MAP_SWARM` for 10+ holders from one source whatever they hold, `MAP_HUB`, `MAP_WHALE`). 20 holders, 75 with your own RPC. |
|
|
84
84
|
| `estimatePnl(wallets)` | `{ pnl: { [wallet]: { realized, unreal, total, ret, st, open } } }`. Needs Helius. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-risk-engine",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
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/i18n/en.js
CHANGED
|
@@ -12,6 +12,7 @@ function prog(d) {
|
|
|
12
12
|
" hold" + (d.exn && d.exn.length === 1 ? "s" : "") + " " + pct(d.ex) + ": their users' funds, not counted";
|
|
13
13
|
if (d && d.mm >= 1 && d.mmn && d.mmn.length) s += ". " + d.mmn.slice(0, 2).join(" and ") + " (market maker" + (d.mmn.length > 1 ? "s" : "") + ") " +
|
|
14
14
|
(d.mmn.length > 1 ? "hold" : "holds") + " " + pct(d.mm) + ": counted, as " + (d.mmn.length > 1 ? "they" : "it") + " can sell it";
|
|
15
|
+
if (d && d.pj >= 1 && d.pjn && d.pjn.length) s += ". The project's own wallets (" + d.pjn.slice(0, 2).join(" and ") + ") hold " + pct(d.pj) + ": counted, as it can sell them";
|
|
15
16
|
return s;
|
|
16
17
|
}
|
|
17
18
|
|
package/src/i18n/es.js
CHANGED
|
@@ -16,6 +16,8 @@ function prog(d) {
|
|
|
16
16
|
// creadores de mercado con nombre: sí cuentan (es su inventario y lo pueden vender)
|
|
17
17
|
if (d && d.mm >= 1 && d.mmn && d.mmn.length) s += ". " + d.mmn.slice(0, 2).join(" y ") + " (creador" + (d.mmn.length > 1 ? "es" : "") + " de mercado) " +
|
|
18
18
|
(d.mmn.length > 1 ? "tienen" : "tiene") + " el " + pct(d.mm) + ": cuenta, porque lo puede" + (d.mmn.length > 1 ? "n" : "") + " vender";
|
|
19
|
+
// wallets del propio proyecto (tesorería, emisor, creador): sí cuentan, el proyecto lo puede vender (0.8.3)
|
|
20
|
+
if (d && d.pj >= 1 && d.pjn && d.pjn.length) s += ". Wallets del propio proyecto (" + d.pjn.slice(0, 2).join(" y ") + ") tienen el " + pct(d.pj) + ": cuenta, porque lo puede vender";
|
|
19
21
|
return s;
|
|
20
22
|
}
|
|
21
23
|
|
package/src/known.js
CHANGED
|
@@ -27,6 +27,17 @@ export const KNOWN_WALLETS = {
|
|
|
27
27
|
"42brAgAVNzMBP7aaktPvAmBSPEkehnFQejiZc53EpJFd": { n: "Bybit", t: "exchange" },
|
|
28
28
|
"6LY1JzAFVZsP2a2xKrtU6znQMQ5h4i7tocWdgrkZzkzF": { n: "Kraken", t: "exchange" },
|
|
29
29
|
"5PAhQiYdLBd6SVdjzBQDxUAEFyDdF5ExNPQfcscnPRj5": { n: "MEXC", t: "exchange" },
|
|
30
|
+
"3RtJvxpkok13LGQsQ3Ye4QvCkbP3ioMpra7ccuf9XqsF": { n: "Bitget", t: "exchange" },
|
|
31
|
+
"FQEmsV5A6jZdmb3KuP3YBLmHfFNoKuoWddBGMQuW1M9f": { n: "Bybit", t: "exchange" },
|
|
32
|
+
// Custodians (0.8.3): keep funds for institutions, so a big balance is not one person; named, left out of the count
|
|
33
|
+
"6427KSfRCUURDHsNir5GBJhdSYPLi1nfxAtTv4PVpJxF": { n: "Fireblocks", t: "custodian" },
|
|
34
|
+
// Project wallets (0.8.3): the project's own treasury, issuer, creator or team. Named, but they DO count in
|
|
35
|
+
// concentration (the project can sell). r = role: treasury | issuer | creator. Public name on Solscan (26 Nov 2026),
|
|
36
|
+
// or, for IdleMine, funded by the project's own Squads vault "Idle26".
|
|
37
|
+
"8pFhUqCU7Fkxfg2DLytRDf7a9oK4XGtN92PrYwtVQc6G": { n: "Raydium", t: "project", r: "treasury" },
|
|
38
|
+
"5gUuDFHswKi2QMA1qJHf6FEVhNCrHnyAdfWniMaUUPE4": { n: "Paxos", t: "project", r: "issuer" },
|
|
39
|
+
"FrXTvkebakR2oNctgsHz1yeijmu9wTZifL3FmffJP5xJ": { n: "Nullmask", t: "project", r: "creator" },
|
|
40
|
+
"EYSgk4bPdA8zcBjufxDYkhtyAAs18CaxHdvzzKSt5nGd": { n: "IdleMine", t: "project", r: "treasury" },
|
|
30
41
|
// Market makers: named, but they DO count in concentration (their own inventory, they can sell).
|
|
31
42
|
// Wintermute: Solscan public names (7 Nov 2026, solscan.io/labelcloud/wintermute).
|
|
32
43
|
"MfDuWeqSHEqTFVYZ7LoexgAK9dxk7cy4DFJWjWMGVWa": { n: "Wintermute", t: "market_maker" },
|
package/src/risk.js
CHANGED
|
@@ -200,6 +200,7 @@ export function buildLights(info, conc, pair, value, type, rc, now, launches) {
|
|
|
200
200
|
if (conc.w1a) data.w1a = conc.w1a; // address of the biggest person-wallet (0.8.0)
|
|
201
201
|
if (conc.ex) { data.ex = conc.ex; data.exn = conc.exn; } // named exchanges, shown but not counted
|
|
202
202
|
if (conc.mm) { data.mm = conc.mm; data.mmn = conc.mmn; } // named market makers, shown and counted
|
|
203
|
+
if (conc.pj) { data.pj = conc.pj; data.pjn = conc.pjn; } // the project's own wallets (0.8.3), shown and counted
|
|
203
204
|
let code = !conc.nW ? (conc.ex ? "CON_EXCHANGES" : "CON_ALL_POOLS") : (st === "ok" ? "CON_OK" : "CON_HIGH");
|
|
204
205
|
// under a verified issuer the big holders are its treasury, custodians, exchanges and lending
|
|
205
206
|
// protocols, not someone about to dump: shown, not counted (PYUSD 56% in one wallet, 1/11)
|
package/src/tokens.js
CHANGED
|
@@ -119,14 +119,15 @@ export async function getConc(client, mint, supply) {
|
|
|
119
119
|
const kind = await accountKinds(client, uniq(owners), true); // emptied wallets (0 SOL) still count
|
|
120
120
|
const agg = {};
|
|
121
121
|
owners.forEach(function (o, i) { agg[o] = (agg[o] || 0) + amts[i]; });
|
|
122
|
-
const ws = [], wo = [], exs = {}, mms = {};
|
|
123
|
-
let prog = 0, ex = 0, mm = 0;
|
|
122
|
+
const ws = [], wo = [], exs = {}, mms = {}, pjs = {};
|
|
123
|
+
let prog = 0, ex = 0, mm = 0, pj = 0;
|
|
124
124
|
Object.keys(agg).forEach(function (o) {
|
|
125
125
|
const k = knownWallet(o);
|
|
126
|
-
if (kind[o] === "wallet" && k && k.t === "exchange") { ex += agg[o]; exs[k.n] = (exs[k.n] || 0) + agg[o]; } // users' funds, not one person
|
|
126
|
+
if (kind[o] === "wallet" && k && (k.t === "exchange" || k.t === "custodian")) { ex += agg[o]; exs[k.n] = (exs[k.n] || 0) + agg[o]; } // users' funds, not one person
|
|
127
127
|
else if (kind[o] === "wallet") {
|
|
128
128
|
ws.push(agg[o]); wo.push([o, agg[o]]);
|
|
129
129
|
if (k && k.t === "market_maker") { mm += agg[o]; mms[k.n] = (mms[k.n] || 0) + agg[o]; } // named, still counted
|
|
130
|
+
if (k && k.t === "project") { pj += agg[o]; pjs[k.n] = (pjs[k.n] || 0) + agg[o]; } // the project's own wallet (0.8.3): named, still counted
|
|
130
131
|
}
|
|
131
132
|
else prog += agg[o];
|
|
132
133
|
});
|
|
@@ -144,6 +145,10 @@ export async function getConc(client, mint, supply) {
|
|
|
144
145
|
out.mm = mm / supply * 100;
|
|
145
146
|
out.mmn = Object.keys(mms).sort(function (x, y) { return mms[y] - mms[x]; });
|
|
146
147
|
}
|
|
148
|
+
if (pj) {
|
|
149
|
+
out.pj = pj / supply * 100;
|
|
150
|
+
out.pjn = Object.keys(pjs).sort(function (x, y) { return pjs[y] - pjs[x]; });
|
|
151
|
+
}
|
|
147
152
|
} catch (e) { if (isCancel(e)) throw e; }
|
|
148
153
|
return out;
|
|
149
154
|
}
|