Catalog npm
Back to packageRELEASE DETAILS

0.4.0

npm

@0xprotovox/deficlaw

DeFi MCP Server for Claude Code — token analysis, prices, trending, holder intelligence

ai-toolsclaude-codecryptodefidexscreenergmgnmcprisk-scoringsolanatoken-analysis
Published25 Mar 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

npm version License: MIT Node.js MCP

deficlaw

The first open-source DeFi MCP server for Claude Code.

Analyze any token in seconds. Holder intelligence, risk scoring, smart money tracking, KOL detection, slippage estimation, contract security. Zero API keys required.

> "analyze Jupiter token"

JUP is a 2.2y old Meteora token with $1.2M liquidity and $525.1M market cap.
Top 5 wallets control 61.5% of supply, very concentrated.
30 diamond hands among holders, decent conviction.
Contract looks safe: mint and freeze authorities revoked.
10 KOLs tracked: 5 holding, 5 selling.

Risk: 18/100 [LOW]
VERDICT: NEUTRAL — Mixed signals: 2 bull vs 2 bear.
Sources: dexscreener + gmgn + solana-rpc | 1.1s

Why deficlaw?

Claude Code can write code, fix bugs, deploy apps. But ask it "what's the price of BONK?" and it says "I don't have real-time data."

deficlaw fixes that. 9 tools, 3 data sources, zero config.

FeatureDetails
Token AnalysisHolder intelligence, risk scoring, KOL tracking, actionable verdicts
Real-time PricesSub-second lookups across Solana, Ethereum, Base, BSC, Arbitrum
Trending TokensVolume, liquidity, and boost data from DexScreener
New LaunchesRecently created tokens with age, mcap, liquidity
Top TradersWho made and lost money on any token with PnL breakdown
Token SearchFind any token by name or symbol across all chains
Slippage EstimationJupiter-based price impact for $50-$1000 buys
Token ComparisonSide-by-side analysis of two tokens
Contract SecurityMint/freeze authority, supply checks on Solana

Install

npm install -g @0xprotovox/deficlaw
claude mcp add defi -- deficlaw

That's it. No API keys, no config files, no accounts needed.

Install from source
git clone https://github.com/0xprotovox/deficlaw.git
cd deficlaw && npm install && npm run build
claude mcp add defi -- node /path/to/deficlaw/dist/index.js

Quick Start

Once installed, just type naturally in Claude Code:

Prices (fastest, ~50ms cached / ~300ms first call)

> what's the price of BONK?
> price of JUP
> how much is SOL right now?

Full Analysis (~1.1s with holders + risk + verdict)

> analyze token JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
> deep analyze BONK
> is this token safe? EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Quick Scan (~350ms, price + risk only, no holders)

> quick analyze So11111...
> give me a quick look at this token
> search for BONK
> what's trending on solana?
> show new launches on solana in the last 30 minutes

Top Traders & Comparison

> who profited on this token?
> compare JUP vs BONK

Slippage & Security

> estimate slippage for buying this token
> is this token contract safe?

Tools Reference

analyze_token

Full token analysis with holder intelligence, risk scoring, and human-readable summary.

ParameterTypeDefaultDescription
addressstringrequiredToken contract address
chainstring"solana"Blockchain (solana, ethereum, bsc, base, arbitrum)
include_holdersbooleantrueInclude GMGN holder analysis
quickbooleanfalseQuick mode: skip holders, price/market/risk only (<1s)
compactbooleanfalseCompact response: summary, price, risk, top 5 holders only

Returns: Token info, price (5m/1h/6h/24h), market data (mcap, fdv, volume, liquidity), contract security, risk score (0-100), holder concentration, holder categories (diamond hands, snipers, KOLs, fresh wallets, insiders, smart money), buy/sell pressure, dev wallet status, top 20 holders with PnL, KOL list, socials, actionable verdict (BUY/SELL/NEUTRAL/AVOID).

get_price

Sub-second price lookup. Accepts both addresses and name/symbol searches.

ParameterTypeDefaultDescription
tokenstringrequiredToken address or search query
chainstring"solana"Blockchain

search_token

Search tokens by name or symbol across all chains.

ParameterTypeDefaultDescription
querystringrequiredToken name or symbol (e.g. "BONK", "Jupiter")
chainstringallFilter by chain
limitnumber10Results to return (1-20)

Trending and boosted tokens with price enrichment.

