honeypot-guard
v1.0.0
Published
Gate your trading bot's buys behind a honeypot / rug-pull check. One call before every buy — verdict OK/CAUTION/HIGH_RISK/AVOID across 8 chains. Pay-per-check in USDC via x402, no API key.
Maintainers
Readme
honeypot-guard
A pre-trade safety gate for trading bots. One call before every buy — is this token a honeypot or rug? Get a clear verdict across 8 chains before your bot apes in.
If your bot buys a honeypot, one 99% sell-tax or a transfer blacklist wipes the position. This gates every buy behind a behavior + known-pattern check (simulation + GoPlus-style security data), collapsed into a single verdict.
npm install honeypot-guardGate your buys in 3 lines
import { assertSafeToBuy } from "honeypot-guard";
await assertSafeToBuy(tokenAddress, "base"); // throws if honeypot / rug
await executeBuy(tokenAddress); // only runs when it's safePrefer a boolean?
import { isSafeToBuy } from "honeypot-guard";
const { safe, verdict, sellTaxPct } = await isSafeToBuy(tokenAddress, "base");
if (!safe) { log(`skip ${tokenAddress}: ${verdict}, sellTax ${sellTaxPct}%`); return; }Or read the full report:
import { checkToken } from "honeypot-guard";
const s = await checkToken("0x…", "ethereum");
// { verdict, isHoneypot, buyTaxPct, sellTaxPct, isOpenSource, holderCount, flags, tokenName, tokenSymbol }Verdict
| verdict | meaning |
|---|---|
| OK | no red flags |
| CAUTION | minor concerns (some tax, low holders) |
| HIGH_RISK | serious markers — size down or skip |
| AVOID | honeypot / rug markers — do not touch |
isSafeToBuy / assertSafeToBuy treat OK and CAUTION as safe.
Chains
ethereum · base · arbitrum · optimism · polygon · bsc · avalanche · solana
Payment
Each check costs $0.006 in USDC on Base, paid per call via the x402 protocol — no account, no API key. Provide a funded Base-USDC wallet and it pays automatically:
// via env
process.env.X402_PRIVATE_KEY = "0x…";
await assertSafeToBuy(addr, "base");
// or per call
await assertSafeToBuy(addr, "base", { privateKey: "0x…" });Already have your own x402-enabled fetch? Pass it: { fetch: myPaidFetch }. Without a wallet, calls throw a PAYMENT_REQUIRED error carrying the x402 instructions so you can pay however you like.
Config
X402_PRIVATE_KEY— funded USDC-on-Base wallet for auto-pay (optional).HONEYPOT_GUARD_BASE— override the API base (defaults tohttps://api.x-402.online).
Powered by x402-farm · also available as an MCP server (npx -y x402farm-mcp).
