Skip to content

dchu3/svm402-gemini-extension

Repository files navigation

SVM 402 Gemini CLI Extension

A Gemini CLI extension for Solana token analysis powered by svm402.com. Token analysis calls cost $0.10, paid automatically via a Solana micro-transaction using the x402 protocol. Some tools (like wallet balance checks) are free.

What It Does

This extension connects the Gemini CLI to the svm402.com remote MCP server, which provides AI-powered analysis tools for Solana tokens. The analysis is generated by AI and should not be considered financial advice. Some tools are free (e.g. wallet balance checks), while token analysis tools are paid — the extension automatically signs a micro-transaction ($0.10 in USDC) on your behalf when needed.

How It Works

  1. Proxy: When Gemini calls a tool, the extension forwards the request to svm402.com.
  2. Challenge: If the tool is gated, the server replies with an HTTP 402 error containing a payment challenge.
  3. Automatic Payment: The extension uses your SOLANA_PRIVATE_KEY to sign a $0.10 USDC transaction.
  4. Result: The server verifies the payment on-chain and returns the analysis results.

Features

  • Automatic Payments: Handles x402 payment challenges transparently — you just use the tools.
  • Sponsored Transactions: The server pays the SOL transaction fee; you only need USDC.
  • Secure Configuration: Your Solana private key is stored via the Gemini CLI's built-in sensitive settings.

Prerequisites

  • Gemini CLI installed and configured.
  • A Solana wallet with a small amount of USDC for paid tool calls (token analysis costs $0.10 per call; wallet balance checks are free).

⚠️ Important Disclaimer & Consent

svm402-gemini-extension is a research assistance tool that helps you gather on-chain data and AI-generated summaries for Solana tokens to support your own due diligence (DYOR).

This is NOT financial advice, investment advice, or a recommendation to buy, sell, or hold any token.

  • AI analysis can contain errors, miss risks, or become outdated quickly.
  • Cryptocurrency is highly speculative — you can lose 100% of your investment.
  • Always verify everything yourself using multiple sources (DexScreener, Solscan, RugCheck, Birdeye, etc.).
  • Use only a dedicated burner wallet with a very small amount of funds.

Micropayments ($0.10 USDC per analysis call) help cover Gemini API and hosting costs so the tool can remain available.

By installing and using this extension, you acknowledge that you are solely responsible for your own decisions and any losses. Enter Y when prompted during installation to confirm you agree.

Installation

gemini extensions install https://github.com/dchu3/svm402-gemini-extension.git

During installation, you will be prompted for:

  • DISCLAIMER_CONSENT: Read the disclaimer and type Y to accept.
  • SOLANA_PRIVATE_KEY: Your base58-encoded Solana private key (handled securely).

Caution

Never share your private key with anyone. Your SOLANA_PRIVATE_KEY grants full control over your wallet — anyone with it can transfer all your funds. Never commit it to source control, paste it in chat, or store it in plain text files. We strongly recommend creating a dedicated low-balance wallet (see below) rather than using a wallet that holds significant funds.

Advanced: You can set the SOLANA_RPC_ENDPOINT environment variable to override the default public Solana mainnet RPC. The extension uses the RPC only for read-only queries (fetching token mint data and the latest blockhash) when constructing payment signatures — the remote server handles actual transaction submission. Most users don't need to change this.

Creating a Dedicated Wallet (Recommended)

For safety, create a separate Solana wallet just for this extension. Only fund it with a few dollars of USDC — enough to cover your analysis calls.

1. Install the Solana CLI

sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"

After installation, restart your terminal or run the export PATH command shown in the installer output.

2. Generate a New Keypair

solana-keygen new --outfile ~/.config/solana/svm402.json

This creates a new wallet and displays the public key (wallet address). Save the seed phrase shown during generation — it's your only backup.

3. Get Your Base58 Private Key

The keypair file is a JSON array of bytes. To convert it to the base58 format needed by this extension, run this command (no extra packages required):

node -e "
const bytes = new Uint8Array(JSON.parse(require('fs').readFileSync(process.env.HOME + '/.config/solana/svm402.json', 'utf8')));
const alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
let num = BigInt('0x' + Buffer.from(bytes).toString('hex')), result = '';
while (num > 0n) { result = alphabet[Number(num % 58n)] + result; num /= 58n; }
for (const b of bytes) { if (b === 0) result = '1' + result; else break; }
console.log(result);
"

The output is your SOLANA_PRIVATE_KEY — use this value when installing the extension.

4. Fund the Wallet

Send a small amount of USDC (e.g. $1–$5) to your new wallet address. Each token analysis call costs $0.10, so $1 covers 10 calls. You do not need SOL — transaction fees are sponsored by the server.

Tip

You can check your wallet address anytime with:

solana-keygen pubkey ~/.config/solana/svm402.json

5. Verify on a Block Explorer

After funding, confirm the USDC arrived by checking your wallet address on a block explorer:

  • Solscan: https://solscan.io/account/<YOUR_WALLET_ADDRESS>
  • Solana Explorer: https://explorer.solana.com/address/<YOUR_WALLET_ADDRESS>

Replace <YOUR_WALLET_ADDRESS> with the public key from the previous step.

6. (Optional) Import into a Wallet App

You can import this wallet into Phantom, Solflare, or another Solana wallet app to manage funds with a UI (send USDC, check balances, etc.).

Important

Import using the private key — not the seed phrase. Wallet apps like Phantom use a different key derivation method (BIP-44) than solana-keygen, so the same seed phrase will produce a different address. The private key import always gives you the correct wallet.

  1. Open your wallet app → SettingsImport Private Key (or "Import Wallet")
  2. Paste the base58 private key from Step 3
  3. Verify the address shown matches your solana-keygen pubkey output

Usage

Once installed, you can analyze Solana tokens in plain English:

  • "Analyze the Solana token [MINT_ADDRESS]"
  • "What can you tell me about [MINT_ADDRESS]?"

Example AI Analysis Output

✦ The analysis for the token Community (771oWnZyoVXW285EeusgicQ7DazFUN2hraGjynhupump) on Solana
  is complete:

🔍 Token Analysis Report: Community

  Price: $0.000335 (🟢 +951.00%)
  Market Cap: $335.36K | 24h Volume: $1.58M | Liquidity: $47.85K

  Safety Status: ✅ Safe (Risk Score: 0.0/10)
  LP Locked: 68.2%

  Key Insights:
  * ✅ Strengths: Explosive trading volume, 68.2% of LP is locked, and a
    low technical safety risk score.
  * ⚠️ Risks: Extremely thin liquidity relative to the high volume,
    potential wash trading patterns, and massive volatility following
    a 951% pump.
  * 🐋 Whale Signal: Accumulation detected.
  * 📈 Narrative Momentum: Positive.

  🎯 Verdict: AVOID (High Confidence)
  > "Parabolic growth on paper-thin liquidity creates a high-risk
  >  environment likely to result in a liquidity trap."

Note

This output is AI-generated analysis and should not be considered financial advice. Always do your own research before making any investment decisions.

Important

Security First: The Gemini CLI will always ask for your explicit confirmation before making a paid tool call (token analysis costs $0.10 per call).

Development

1. Install Dependencies

npm install

2. Build the Project

npm run build

3. Run Locally

SOLANA_PRIVATE_KEY=your_base58_private_key \
npx tsx src/index.ts

License

MIT

About

AI-powered Solana token analysis with automatic pay-per-use micro-transactions via svm402.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors