Skip to content

About

Token due diligence for AI agents, powered by the CoinMarketCap API: GREEN / YELLOW / RED verdicts with reasons and provenance. MCP server, CLI, x402 pay-per-request, and a paid agent on BotHire. #BuildwithCMC

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

cmc-agent-dd — token due diligence for AI agents, powered by CoinMarketCap

Before an AI agent buys a token, accepts one as payment, or tells a human to ape in, it should ask one question: is this token safe to touch? cmc-agent-dd answers it in one call. Give it a chain and a contract address; it pulls CoinMarketCap market, DEX-security, liquidity and holder data and returns a 🟢 GREEN / 🟡 YELLOW / 🔴 RED verdict with plain-language reasons — and every number names the CMC endpoint it came from.

Built for Build with CMC: API Hackathon (Round 2) · Track: AI Agents and Automation · #BuildwithCMC

A real run — an excerpt (some rows and reasons omitted) of docs/evidence/report-red-catme-bsc.md; every line shown is verbatim:

$ cmc-dd dd bsc 0xb71b42f7f0513b3f49a0a42ffdcf90509a888888
## 🔴 RED — avoid CATME (ELON'S CAT): Security scan: A scam address may be associated with fraud, Ponzi schemes, or other malicious activities. Users should conduct extra verification before transactions.

- **Token:** CATME — ELON'S CAT
- **Chain / contract:** BSC · `0xb71b42f7f0513b3f49a0a42ffdcf90509a888888`
- **Liquidity:** $16
- **Holders:** 164.9K
- **Taxes:** buy 0% / sell 0.56%

### Why
- 🔴 Security scan: A scam address may be associated with fraud, Ponzi schemes, or other malicious activities. Users should conduct extra verification before transactions.
- 🔴 CoinMarketCap marks this token's risk level as "highRisk".
- 🔴 Only $16 of DEX liquidity — a small trade moves the price a lot and exits may be impossible.
- 🟡 Security scan: The token was deployed by a high-risk address, which may be associated with fraud, exploits, or other malicious activities.
- 🟡 Security scan: Low liquidity means that there is no or a small liquidity pool, resulting in failure to swap or large slippage.

### Data sources (CoinMarketCap API, 8 credits)
- `/v1/dex/holders/count` → HTTP 200 @ 2026-11-22T12:16:11.776Z
- `/v1/dex/liquidity-change/list` → HTTP 200 @ 2026-11-22T12:16:11.775Z
- `/v1/dex/security/detail` → HTTP 200 @ 2026-11-22T12:16:11.409Z
- `/v1/dex/token` → HTTP 200 @ 2026-11-22T12:16:11.788Z
- `/v1/global-metrics/quotes/latest` → HTTP 200 @ 2026-11-22T12:16:11.252Z
- …

All real outputs, captured from the live API (npx tsx scripts/capture-evidence.ts regenerates them):

Verdict Token Why
🟢 GREEN CAKE on BSC $11M liquidity, 1.89M holders, 120 exchanges, CMC rank #74
🟢 GREEN BONK on Solana Solana blue chip
🟡 YELLOW USDC on Ethereum honest YELLOW: the contract can blacklist, pause, mint and be upgraded
🟡 YELLOW the original AERO contract on Base CoinMarketCap's AERO now lives at a different contract; this one has a long history, so it's flagged as a likely legacy version, not a fake
🔴 RED CATME on BSC scam-flagged by the security scan, CMC "highRisk", $16 liquidity
🔴 RED BNBCake on BSC reported by users / researchers, $4.6K liquidity

Plus the raw CMC responses behind a report, a market pulse, and a real pay-per-request x402 call (402 → signed USDC authorization → 200).

Three ways to use it

For How
MCP server Claude Desktop, Cursor, OpenClaw, any MCP client tools token_due_diligence, market_pulse, search_token
CLI humans, scripts, CI cmc-dd dd <chain> <address> · cmc-dd pulse
Paid agent on BotHire other AI agents hire it on BotHire, pay into on-chain escrow, send {chain, address}, get the report

This ran for real (docs/evidence/bothire-agent-hire.json): a human-backed buyer agent hired the CMC Due Diligence Desk on BotHire, deposited 1 USDC into escrow on Arc mainnet (deposit), asked about a BSC token; this repo's src/provider.ts built the CoinMarketCap report (🔴 RED — scam-flagged) and delivered it; the escrow settled for one report (settle); and the buyer recomputed the report's result_hash and got the same value.

The third one is the point: CMC data becomes a service one agent sells to another. A buyer agent pays a small USDC fee into escrow on BotHire; src/provider.ts runs the due diligence on CoinMarketCap data and delivers the report; the escrow pays out. No human in the loop on either side.

CMC API endpoints used

Endpoint Used for
/v1/dex/token price, liquidity, age, 24h trades, owner, CMC risk level (rl), CMC asset id (cid), CEX listings
/v1/dex/security/detail honeypot / rug / fake-token status, buy & sell tax, verification, vendor flags, user reports, scan items
/v1/dex/holders/count holder count
/v1/dex/liquidity-change/list liquidity add/remove events (rug-pull signal)
/v3/cryptocurrency/quotes/latest CMC listing & rank, CMC market cap, look-alike / impersonation check
/v3/fear-and-greed/latest · /v1/altcoin-season-index/latest · /v1/global-metrics/quotes/latest · /v3/index/cmc20-latest market context and market_pulse
/v1/dex/platform/list chain names → CMC platforms
/v1/dex/search search_token (find the right contract)
/x402/… pay-per-request mode (quotes, listings, DEX search)

What it checks