ParameterTypeDefaultDescription
chainstring"solana"Blockchain
limitnumber20Number of tokens (1-50)

get_new_launches

Recently created tokens sorted by creation time.

ParameterTypeDefaultDescription
chainstring"solana"Blockchain
max_age_minutesnumber60Max token age in minutes (5-1440)
limitnumber20Tokens to return (1-50)

get_top_traders

Who made and lost money on a token. Shows winners and losers with PnL, tags, and Twitter handles.

ParameterTypeDefaultDescription
addressstringrequiredToken contract address
limitnumber10Number of top winners/losers (1-50)

estimate_slippage

Jupiter-based price impact estimation for $50, $100, $500, $1000 buys. Solana only.

ParameterTypeDefaultDescription
addressstringrequiredSolana token mint address

compare_tokens

Side-by-side comparison of two tokens: price, mcap, volume, liquidity, age, holders.

ParameterTypeDefaultDescription
address_astringrequiredFirst token address
address_bstringrequiredSecond token address
chainstring"solana"Blockchain

get_token_security

Quick contract security check. Solana only.

ParameterTypeDefaultDescription
addressstringrequiredSolana token mint address

Returns: Mint authority status, freeze authority status, total supply, decimals, and a SAFE/CAUTION/DANGEROUS verdict.

Architecture

Claude Code
    |
    | MCP stdio
    v
+------------------+
|    deficlaw       |
|    MCP Server     |
|                  |
|  +-- Cache ----+ |      +--------------+
|  | TTL-based   | | ---> | DexScreener  |  prices, volume,
|  | in-memory   | |      | (free API)   |  liquidity, pairs
|  +-------------+ |      +--------------+
|                  |
|  +-- Risk ----+  |      +--------------+
|  | 8-dimension | | ---> | GMGN         |  holders, KOLs,
|  | scorer      | |      | (curl/PW)    |  tags, PnL
|  +-------------+ |      +--------------+
|                  |
|  +-- Summary --+ |      +--------------+
|  | Rule-based  | | ---> | Solana RPC   |  mint/freeze auth,
|  | generator   | |      | (free)       |  supply, LP detect
|  +-------------+ |      +--------------+
|                  |
|  +-- Jupiter --+ |      +--------------+
|  | Quote API   | | ---> | Jupiter      |  slippage quotes,
|  | client      | |      | (free API)   |  route planning
|  +-------------+ |      +--------------+
+------------------+

Key design decisions:

  • curl-based GMGN fetcher bypasses Cloudflare TLS fingerprinting (Playwright fallback if curl is blocked)
  • TTL-based in-memory cache with automatic cleanup prevents rate limiting and keeps responses fast
  • Rate limiter with exponential backoff and retry logic for DexScreener (200ms min interval)
  • Parallel fetching where possible (holders + security run simultaneously)
  • All free APIs, no keys needed

Performance

Benchmarked on real tokens (BONK), averaged across multiple runs:

OperationTimeNotes
get_price~54msCached: near-instant
search_token~340msDexScreener search API
analyze_token (quick)~410msPrice + market + risk, no holders
analyze_token (full)~1.1-1.5sAll sources: DexScreener + GMGN + Solana RPC
get_token_security~300msSingle Solana RPC call
estimate_slippage~500ms4 Jupiter quotes in parallel

Risk Scoring

The composite risk scorer analyzes 8 dimensions to produce a 0-100 score:

#DimensionMax PointsWhat It Checks
1Liquidity22Pool depth in USD. <$1K = critical, <$5K = extreme, <$25K = high
2Token Age10Time since pair creation. <1h = critical, <6h = high, <24h = medium
3Volume Anomalies8Vol/mcap ratio for wash trading signals. >5x = suspicious
4Holder Concentration18Top 10 holder supply %. >60% = critical, >40% = high
5Dev Wallet15Dev holdings % and selling behavior. >20% = rug risk
6Fresh Wallets12New wallet % among holders. >40% = likely bundled/wash
7Sniper Activity10Bot/sniper/sandwich wallets in top holders
8Contract Security5Mint authority (3pts) + freeze authority (2pts)

Risk Levels:

LevelScore RangeMeaning
LOW0-19Few concerns, safer relative to peers
MEDIUM20-44Some concerns, do your own research
HIGH45-69Multiple red flags, elevated caution
CRITICAL70-100Extreme risk, likely scam or rug-pull

Configuration

All environment variables are optional. deficlaw works out of the box with zero config.

