diff --git a/.changeset/liquiditychecker.md b/.changeset/liquiditychecker.md new file mode 100644 index 0000000..6c58c09 --- /dev/null +++ b/.changeset/liquiditychecker.md @@ -0,0 +1,5 @@ +--- +'@degenfrends/solana-rugchecker': patch +--- + +## @degenfrends/solana-rugchecker: Initial version diff --git a/package-lock.json b/package-lock.json index eacae7b..1fc33fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@degenfrends/solana-rugchecker", - "version": "0.0.8", + "version": "0.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@degenfrends/solana-rugchecker", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "dependencies": { "@metaplex-foundation/js": "^0.20.1", @@ -5002,9 +5002,9 @@ "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.23.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", + "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", "dev": true, "funding": [ { @@ -5021,10 +5021,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", + "caniuse-lite": "^1.0.30001629", + "electron-to-chromium": "^1.4.796", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "update-browserslist-db": "^1.0.16" }, "bin": { "browserslist": "cli.js" @@ -5974,9 +5974,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.795", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.795.tgz", - "integrity": "sha512-hHo4lK/8wb4NUa+NJYSFyJ0xedNHiR6ylilDtb8NUW9d4dmBFmGiecYEKCEbti1wTNzbKXLfl4hPWEkAFbHYlw==", + "version": "1.4.796", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.796.tgz", + "integrity": "sha512-NglN/xprcM+SHD2XCli4oC6bWe6kHoytcyLKCWXmRL854F0qhPhaYgUswUsglnPxYaNQIg2uMY4BvaomIf3kLA==", "dev": true }, "node_modules/elliptic": { @@ -13582,9 +13582,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.3.tgz", - "integrity": "sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", "dev": true, "bin": { "yaml": "bin.mjs" diff --git a/src/checker/liquidity-checker.ts b/src/checker/liquidity-checker.ts index f370701..b4e11c6 100644 --- a/src/checker/liquidity-checker.ts +++ b/src/checker/liquidity-checker.ts @@ -25,8 +25,11 @@ export default class LiquidityChecker { async check(tokenAddress: string): Promise { const poolAddress = await this.getLiquidityPool(tokenAddress); + const liquidityCheckResult = new LiquidityCheckResult(); if (!poolAddress) { - throw new Error('No pool found'); + //throw new Error('No pool found'); + liquidityCheckResult.liquidityPoolAddress = ''; + return liquidityCheckResult; } const acc = await this.connection.getMultipleAccountsInfo([new PublicKey(poolAddress)]); const parsed = acc.map((v) => (v ? LIQUIDITY_STATE_LAYOUT_V4.decode(v.data) : null)); @@ -39,9 +42,9 @@ export default class LiquidityChecker { const maxLpSupply = Math.max(actualSupply, lpReserve - 1); const burnAmt = lpReserve - actualSupply; const burnPct = (burnAmt / lpReserve) * 100; - const liquidityCheckResult = new LiquidityCheckResult(); liquidityCheckResult.isLiquidityLocked = burnPct > 95; liquidityCheckResult.burnt = burnPct; + liquidityCheckResult.liquidityPoolAddress = poolAddress; return liquidityCheckResult; } diff --git a/src/model/result/liquidity-check.ts b/src/model/result/liquidity-check.ts index 4942c6c..2ea6d3c 100644 --- a/src/model/result/liquidity-check.ts +++ b/src/model/result/liquidity-check.ts @@ -1,4 +1,5 @@ export default class LiquidityCheckResult { isLiquidityLocked: boolean; burnt: number; + liquidityPoolAddress: string; }