hyperd.wallet.anomaly
Detect wallet behavioral anomalies by comparing recent activity to a 180-day baseline. Identifies compromised wallets, dormant whales, and MEV-bot shifts.
Instructions
Wallet behavioral anomaly detection. Compares recent activity against the wallet's own 180-day baseline — surfaces tx-volume spikes, dormant-wakeup patterns, new-protocol interactions, counterparty diversification. Catches compromised hot wallets, dormant whales, MEV-bot strategy shifts. Costs $0.10 in USDC.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | 0x EVM wallet address | |
| chain | No | Chain to analyze. Default 'base'. | |
| window | No | Recent activity window. "24h", "7d", "30d", or bare integer days. Default "24h". |
Implementation Reference
- src/server.ts:371-387 (registration)Tool registration for 'hyperd.wallet.anomaly' using the McpServer. Registers the tool with a description, Zod schema for input params (address, chain, window), and a handler that calls paidGet('/api/wallet/anomaly', args) and wraps the result with asText().
// hyperd.wallet.anomaly — behavioral anomaly detection ($0.10) server.tool( "hyperd.wallet.anomaly", "Wallet behavioral anomaly detection. Compares recent activity against the wallet's own 180-day baseline — surfaces tx-volume spikes, dormant-wakeup patterns, new-protocol interactions, counterparty diversification. Catches compromised hot wallets, dormant whales, MEV-bot strategy shifts. Costs $0.10 in USDC.", { address: z.string().describe("0x EVM wallet address"), chain: z .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb"]) .optional() .describe("Chain to analyze. Default 'base'."), window: z .string() .optional() .describe('Recent activity window. "24h", "7d", "30d", or bare integer days. Default "24h".'), }, async (args) => asText(await paidGet("/api/wallet/anomaly", args)), ); - src/server.ts:386-386 (handler)Handler logic for hyperd.wallet.anomaly: delegates to paidGet('/api/wallet/anomaly', args), which performs an x402 payment-gated GET request to the hyperD API, then formats the JSON response as text via asText().
async (args) => asText(await paidGet("/api/wallet/anomaly", args)), - src/server.ts:375-385 (schema)Input schema for hyperd.wallet.anomaly using Zod: 'address' (required string, EVM address), 'chain' (optional enum of chains, default 'base'), 'window' (optional string for time window like '24h', '7d', '30d').
{ address: z.string().describe("0x EVM wallet address"), chain: z .enum(["base", "ethereum", "polygon", "arbitrum", "optimism", "avalanche", "bnb"]) .optional() .describe("Chain to analyze. Default 'base'."), window: z .string() .optional() .describe('Recent activity window. "24h", "7d", "30d", or bare integer days. Default "24h".'), }, - src/server.ts:79-92 (helper)paidGet helper function used by the tool handler. Constructs the API URL with query params and initiates the x402 payment-gated GET request via paidRequest.
async function paidGet( path: string, query: Record<string, string | number | boolean | undefined>, ): Promise<unknown> { if (!httpClient) { throw new Error(WALLET_NOT_CONFIGURED_MSG); } const url = new URL(`${API_BASE}${path}`); for (const [k, v] of Object.entries(query)) { if (v !== undefined && v !== "" && v !== null) url.searchParams.set(k, String(v)); } return paidRequest("GET", url, undefined); } - src/server.ts:155-157 (helper)asText helper function that wraps JSON data into the MCP content response format { content: [{ type: 'text', text: ... }] }.
function asText(data: unknown) { return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; }