VariableDefaultDescription
SOLANA_RPC_URLhttps://api.mainnet-beta.solana.comCustom Solana RPC endpoint (use a private RPC for better reliability)
DEFICLAW_CACHE_TTL120000 (2 min)GMGN holder cache TTL in milliseconds
DEFICLAW_PRICE_CACHE_TTL30000 (30s)Price cache TTL in milliseconds
DEBUG(unset)Set to deficlaw to enable debug logging to stderr

Claude Code Config

Add to your project's .mcp.json:

{
  "mcpServers": {
    "defi": {
      "command": "npx",
      "args": ["-y", "@0xprotovox/deficlaw"]
    }
  }
}
With custom environment variables
{
  "mcpServers": {
    "defi": {
      "command": "npx",
      "args": ["-y", "@0xprotovox/deficlaw"],
      "env": {
        "SOLANA_RPC_URL": "https://your-rpc.com",
        "DEFICLAW_CACHE_TTL": "120000",
        "DEFICLAW_PRICE_CACHE_TTL": "30000",
        "DEBUG": "deficlaw"
      }
    }
  }
}

Supported Chains

Prices and trending work on all DexScreener-supported chains: Solana, Ethereum, Base, BSC, Arbitrum, Polygon, Avalanche, Optimism, Fantom, and more.

Holder analysis (GMGN) currently supports Solana tokens.

Slippage estimation (Jupiter) supports Solana tokens.

Roadmap

  • Token analysis with holder intelligence
  • Risk scoring (8 dimensions, 0-100)
  • Contract security checks (mint/freeze authority)
  • KOL detection with Twitter handles
  • Human-readable AI summary with actionable insights
  • Top traders (winners/losers with PnL)
  • Token search by name/symbol
  • New launches detection
  • Actionable verdict (BUY/SELL/NEUTRAL/AVOID)
  • Slippage estimation (Jupiter quotes)
  • Token comparison (side by side)
  • Configurable cache TTL via env vars
  • Debug logging (DEBUG=deficlaw)
  • LP pool detection in top holders
  • Multi-chain holder analysis (Ethereum, Base)
  • Price alerts via MCP resources
  • Wallet portfolio analysis
  • Historical price charts
  • DEX aggregator integration for trade execution

Contributing

Contributions welcome! Here's how:

  1. Fork the repo
  2. Create your branch (git checkout -b feature/my-feature)
  3. Make changes and ensure npx tsc --noEmit passes with zero errors
  4. Run benchmarks (npm test) to verify nothing regressed
  5. Commit and open a PR

Development setup:

git clone https://github.com/0xprotovox/deficlaw.git
cd deficlaw
npm install
npm run build    # compile TypeScript
npm test         # run speed benchmarks
npm run dev      # run from source with tsx

Built With

License

MIT

Author

@0xprotovox - Twitter | GitHub

20 years building software. Now building AI trading agents and DeFi tools.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
zod
Environment
{
  "local_name": "zod",
  "alias": false,
  "peer_metadata": null
}
^3.23.0runtime
@modelcontextprotocol/sdk
Environment
{
  "local_name": "@modelcontextprotocol/sdk",
  "alias": false,
  "peer_metadata": null
}
^1.27.1runtime
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.19.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.5.0development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.0.0development
playwright
Environment
{
  "local_name": "playwright",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
^1.58.2peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "406efb5628d79d832214d7b90a2443ac9d400692",
  "tarball": "https://registry.npmjs.org/@0xprotovox/deficlaw/-/deficlaw-0.4.0.tgz",
  "fileCount": 56,
  "integrity": "sha512-7AOIRBjnyy2IPd3CYQT96SjlJLlW6+69Yfnk+DgjILCsDB3UIsZxg6Sd6VbfaoMgsRArA9tufdpEzC545Y0QTg==",
  "signatures": [
    {
      "sig": "MEYCIQC9gh51w45YeRUagzSRv22oTRIQbIQXPBtL7wrZJ/rs/AIhAPSADoibxtAAU1wxVY1n4usVomg4GQSwq3yM6veZedCa",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 222844
}

Repository

PENDING
0xprotovox/deficlaw

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:36 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:bb9b2f17c3b02bae160be29d21dad408214b37acf4df8a339c8e4d936a06dd99

Other collected versions

0.7.029 Mar0.6.127 Mar0.6.027 Mar0.5.025 Mar0.4.125 Mar0.3.024 MarView all collected versions →