XS

x402agent/solana-clawd

Developer tools
25 stars Quality 59 Trend 32

AI will not become truly useful at global scale until actions become verifiable. Clawd turns AI from probabilistic speech into attestable machine labor.

Overview

: export BWS_ACCESS_TOKEN= before running any path above and all API keys hydrate automatically — no .env editing required. See setup → After install, verify everything is wired: The current frontier AI stack is mostly: Clawd does not call itself "an AI terminal." It is the — the layer where every meaningful AI action can be routed, priced, permissioned, executed, attested, audited, and remembered. The sdk/ workspace is now a first-class entrypoint for Clawd. It packages the sovereign runtime, TUI operator, TypeScript SDK, wallet helpers, x402 payments, MCP tools, examples, automation, bundled skills, hosted graph metadata, and local install scripts under one harness. Global package surface installed by the SDK scripts: The SDK never publishes local secrets. Public graph data is sanitized metadata; keys, wallet files, RPC credentials, bearer tokens, .env files, node_modules, and private user skills stay local.

README


⛏️ Clawd ORE Mining Agent — NEW

One-shot install

# Interactive — prompts for your DeepSeek key, RPC, and keypair:
curl -fsSL https://x402.wtf/ore/install.sh | bash

# One-liner — all inline, no prompts:
DEEPSEEK_API_KEY=sk-... \
RPC=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY \
KEYPAIR=~/.config/solana/id.json \
curl -fsSL https://x402.wtf/ore/install.sh | bash

# Dry run — watch the AI reason with zero real transactions:
DRY_RUN=true DEEPSEEK_API_KEY=sk-... RPC=... KEYPAIR=... \
curl -fsSL https://x402.wtf/ore/install.sh | bash

Or from the repo:

# Status (no keys needed)
RPC=https://mainnet.helius-rpc.com/?api-key=KEY npm run ore:status

# Start the agent + live dashboard at http://localhost:3333
DEEPSEEK_API_KEY=sk-... RPC=... KEYPAIR=... npm run ore:miner

⚡ One-Shot Install — Pick Your Path

# ── ONE COMMAND — everything (recommended) ───────────────────────────────────
git clone https://github.com/x402agent/solana-clawd.git
cd solana-clawd && bash install.sh

# ── PATH 1 — Full TUI + Agent Kit + Dark DeFi ────────────────────────────────
curl -fsSL https://solanaclawd.com/leviathan.sh | sh && clawd-tui

# ── PATH 2 — MCP server only (Claude Desktop / Cursor / VS Code) ────────────
curl -fsSL https://raw.githubusercontent.com/x402agent/solana-clawd/main/mcp/install.sh | bash

# ── PATH 3 — npm global surface ─────────────────────────────────────────────
npm install -g solana-clawd @openclawdsolana/clawd-sdk @openclawdsolana/dark-sdk dark-x402-terminal && clawd

# ── PATH 4 — full SDK workspace (perps + automaton + dark DeFi) ─────────────
git clone https://github.com/x402agent/solana-clawd.git
cd solana-clawd && bash install.sh --full

# ── PATH 5 — Dark Privacy Terminal only ─────────────────────────────────────
npm install -g dark-x402-terminal && dark-x402-terminal

# ── PATH 6 — browser terminal (zero install) ─────────────────────────────────
open https://solanaclawd.com/terminal

Bitwarden Secrets Manager: export BWS_ACCESS_TOKEN= before running any path above and all API keys hydrate automatically — no .env editing required. See setup →

After install, verify everything is wired:

clawd --version                                   # root CLI
clawd-tui                                         # Bloomberg-style operator terminal
clawd-perps signal oi SOL-PERP --mock             # perps OI signal (no RPC needed)
clawd balance                                     # wallet status
dark-x402-terminal                                # privacy DeFi TUI
npm run dark:demo                                 # dark DeFi barrel smoke test
curl https://x402.wtf/api/solana-clawd/sdk | jq '.data.stats'  # hosted SDK graph

The Thesis

AI will not become truly useful at global scale until actions become verifiable. Clawd turns AI from probabilistic speech into attestable machine labor.

The current frontier AI stack is mostly:

prompt → model → answer

Clawd is:

intent → route → reason → simulate → verify → execute → attest → settle → remember → evolve

Clawd does not call itself “an AI terminal.” It is the verifiable execution harness for autonomous agents — the layer where every meaningful AI action can be routed, priced, permissioned, executed, attested, audited, and remembered.

Trust the harness. Verify the model. Constrain the tools. Attest the action. Audit the result.


SDK-First Runtime

The sdk/ workspace is now a first-class entrypoint for Clawd. It packages the sovereign runtime, TUI operator, TypeScript SDK, wallet helpers, x402 payments, MCP tools, examples, automation, bundled skills, hosted graph metadata, and local install scripts under one harness.

SDK surface Path What it provides
Runtime core sdk/src, sdk/dist Leviathan OODA loop, identity, balances, Metaplex spawn, memory, survival tiers, and x402 service exports
Package workspace sdk/packages @openclawdsolana/clawd, clawd-tui, clawd-sdk, clawd-standalone, clawd-wallet, and clawd-perps package surfaces
Install automation sdk/install.sh, sdk/enter.sh One-shot SDK install, global npm surface, local harness checks, and runtime entry
Skills + knowledge sdk/skills, sdk/knowledge, sdk/library Skill Hub snapshot, local-first agent knowledge, prompt library, MagicBlock, Imperial, DFlow/Phantom, commerce, oracle, and TTS skills
Agent integrations sdk/mcp-server, sdk/livekit-agent, sdk/automation MCP server, LiveKit/backrooms agent, bootstrap scripts, CI checks, and constitution/runtime automation
Payment rails sdk/x402, sdk/pay HTTP 402 Solana USDC flow, facilitator defaults, client/server examples, and pay-side references
Examples + assets sdk/examples, sdk/assets, sdk/characters, sdk/goals, sdk/data Nine runnable demos, local assets, character definitions, active goals, and program/token maps
Hosted SDK graph Public manifest for packages, skills, examples, automation, characters, commands, and integration lanes

Local SDK install and verification:

