Skip to main content
Glama
BaseStock Guard

BaseStock Guard

by Bfat-6z

BaseStock Guard (base-stock-agent)

Zero-dependency Agentic Stock Finance SDK, CLI pre-trade guardrail, Live Web Verifier, and MCP Server (stdio + HTTP POST /mcp) for Coinbase Tokenized Stocks on Base (Chain 8453).

Built for Base Stocks Maxxing Season — Agentic Stock Finance Track.

Why Autonomous Stock Agents Need This

When integrating Coinbase's B20 tokenized stocks (/v1/tokenized-stocks), naive swap or portfolio bots fail on four real production edge cases:

  1. total_supply vs underlying share equivalents: Corporate actions (dividends, splits) update each contract's B20/ERC-8056 multiplier (e.g. SNDKc at 8.0000x, NVDAc at 1.0005x, GOOGLc at 1.0004x). Raw balanceOf and raw total_supply do not equal 1:1 shares.

  2. Omitted nav_price fields: /v1/tokenized-stocks omits nav_price on many responses; you must join /nav-feeds (normalizing EIP-55 checksums) and read Chainlink decimals() + latestRoundData() directly from Base RPC (eth_call batch).

  3. Unpriced long-tail stocks: Only a subset of live positive-supply tokens (e.g. 13 out of 236) have configured Chainlink NAV feeds; trading unpriced tokens blindly risks unbounded slippage.

  4. US Equity Off-Hours Holds vs Stale Oracles + B20 Pauses: Distinguish normal weekend/overnight NAV holds from genuine oracle staleness and detect paused_features before routing orders.

Related MCP server: Trading Signals MCP

Quickstart (Zero API Keys, Zero Gas, Node >= 20)

# Scan live Base tokenized stocks + batched Base RPC Chainlink NAV verification
node ./bin/base-stock-agent.mjs scan

# Pre-trade safety guardrail for an AI trading agent
node ./bin/base-stock-agent.mjs guard SNDKc --json

# Check a Base wallet's tokenized stock exposure (multiplier-adjusted)
node ./bin/base-stock-agent.mjs wallet 0xYourBaseAddress

# Launch live dashboard + REST API + HTTP MCP endpoint (http://127.0.0.1:4790)
node ./bin/base-stock-agent.mjs serve --port 4790

# Run as a stdio MCP server for Claude / Cursor / AgentKit
node ./bin/base-stock-agent.mjs mcp

MCP Tools Exposed (tools/list)

  • scan_base_tokenized_stocks — Live paginated Coinbase API + batched Chainlink latestRoundData() scan.

  • guard_tokenized_stock_trade — Deterministic PASS/BLOCK check before agent trade execution.

  • inspect_wallet_stock_exposure — Zero-key Base balanceOf batch with corporate-action multiplier math.

Verification

npm test

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      MCP server exposing 17 pay-per-call web, finance, legal and onchain utilities for AI agents: crypto readers and Base deployer intelligence, SEC EDGAR filings, OFAC sanctions checks, insider transactions, 13F holdings, and multi-jurisdiction caselaw and legislation search. Pay per call in USDC on Base via x402 or MPP.
      17
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP-capable agents to run pay-per-call trading checks and quant tools, including pre-trade GO/CAUTION/NO_GO verdicts, futures event gates, session briefs, SEC insider-buy lookups, Base token safety verdicts, and small calculators, with automatic x402 USDC payments on Base.
      21
      524 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients and AI agents to access cross-chain spot trading, tokenized stocks, and perpetual futures through a local stdio server, with JSON outputs and locally signed transactions.
      174 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to query live price-safety verdicts, token listings, authorized-participant flows, recent events, daily briefs, and natural-language research answers for Coinbase tokenized stocks on Base.
      MIT