{"_id":"@b402ai/stealth-trader","_rev":"3-445b45d0f57bda8391d70570711ba757","name":"@b402ai/stealth-trader","dist-tags":{"latest":"0.5.2"},"versions":{"0.5.0":{"name":"@b402ai/stealth-trader","version":"0.5.0","keywords":["solana","mcp","agent","privacy","shielded-pool","copy-trading","telegram-bot","defi","zk-snark","b402","jupiter","kamino"],"author":{"name":"mmchougule"},"license":"Apache-2.0","_id":"@b402ai/stealth-trader@0.5.0","maintainers":[{"name":"mayurc9","email":"mayur@vistara.dev"}],"homepage":"https://github.com/mmchougule/stealth-trader","bugs":{"url":"https://github.com/mmchougule/stealth-trader/issues"},"bin":{"stealth-trader":"dist/cli.js","stealth-trader-mcp":"dist/mcp/index.js"},"dist":{"shasum":"e60bf7b9935085a9f0bb65530d650202783d7ec7","tarball":"https://registry.npmjs.org/@b402ai/stealth-trader/-/stealth-trader-0.5.0.tgz","fileCount":165,"integrity":"sha512-EVO2j1nvPQxAMLGMnqBb0+I28octm5cLcPwGegq0UexwK5KVNbIfYTxch8YdnOMu35iopt/1HsJIaH8hQNokHQ==","signatures":[{"sig":"MEUCIQChpnUE5W484WZIIiV2zC9s86pdRcZmnY5YzB3Jtv4xgwIgS3I8z/0TT8ielo2db9bpm913a+9Mu06s5OZKGGuWmLw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":504977},"main":"dist/bot.js","type":"module","types":"./dist/bot.d.ts","engines":{"node":">=20"},"gitHead":"397261e5f356ef217b207dfcbba8b9fcd43245be","scripts":{"dev":"tsx watch src/bot.ts","mcp":"tsx src/mcp/index.ts","test":"vitest run","build":"tsc","smoke":"tsx scripts/smoke.ts","start":"tsx src/bot.ts","wizard":"tsx src/cli.ts wizard","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"mayurc9","email":"mayur@vistara.dev"},"repository":{"url":"git+https://github.com/mmchougule/stealth-trader.git","type":"git"},"_npmVersion":"11.4.2","description":"Buy, copy-trade, and cash out on Solana without your wallet showing up in the tx. MCP server + Telegram bot + TypeScript SDK.","directories":{},"_nodeVersion":"24.4.0","dependencies":{"pg":"^8.20.0","zod":"^3.25.76","bs58":"^6.0.0","pino":"^9.5.0","dotenv":"^16.4.7","grammy":"^1.32.0","prompts":"^2.4.2","@noble/hashes":"^2.2.0","@b402ai/solana":"^0.0.33","@solana/web3.js":"^1.98.0","@solana/spl-token":"^0.4.14","zod-to-json-schema":"^3.25.2","@electric-sql/pglite":"^0.4.5","@b402ai/solana-shared":"0.0.3","@modelcontextprotocol/sdk":"^1.29.0","@lightprotocol/stateless.js":"0.23.0-beta.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^4.1.5","@types/pg":"^8.20.0","typescript":"^5.9.3","@types/node":"^22.10.0","pino-pretty":"^13.0.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/stealth-trader_0.5.0_1779849627772_0.20607839452201504","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@b402ai/stealth-trader","version":"0.5.1","keywords":["solana","mcp","agent","privacy","shielded-pool","copy-trading","telegram-bot","defi","zk-snark","b402","jupiter","kamino"],"author":{"name":"mmchougule"},"license":"Apache-2.0","_id":"@b402ai/stealth-trader@0.5.1","maintainers":[{"name":"mayurc9","email":"mayur@vistara.dev"}],"homepage":"https://github.com/mmchougule/stealth-trader","bugs":{"url":"https://github.com/mmchougule/stealth-trader/issues"},"bin":{"stealth-trader":"dist/cli.js","stealth-trader-mcp":"dist/mcp/index.js"},"dist":{"shasum":"221f05a089a266cb6e4ee000935023b0484d1727","tarball":"https://registry.npmjs.org/@b402ai/stealth-trader/-/stealth-trader-0.5.1.tgz","fileCount":165,"integrity":"sha512-n7B6ow993tlVtpBMJiSfAJaLAPTcPz5hhHfc+agQ1LaXk3+cIoyvzyNGadb8sL50iDh0r+HyqxOiRO6c59+pmQ==","signatures":[{"sig":"MEQCIDUhMDp0yZEtxBuFwkTG/tkCa0m3tjg7RN5I6ROiomaTAiAWlqIKZmtKaHJnYTEYUs1MJI+5DFYs9PztBKouF/qgsw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":505231},"main":"dist/bot.js","type":"module","types":"./dist/bot.d.ts","engines":{"node":">=20"},"gitHead":"f5cc0f58d713e602624f5f5650229f11045fdda4","scripts":{"dev":"tsx watch src/bot.ts","mcp":"tsx src/mcp/index.ts","test":"vitest run","build":"tsc","smoke":"tsx scripts/smoke.ts","start":"tsx src/bot.ts","wizard":"tsx src/cli.ts wizard","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"mayurc9","email":"mayur@vistara.dev"},"repository":{"url":"git+https://github.com/mmchougule/stealth-trader.git","type":"git"},"_npmVersion":"11.4.2","description":"Buy, copy-trade, and cash out on Solana without your wallet showing up in the tx. MCP server + Telegram bot + TypeScript SDK.","directories":{},"_nodeVersion":"24.4.0","dependencies":{"pg":"^8.20.0","zod":"^3.25.76","bs58":"^6.0.0","pino":"^9.5.0","dotenv":"^16.4.7","grammy":"^1.32.0","prompts":"^2.4.2","@noble/hashes":"^2.2.0","@b402ai/solana":"^0.0.33","@solana/web3.js":"^1.98.0","@solana/spl-token":"^0.4.14","zod-to-json-schema":"^3.25.2","@electric-sql/pglite":"^0.4.5","@b402ai/solana-shared":"0.0.3","@modelcontextprotocol/sdk":"^1.29.0","@lightprotocol/stateless.js":"0.23.0-beta.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","vitest":"^4.1.5","@types/pg":"^8.20.0","typescript":"^5.9.3","@types/node":"^22.10.0","pino-pretty":"^13.0.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/stealth-trader_0.5.1_1779853453258_0.3326960448555132","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@b402ai/stealth-trader","version":"0.5.2","description":"Buy, copy-trade, and cash out on Solana without your wallet showing up in the tx. MCP server + Telegram bot + TypeScript SDK.","type":"module","license":"Apache-2.0","engines":{"node":">=20"},"main":"dist/bot.js","bin":{"stealth-trader":"dist/cli.js","stealth-trader-mcp":"dist/mcp/index.js"},"scripts":{"dev":"tsx watch src/bot.ts","start":"tsx src/bot.ts","mcp":"tsx src/mcp/index.ts","build":"tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","smoke":"tsx scripts/smoke.ts","wizard":"tsx src/cli.ts wizard"},"dependencies":{"@b402ai/solana":"^0.0.33","@b402ai/solana-shared":"0.0.3","@electric-sql/pglite":"^0.4.5","@lightprotocol/stateless.js":"0.23.0-beta.5","@modelcontextprotocol/sdk":"^1.29.0","@noble/hashes":"^2.2.0","@solana/spl-token":"^0.4.14","@solana/web3.js":"^1.98.0","bs58":"^6.0.0","dotenv":"^16.4.7","grammy":"^1.32.0","pg":"^8.20.0","pino":"^9.5.0","prompts":"^2.4.2","zod":"^3.25.76","zod-to-json-schema":"^3.25.2"},"devDependencies":{"@types/node":"^22.10.0","@types/pg":"^8.20.0","@types/prompts":"^2.4.9","pino-pretty":"^13.0.0","tsx":"^4.19.2","typescript":"^5.9.3","vitest":"^4.1.5"},"keywords":["solana","mcp","agent","privacy","shielded-pool","copy-trading","telegram-bot","defi","zk-snark","b402","jupiter","kamino"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/mmchougule/stealth-trader.git"},"homepage":"https://github.com/mmchougule/stealth-trader","bugs":{"url":"https://github.com/mmchougule/stealth-trader/issues"},"author":{"name":"mmchougule"},"_id":"@b402ai/stealth-trader@0.5.2","gitHead":"3245377c44fdba5ceb8107bae6a558c641f3298d","types":"./dist/bot.d.ts","_nodeVersion":"24.4.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-Pff8TGzFNoSl1+OJJ0Ud/umTRNNNSu0B48Pg+saQZdN0QsgSW5E/qS+Qu/8OqBZ/pf0EHt9QLmJugrbBuNzoFA==","shasum":"2a32f3dfce4aa7162a05ca232a6cef0462eef660","tarball":"https://registry.npmjs.org/@b402ai/stealth-trader/-/stealth-trader-0.5.2.tgz","fileCount":165,"unpackedSize":511859,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDSwdcs7RcexOxsNOUK/nenThPaPFxwFqlgkMiYilbI/AIgQwTdh9QzFZsyMpdRjbIGEXtJNtSTLnO9r5rStxxv9iI="}]},"_npmUser":{"name":"mayurc9","email":"mayur@vistara.dev"},"directories":{},"maintainers":[{"name":"mayurc9","email":"mayur@vistara.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stealth-trader_0.5.2_1779927953953_0.49429730891823564"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-27T02:40:27.634Z","modified":"2026-05-28T00:25:54.242Z","0.5.0":"2026-05-27T02:40:27.955Z","0.5.1":"2026-05-27T03:44:13.385Z","0.5.2":"2026-05-28T00:25:54.131Z"},"bugs":{"url":"https://github.com/mmchougule/stealth-trader/issues"},"author":{"name":"mmchougule"},"license":"Apache-2.0","homepage":"https://github.com/mmchougule/stealth-trader","keywords":["solana","mcp","agent","privacy","shielded-pool","copy-trading","telegram-bot","defi","zk-snark","b402","jupiter","kamino"],"repository":{"type":"git","url":"git+https://github.com/mmchougule/stealth-trader.git"},"description":"Buy, copy-trade, and cash out on Solana without your wallet showing up in the tx. MCP server + Telegram bot + TypeScript SDK.","maintainers":[{"name":"mayurc9","email":"mayur@vistara.dev"}],"readme":"# stealth-trader\n\n**Give your AI agent its own Solana wallet — it trades for you, and nothing traces back to it.**\n\nAn open-source MCP server (plus a Telegram bot) that gives an AI agent its own Solana wallet. Hand it to a Claude or Cursor agent and it can buy, sell, and cash out on its own. Every trade runs *inside* the [b402 shielded pool](https://github.com/mmchougule/b402-solana): the SOL is shielded, swapped, and reshielded as an encrypted note behind a zero-knowledge proof, with a relayer signing the on-chain tx. The trade lands on-chain — but the agent's wallet isn't the signer or even an account on it, so nothing traces back to it. Prefer to tap instead of prompt? The same engine runs as a Telegram bot.\n\n[Get started](#get-started) · [What it does](#what-it-does) · [MCP tools](#mcp-tools) · [How it works](#how-it-works) · [Security](SECURITY.md)\n\n![MCP](https://img.shields.io/badge/MCP-compatible-7C3AED) ![ci](https://github.com/mmchougule/stealth-trader/actions/workflows/ci.yml/badge.svg) ![license: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue) ![node: 20+](https://img.shields.io/badge/node-20+-339933) ![tests: 206](https://img.shields.io/badge/tests-206%20passing-green)\n\n> **Note: the live mainnet deployment is a test playground, not production.** The current program IDs are an experimental preview — use small amounts only and treat it as a tech demo. An audited production deployment, under multisig upgrade authority, is in progress and will replace these program IDs.\n\n<table>\n  <tr>\n    <td align=\"center\" valign=\"top\" width=\"60%\">\n      <img src=\"docs/demo.gif\" alt=\"terminal smoke — pnpm smoke runs shield + swap + cashout on Solana mainnet in ~25s\" /><br/>\n      <sub><b>Terminal:</b> <code>pnpm smoke</code> — a mainnet shield → swap → cashout in ~25 seconds. Prints Solscan links so you can verify the depositor wallet is absent from <code>tx.accountKeys</code>.</sub>\n    </td>\n    <td align=\"center\" valign=\"top\" width=\"40%\">\n      <img src=\"docs/tg-demo.gif\" alt=\"hosted Telegram bot — buy a token, then verify on-chain the wallet isn't in the swap tx\" /><br/>\n      <sub><b>Telegram (hosted bot):</b> buy a token, then verify on-chain that the swap tx's <code>accountKeys</code> don't include your wallet. <a href=\"https://github.com/mmchougule/stealth-trader/releases/download/v0.4.0/stealth-trader-demo-1.mp4\">Full MP4</a>.</sub>\n    </td>\n  </tr>\n</table>\n\n## Get started\n\n**Use it from an agent — one command, zero config** (Claude Code, Cursor, any MCP runtime):\n\n```bash\nclaude mcp add stealth-trader -- npx -y @b402ai/stealth-trader@latest mcp\n```\n\nFirst run generates a wallet and saves its seed to `~/.config/stealth-trader/master-seed` — **back that file up; it derives the wallet that holds your funds.** It boots on public mainnet RPC so reads work out of the box, but **set `HELIUS_RPC_URL` (free, 1 min at [helius.dev](https://helius.dev)) before trading** — public RPC throttles and swaps can fail on it.\n\nYour agent can now **buy, sell, check holdings, and cash out — privately**. Ask it: *\"privately buy 0.01 SOL of `<mint>`, then cash out to a fresh address.\"* It composes the tools and signs nothing with your own wallet — the relayer does.\n\n**See it on mainnet — ~25s, costs ~$0.01:**\n\n```bash\ngit clone https://github.com/mmchougule/stealth-trader && cd stealth-trader\npnpm install\nexport HELIUS_RPC_URL=\"https://mainnet.helius-rpc.com/?api-key=YOUR_KEY\"   # free at helius.dev\npnpm smoke\n```\n\nNeeds a Solana CLI wallet with ~0.005 SOL — the script auto-funds the test wallet from `~/.config/solana/id.json` (or fund the address it prints). It shields, swaps, and cashes out, then prints two Solscan links: your wallet is **not** in the swap's `accountKeys`. ([full steps + exact cost ↓](#try-it-in-30-seconds))\n\n**Or use the hosted Telegram bot:** [t.me/btrader021bot](https://t.me/btrader021bot) — `/start`, send a little SOL, Buy. This repo ships v0.5 (`/buy`, `/sell`, `/cashout`, `/holdings`, leader discovery, MCP); `/follow` lands in v0.6.\n\n## What it does (v0.5)\n\n| feature | what it is | how to use |\n|---|---|---|\n| **Private buy** | Buy any SPL token through Jupiter. Your wallet never signs the swap; the relayer does. Rug-check gate aborts obvious honeypots before any SOL moves. | TG `/buy <mint> <sol>` · MCP `private_buy` · `pnpm smoke` |\n| **Private sell** | Sell a shielded token note back to SOL — same privacy property as buy. | TG `/sell <mint> <amount>` |\n| **Private cashout** | Withdraw shielded balance to any wallet. The recipient has no on-chain edge to your deposit address. | TG `/cashout <addr>` · MCP `cashout` |\n| **Private holdings** | Per-mint shielded balance — only the viewing-key holder can read it. | TG `/holdings` · MCP `get_holdings` |\n| **Private lend** | Deposit shielded USDC into Kamino V2 for yield. Deposit address absent on chain. | MCP `private_lend` (mainnet) |\n| **Leader stats / discovery** | 7-day PnL, hit rate, top mints for any wallet; curated starter list. Read-only in v0.5. | TG `/leader <wallet>`, `/discover` · MCP `discover_leaders` |\n\nSeven MCP tools an agent can compose: *\"check this wallet's 7-day stats, then privately buy 0.01 SOL of its top mint, and cash out to a fresh address.\"* The agent calls `discover_leaders` → `private_buy` → `cashout` — every trade signed by the relayer, your wallet never in `tx.accountKeys`.\n\n**Copy-trade (`/follow`) ships in v0.6** — it needs a hosted Helius webhook proxy so self-hosters don't need ngrok. The full copy-trade bot is live now at [t.me/btrader021bot](https://t.me/btrader021bot) if you want to try that flow today.\n\n## Why it matters\n\nOn Solana, the wallet that signs your swap is your wallet — so every trade is stamped with your address in public. Anyone can front-run your buys, copy your positions in real time, read your whole portfolio from a single address, and watch exactly when you exit.\n\nstealth-trader breaks that link: a relayer signs the trade, not you, so there's nothing to correlate. Don't take our word for it — open any tx the bot produces on Solscan and your deposit address is not in `tx.accountKeys`. The bot's \"Verify privacy\" button shows you that, per trade.\n\n## Try it in 30 seconds\n\n```bash\ngit clone https://github.com/mmchougule/stealth-trader && cd stealth-trader\npnpm install\nexport HELIUS_RPC_URL=\"https://mainnet.helius-rpc.com/?api-key=YOUR_KEY\"\npnpm smoke\n```\n\n**Try it before any Telegram setup** — the smoke needs a Helius RPC URL + a funded Solana CLI wallet, runs on mainnet in ~25 seconds, and proves the privacy property end-to-end.\n\nHere's exactly what happens, no surprises:\n\n1. Generates a `MASTER_SEED` into `./.env` (back this up if you keep using it)\n2. Derives a test wallet from that seed\n3. **Transfers 0.0045 SOL from your Solana CLI wallet** (`~/.config/solana/id.json`) to the test wallet. The script previews this with a 5-second Ctrl-C window. Opt out: `STEALTH_NO_AUTOFUND=1` + fund the printed address manually.\n4. Shields 0.0015 SOL into the b402 pool. *Your test wallet signs this — the one on-chain step where you're visible.*\n5. Swaps shielded SOL → USDC. *Relayer signs; your wallet isn't in the swap tx.*\n6. Cashes the USDC out — back to your CLI wallet by default. *Relayer signs; your wallet isn't in the cashout tx either.*\n\nThe script prints two Solscan links. Open both: the test wallet address doesn't appear in `accountKeys` for the swap or the cashout. That's the privacy property, verifiable on chain. ([How it works on-chain →](https://docs.b402.ai/solana/concepts/privacy-model))\n\n**Net cost: ~$0.01** in tx fees + a few cents of swap slippage. The 0.0015 SOL becomes ~0.13 USDC and comes back to your CLI wallet at the cashout — nothing is drained.\n\nNo Solana CLI keypair? The script prints the deposit address and waits 5 minutes for you to fund it manually.\n\n## Use cases\n\n| audience | how they use it | result |\n|---|---|---|\n| **Solana trader** (Telegram) | `/buy <mint> <sol>` to enter, `/sell` to exit, `/cashout <addr>` to withdraw to a fresh wallet | trades land shielded; cashout has no on-chain link to the deposit |\n| **AI agent** (MCP) | One prompt composes `discover_leaders` → `private_buy` → `get_holdings` → `cashout` | agent runs a private DeFi strategy with no wallet attribution |\n| **App developer** (TypeScript SDK) | `import { B402Solana } from '@b402ai/solana'` and drive the same primitives directly | embed private execution into your own product |\n\nSame code, three surfaces.\n\n## Install\n\n**As an MCP server (Claude Code, Cursor, any MCP runtime):**\n\n```bash\nclaude mcp add stealth-trader -- npx -y @b402ai/stealth-trader@latest mcp\n```\n\nEnv: `STEALTH_TG_ID`, `MASTER_SEED`, `HELIUS_RPC_URL`. Data persists to a local pglite store at `~/.stealth-trader/db` — set `DATABASE_URL=postgresql://…` to point at a real cluster.\n\nFor more MCP-side wiring (Claude Code, Cursor configs, prompt patterns): [b402 MCP overview →](https://docs.b402.ai/solana/mcp/overview).\n\n**As a self-hosted Telegram bot:**\n\n```bash\ngit clone https://github.com/mmchougule/stealth-trader && cd stealth-trader\npnpm install\npnpm wizard                       # paste bot token + Helius key\npnpm start                       # schema auto-applies on first boot\n```\n\nGet a bot token from [@BotFather](https://t.me/botfather) and a free Helius key from [helius.dev](https://helius.dev). The bot ships with pglite (WASM Postgres) in-process, so the only thing you need to provision is the bot itself.\n\nFor production deployments, set `OPERATOR_FEE_KEYPAIR_PATH` to a keypair file with ~0.05 SOL on hand. It absorbs the one-time ~0.002 SOL rent per (recipient, mint) on `/cashout` so users never see \"insufficient funds for rent\" the first time they withdraw to a fresh address.\n\n## Usage (Telegram)\n\n```\n/start                            welcome + your deposit address\n/wallet                           your deposit address (where to send SOL)\n/balance                          public SOL balance you can spend\n\n/buy <mint> <sol>                 private buy — shield fresh SOL and swap\n/sell <mint> <raw-amount>         private sell — swap a token note back to SOL\n/holdings                         per-mint shielded balances\n\n/leader <wallet>                  7-day stats — PnL, hit rate, top mints\n/discover                         curated leaders (paste any into /leader)\n\n/cashout <recipient> [mint]       unshield to any wallet (no link to deposit)\n```\n\nCopy-trade (`/follow`, `/follows`, `/unfollow`) lands in v0.6 once the hosted Helius webhook proxy ships — until then end-users would need ngrok to receive leader events.\n\n## MCP tools\n\nSeven tools an agent (Claude Code, Cursor, custom) can compose. Example: *\"score this wallet's last 7 days, privately buy 0.01 SOL of its top mint, then cash out to a fresh address.\"*\n\n| tool                  | what it does                                                          |\n|-----------------------|------------------------------------------------------------------------|\n| `private_buy`         | swap SOL → any SPL token through the shielded pool                    |\n| `private_lend`        | lend a shielded token into Kamino (mainnet only)                      |\n| `cashout`             | unshield to a recipient with no on-chain link to your deposit         |\n| `get_holdings`        | shielded token balances per mint                                      |\n| `get_wallet`          | your deposit address (where you shield SOL once)                      |\n| `get_balance`         | public SOL balance available for new shields                          |\n| `discover_leaders`    | rank candidate wallets by recent on-chain PnL + activity              |\n\n## How it works\n\n```\nFund your derived address  ──►  public SOL balance\n                                       │  shield at trade time\n                                       ▼\n        ┌──────────────  b402 shielded pool  ──────────────┐\n        │   encrypted notes · commitment tree + nullifier tree\n        ▼                      ▼                      ▼\n   private_buy            private_sell           private_lend\n   (SOL → token)          (token → SOL)          (Kamino USDC)\n        │                      │                      │\n        └──────────┬───────────┴──────────┬───────────┘\n                   ▼                      ▼\n          swap is CPI'd inside     output reshields as a\n          the pool; relayer        new encrypted note\n          signs the on-chain tx    (yours, still hidden)\n```\n\nYou fund a derived address — that's your public balance. A buy shields fresh SOL into the pool, swaps it for the token via a CPI *from inside* the pool, and reshields the output as a new encrypted note; if you already hold a shielded note, it skips the shield and just swaps that note. Each spend is an adapt proof: it proves in zero-knowledge that you own a valid unspent note — tracked in the commitment tree, retired in the nullifier tree — without revealing which one or whose. The relayer signs the on-chain tx from a pool-controlled account, so your wallet is not a signer, not an account, not in the block.\n\nDeeper reading on the b402 docs site:\n- [Privacy model](https://docs.b402.ai/solana/concepts/privacy-model) — exactly what's hidden, what's revealed\n- [Trust assumptions](https://docs.b402.ai/solana/concepts/trust-assumptions) — what the relayer can and can't do\n- [Protocol architecture](https://docs.b402.ai/solana/protocol/architecture) — circuits, nullifier tree, verifier\n- [Adapter overview](https://docs.b402.ai/solana/adapters/overview) — how Jupiter/Kamino integrate\n\nTwo correctness properties worth knowing — both ship in `@b402ai/solana@0.0.33`:\n- **Swap routes ladder down on tx-size overrun.** Jupiter routes vary trade-to-trade; some exceed the relayer's tx-build buffer (\"encoding overruns Uint8Array\"). The swap layer retries at `maxAccounts` [32, 28, 24, 20] until the wrapped tx fits, then surfaces a clean error if none do.\n- **Note leafIndex comes from the pool's `CommitmentAppended` event log, not the pre-tx `tree.leafCount` prediction.** Concurrent shields on the shared pool race the prediction. Reading the post-confirm event eliminates the phantom-note class that produces silent `Adapt_221` proof failures.\n\n## Compared to\n\nvs. public DEX routers (Jupiter, Raydium UI, etc.):\n\n| property                                       | stealth-trader | public router |\n|------------------------------------------------|:--------------:|:-------------:|\n| your wallet signs the swap?                    | no             | yes           |\n| your wallet appears in `tx.accountKeys`?       | no             | yes           |\n| your portfolio is readable from your address?  | no             | yes           |\n| wallet trackers can link the trade to you?     | no             | yes           |\n\nvs. copy-trade bots (Trojan, BullX, Photon, Maestro):\n\n| property                                          | stealth-trader | Trojan / BullX / Photon |\n|---------------------------------------------------|:--------------:|:-----------------------:|\n| follower's wallet appears in the leader's block?  | no             | yes                     |\n| MCP-callable (any agent runtime)?                 | yes            | no                      |\n| open source?                                      | yes            | no                      |\n\nThe \"wallet in accountKeys\" rows are facts checkable on Solscan in 30 seconds for any tx those tools produce.\n\n## Numbers\n\n- 206 unit tests covering swap-ladder, rug-check gate, Jupiter quote breaker, per-user serial lock, balance ledger, wallet derivation, delta-balance deposits, leader stats, MCP handlers.\n- Tests run against in-memory pglite + a mocked SDK; ~3s wall time. A few exercise live Jupiter/RugCheck and degrade gracefully when rate-limited, so the suite stays green offline.\n- Built on `@b402ai/solana@0.0.33`, mainnet program `42a3hsCXtQLWonyxWZosaaCJCweYYKMrvNd25p1Jrt2y`.\n\n## Status\n\nv0.5 — `/buy`, `/sell`, `/holdings`, `/cashout` work end-to-end against mainnet (TG + MCP); `/leader` and `/discover` are read-only stats. Every trade is relayer-signed; the user wallet never appears in the swap or cashout `accountKeys`. Copy-trade (`/follow`) lands in v0.6 with a hosted webhook proxy.\n\n## Limits\n\n- Copy-trade is buys only. Sells (leader sells X → follower sells X) ship with copy-trade in v0.6.\n- Hosted b402 relayer is the default. Run your own from [`mmchougule/b402-solana/packages/relayer`](https://github.com/mmchougule/b402-solana/tree/main/packages/relayer) and point `B402_RELAYER_URL` at it.\n- The b402 shielded pool is unaudited. Read the [trust assumptions](https://docs.b402.ai/solana/concepts/trust-assumptions) before depositing more than you'd lose in an experiment.\n- Same-amount notes pile up if every copy uses identical `per_trade_lamports`. The SDK recycles existing notes when shapes match. Snap-to-nearest recycle is on the roadmap.\n\n## Security\n\nReports: see [SECURITY.md](SECURITY.md). 90-day coordinated disclosure.\n\n## Stack\n\n- [`@b402ai/solana`](https://www.npmjs.com/package/@b402ai/solana) — shielded pool SDK\n- [`@modelcontextprotocol/sdk`](https://github.com/modelcontextprotocol/typescript-sdk) — MCP transport\n- [`grammy`](https://github.com/grammyjs/grammY) — Telegram bot framework\n- [`zod`](https://github.com/colinhacks/zod) — MCP tool schema validation\n- [`pino`](https://github.com/pinojs/pino) — structured logging\n- [`pg`](https://github.com/brianc/node-postgres) — Postgres driver\n- Helius enhanced webhooks for leader-tx ingestion\n\n## License\n\nApache-2.0.\n","readmeFilename":"README.md"}