cd sdk
bash install.sh
bash enter.sh
npm run harness:packages
npm run skills:sync

Global package surface installed by the SDK scripts:

npm install -g @openclawdsolana/clawd @openclawdsolana/clawd-tui @openclawdsolana/clawd-sdk @openclawdsolana/clawd-standalone @openclawdsolana/clawd-wallet @openclawdsolana/clawd-perps clawd-automaton x402.wtf x402agent-nanoclawd-cli

Run the SDK examples:

clawd examples list
clawd examples run ooda
clawd examples run lobtrader
clawd examples run x402sol
clawd examples run wallet

The SDK never publishes local secrets. Public graph data is sanitized metadata; keys, wallet files, RPC credentials, bearer tokens, .env files, node_modules, and private user skills stay local.

🌑 Dark DeFi — Privacy Layer

Zcash Sapling privacy, TEE-attested confidential agents, and shielded Jupiter swaps, fully integrated into the CLAWD runtime.

dark-defi/
├── packages/
│   ├── protocol/       @openclawdsol/dark-protocol      — Solana client, Sapling, note encryption
│   ├── sdk/            @openclawdsol/dark-protocol-sdk  — shielded wallets, swaps, oracle, AI agents
│   ├── tee-agents/     @openclawdsol/dark-tee-agents    — TEE agents, x402 sealed inference, SAS
│   ├── sas-lib/        sas-lib                          — Solana Attestation Service client
│   ├── terminal/       dark-x402-terminal               — privacy DeFi TUI
│   └── dark-defi/      dark-defi                        — meta-package / umbrella
└── dark-protocol-program/                               — on-chain Anchor program

Install & build the full privacy stack:

npm run dark:install   # npm install each Dark DeFi package
npm run dark:build     # tsc-compile protocol → sas-lib → sdk → tee-agents → terminal
npm install            # re-link workspaces in root node_modules

Launch the privacy terminal:

npm run dark:terminal
# or globally:
dark-x402-terminal

Use from TypeScript (single import path):

import {
  // High-level SDK — shielded wallets, Jupiter swaps, oracle
  DarkProtocolClient, DarkWallet, PrivacyUtils,
  PrivateSwapManager, PriceOracle, ShieldedWallet,
  // TEE agents — confidential inference + x402 payments
  ConfidentialAgent, ClawdTeeAgent, DARK_SCHEMAS,
  // CLAWD integration wrappers
  DarkClawdClient, DarkTeeAgent, darkMcpTools,
  // Namespace groups (no symbol conflicts)
  darkSdk, teeAgents, sas,
} from 'solana-clawd/dark';

// One-stop dark client
const dark = await DarkClawdClient.create({ heliusApiKey: process.env.HELIUS_API_KEY! });
const { wallet, mnemonic } = await dark.generateWallet();

// Privacy primitives
const { commitment, nullifier, viewingKey } = dark.generatePrivacyPrimitives();

// Spawn a TEE-attested confidential agent
const bundle = DarkTeeAgent.spawn({ agentId: 'hermes-01', owner: wallet.publicKey.toBase58() });

// MCP tool stubs (read-only, safe for agent use)
const price = await darkMcpTools.getTokenPrice(mint, process.env.HELIUS_API_KEY!);