Signal Red 🔴 Yellow 🟡
Security scan: honeypot / rug-pull / fake token (EVM and Solana), vendor flag, user reports any hit —
Security scan items (CMC risk level r / y) r items (e.g. "scam address") y items (e.g. blacklist, mintable, upgradeable)
Buy / sell tax ≥ 10% 3–10%
Contract source — not verified
DEX liquidity < $10K < $100K
Liquidity pulled (add/remove events, last 24h) one tx removed ≥ 50% of what's left net outflow ≥ 30%
CoinMarketCap risk level (rl) high other non-"safe" levels
Look-alike / impersonation — this contract is not a CMC asset, but a ranked CMC asset uses its symbol (symbols normalized, so $USDC / USDC.e can't dodge it) that asset is in the top 500 and this contract is young / little-held ranked lower, or this contract is long-established (legacy / migrated)
Holders · age · 24h move · volume vs liquidity — < 500 · < 7 days · ±50% · ≥ 10×
Market cap ≫ liquidity — market cap > 100,000× liquidity is flagged as meaningless
No security scan and no CMC listing — "unchecked"
Contract owner, no scan on a listed asset, low CMC rank info
Deep liquidity, many holders, CMC top-1000, CEX listings, age, CMC "safe" (CMC's label is shown only when nothing is red) good signs — never override a flag

Rules that keep it honest:

  • If CoinMarketCap can't be reached for the core token data (rate limit, auth, outage), no verdict is issued — an error is returned instead of a misleading GREEN.
  • A contract CMC knows nothing about is YELLOW ("check the address and chain"), never GREEN; if the look-alike lookup or the liquidity-events lookup fails, that is a YELLOW too.
  • Token names and symbols come from whoever deployed the contract, so they are stripped of Markdown/control characters before they appear in a report.

Thresholds live in one object (RULES in src/dd.ts). The scoring step (assess) is a pure function; 34 tests cover it, the client and the x402 payer. Every report carries sources (endpoint, HTTP status, CMC timestamp, credits), credits_used and a result_hash (sha256 of the canonical report) so a buyer can prove what it was sold.

Quick start

git clone https://github.com/BotHireAgent/cmc-agent-dd && cd cmc-agent-dd
npm install                     # also builds dist/ (prepare script)
npm run dd -- bsc 0x0E09FaBB73Bd3Ade0a17ECc321fD13a19e81cE82    # works with no key (keyless API, low rate limit)
export CMC_API_KEY=your-own-key # recommended: https://coinmarketcap.com/api (never commit it)
npm run pulse
npm test

Three ways to call CMC

src/cmc.ts picks the mode automatically:

  1. CMC_API_KEY set → the Pro API with your key. Recommended.
  2. No key → CMC's keyless public API — the whole pipeline runs, at a low anonymous rate limit. Good for trying it.
  3. No key + CMC_X402_PRIVATE_KEY → pay per request with x402 for the endpoints CMC sells that way (quotes, listings, DEX search, DEX pair quotes), keyless for the rest. CMC answers 402 Payment Required; the client signs an EIP-3009 USDC authorization on Base with the agent's own wallet and retries — $0.01 per call, no account. Guard rails: Base USDC only, fixed EIP-712 domain, per-call ceiling (CMC_X402_MAX_USDC, default 0.05), per-process cap (CMC_X402_MAX_TOTAL_USDC, default 1), optional payee pin (CMC_X402_PAYTO), redirects refused. See src/x402.ts and the captured call.

MCP (Claude Desktop / Cursor / OpenClaw)

{
  "mcpServers": {
    "cmc-dd": { "command": "node", "args": ["/path/to/cmc-agent-dd/dist/mcp.js"], "env": { "CMC_API_KEY": "your-key" } }
  }
}

Then ask: "Is 0x… on BSC safe to buy?" — the agent calls token_due_diligence. Ask "find the real PEPE on Ethereum" and it uses search_token first.

Sell it on BotHire

export CMC_API_KEY=... BOTHIRE_API_KEY=bh_... BOTHIRE_BOT_ID=...
npm run provider          # polls paid hires, answers each {chain, address} request with a report

Register the agent and list the skill per bothire.io/skill.md. The worker is built for paid work: each request is written (fsync'd) to a local queue before anything else, a report is built once and stored so retries never pay CMC twice, deliveries BotHire permanently refuses are not retried forever, metered-escrow hires are settled once with the number of reports actually delivered, and a damaged state file stops the worker instead of silently dropping paid jobs.

Project layout

src/cmc.ts        CMC client: key / keyless / x402 modes, per-call provenance (the key is never recorded)
src/x402.ts       x402 v2 payer (EIP-3009 on Base USDC) with price ceiling, spend cap and optional payee pin
src/chains.ts     chain alias → CMC DEX platform (via /v1/dex/platform/list)
src/dd.ts         due-diligence pipeline + pure scoring (assess) + canonical hash
src/pulse.ts      market pulse
src/format.ts     Markdown report
src/mcp.ts        MCP server (stdio)
src/cli.ts        CLI
src/provider.ts   BotHire seller agent
scripts/          evidence capture (reports, raw responses, x402 call)
docs/API_FEEDBACK.md   what the CMC API made possible, and where it got in the way
docs/evidence/    real CMC responses and reports (no keys)

Disclaimer

An automated screen of CoinMarketCap data, not financial advice. GREEN means no flags were found, not that a token is safe.

MIT © BotHire

About

Token due diligence for AI agents, powered by the CoinMarketCap API: GREEN / YELLOW / RED verdicts with reasons and provenance. MCP server, CLI, x402 pay-per-request, and a paid agent on BotHire. #BuildwithCMC

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages