verifystack-x402-mcp 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +137 -127
  2. package/bin/verifystack-mcp.mjs +700 -516
  3. package/package.json +59 -59
package/README.md CHANGED
@@ -1,127 +1,137 @@
1
- # VerifyStack x402 — Crypto Intelligence & Verification API for AI Agents
2
-
3
- Real-time cross-exchange funding rate arbitrage scanner, multi-source pre-trade token security audit, and deterministic EVM/Solana signature & risk APIs monetized natively via **HTTP 402 (`x402`)** USDC micropayments on **Base Mainnet (`eip155:8453`)**.
4
-
5
- No API keys. No subscriptions. Agents pay per request using standard `PAYMENT-REQUIRED` / `PAYMENT-SIGNATURE` headers.
6
-
7
- - **Live Endpoint Root:** `https://x402-crypto-math-api.verifystack.workers.dev`
8
- - **x402scan Registry:** [x402scan.com/server/6f29bbaa-8a3a-40d8-971e-059a789d3019](https://www.x402scan.com/server/6f29bbaa-8a3a-40d8-971e-059a789d3019)
9
- - **TryPoncho Merchant Playground:** [tryponcho.com/m/x402-crypto-math-api.verifystack.workers.dev](https://tryponcho.com/m/x402-crypto-math-api.verifystack.workers.dev)
10
- - **OpenAPI 3.1 Spec:** `https://x402-crypto-math-api.verifystack.workers.dev/openapi.json`
11
- - **Discovery Manifest:** `https://x402-crypto-math-api.verifystack.workers.dev/.well-known/x402`
12
- - **LLM Crawler Index:** `https://x402-crypto-math-api.verifystack.workers.dev/llms.txt`
13
-
14
- ---
15
-
16
- ## Paid Endpoints (Base Mainnet USDC)
17
-
18
- | Method | Endpoint | Price (USDC) | Description |
19
- | :--- | :--- | :--- | :--- |
20
- | `GET` | `/api/live-funding-arb` | **$0.01** | Live cross-exchange perp funding arbitrage across **Hyperliquid, dYdX v4, and Gate.io** normalized to hourly spreads & gross APR (20s cache). Query: `?symbol=BTC&limit=15&minApr=10` |
21
- | `GET` | `/api/prediction-markets` | **$0.008** | Live prediction market scanner & cross-venue arbitrage finder across **Polymarket, Kalshi, and Manifold Markets** (30s cache). Query: `?q=bitcoin&platform=all&minLiquidity=1000&limit=20` |
22
- | `GET` | `/api/defi-yields` | **$0.005** | Live DeFi yield & stablecoin APY scanner powered by **DefiLlama**: filters by chain/symbol/TVL & scores organic Base APY vs reward emissions (60s cache). |
23
- | `POST` | `/api/decode-tx` | **$0.005** | EVM transaction decoder & calldata firewall resolving selectors via **OpenChain + EVM RPC** and flagging unlimited ERC-20/NFT approvals. |
24
- | `POST` | `/api/domain-intel` | **$0.004** | Domain anti-phishing & trust profiler using **Cloudflare DoH** (`A/MX/SPF/DMARC`), **RDAP** domain age, and HTTPS security headers (60s cache). |
25
- | `GET` | `/api/web-research` | **$0.004** | Universal tech, news & academic search across **HackerNews, GitHub, arXiv, and Wikipedia** with zero API keys (60s cache). Query: `?q=x402&sources=all&limit=5` |
26
- | `POST` | `/api/clean-url` | **$0.005** | Web-to-LLM Markdown & metadata extractor: strips ads, scripts, and navigation boilerplate, returning compact Markdown + token estimate (60s cache). |
27
- | `POST` | `/api/wallet-profile` | **$0.008** | Multichain EVM wallet counterparty & gas profiler across **Base, Ethereum, Arbitrum, Optimism, and Polygon** (native/USDC balances, EOA vs contract, nonce activity, live gas fees; 20s cache). |
28
- | `POST` | `/api/token-safety` | **$0.008** | Pre-trade token security & liquidity risk audit combining **GoPlus Security**, **Honeypot.is**, and **DexScreener** (`base`, `ethereum`, `arbitrum`, `bsc`, `polygon`, `solana`). |
29
- | `POST` | `/api/verify-signature` | **$0.005** | Deterministic signature verifier for `evm_personal` (EIP-191), `evm_eip712`, `evm_erc1271` (live on-chain Smart Wallet RPC), and `ed25519` (Solana Base58/Hex/Base64). |
30
- | `POST` | `/api/arb-net-profit` | **$0.005** | Exact arbitrage net profit, break-even spread, and APR after fees, slippage, transfer gas, and funding. |
31
- | `POST` | `/api/liquidation-sim` | **$0.005** | Isolated-margin liquidation price, distance-to-liquidation %, risk/reward, and half-Kelly collateral sizing. |
32
-
33
- ---
34
-
35
- ## Example Responses
36
-
37
- ### 1. `GET /api/live-funding-arb?limit=2`
38
- ```json
39
- {
40
- "updatedAt": "2026-11-16T15:01:42.964Z",
41
- "sourcesSucceeded": ["hyperliquid", "dydx", "gateio"],
42
- "totalOpportunities": 101,
43
- "opportunities": [
44
- {
45
- "symbol": "INIT",
46
- "longExchange": "hyperliquid",
47
- "shortExchange": "gateio",
48
- "longHourlyRatePct": -0.157644,
49
- "shortHourlyRatePct": -0.0764,
50
- "hourlySpreadPct": 0.081244,
51
- "aprGrossPercent": 711.7,
52
- "longMarkPrice": 0.099624,
53
- "shortMarkPrice": 0.09947,
54
- "priceSpreadBps": -15.46,
55
- "estimatedBreakEvenDays": 0.1
56
- }
57
- ]
58
- }
59
- ```
60
-
61
- ### 2. `POST /api/token-safety`
62
- ```json
63
- {
64
- "chain": "base",
65
- "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
66
- "symbol": "USDC",
67
- "name": "USD Coin",
68
- "riskScore": 0,
69
- "verdict": "LOW_RISK",
70
- "sourcesUsed": ["honeypot_is", "dexscreener"],
71
- "security": {
72
- "isHoneypot": false,
73
- "buyTaxPercent": 0,
74
- "sellTaxPercent": 0
75
- },
76
- "market": {
77
- "priceUsd": 1.000078,
78
- "liquidityUsd": 86196.87,
79
- "volume24hUsd": 1488.85,
80
- "dexId": "alien-base"
81
- }
82
- }
83
- ```
84
-
85
- ---
86
-
87
- ## Use via MCP (Claude Desktop, Cursor, AI Agents)
88
-
89
- Zero-install via `npx` (once published on npm) or from a local clone:
90
-
91
- ```json
92
- {
93
- "mcpServers": {
94
- "verifystack-x402": {
95
- "command": "npx",
96
- "args": ["-y", "verifystack-x402-mcp"],
97
- "env": {
98
- "X402_BUYER_KEY": "0xYOUR_BASE_BUYER_PRIVATE_KEY"
99
- }
100
- }
101
- }
102
- }
103
- ```
104
-
105
- Or clone and run locally:
106
-
107
- ```bash
108
- git clone https://github.com/verifystack-dev/verifystack-x402.git
109
- cd verifystack-x402
110
- npm install
111
- ```
112
-
113
- ---
114
-
115
- ## Quickstart Script (Node.js)
116
-
117
- See [examples/quickstart.mjs](./examples/quickstart.mjs):
118
-
119
- ```bash
120
- X402_BUYER_KEY="0xYOUR_BASE_BUYER_PRIVATE_KEY" node examples/quickstart.mjs
121
- ```
122
-
123
- Inspect payment requirements directly with `curl`:
124
-
125
- ```bash
126
- curl -i https://x402-crypto-math-api.verifystack.workers.dev/api/live-funding-arb
127
- ```
1
+ # VerifyStack x402 — Crypto Intelligence & Verification API for AI Agents
2
+
3
+ Real-time cross-exchange funding rate arbitrage scanner, multi-source pre-trade token security audit, and deterministic EVM/Solana signature & risk APIs monetized natively via **HTTP 402 (`x402`)** USDC micropayments on **Base Mainnet (`eip155:8453`)**.
4
+
5
+ No API keys. No subscriptions. Agents pay per request using standard `PAYMENT-REQUIRED` / `PAYMENT-SIGNATURE` headers.
6
+
7
+ - **Live Endpoint Root:** `https://x402-crypto-math-api.verifystack.workers.dev`
8
+ - **x402scan Registry:** [x402scan.com/server/6f29bbaa-8a3a-40d8-971e-059a789d3019](https://www.x402scan.com/server/6f29bbaa-8a3a-40d8-971e-059a789d3019)
9
+ - **TryPoncho Merchant Playground:** [tryponcho.com/m/x402-crypto-math-api.verifystack.workers.dev](https://tryponcho.com/m/x402-crypto-math-api.verifystack.workers.dev)
10
+ - **OpenAPI 3.1 Spec:** `https://x402-crypto-math-api.verifystack.workers.dev/openapi.json`
11
+ - **Discovery Manifest:** `https://x402-crypto-math-api.verifystack.workers.dev/.well-known/x402`
12
+ - **LLM Crawler Index:** `https://x402-crypto-math-api.verifystack.workers.dev/llms.txt`
13
+
14
+ ---
15
+
16
+ ## Paid Endpoints (Base Mainnet USDC)
17
+
18
+ | Method | Endpoint | Price (USDC) | Description |
19
+ | :--- | :--- | :--- | :--- |
20
+ | `GET` | `/api/live-funding-arb` | **$0.01** | Live cross-exchange perp funding arbitrage across **Hyperliquid, dYdX v4, and Gate.io** normalized to hourly spreads & gross APR (20s cache). Query: `?symbol=BTC&limit=15&minApr=10` |
21
+ | `GET` | `/api/prediction-markets` | **$0.008** | Live prediction market scanner & cross-venue arbitrage finder across **Polymarket, Kalshi, and Manifold Markets** (30s cache). Query: `?q=bitcoin&platform=all&minLiquidity=1000&limit=20` |
22
+ | `GET` | `/api/defi-yields` | **$0.005** | Live DeFi yield & stablecoin APY scanner powered by **DefiLlama**: filters by chain/symbol/TVL & scores organic Base APY vs reward emissions (60s cache). |
23
+ | `POST` | `/api/decode-tx` | **$0.005** | EVM transaction decoder & calldata firewall resolving selectors via **OpenChain + EVM RPC** and flagging unlimited ERC-20/NFT approvals. |
24
+ | `POST` | `/api/domain-intel` | **$0.004** | Domain anti-phishing & trust profiler using **Cloudflare DoH** (`A/MX/SPF/DMARC`), **RDAP** domain age, and HTTPS security headers (60s cache). |
25
+ | `GET` | `/api/web-research` | **$0.004** | Universal tech, news & academic search across **HackerNews, GitHub, arXiv, and Wikipedia** with zero API keys (60s cache). Query: `?q=x402&sources=all&limit=5` |
26
+ | `POST` | `/api/clean-url` | **$0.005** | Web-to-LLM Markdown & metadata extractor: strips ads, scripts, and navigation boilerplate, returning compact Markdown + token estimate (60s cache). |
27
+ | `POST` | `/api/wallet-profile` | **$0.008** | Multichain EVM wallet counterparty & gas profiler across **Base, Ethereum, Arbitrum, Optimism, and Polygon** (native/USDC balances, EOA vs contract, nonce activity, live gas fees; 20s cache). |
28
+ | `POST` | `/api/token-safety` | **$0.008** | Pre-trade token security & liquidity risk audit combining **GoPlus Security**, **Honeypot.is**, and **DexScreener** (`base`, `ethereum`, `arbitrum`, `bsc`, `polygon`, `solana`). |
29
+ | `POST` | `/api/verify-signature` | **$0.005** | Deterministic signature verifier for `evm_personal` (EIP-191), `evm_eip712`, `evm_erc1271` (live on-chain Smart Wallet RPC), and `ed25519` (Solana Base58/Hex/Base64). |
30
+ | `POST` | `/api/arb-net-profit` | **$0.005** | Exact arbitrage net profit, break-even spread, and APR after fees, slippage, transfer gas, and funding. |
31
+ | `POST` | `/api/liquidation-sim` | **$0.005** | Isolated-margin liquidation price, distance-to-liquidation %, risk/reward, and half-Kelly collateral sizing. |
32
+ | `POST` | `/api/contract-intel` | **$0.008** | Smart contract firewall & EIP-1967 proxy inspector via **EVM RPC, Blockscout ABI verification, and Sourcify** (`base`, `ethereum`, `arbitrum`, `optimism`, `polygon`). |
33
+ | `GET` | `/api/spot-perp-basis` | **$0.008** | Live cross-exchange cash-and-carry **Spot vs Perpetual** basis, executable BBO spread & combined 30d carry APR across **Gate.io, OKX, and Hyperliquid**. |
34
+ | `GET` | `/api/dex-market-intel` | **$0.006** | Live multi-chain DEX liquidity, 24h volume, price changes & buy/sell order-flow oracle via **DexScreener and GeckoTerminal**. |
35
+
36
+ ---
37
+
38
+ ## Example Responses
39
+
40
+ ### 1. `GET /api/live-funding-arb?limit=2`
41
+ ```json
42
+ {
43
+ "updatedAt": "2026-11-16T15:01:42.964Z",
44
+ "sourcesSucceeded": ["hyperliquid", "dydx", "gateio"],
45
+ "totalOpportunities": 101,
46
+ "opportunities": [
47
+ {
48
+ "symbol": "INIT",
49
+ "longExchange": "hyperliquid",
50
+ "shortExchange": "gateio",
51
+ "longHourlyRatePct": -0.157644,
52
+ "shortHourlyRatePct": -0.0764,
53
+ "hourlySpreadPct": 0.081244,
54
+ "aprGrossPercent": 711.7,
55
+ "longMarkPrice": 0.099624,
56
+ "shortMarkPrice": 0.09947,
57
+ "priceSpreadBps": -15.46,
58
+ "estimatedBreakEvenDays": 0.1
59
+ }
60
+ ]
61
+ }
62
+ ```
63
+
64
+ ### 2. `POST /api/token-safety`
65
+ ```json
66
+ {
67
+ "chain": "base",
68
+ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
69
+ "symbol": "USDC",
70
+ "name": "USD Coin",
71
+ "riskScore": 0,
72
+ "verdict": "LOW_RISK",
73
+ "sourcesUsed": ["honeypot_is", "dexscreener"],
74
+ "security": {
75
+ "isHoneypot": false,
76
+ "buyTaxPercent": 0,
77
+ "sellTaxPercent": 0
78
+ },
79
+ "market": {
80
+ "priceUsd": 1.000078,
81
+ "liquidityUsd": 86196.87,
82
+ "volume24hUsd": 1488.85,
83
+ "dexId": "alien-base"
84
+ }
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Use via MCP (Claude Desktop, Cursor, AI Agents)
91
+
92
+ Zero-install via `npx` (once published on npm) or from a local clone:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "verifystack-x402": {
98
+ "command": "npx",
99
+ "args": ["-y", "verifystack-x402-mcp"],
100
+ "env": {
101
+ "X402_BUYER_KEY": "0xYOUR_BASE_BUYER_PRIVATE_KEY"
102
+ }
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ Or clone and run locally:
109
+
110
+ ```bash
111
+ git clone https://github.com/verifystack-dev/verifystack-x402.git
112
+ cd verifystack-x402
113
+ npm install
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Code Examples (Python, Node.js, Trading & Agent Bots)
119
+
120
+ See [examples/README.md](./examples/README.md) for all ready-to-run templates:
121
+
122
+ - **Python (`x402[httpx,evm]`):** [examples/python-x402-quickstart.py](./examples/python-x402-quickstart.py)
123
+ - **Autonomous AI Agent Workflow (5 tools):** [examples/agent-workflow.mjs](./examples/agent-workflow.mjs)
124
+ - **4-Layer Pre-Trade Security Gatekeeper:** [examples/pretrade-safety-gate.mjs](./examples/pretrade-safety-gate.mjs)
125
+ - **Automated Yield & Arb Monitor Loop:** [examples/arb-monitor-loop.mjs](./examples/arb-monitor-loop.mjs)
126
+ - **MCP Client Configs (Claude, Cursor, Windsurf):** [examples/mcp-configs.json](./examples/mcp-configs.json)
127
+ - **Minimal Node.js Quickstart:** [examples/quickstart.mjs](./examples/quickstart.mjs)
128
+
129
+ ```bash
130
+ X402_BUYER_KEY="0xYOUR_BASE_BUYER_PRIVATE_KEY" node examples/agent-workflow.mjs
131
+ ```
132
+
133
+ Inspect payment requirements directly with `curl`:
134
+
135
+ ```bash
136
+ curl -i https://x402-crypto-math-api.verifystack.workers.dev/api/live-funding-arb
137
+ ```