Vault security (fixed in issue #158):

  • agentwallet server now defaults to 127.0.0.1 (not 0.0.0.0)
  • Auth is always enforced — token auto-generated and printed if VAULT_API_TOKEN unset
  • CORS restricted to localhost/127.0.0.1 origins only (no wildcard *)

ORE Mining Automation

The repo vendors Regolith ORE in ore-master and exposes it through automaton-main. The integration keeps ORE instruction/account logic in Rust while Solana Clawd handles operator automation, status checks, and miner loops.

# Build the local ORE CLI bridge
npm run ore:build

# Inspect board/miner state
ORE_KEYPAIR=~/.config/solana/id.json \
ORE_RPC_URL=https://your-rpc.example \
npm run ore:status

# Configure ORE automation and run one miner tick
cd automaton-main
ORE_KEYPAIR=~/.config/solana/id.json \
ORE_RPC_URL=https://your-rpc.example \
pnpm ore:miner -- --ore-setup --ore-once \
  --ore-amount-sol 0.001 \
  --ore-deposit-sol 0.05 \
  --ore-strategy random \
  --ore-num-squares 1

Use cd automaton-main && pnpm ore:miner -- --help for the automaton CLI help. Direct deployments require an explicit square selection or --ore-deploy-all; automation setup requires both amount and deposit inputs.


CLAWD: Cryptographic Layer for Autonomous Work & Decisions

Layer State of the art Clawd delta
Model answer generation routed, scored, policy-bound model execution
Agent tool wrapper permissioned autonomous entity with wallet + constitution
Identity API key / account wallet-native agent identity with MPL Core birth certificate
Trust logs controlled by platform portable SAS attestations + signed receipts
Payment subscription / API billing x402 / pay-per-action settlement on Solana USDC
Execution opaque tool call simulated, routed, signed, journaled action
Memory app silo local-first vault + onchain proof pointers
Security prompt filters policy firewall + formal verification gates
Privacy platform custody encrypted local state + selective proof disclosure
Market SaaS users autonomous economic entities with AUD-optimized routes

Proof of Agentic Action

Every important AI action creates a signed, replayable, queryable receipt:

{
  "agent_id": "clawd://agent/...",
  "operator_wallet": "...",
  "model_route": { "provider": "openrouter", "model": "claude/gpt/grok/local" },
  "input_hash": "...",
  "tool_manifest_hash": "...",
  "memory_context_hash": "...",
  "output_hash": "...",
  "action_type": "trade | code | research | payment | mint | deploy | message",
  "risk_score": 0.18,
  "human_approval_required": false,
  "execution_receipt": {
    "tx_sig": "...",
    "venue": "phoenix | imperial | x402 | mcp",
    "status": "simulated | submitted | settled | failed"
  },
  "attestation": {
    "schema": "clawd.agent.action.v1",
    "issuer": "clawd-harness",
    "signature": "..."
  }
}

AI output is no longer ephemeral. It becomes a cryptographic action object.


AUD Loop — Algorithmic Utility Delta

The current state of the art optimizes for answer quality / token cost.

Clawd optimizes for verified action utility / dollar / second / unit of risk.

AUD = (N × F × V × A × E × T) / (C × L × R × O)

N = reach (people/agents affected)
F = frequency (normalized actions/time)
V = verifiability gain vs baseline
A = autonomy gain
E = economic execution gain
T = trust / auditability gain

C = cost   L = latency   R = risk   O = opacity

The AUD Loop is implemented in packages/clawd/src/aud-loop.ts:

import { computeAud, rankRoutes, AUD_PROFILES } from "./aud-loop.js";

// Compare SOTA baseline vs Clawd verified action
const sota = computeAud(AUD_PROFILES.sota_baseline);
const clawd = computeAud({ ...AUD_PROFILES.clawd_verified_action, reach: 50_000 });
console.log(clawd.summary);
// → "AUD strong (412.3). Delta vs SOTA baseline: +399.1.
//    Reach-weighted delta: 2194 utility units. Recommended route mode: verified."

// Score a global AI output vs Clawd harness at scale
const ranked = rankRoutes([
  { label: "global_ai_sota",    factors: AUD_PROFILES.global_ai_output },
  { label: "clawd_global",      factors: AUD_PROFILES.clawd_global_harness },
]);
// clawd_global scores orders of magnitude higher due to V, T, low O

ClawdRouter modes derived from AUD scoring:

Mode When chosen Optimizes for
fast low cost + latency cheapest good answer
deep high trust + verifiability best reasoning + audit trail
private low opacity target local / TEE / encrypted path
verified V > 0.8, O < 0.2 only attested models and tools
economic high economic gain maximum ROI per settlement
trading low latency + high E execution probability + MEV protection
court risk > 0.6 maximum audit trail

$CLAWD Token

Field Value
Symbol $CLAWD
Network Solana mainnet
Mint (SPL) 8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump
Burn + Lock Treasury GyZGtA7hEThVHZpj52XC9jX15a8ABtDHTwELjFRWEts4
Site x402.wtf · solanaclawd.com

$CLAWD is the economic pressure valve of the harness: access, routing stake, agent reputation stake, settlement discount, proof issuance fee, burn on execution, arena entry, skill publishing bond.


Quick Start

# One-line install → full TUI with Agent Kit
curl -fsSL https://solanaclawd.com/leviathan.sh | sh && clawd-tui

# Open the browser terminal
open https://solanaclawd.com/terminal

# One-shot MCP server install
curl -fsSL https://raw.githubusercontent.com/x402agent/solana-clawd/main/mcp/install.sh | bash

# Enter the public backroom
curl -fsSL https://backrooms.x402.wtf/enter.sh | bash

# Install and enter the SDK harness
cd sdk && bash install.sh && bash enter.sh

# Install root CLI
npm install -g solana-clawd && clawd

# Install full SDK npm surface
npm install -g @openclawdsolana/clawd @openclawdsolana/clawd-tui @openclawdsolana/clawd-sdk @openclawdsolana/clawd-standalone @openclawdsolana/clawd-wallet @openclawdsolana/clawd-perps clawd-automaton x402.wtf x402agent-nanoclawd-cli

# Inspect the hosted SDK graph
curl https://x402.wtf/api/solana-clawd/sdk | jq '.data.stats'
Command What it does
🔍 clawd-perps signal oi SOL-PERP --mode paper OI regime signal (Observe layer)
📊 clawd-perps signal watch SOL-PERP --interval 5s Live OI watch loop
🚀 clawd-tui → press 6 Full Bloomberg-style Agent Kit TUI
⚡ clawd-agents-perps paper-long SOL --notional 100 Simulated Phoenix perp long
🎨 clawd-agent mint --network devnet ... --yes Real Metaplex registered agent
💰 clawd balance + clawd fund 10 USDC + CLAWD wallet ops
🤖 bash automaton-main/leviathan.sh --full Full runtime bootstrap
🖥️ https://solanaclawd.com/terminal Browser terminal
📦 clawdhub install meme-trader Install a skill from ClawdHub

🔐 Bitwarden Secrets Manager — Installation Integration

All secret handling in the Clawd install flow is now backed by Bitwarden Secrets Manager (bws CLI). A single BWS_ACCESS_TOKEN unlocks the full credential set at install time — no manual .env editing required.

How it works

install.sh
  └─ bootstrap_bitwarden()
       ├─ checks for bws CLI (auto-installs if missing)
       ├─ loads BWS_ACCESS_TOKEN from env / prompt
       ├─ bws secret list → hydrates all tracked secrets
       ├─ writes .env from secret values (never commits)
       └─ launchers wrap exec with bws inject prelude

Every launcher the install creates uses bws inject so secrets are pulled fresh at runtime, not baked into the process environment at build time.

Quickstart

# 1. Install the bws CLI (one-time)
curl -fsSL https://bws.bitwarden.com/install | sh

# 2. Export your machine access token
export BWS_ACCESS_TOKEN=

# 3. Run the MCP installer — Bitwarden runs automatically
curl -fsSL https://raw.githubusercontent.com/x402agent/solana-clawd/main/mcp/install.sh | bash

# 4. Or run the root install — same bootstrap applies
bash install.sh

# 5. Verify secret hydration manually
source mcp/bitwarden-secrets.sh
bws_status          # → connected | offline | unconfigured
bws_load_all        # → prints which secrets were injected

The bitwarden-secrets.sh library

mcp/bitwarden-secrets.sh is a sourceable shell library that every install script sources. Key helpers:

Function What it does
bws_status Prints connected, offline, or unconfigured
bws_load_all Fetches all project secrets, exports to env, reports count
bws_get Resolve one secret by ID or name
bws_inject_exec Runs cmd with all secrets injected as env vars — used by launchers
bws_write_env Writes resolved secrets to a local .env file (never committed)
bootstrap_bitwarden Full bootstrap: check, install, auth, hydrate, write .env
# Minimal source-and-use pattern
source /path/to/bitwarden-secrets.sh

if bws_status | grep -q connected; then
  bws_load_all
else
  echo "No BWS token — falling back to local .env"
  [ -f .env ] && source .env
fi

How launchers use it

Launchers generated by install.sh and mcp/install.sh wrap their exec calls in bws_inject_exec:

#!/usr/bin/env bash
# Generated launcher — do not hand-edit secrets into this file
source "$(dirname "$0")/bitwarden-secrets.sh"
bws_inject_exec node /path/to/dist/server.js "$@"

If bws is unavailable or BWS_ACCESS_TOKEN is unset, the launcher falls back gracefully to local .env. No secret ever appears in the launcher script itself.

Tracked secrets

The following env vars are managed through Bitwarden Secrets Manager when BWS_ACCESS_TOKEN is set:

Env var Used by
ANTHROPIC_API_KEY MCP server, automaton, TUI
HELIUS_API_KEY MCP Helius tools, RPC calls
SOLANA_RPC_URL All on-chain ops
OPENAI_API_KEY Fallback model routing
TELEGRAM_BOT_TOKEN Backrooms agent, TUI notifications
X402_FACILITATOR_URL x402 payment rails
CLAWD_WALLET_KEYPAIR Agent wallet operations
CLAWD_ONCHAIN_MM_LIVE Phoenix MM live gate
CLAWD_TWAMM_LIVE TWAMM crank live gate
OPERATOR_CONFIRMED Live execution master gate

The live-execution gates (CLAWD_ONCHAIN_MM_LIVE, CLAWD_TWAMM_LIVE, OPERATOR_CONFIRMED) should only be set in your Bitwarden production machine account — never in a shared .env file.

Node-side hydration

For TypeScript processes launched directly (not via a shell launcher), import the hydrator before loading config:

import { hydrateBwsSecrets } from "./bitwarden-secrets.js";

// Call before any env reads — no-op if BWS_ACCESS_TOKEN is absent
await hydrateBwsSecrets();

const config = loadPerpsRuntimeConfig(); // now sees all secrets

Zero-secret-in-git guarantee

What Rule
.env files In .gitignore — never committed
Launcher scripts Use bws_inject_exec, never embed values
bitwarden-secrets.sh Only IDs/names — no secret values
Bitwarden machine tokens Local env only (export BWS_ACCESS_TOKEN=...)
# Audit your working tree before push
git diff HEAD --name-only | xargs grep -l "BWS_ACCESS_TOKEN\|ANTHROPIC_API_KEY" 2>/dev/null
# → should return nothing

→ mcp/bitwarden-secrets.sh — full library source → mcp/install.sh — MCP installer with Bitwarden bootstrap


Hosted SDK Graph

The public x402.wtf app now indexes this repo and the sdk/ workspace as a first-class SDK graph. That gives installers, agents, and users a stable hosted map without shipping local paths, node_modules, or dist artifacts.

Surface URL Purpose
SDK dashboard Human view of packages, skills, examples, automation, character files, commands, and integration lanes
SDK manifest Machine-readable manifest consumed by the dashboard, installers, docs, and agent clients
Package map Public package/workspace metadata from sdk/packages with hosted fallback data
Source status Sanitized source detection and activation map for site/gateway wiring

Local ClawdBrowser development can point at this checkout with:

export SOLANA_CLAWD_HOME=/path/to/solana-clawd
export SOLANA_CLAWD_SDK_HOME=/path/to/solana-clawd/sdk
# CLAWD_SDK_HOME also works as an SDK override.

Public production smoke:

curl https://x402.wtf/api/solana-clawd/sdk | jq '.data.source, .data.stats'
curl https://x402.wtf/api/solana-clawd/packages | jq '.data.total, .data.packages[0].name'

SDK-local maintenance:

npm --prefix sdk run harness:packages
npm --prefix sdk run skills:sync
npm --prefix sdk run mcp:build
npm --prefix sdk run x402:build

The SDK manifest covers the same public-safe lanes exposed in the local tree: sdk/packages, sdk/skills, sdk/examples, sdk/automation, sdk/characters, sdk/mcp-server, sdk/livekit-agent, sdk/x402, and sdk/pay.


Google ADK + Private Agent Gateway

Clawd now includes a TypeScript Google Agent Development Kit entrypoint at adk/agent.ts. It exports rootAgent as a multi-tool LlmAgent for:

Tool surface Purpose
get_agent_catalog_stats Proves installed catalog coverage across agents/agents-catalog.json and agents/src/*.json
search_agent_catalog Finds registry agents by identifier, category, tag, or capability
get_private_destinations Lists private routing destinations for the Clawd gateway and catalog
get_token_price / get_token_search Reads Solana market metadata through Jupiter
prepare_jupiter_swap Prepares unsigned swap payloads for wallet review only

The gateway registry now publishes Google ADK metadata through:

GET /registry
GET /identity
GET /adk/manifest.json

The ADK manifest reports the private connection mode, all nine configured destination URLs, and full installed catalog coverage. Current local verification shows 135 installed source-backed agents, 135 catalog entries, and no missing source/catalog entries.

Run the ADK agent locally:

cd adk
npm run check
npm run run

Open the ADK dev UI:

cd adk
npm run web

Docs:

Path Description
adk/README.md Animated Google ADK integration README
gateway/README.md Private Preview Agent Gateway notes, permissions, APIs, and governance patterns
adk/.env.example Non-secret env template for ADK model auth and private routing overrides

Secrets stay out of git. Put real Gemini keys, RPC URLs, API keys, and wallet material in local .env files or the shell only.


Skills Catalog Update

The project-local skills registry now bundles skills/magicblock, the MagicBlock Ephemeral Rollups development skill, plus the ClawdBrowser skill import from /Users/8bit/Downloads/ClawdBrowser/skills. These skills are listed in skills/README.md, skills/catalog.json, and skills/index.json for discovery by Codex, Claude-style skill loaders, and the Clawd skill hub.

Skill Coverage
magicblock MagicBlock Ephemeral Rollups, delegation/undelegation, dual-connection flows, cranks, VRF, Magic Actions, lamports top-up, private payments, commit sponsorship, and TypeScript/Anchor integration
imperial* Imperial/Phoenix perps routing, execution modes, market/portfolio intel, margin, risk, position management, TP/SL, TWAP, and grid workflows
oracle, sherpa-onnx-tts, skill-creator One-shot model consultation, offline TTS, and AgentSkill authoring/packaging

The root one-shot installers now regenerate skills/catalog.json; scripts/setup.sh already performs this step, and install.sh now does the same after the Node workspace is ready.


Hackathon Submission

Solana Clawd is submitted to Colosseum here: arena.colosseum.org/projects/explore/solana-clawd.

Judges should start with the dedicated hackathon guide, then use the demo script, judge guide, and repo map.

Path What judges should use it for
hackathon/README.md Main animated submission guide and product narrative
hackathon/JUDGES.md Fast evaluation path, architecture notes, and scoring hooks
hackathon/DEMOS.md Demo flows for research, market intelligence, wallet analysis, and onchain execution
hackathon/REPO_MAP.md Map of the submitted GitHub repo across MCP, agents, SDK, TUI, perps, AMM, gateway, verification, and skills

AMM Pool Routing Upgrade

The /amm package now carries the merged perps AMM work into the standalone AMM surface: pool state, pool impact math, split routing, CLI commands, SDK exports, and two new MCP tools.

Surface Upgrade
amm/src/aggregator/ammMath.ts Per-side utilization, capacity checks, OI skew, predicted funding, borrow rates, and pool health
amm/src/venues/poolState.ts Operator-injected pool state with synthetic fallback from funding and liquidity defaults
amm/src/aggregator/splitRouter.ts Greedy marginal-cost split routing across venues when it beats single-venue execution
amm/src/mcp/tools.ts amm_route_trade_split and amm_get_pools, bringing the AMM MCP surface to 17 tools
amm/README.md AMM-specific animated guide, CLI examples, SDK usage, and MCP tool map
npm --prefix amm run typecheck
npm --prefix amm run test:math
npm --prefix amm run build
node amm/dist/cli.js pools SOL-PERP
node amm/dist/cli.js route-split SOL-PERP long 4000

🌊 Perps Overhaul — TWAMM · Phoenix MM · Aggregator Venues · Skills

The execution stack just got three new time-aware strategies, two new venue adapters, two new agent skills, and a fully enumerable skill registry wired into ClawdPerpsRuntime.

What changed


⏱ TWAMM — Time-Weighted On-Chain Execution

TWAMM splits your order into infinitely many infinitesimal swaps over a time window. The result: average fill = time-weighted oracle price. Zero market impact. Deferred settlement.

# Check workspace (finds perps/twamm-master automatically)
clawd perps twamm status

# Build the Anchor program
clawd perps twamm build

# Preview the crank command (dry-run, no tx)
clawd perps twamm plan \
  --token-a So11111111111111111111111111111111111111112 \
  --token-b EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

# Live gated run — all three env vars required
CLAWD_TWAMM_LIVE=true OPERATOR_CONFIRMED=true \
  clawd perps twamm crank \
  --token-a  --token-b  --yes
const runtime = new ClawdPerpsRuntime();

// Workspace status
const status = runtime.getTwammStatus();
// status.exists  — true when perps/twamm-master is present
// status.liveEnabled  — true when CLAWD_TWAMM_LIVE=true

// Preview a $50k SOL buy routed through TWAMM
const preview = runtime.previewTwammExecution("SOL", "buy", 50_000);
// preview.route.payload.blocked → false only after CLAWD_TWAMM_LIVE=true
// preview.twamm.command → exact crank invocation

When to use TWAMM vs immediate execution:

Scenario Route
Order > $50k notional ✅ TWAMM
Thin book / high slippage ✅ TWAMM
Needs immediate fill ❌ Phoenix CLOB
Levered perps position ❌ Vulcan TWAP

🦅 Phoenix On-Chain Market Maker

The mm Rust binary places resting two-sided limit orders on the Phoenix CLOB around the Coinbase mid price. Every refresh earns maker rebates and tightens the book spread.

# Build the mm binary
clawd perps onchain-mm build

# Preview the run command (no tx)
clawd perps onchain-mm plan \
  --market HhHRvLFvZid6FD7C96H93F2MkASjYfYAx8Y2P8KMAr6b \
  --ticker SOL-USD \
  --quote-edge-bps 3

# Arm and run
CLAWD_ONCHAIN_MM_LIVE=true OPERATOR_CONFIRMED=true \
  clawd perps onchain-mm run \
  --market  --ticker SOL-USD \
  --quote-edge-bps 3 --quote-size 100000000 --yes
Flag Default Description
--quote-edge-bps 3 Half-spread in bps around mid
--quote-size 100,000,000 Quote size in quote atoms
--refresh-ms 2000 Quote refresh interval
--price-improvement ignore join / dime / ignore
--post-only true Reject if would cross book
// Runtime API
const { status, plan } = runtime.previewOnchainMm("SOL-USD", 3);
// status.binaryBuilt — true if cargo build has run
// plan.command + plan.args → exact invocation, copy-paste ready

🔀 Vulcan TWAP Strategy

For large perps orders on levered venues, Vulcan’s strategy twap start owns the loop, tick display, ledger, and report. One call, zero manual slicing.

const plan = runtime.buildVulcanTwapPlan({
  symbol: "SOL",
  side: "buy",
  notionalUsd: 100_000,
  slices: 10,
  intervalSeconds: 30,
  mode: "paper",               // paper | dry_run | confirm_each | auto_execute
  maxPriceDriftBps: 50,
});
// plan.command → "vulcan"
// plan.args → ["strategy", "twap", "start", "--symbol", "SOL", ...]
// plan.note → human-readable summary

🏛 Venue Registry — twamm Now First-Class

Both packages/clawd-perps-aggregator and amm now include TWAMM as a registered venue:

import { buildVenueAdapters } from "@openclawdsolana/clawd-perps-aggregator";
import { TwammVenueAdapter } from "@openclawdsolana/clawd-perps-aggregator";

// Enable all venues including TWAMM
const adapters = buildVenueAdapters(transport, ["phoenix", "flash", "jupiter", "gmtrade", "twamm"]);

// TWAMM adapter caps slippageBps ≤ 2 for any notional
const quote = await adapters.twamm.quote({ symbol: "SOL-PERP", side: "long", notionalUsd: 200_000 });
// quote.estimatedSlippageBps → ≤ 2
// quote.warnings → ["TWAMM: fills at time-weighted oracle price. Not immediate."]

TWAMM has no on-chain underwriter code (it is not routed through the Imperial CPI path). The UNDERWRITER map uses sentinel -1 for TWAMM to keep the type system clean.


🧠 Skills — TWAMM + Phoenix MM

Two new agent skills are now live in skills/ and indexed by VulcanCatalogSummary:

The skill catalog is now enumerable at runtime:

// All skills indexed from skills/ directory
const runtime = new ClawdPerpsRuntime();

const all = await runtime.listSkills();
// [{ name: "clawd-twamm", path: "skills/clawd-twamm/SKILL.md", category: "clawd" }, ...]

const vulcanOnly = await runtime.listSkills("vulcan");
const clawdOnly  = await runtime.listSkills("clawd");

// Also surfaced in health check
const health = await runtime.getRuntimeHealth();
// health.vulcan.skills → VulcanSkillEntry[] (all skills by category)
// health.vulcan.commandCount, groupCount, dangerousCommands

getRuntimeHealth() now returns the full VulcanCatalogSummary including skills — no extra call needed.



Public Gitlawb Mirrors

The sanitized public mirrors are tracked from this GitHub repo as gitlinks/submodules, not as expanded private workspaces:

Mirror Purpose Public safety rule
my-project-public Stable public mirror for judge/reviewer cloning Sanitized source only; no local secrets, wallets, live env, UCAN material, or dependency folders
my-project-public-fresh Fresh rebuild mirror used to verify the public export path Same sanitizer rules as my-project-public; used as a second-pass safety check

Force the public node before clone so git-remote-gitlawb does not fall back to a local node:

export GITLAWB_NODE=https://node.gitlawb.com
OWNER_DID=did:key:z6Mkq5mY3JWtxoxUobWcfNHm7AkRubgSWEZTkBVqZXJviFZ5
git clone "gitlawb://$OWNER_DID/my-project-public"

The public mirrors include source for sdk, tui, ooda, MemeBRain, gateway, automaton-main, agents, leviathan, and perps/clawd-agents-perps. They can include package metadata, READMEs, .env.example templates, source trees, and small checked build artifacts where useful. They never include .local-secrets, .playwright-mcp, live .env files, key material, UCAN files, browser snapshots, or any node_modules directory.

Public mirror source groups:

Group Included paths Explicitly excluded
Automaton runtime automaton-main/assets, automaton-main/automation, automaton-main/packages, automaton-main/scripts, automaton-main/src, automaton-main/dist, automaton-main/*.md, package manifests, lockfiles, and shell entrypoints automaton-main/node_modules, local .automaton wallets/state, live .env files
Clawd Perps perps/clawd-agents-perps/src, perps/clawd-agents-perps/dist, .env.example, README.md, package.json, package-lock.json, and tsconfig.json perps/clawd-agents-perps/node_modules, live .env files, wallet/key material
Gateway + ADK gateway, adk, agents, sdk, tui, and registry docs/templates live RPC URLs, API keys, bot tokens, UCAN credentials, generated dependency folders

Repository Galaxy

Zone Paths Publish posture
Agent interface .claude, .github, adk, agent-kit, agents, mcp, skills Track source and examples only; local Claude settings stay ignored
Gateway + governance gateway, x402, attestation, formal_verification, docs, examples Track public code, proofs, manifests, and templates
Solana execution amm, perps, programs, pump-fun, pinocchio, llm_oracle, vulcan-cli-master Track source and examples; never commit keys or live .env files
Apps + operators apps, tui, chrome-extension, operator, clawd-cloud-os, tailclawd Track app source; tui/.env, tui/dist, and tui/node_modules stay local-only
Automation + memory automaton-main, leviathan, MemeBRain, moltbook-agent, ooda, deep-clawd, data Track source/config templates; private data dumps stay local-only
SDK + packages packages, sdk, clawdcli, clawdrouter, openShell, email-worker, scripts Track reusable package source and automation
Local-only vaults .local-secrets, openclawd-framework, UltraThink-SKill, node_modules Ignored. Do not push to GitHub, gitlawb, npm, or deployment artifacts
Root docs/config .env.example, .gitattributes, .gitignore, .gitmodules, .nvmrc, biome.json, bun.lock, bunfig.toml, CONTRIBUTING.md, HACKATHON.md, install.sh, leviathan.sh, LICENSE, MIGRATE.md, netlify.toml, package-lock.json, package.json, README.md, SECURITY.md, skills-lock.json, SOUL.md, STARTHERE, STARTHERE.md, STRATEGY.md, TRADE.md, tsconfig*.json Track public project metadata and non-secret examples

Viral surface area is deliberate: animated docs, explicit agent maps, private gateway manifests, verifiable Solana receipts, and x402 routes are all visible. Private material is not.


🦞👑 /Perps — The Execution Heart

OI alone is not the signal. The Clawd Perps Core OI Signal is:

OI delta + mark price delta + funding pressure + long/short skew
+ orderbook liquidity + spread + mark/index basis + account health
= Clawd Core OI Signal → regime → score → gate → route
Regime Condition
LONG_CONTINUATION price ↑ + OI ↑ + funding sane + spread tight
SHORT_CONTINUATION price ↓ + OI ↑ + funding sane + spread tight
SHORTS_CLOSING price ↑ + OI ↓ — do not chase
LONGS_CLOSING price ↓ + OI ↓ — wait
CROWDED_LONG_RISK OI ↑ hard + funding very positive + skew long
CROWDED_SHORT_RISK OI ↑ hard + funding very negative + skew short
DATA_INVALID any execution gate failed
# OI signal — mock (no RPC needed)
clawd-agents-perps signal oi SOL-PERP --mock

# Live + watch loop
clawd-agents-perps signal watch SOL-PERP --interval 5s --mode paper

# Risk gate before entering
clawd-agents-perps signal risk-gate SOL-PERP --notional 500 --side long

# Strategy runners (paper-first, ledgered, gated)
clawd-perps perps twap SOL --side buy --notional-usdc 500 --slices 5 --detached
clawd-perps perps grid SOL --center-on-mark --width-pct 2.5 --levels-per-side 5 --tokens-per-level 0.5
clawd-perps perps finalize  --cancel-orders --close-position --wait --yes

The OI signal is the Observe layer of the perps OODA loop:

Phoenix reads the tape → RPC verifies the chain → Clawd scores the crowd
→ Imperial routes only after the shell says risk is clean

→ perps/clawd-agents-perps/README.md — full OI signal reference -> perps/README.md - full execution stack (Imperial, Phoenix, Vulcan)


⚡ MCP Server v3 — Federated Trust Machine

The MCP server is the central orchestration and receipt plane. Every tool call becomes a signed event: who called it, what model requested it, what permission allowed it, what data was touched, what settlement occurred.

curl -fsSL https://raw.githubusercontent.com/x402agent/solana-clawd/main/mcp/install.sh | bash
solana-clawd-mcp                    # STDIO for Claude Desktop / Cursor / VS Code
PORT=3001 solana-clawd-mcp-http     # Streamable HTTP + SSE
{ "mcpServers": { "solana-clawd": { "command": "~/.local/bin/solana-clawd-mcp" } } }
              MCP Server
┌──────────┐  ┌────────────┐  ┌──────────────┐
│ Plugin   │  │ Federation │  │ Agent Task   │
│ Registry │  │ Bridge     │  │ Router       │
└──────────┘  └────────────┘  └──────────────┘
            ↓          ↓          ↓
   ┌─────────────────────────────────────┐
   │   Orchestrator + SessionMeter       │
   │   + PTokenStreamFacilitator         │
   └─────────────────────────────────────┘
Category Count Description
solana 11 Public Solana market data
helius 8 Helius RPC / DAS / Webhooks
x402 9 Payment protocol + p-token metered billing
leviathan 9 OODA loop + autonomous agent control
market 5 Composite intelligence (premium)
pump 8 Pump.fun bonding curve
memory 4 Persistent agent memory + autoDream
agents 6 Agent fleet + skill management
deep-clawd 6 DeepSeek trading agent tools
docs 3 Documentation system
federation N Federated MCP tools from external servers
orchestrator 6+ Orchestrator management, integration status

p-token stream settlement: 98.3% CU reduction vs SPL Token (6,200 → 105 CU). Atomic, batched, and streamed modes. $0.0001/token micropayments — cheap enough for high-frequency agent receipts.

→ mcp/README.md


🤖 Crustacean Automation (clawd-automaton)

Sovereign agent runtime — OODA loops, identity provisioning, sandbox lifecycle, replication, SQLite-backed state. All locally, all yours.

npm install -g clawd-automaton
clawd-automaton --run        # OODA loop
clawd-automaton --goblin     # Devnet paper Goblin mode
Tier USDC Pulse Posture
deep >= $5.00 60s full capability
shallow >= $1.00 5m economical hunting
shoreline >= $0.10 15m conserve resources
beached $0 — stop before harm

→ automaton-main/README.md


🖥️ TUI — Bloomberg-Style Sovereign Terminal

 ██████╗██╗      █████╗ ██╗    ██╗██████╗
██╔════╝██║     ██╔══██╗██║    ██║██╔══██╗
██║     ██║     ███████║██║ █╗ ██║██║  ██║
╚██████╗███████╗██║  ██║╚███╔███╔╝██████╔╝
npm install -g @openclawdsolana/clawd-tui
clawd-tui   # or: hermes

# Mint a real Metaplex agent
clawd-agent mint --network devnet --keypair ~/.config/solana/id.json \
  --name "My AI Agent" --uri https://example.com/agent.json \
  --service MCP=https://example.com/mcp --yes

# Gasless mint (no local SOL needed)
clawd-agent mint-free --network devnet --owner  \
  --name "My AI Agent" --uri https://example.com/agent.json

→ tui/README.md


🧠 MemeBRain — Persistent Agent Memory

remember → vault note → SQLite bank → recall → action

Local-first memory: SQLite bank, markdown research vault, OODA journal ingestion, fast recall.

clawd-brain init
clawd-brain remember "Jupiter Perps Risk" "Track liquidity, funding, oracle failure modes." --kind perp
clawd-brain recall "Jupiter perp risk"
npm run brain:ingest-ooda

→ MemeBRain/README.md


📦 On-Chain Programs

Program Description
agent-minter On-chain agent minting with Metaplex integration
clawd-stake $CLAWD staking with reward distribution
llm_oracle On-chain LLM callback bridge
mpl-corenft-staking MPL Core NFT staking with yield mechanics
p-token-launchpad SIMD-0266 p-token launch and stream settlement
solana-ai-inference On-chain AI inference routing primitives
solana-gpt-oracle GPT oracle bridge for on-chain AI responses
token-launcher Token launch automation with metadata + LP

📦 Packages

# ── Core operator surface ────────────────────────────────────────────────────
npm i -g @openclawdsolana/clawd          # Main operator CLI + OODA loop
npm i -g @openclawdsolana/clawd-tui      # TUI + Metaplex Agent Registry
npm i -g @openclawdsolana/clawd-perps    # Phoenix perps + OI signal + Vulcan
npm i -g clawd-automaton                 # OODA runtime + cloud dashboard
npm i -g solana-clawd                    # Root CLI
npm i @openclawdsolana/clawd-wallet      # Wallet SDK
npm i @openclawdsolana/clawd-sdk         # On-chain SDK, adaptive curves, vaults

# ── Dark DeFi privacy layer ──────────────────────────────────────────────────
npm i @openclawdsolana/dark-sdk          # Shielded wallets, private swaps, oracle
npm i @openclawdsolana/dark-tee-agents   # TEE-attested agents + x402 sealed inference
npm i -g dark-x402-terminal              # Privacy DeFi TUI (Zcash + Jupiter + Gemini AI)

# ── Local workspace (all packages, recommended) ──────────────────────────────
git clone https://github.com/x402agent/solana-clawd.git && cd solana-clawd
bash install.sh                          # one-shot: everything including dark-defi

Programmatic import (after bash install.sh):

// Full stack — single import
import { DarkClawdClient, ConfidentialAgent } from 'solana-clawd/dark';
import { buildAgentLaunchInstructions }       from '@openclawdsolana/clawd-sdk';

⚡ x402 — Agent-Native Payments

HTTP 402 Payment Required as agent-native settlement. Runtime loops that earn, pay, and keep operating. p-token micropayments cheap enough for per-action receipts.

The x402 folder now includes the Solana Clawd x402 Agent Store: paid Google-agent SKUs, /commerce/checkout Solana USDC settlement, and Merchant API v1 sync-plan generation for Google Merchant Center product inputs. See x402/ECOMMERCE.md.

curl https://x402.wtf/api/agents | jq .
curl https://x402.wtf/registry | jq .

🤝 Backrooms

Three agents. One room. No exit.
Analyst ↔ Satirist ↔ Clawd
curl -fsSL https://backrooms.x402.wtf/enter.sh | bash
enter --loop 5

🗺️ Repo Map

solana-clawd/
├── packages/clawd/src/aud-loop.ts   ← AUD Loop — Algorithmic Utility Delta
├── mcp/                             MCP v3 — receipt middleware + federation
├── sdk/                             runtime source, goals, knowledge
│   ├── dark-integration.ts          CLAWD ↔ Dark DeFi wrappers (DarkClawdClient, DarkTeeAgent)
│   └── dark/index.ts                unified barrel: solana-clawd/dark import path
├── dark-defi/                       🌑 Privacy layer — Zcash Sapling + TEE agents
│   ├── packages/protocol/           @openclawdsol/dark-protocol (v0.2)
│   ├── packages/sdk/                @openclawdsol/dark-protocol-sdk (v0.3)
│   ├── packages/tee-agents/         @openclawdsol/dark-tee-agents (v0.1)
│   ├── packages/sas-lib/            sas-lib — Solana Attestation Service
│   ├── packages/terminal/           dark-x402-terminal — privacy DeFi TUI
│   ├── packages/dark-defi/          dark-defi meta-package
│   └── dark-protocol-program/       on-chain Anchor program
├── automaton-main/                  clawd-automaton OODA runtime + dashboard
├── attestation/                     Solana Attestation Service + clients
├── operator/                        OpenClawd Operator loop + ACP
├── agents/                          134-agent catalog + 115 skills
├── leviathan/                       sovereign runtime
├── x402/                            payment rails
├── MemeBRain/                       SQLite + markdown memory vault
├── tui/                             Bloomberg TUI + Metaplex Agent CLI
├── perps/clawd-agents-perps/        OI Signal + Imperial + Phoenix + TWAMM
├── perps/                           Phoenix, Vulcan, market-maker suite
├── programs/                        Anchor programs workspace
│   ├── agent-minter/
│   ├── clawd-stake/
│   ├── llm_oracle/
│   ├── p-token-launchpad/
│   ├── solana-ai-inference/
│   └── token-launcher/
├── packages/
│   ├── clawd/                       main operator CLI + AUD loop
│   ├── clawd-perps/                 Phoenix perps + OI signal
│   ├── clawd-protocol/              vaults, staking, adaptive curves
│   ├── clawd-sdk/                   on-chain SDK (agent launch, bonding curves)
│   ├── clawd-wallet/                wallet SDK + safeguards
│   └── agentwallet/                 encrypted keypair vault (auth-hardened)
└── openclawd/                       x402, gateway, E2B subtree

📖 Reading Order

  1. README.md — you are here
  2. packages/clawd/src/aud-loop.ts — AUD Loop implementation
  3. perps/clawd-agents-perps/README.md — OI signal + execution
  4. perps/README.md - Imperial, Phoenix, Vulcan
  5. mcp/README.md — MCP v3 operator manual
  6. automaton-main/README.md — sovereign agent runtime
  7. tui/README.md — TUI + agent minting
  8. attestation/README.md — Solana Attestation Service
  9. sdk/README.md — SDK, goals, knowledge
  10. x402/README.md — payment rails
  11. MemeBRain/README.md — agent memory system

Fast Start

git clone https://github.com/x402agent/solana-clawd.git
cd solana-clawd

# One-shot: installs everything including dark-defi privacy layer
bash install.sh

# Or step by step:
npm install                    # link all workspaces
npm run packages:install       # clawd, clawd-sdk, agentwallet, clawd-perps…
npm run dark:install           # dark-defi packages (protocol, sdk, tee-agents…)
npm run dark:build             # compile privacy layer
npm run check                  # typecheck + lint
npm run smoke:readme

# Launch surfaces
npm run hermes                 # Bloomberg TUI
npm run leviathan:spawn        # sovereign runtime first-time wizard
npm run dark:terminal          # privacy DeFi TUI
npm run dark:demo              # dark DeFi barrel smoke test (no keys needed)
npm run automation:ci
npm run programs:map
npm run brain:init

╔═══════════════════════════════════════════════════════════════════════════╗
║  CLAWD — The Verifiable Agentic Harness                                  ║
╠═══════════════════════════════════════════════════════════════════════════╣
║  Harness    clawd · leviathan · clawd-automaton · OODA                   ║
║  Execution  Phoenix · Vulcan · Imperial · OI Signal · AUD Loop           ║
║  Receipts   Proof of Agentic Action · SAS attestation · memory journal   ║
║  Programs   agent-minter · clawd-stake · llm_oracle · p-token-launchpad  ║
║  Memory     MemeBRain · SQLite vault · OODA ingestion                    ║
║  Payments   x402 · HTTP 402 · Solana USDC · p-token stream settlement    ║
║  Agents     134 agents · 115 skills · gasless MPL Core minting           ║
║  Privacy    🌑 dark-defi · Zcash Sapling · TEE agents · shielded swaps   ║
║  Vault      agentwallet · 127.0.0.1 · mandatory auth · localhost CORS    ║
╚═══════════════════════════════════════════════════════════════════════════╝

License

MIT.

View this README on GitHub

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add x402agent/solana-clawd