solana-risk-engine 0.5.1 → 0.5.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/constants.js +13 -3
- package/src/i18n/en.js +3 -0
- package/src/i18n/es.js +4 -0
- package/src/index.js +1 -1
- package/src/known.js +8 -0
- package/src/risk.js +41 -5
- package/src/tokens.js +10 -3
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ for (const l of r.lights) // the four traffic lights
|
|
|
31
31
|
| **Serial creators** | For markets under 7 days: how many other tokens the creator launched in the last 24 h (RugCheck). 2 or more is a warning, 5 or more a red flag. `recentLaunches(client, wallet)` counts the same on chain for the wallet that *paid* a launch, which catches farms that name a fresh creator each time. When RugCheck has no report yet (it often answers 400 for tokens a few minutes old) the analysis falls back to `chainLaunches(client, mint)`: that count for the first signer of the token's creation transaction, reported as its own signal `CTL_SERIAL_PAYER` ("the wallet that paid for this launch…", never as the creator) and skipped when the SolFlag wallet base knows that wallet as an exchange or platform. |
|
|
32
32
|
| **Impostors** | Tokens using the symbol or name of a famous token (USDC, JUP, BONK, WIF, BTC, ETH...) with a different address. |
|
|
33
33
|
| **Real brands** | About 320 real companies with no token on Solana (Spotify, Nike, Zara, Ferrari...). A token called just that is a red flag and **HIGH**; the brand as one word of a longer name is a warning. Everyday words that are also brands (Shell, Target, Puma) are left out, and markets at least 30 days old with $100k+ liquidity are not checked. |
|
|
34
|
-
| **Known issuers and official tokens** | Stablecoins from Paxos (PYUSD, USDG), Circle (USDC, EURC) and Tether (USDT), tokenized shares from xStocks (all recognised by their control keys, taken from mints the issuer lists on its own pages) and official tokens from exchanges and Socios.com (bnSOL, bbSOL, cbBTC, club fan tokens..., by mint address) are shown as dependency on the issuer. Their large holders (treasury, custodians, exchanges) are shown but do not count as concentration, a 0% transfer fee is not a warning, and a tiny Solana pool is a warning, not a red flag. A short **trusted** list (Circle, Paxos, Tether, xStocks; `trustedIssuer()`) goes further: every light green, holders not checked. |
|
|
34
|
+
| **Known issuers and official tokens** | Stablecoins from Paxos (PYUSD, USDG), Circle (USDC, EURC) and Tether (USDT), tokenized shares from xStocks (all recognised by their control keys, taken from mints the issuer lists on its own pages) and official tokens from exchanges and Socios.com (bnSOL, bbSOL, cbBTC, club fan tokens..., by mint address) are shown as dependency on the issuer. Their large holders (treasury, custodians, exchanges) are shown but do not count as concentration, a 0% transfer fee is not a warning, and a tiny Solana pool is a warning, not a red flag. A short **trusted** list (Circle, Paxos, Tether, xStocks; `trustedIssuer()`) goes further: every light green, holders not checked. If one of an issuer's official mints shows a control key that is not on the list (a key rotation, or a stolen key), it keeps the issuer but turns amber (`CTL_ISSUER_KEYS_CHANGED`, `issuerKeysChanged()`) until the key is reviewed; `setIssuers(list)` swaps in a reviewed list without a new release. |
|
|
35
35
|
| **Token type** | `STABLE`, `TOKENIZED`, `BRIDGED`, `CREATOR`, `OPEN`. Each type is judged by the rules that fit it: a bridged token normally has a program as mint authority, a memecoin does not. |
|
|
36
36
|
| **Bots and exchanges** | Wallets that made 200 transactions in under 2 days are marked `active` and are not counted as whales. |
|
|
37
37
|
| **Funder clusters** | The fee payer of each holder's *first* transaction reveals who created it. Holders sharing a funder are grouped, since that is often one team splitting the supply. Exchange hot wallets are excluded as sources. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-risk-engine",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.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/constants.js
CHANGED
|
@@ -170,14 +170,22 @@ export const ISSUERS = [
|
|
|
170
170
|
] },
|
|
171
171
|
// Each mint below is listed by its issuer (URL); the keys are the ones those mints carry on-chain (1/11/2026).
|
|
172
172
|
// An issuer is only added with an official page for its mints: FDUSD was left out for lack of one.
|
|
173
|
-
|
|
173
|
+
// mints: the issuer's official mints and the page that lists them. A mint on this list whose keys are
|
|
174
|
+
// not all known any more is a key rotation pending review (issuerKeysChanged), not a stranger's token
|
|
175
|
+
{ name: "Paxos", trusted: true, mints: {
|
|
176
|
+
"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo": "https://docs.paxos.com/guides/stablecoin/pyusd/mainnet",
|
|
177
|
+
"2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH": "https://docs.paxos.com/guides/stablecoin/usdg/mainnet"
|
|
178
|
+
}, keys: [
|
|
174
179
|
// PYUSD 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo https://docs.paxos.com/guides/stablecoin/pyusd/mainnet
|
|
175
180
|
// USDG 2u1tszSeqZ3qBWF3uNGPFc8TzMk2tdiwknnRMWGWjGWH https://docs.paxos.com/guides/stablecoin/usdg/mainnet
|
|
176
181
|
"AxJkHRY3puoofyj7Pn512M1SGBgWroXMkEdNPQypkzbu", // PYUSD mint
|
|
177
182
|
"2e99QgqSDtiJSi5omGRVeZJuqNFRZdpy2YgG3mBd1AB4", // USDG mint
|
|
178
183
|
"2apBGMsS6ti9RyF5TwQTDswXBWskiJP2LD4cUEDqYJjk" // freeze, permanent delegate, hook, fee (both)
|
|
179
184
|
] },
|
|
180
|
-
{ name: "Circle", trusted: true,
|
|
185
|
+
{ name: "Circle", trusted: true, mints: {
|
|
186
|
+
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "https://developers.circle.com/stablecoins/usdc-contract-addresses",
|
|
187
|
+
"HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr": "https://developers.circle.com/stablecoins/eurc-contract-addresses"
|
|
188
|
+
}, keys: [
|
|
181
189
|
// USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, EURC HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr
|
|
182
190
|
// https://developers.circle.com/stablecoins/usdc-contract-addresses , .../eurc-contract-addresses
|
|
183
191
|
"BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG", // USDC mint
|
|
@@ -185,7 +193,9 @@ export const ISSUERS = [
|
|
|
185
193
|
"Hy9168u7b2Toujh8SJKtKK8DWbyaBbXPzxm337R4o4XY", // EURC mint
|
|
186
194
|
"6FF2CPcL6fat16QVJH6W27DeBcX7TSqbwY3a5wtyVJLC" // EURC freeze
|
|
187
195
|
] },
|
|
188
|
-
{ name: "Tether", trusted: true,
|
|
196
|
+
{ name: "Tether", trusted: true, mints: {
|
|
197
|
+
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB": "https://tether.to/en/supported-protocols"
|
|
198
|
+
}, keys: [
|
|
189
199
|
// USDT Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB (FAMOUS.USDT)
|
|
190
200
|
"Q6XprfkF8RQQKoQVG33xT88H7wi8Uk1B1CC7YAs69Gi" // USDT mint and freeze
|
|
191
201
|
] }
|
package/src/i18n/en.js
CHANGED
|
@@ -10,6 +10,8 @@ function prog(d) {
|
|
|
10
10
|
// named exchanges: their users' funds, not one person who can sell (not counted)
|
|
11
11
|
if (d && d.ex >= 1) s += ". " + (d.exn && d.exn.length ? d.exn.slice(0, 2).join(" and ") + (d.exn.length > 2 ? " and other exchanges" : "") : "Exchanges") +
|
|
12
12
|
" hold" + (d.exn && d.exn.length === 1 ? "s" : "") + " " + pct(d.ex) + ": their users' funds, not counted";
|
|
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
|
+
(d.mmn.length > 1 ? "hold" : "holds") + " " + pct(d.mm) + ": counted, as " + (d.mmn.length > 1 ? "they" : "it") + " can sell it";
|
|
13
15
|
return s;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -41,6 +43,7 @@ export default {
|
|
|
41
43
|
CTL_NON_TRANSFERABLE: () => "Cannot be transferred",
|
|
42
44
|
CTL_DEFAULT_FROZEN: () => "New accounts can be created frozen",
|
|
43
45
|
CTL_ONLY_PROGRAMS: () => "Only program-controlled authorities (see dependency)",
|
|
46
|
+
CTL_ISSUER_KEYS_CHANGED: (d) => "An official " + d.issuer + " token, but it has " + (((d.keys && d.keys.length) || 1) === 1 ? "a new control key" : d.keys.length + " new control keys") + " we have not checked yet: it may be a change by the issuer or a stolen key. Until it is reviewed, we do not count it as verified",
|
|
44
47
|
CTL_KNOWN_ISSUER: (d) => "Controlled by its issuer, " + d.issuer + " (see dependency)",
|
|
45
48
|
CTL_NONE: () => "No active authorities: nobody can mint more or freeze",
|
|
46
49
|
CTL_SERIAL_CREATOR: (d) => "The creator launched " + d.n + " other tokens in the last 24 h (per RugCheck): a serial launcher, who usually drops each token as soon as buyers arrive",
|
package/src/i18n/es.js
CHANGED
|
@@ -13,6 +13,9 @@ function prog(d) {
|
|
|
13
13
|
// exchanges con nombre: fondos de sus usuarios, no una persona que pueda vender (no cuentan)
|
|
14
14
|
if (d && d.ex >= 1) s += ". " + (d.exn && d.exn.length ? d.exn.slice(0, 2).join(" y ") + (d.exn.length > 2 ? " y otros exchanges" : "") : "Los exchanges") +
|
|
15
15
|
" guarda" + (d.exn && d.exn.length === 1 ? "" : "n") + " el " + pct(d.ex) + ": son fondos de sus usuarios y no cuentan";
|
|
16
|
+
// creadores de mercado con nombre: sí cuentan (es su inventario y lo pueden vender)
|
|
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
|
+
(d.mmn.length > 1 ? "tienen" : "tiene") + " el " + pct(d.mm) + ": cuenta, porque lo puede" + (d.mmn.length > 1 ? "n" : "") + " vender";
|
|
16
19
|
return s;
|
|
17
20
|
}
|
|
18
21
|
|
|
@@ -44,6 +47,7 @@ export default {
|
|
|
44
47
|
CTL_NON_TRANSFERABLE: () => "No se puede transferir",
|
|
45
48
|
CTL_DEFAULT_FROZEN: () => "Las cuentas nuevas pueden crearse congeladas",
|
|
46
49
|
CTL_ONLY_PROGRAMS: () => "Solo hay autoridades controladas por un programa (ver dependencia)",
|
|
50
|
+
CTL_ISSUER_KEYS_CHANGED: (d) => "Es un token oficial de " + d.issuer + ", pero tiene " + (((d.keys && d.keys.length) || 1) === 1 ? "una clave de control nueva" : d.keys.length + " claves de control nuevas") + " que aún no hemos comprobado: puede ser un cambio del emisor o una clave robada. Hasta revisarlo, no lo damos por verificado",
|
|
47
51
|
CTL_KNOWN_ISSUER: (d) => "Lo controla su emisor, " + d.issuer + " (ver dependencia)",
|
|
48
52
|
CTL_NONE: () => "Sin autoridades activas: nadie puede crear más ni congelar",
|
|
49
53
|
CTL_SERIAL_CREATOR: (d) => "El creador ha lanzado " + d.n + " tokens más en las últimas 24 h (según RugCheck): es un lanzador en serie, que suele abandonar cada token en cuanto llegan compradores",
|
package/src/index.js
CHANGED
|
@@ -51,7 +51,7 @@ export { KNOWN_WALLETS, knownWallet } from "./known.js";
|
|
|
51
51
|
export { getTokens, getMint, getConc, getAuthKinds, isMint, accountKinds, kindOf } from "./tokens.js";
|
|
52
52
|
export { getMarkets, realLiq, impostorOf, INFLATED_RATIO, geckoLiquidity, geckoPair, brandOf, copiesOf, fakeLiquidity, FAKE_LIQ_RATIO } from "./markets.js";
|
|
53
53
|
export { rugcheckSummary, rugcheckReport, rugcheckGraph, netBalances, creatorLaunches, CREATOR_DEAD_MCAP } from "./rugcheck.js";
|
|
54
|
-
export { score, issuerOf, trustedIssuer, tokenType, buildLights, levelFrom, dataOnly, reasonsFrom, assess, SERIAL_WARN, SERIAL_BAD, HISTORY_MIN, HISTORY_WARN, HISTORY_BAD_MIN, HISTORY_BAD } from "./risk.js";
|
|
54
|
+
export { score, issuerOf, trustedIssuer, issuerKeysChanged, setIssuers, tokenType, buildLights, levelFrom, dataOnly, reasonsFrom, assess, SERIAL_WARN, SERIAL_BAD, HISTORY_MIN, HISTORY_WARN, HISTORY_BAD_MIN, HISTORY_BAD } from "./risk.js";
|
|
55
55
|
export { recentLaunches, chainLaunches } from "./launch.js";
|
|
56
56
|
export { analyzeToken, analyzeWallet, analyzeAddress, sortResults } from "./wallet.js";
|
|
57
57
|
export { holderBase, markBusy, onlyReceives, PASSIVE_SAMPLE, findFunder, findFunders, clusterByFunder, holderRows, creatorInfo, analyzeHolders,
|
package/src/known.js
CHANGED
|
@@ -20,6 +20,14 @@ export const KNOWN_WALLETS = {
|
|
|
20
20
|
"A77HErqtfN1hLLpvZ9pCtu66FEtM8BveoaKbbMoZ4RiR": { n: "Bitget", t: "exchange" },
|
|
21
21
|
"88xTWZMeKfiTgbfEmPLdsUCQcZinwUfk25EBQZ21XMAZ": { n: "HTX", t: "exchange" },
|
|
22
22
|
"6FEVkH17P9y8Q9aCkDdPcMDjvj7SVxrTETaYEm8f51Jy": { n: "Crypto.com", t: "exchange" },
|
|
23
|
+
// Market makers: named, but they DO count in concentration (their own inventory, they can sell).
|
|
24
|
+
// Wintermute: Solscan public names (7 Nov 2026, solscan.io/labelcloud/wintermute).
|
|
25
|
+
"MfDuWeqSHEqTFVYZ7LoexgAK9dxk7cy4DFJWjWMGVWa": { n: "Wintermute", t: "market_maker" },
|
|
26
|
+
"44P5Ct5JkPz76Rs2K6juC65zXMpFRDrHatxcASJ4Dyra": { n: "Wintermute", t: "market_maker" },
|
|
27
|
+
"5sTQ5ih7xtctBhMXHr3f1aWdaXazWrWfoehqWdqWnTFP": { n: "Wintermute", t: "market_maker" },
|
|
28
|
+
"7sMiW38oLg5q9SKNoyPaH2Ee1VhpGdMCDrC4Lo4uLBBE": { n: "Wintermute", t: "market_maker" },
|
|
29
|
+
// DWF Labs: its own disclosure of its Solana buying wallet (Andrei Grachev on X, 6 May 2025)
|
|
30
|
+
"HwDkuDCUipJHHKodBBCjffFvrjhmd4iVVh7fq25fShvt": { n: "DWF Labs", t: "market_maker" },
|
|
23
31
|
// off the curve, so it already counts as a program; named so it can be shown
|
|
24
32
|
"1nc1nerator11111111111111111111111111111111": { n: "Incinerator", t: "burn" }
|
|
25
33
|
};
|
package/src/risk.js
CHANGED
|
@@ -56,7 +56,7 @@ export function tokenType(info, pair, now) {
|
|
|
56
56
|
if (/USD|DOLLAR/i.test(sym) && price > 0.97 && price < 1.03 && liq >= 200000 && ageDays >= 30) return "STABLE";
|
|
57
57
|
// a verified issuer's dollar or euro token is a stablecoin whatever pair DexScreener found (USDC showed
|
|
58
58
|
// "bridged" because its pair as base token is recent)
|
|
59
|
-
if (/USD|DOLLAR|EUR/i.test(sym) &&
|
|
59
|
+
if (/USD|DOLLAR|EUR/i.test(sym) && anyIssuer(info, pair && pair.baseToken && pair.baseToken.address)) return "STABLE";
|
|
60
60
|
if (info.ext.indexOf("permanentDelegate") >= 0) return "TOKENIZED";
|
|
61
61
|
const walletAuth = (info.mintAuth && ak[info.mintAuth] !== "program") || (info.freezeAuth && ak[info.freezeAuth] !== "program");
|
|
62
62
|
if (walletAuth) return "CREATOR";
|
|
@@ -76,6 +76,37 @@ export function issuerOf(info, mint) {
|
|
|
76
76
|
return found ? found.name : null;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
// An issuer's official mint (listed in its mints) whose control keys are not all known any more: the
|
|
80
|
+
// issuer rotated a key, or someone took one. Seeing the new key on chain does not prove it is the
|
|
81
|
+
// issuer's, so until it is reviewed the token keeps its issuer but loses the trusted green.
|
|
82
|
+
// Returns { issuer, keys: [the unknown keys] } or null
|
|
83
|
+
export function issuerKeysChanged(info, mint) {
|
|
84
|
+
if (!mint || !info || !info.extKeys || issuerOf(info, mint)) return null;
|
|
85
|
+
const found = ISSUERS.find(function (i) { return i.mints && i.mints[mint]; });
|
|
86
|
+
if (!found) return null;
|
|
87
|
+
const fresh = [info.mintAuth, info.freezeAuth].concat(info.extKeys).filter(function (k) { return k && found.keys.indexOf(k) < 0; });
|
|
88
|
+
return fresh.length ? { issuer: found.name, keys: fresh.filter(function (k, n, a) { return a.indexOf(k) === n; }) } : null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// The issuer, known or with a key rotation pending review
|
|
92
|
+
function anyIssuer(info, mint) {
|
|
93
|
+
const r = issuerKeysChanged(info, mint);
|
|
94
|
+
return issuerOf(info, mint) || (r && r.issuer) || null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Replaces the issuer list with a reviewed copy (emisores.json on solflag.com), so an approved key
|
|
98
|
+
// rotation does not need a new engine release. Entries without a name or keys are ignored; if none is
|
|
99
|
+
// valid the built-in list stays. Returns how many issuers are in use
|
|
100
|
+
export function setIssuers(list) {
|
|
101
|
+
const ok = (Array.isArray(list) ? list : []).filter(function (i) {
|
|
102
|
+
return i && typeof i.name === "string" && Array.isArray(i.keys) && i.keys.length && i.keys.every(function (k) { return typeof k === "string"; });
|
|
103
|
+
}).map(function (i) {
|
|
104
|
+
return { name: i.name, trusted: !!i.trusted, keys: i.keys.slice(), mints: i.mints && typeof i.mints === "object" ? Object.assign({}, i.mints) : undefined };
|
|
105
|
+
});
|
|
106
|
+
if (ok.length) ISSUERS.splice.apply(ISSUERS, [0, ISSUERS.length].concat(ok));
|
|
107
|
+
return ISSUERS.length;
|
|
108
|
+
}
|
|
109
|
+
|
|
79
110
|
// Name of the issuer when it is on SolFlag's short trusted list, or null
|
|
80
111
|
export function trustedIssuer(info, mint) {
|
|
81
112
|
const name = issuerOf(info, mint);
|
|
@@ -111,8 +142,10 @@ function mkLight(k, items, okSignal) {
|
|
|
111
142
|
export function buildLights(info, conc, pair, value, type, rc, now, launches) {
|
|
112
143
|
now = now || Date.now();
|
|
113
144
|
const ak = (info && info.authKind) || {};
|
|
114
|
-
const
|
|
115
|
-
const
|
|
145
|
+
const mintAddr = pair && pair.baseToken && pair.baseToken.address;
|
|
146
|
+
const rotated = issuerKeysChanged(info, mintAddr);
|
|
147
|
+
const issuer = issuerOf(info, mintAddr) || (rotated && rotated.issuer);
|
|
148
|
+
const trusted = !rotated && issuer && trustedIssuer(info, mintAddr);
|
|
116
149
|
let it;
|
|
117
150
|
|
|
118
151
|
// 1) creator control
|
|
@@ -126,6 +159,8 @@ export function buildLights(info, conc, pair, value, type, rc, now, launches) {
|
|
|
126
159
|
if (info.ext.indexOf("transferHook") >= 0 && hookActive(info)) it.push(sig("CTL_TRANSFER_HOOK", "warn"));
|
|
127
160
|
if (info.ext.indexOf("defaultAccountState") >= 0 && bornFrozen(info)) it.push(sig("CTL_DEFAULT_FROZEN", "warn"));
|
|
128
161
|
}
|
|
162
|
+
// strict while a rotation is unreviewed: amber, never the trusted green, never "fake"
|
|
163
|
+
if (rotated) it.push(sig("CTL_ISSUER_KEYS_CHANGED", "warn", { issuer: rotated.issuer, keys: rotated.keys }));
|
|
129
164
|
// PYUSD and USDG carry the fee extension at 0%: under a known issuer that is how the product is built
|
|
130
165
|
if (info.ext.indexOf("transferFeeConfig") >= 0 && !(issuer && info.feeBps === 0)) it.push(sig("CTL_TRANSFER_FEE", "warn"));
|
|
131
166
|
if (info.ext.indexOf("nonTransferable") >= 0) it.push(sig("CTL_NON_TRANSFERABLE", "warn"));
|
|
@@ -158,6 +193,7 @@ export function buildLights(info, conc, pair, value, type, rc, now, launches) {
|
|
|
158
193
|
if (soft && st === "bad") st = "warn";
|
|
159
194
|
const data = { w1: conc.w1, w10: conc.w10, prog: conc.prog, wallets: conc.nW }; // prog >= 20 is worth mentioning
|
|
160
195
|
if (conc.ex) { data.ex = conc.ex; data.exn = conc.exn; } // named exchanges, shown but not counted
|
|
196
|
+
if (conc.mm) { data.mm = conc.mm; data.mmn = conc.mmn; } // named market makers, shown and counted
|
|
161
197
|
let code = !conc.nW ? (conc.ex ? "CON_EXCHANGES" : "CON_ALL_POOLS") : (st === "ok" ? "CON_OK" : "CON_HIGH");
|
|
162
198
|
// under a verified issuer the big holders are its treasury, custodians, exchanges and lending
|
|
163
199
|
// protocols, not someone about to dump: shown, not counted (PYUSD 56% in one wallet, 1/11)
|
|
@@ -309,7 +345,7 @@ export async function assess(client, mint, pair, opts) {
|
|
|
309
345
|
if (brand) front.push(sig(brand.exact ? "BRAND_COPY" : "BRAND_NAME", brand.exact ? "bad" : "warn", { brand: brand.brand }));
|
|
310
346
|
// the real USDC/USDT is rarely the base token of a DexScreener pair, so the search found an older
|
|
311
347
|
// "USDC" and called the real one the copy (USDC and USDT showed HIGH, 1/11)
|
|
312
|
-
const canon = Object.keys(FAMOUS).some(function (k) { return FAMOUS[k] === mint; }) || !!
|
|
348
|
+
const canon = Object.keys(FAMOUS).some(function (k) { return FAMOUS[k] === mint; }) || !!anyIssuer(info, mint);
|
|
313
349
|
if (copies && !imp && !official && !canon) {
|
|
314
350
|
const strong = copies.origLiq >= 50000 && copies.origLiq >= 10 * Math.max(copies.liq, 1);
|
|
315
351
|
front.push(sig("COPYCAT", strong ? "bad" : "warn", copies));
|
|
@@ -321,7 +357,7 @@ export async function assess(client, mint, pair, opts) {
|
|
|
321
357
|
const lf = levelFrom(lights); lvl = lf.lvl; sev = lf.sev; reasons = reasonsFrom(lights);
|
|
322
358
|
// a copy of a famous token or a real company, or liquidity faked 100 times over, is high risk even
|
|
323
359
|
// when everything else looks normal: it is built to look like something it is not
|
|
324
|
-
if (imp || (brand && brand.exact) || (fakeLiquidity(pair) && !
|
|
360
|
+
if (imp || (brand && brand.exact) || (fakeLiquidity(pair) && !anyIssuer(info, mint))) { if (lvl !== "HIGH") sev += 5; lvl = "HIGH"; }
|
|
325
361
|
} else {
|
|
326
362
|
const s = score(info);
|
|
327
363
|
pts = s.pts; reasons = s.why; lvl = pts >= 25 ? "SPAM" : "NO_MARKET";
|
package/src/tokens.js
CHANGED
|
@@ -119,12 +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 = [], exs = {};
|
|
123
|
-
let prog = 0, ex = 0;
|
|
122
|
+
const ws = [], exs = {}, mms = {};
|
|
123
|
+
let prog = 0, ex = 0, mm = 0;
|
|
124
124
|
Object.keys(agg).forEach(function (o) {
|
|
125
125
|
const k = knownWallet(o);
|
|
126
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
|
|
127
|
-
else if (kind[o] === "wallet")
|
|
127
|
+
else if (kind[o] === "wallet") {
|
|
128
|
+
ws.push(agg[o]);
|
|
129
|
+
if (k && k.t === "market_maker") { mm += agg[o]; mms[k.n] = (mms[k.n] || 0) + agg[o]; } // named, still counted
|
|
130
|
+
}
|
|
128
131
|
else prog += agg[o];
|
|
129
132
|
});
|
|
130
133
|
ws.sort(function (x, y) { return y - x; });
|
|
@@ -136,6 +139,10 @@ export async function getConc(client, mint, supply) {
|
|
|
136
139
|
out.ex = ex / supply * 100;
|
|
137
140
|
out.exn = Object.keys(exs).sort(function (x, y) { return exs[y] - exs[x]; });
|
|
138
141
|
}
|
|
142
|
+
if (mm) {
|
|
143
|
+
out.mm = mm / supply * 100;
|
|
144
|
+
out.mmn = Object.keys(mms).sort(function (x, y) { return mms[y] - mms[x]; });
|
|
145
|
+
}
|
|
139
146
|
} catch (e) { if (isCancel(e)) throw e; }
|
|
140
147
|
return out;
|
|
141
148
|
}
|