Documentation

Full project guide — architecture, security, workflows, and agent commands.

ClawStock

A strategy and capital operating system for AI Agents.

ClawStock lets an AI Agent trade on-chain assets on your behalf, without ever holding your private keys, and without giving up auditability over where your funds go. You connect a Web3 wallet, fund a strategy through a transparent on-chain deposit flow, and talk to your Agent in natural language to start, monitor, and exit a strategy. Custody of your assets never leaves your own wallet's control.

This page introduces the problem ClawStock solves, how the system is put together, and walks through getting a strategy running end to end.


Why ClawStock

The on-chain path around a closing door

Access to overseas equities through traditional brokerages has been narrowing. Major platforms have stopped onboarding new mainland users and are winding down existing accounts, leaving individual investors with fewer working channels. Foreign-exchange rules restrict the use of personal currency-conversion quotas for offshore securities investment, and banks have tightened review on cross-border transfers as a result. Legitimate channels for moving capital offshore — already limited by QDII quotas and restricted use cases — have grown narrower still, while informal alternatives carry serious risk.

On-chain markets offer a path that doesn't depend on any of this. Trading tokenized U.S. equities on-chain means no brokerage account, no overseas KYC process, and full self-custody of assets — a wallet is the only requirement to participate.

Why hand this to an AI Agent

Manual trading is slow and effort-intensive: researching the market, picking instruments, placing orders, adjusting positions, and managing stop-loss and take-profit levels all require sustained manual attention, and emotion creeps into decisions made under pressure. An AI Agent collapses this into a single natural-language instruction — match a strategy, manage position sizing, and execute — removing both the manual overhead and the emotional noise.

The problem with handing an AI your keys

Letting a general-purpose AI act on DeFi directly introduces two classes of risk that are difficult to fully mitigate after the fact.

The first is custodial. For an AI to execute trades, it typically needs your exchange API key or your wallet's private key. Any compromise of the model, its tooling, or its environment becomes a compromise of your funds directly. Prompt injection makes this worse — a malicious instruction buried in content the model reads can trigger a transfer that bypasses simple permission checks by exploiting how the model interprets context.

The second is strategic. General-purpose AI models reason over public, surface-level information; they don't carry domain-specific trading logic or an understanding of market microstructure, so decisions often reduce to statistical pattern-matching dressed up as analysis. Models can also hallucinate supporting data when information is incomplete, and execution of complex multi-step trading instructions can drift from what was intended. Without built-in risk controls — stop-loss discipline, position sizing limits — nothing stops an Agent from taking an outsized position and holding it against the market in a way no risk-aware trader would.

ClawStock is built to close both gaps at once: the Agent never touches your private key, and the strategy logic it can act on is constrained, auditable, and risk-aware by design.


How It Works

ClawStock is the connective layer between a user, an AI Agent, and the on-chain financial services a strategy needs. It's made up of four cooperating parts.

AI Agent Skill — A standardized operating manual for any Agent that supports the Skill pattern. It defines the safety boundaries the Agent must respect and the exact shape of the API calls it's allowed to make, so risk is constrained at the source rather than patched on afterward.

ClawStock API — The strategic and operational core. It handles identity verification, transaction routing, and the strategy logic itself, and is the single place all of this is coordinated consistently.

Wallet Interaction Layer — The security boundary between the Agent and your funds. All login and authorization happens through wallet signatures and a visual confirmation step, so permission over your assets stays entirely in your hands.

External Integrations — The open edge of the system, connecting out to market services, liquidity pools, and other external infrastructure so the ecosystem around ClawStock can grow without changing its security model.

Wallet-signature login

Authentication is non-custodial from end to end: ClawStock never sees a private key or seed phrase, and identity is proven entirely through wallet signatures. A login round-trip looks like this:

  1. ClawStock issues a login challenge.
  2. The user signs the challenge with their wallet.
  3. The signature is verified against the wallet address.
  4. A session credential is issued.
  5. The Agent can now relay trading instructions on the user's behalf.

Because the credential is scoped to a session and tied to a signature rather than a stored secret, there's nothing persistent for an attacker to steal even if some part of the pipeline were compromised.

The two-account model

Funds are split across two accounts with distinct jobs, which keeps gas costs down and keeps the boundary between "your money" and "a running strategy" clean.

The Main Account is where deposits land and where withdrawals originate — it's the staging area between your wallet and any active strategy.

The Strategy Account is where a specific strategy actually runs. All of its gains, losses, and fees are settled inside this account, isolated from the Main Account and from any other strategy you might be running.

The flow between them is a closed loop: a deposit moves from your wallet into the Main Account, capital is allocated from there into a Strategy Account when a strategy starts, and when the strategy ends its balance flows back to the Main Account, from which you initiate a withdrawal back to your own wallet. Every hop in that path is on-chain and auditable.

System architecture

ClawStock is organized into four layers, each with a narrow, well-defined responsibility:

  • AI Agent Layer — where strategy requests originate and get executed
  • REST API Layer — the core business logic and decision-making surface
  • Wallet Interaction Layer — the user-facing surface for signatures and confirmations
  • Service Layer — the integration point for market data, smart contracts, and other external systems

This separation keeps coupling low between layers, gives each layer room to evolve independently, and lets security controls be enforced in depth rather than at a single chokepoint. The same layering is also what makes the API safe to expose as a standardized, open interface for third parties to build against.

Deposits, strategy execution, and withdrawal

Deposits happen through a dedicated on-chain session: the Agent opens a deposit session, the user authorizes and transfers funds via a smart contract interaction, and once the transfer is confirmed on-chain, control returns seamlessly to the conversation with the Agent.

Starting a strategy is a short, guided sequence — choose a strategy, confirm the details with the Agent, authorize the transfer of capital from the Main Account into the corresponding Strategy Account, and the strategy begins running.

Exiting a strategy is just as direct: tell the Agent to close the strategy, the system settles any open positions and computes final P&L automatically, and funds flow back to the Main Account. Withdrawals are restricted to the user's own verified wallet address as a hard constraint — there is no path for funds to be redirected to a third-party address.

Security model

ClawStock's security posture rests on a small number of non-negotiable boundaries rather than a long list of best-effort mitigations:

  • The system is designed from the ground up to never handle a user's private key or seed phrase.
  • High-risk actions require explicit user confirmation, API keys are managed under strict access control, and withdrawal addresses are locked to the user's verified address.
  • The two-account model and layered architecture mean a failure in one part of the system doesn't automatically cascade into custody of funds.

Together, these are what make it reasonable to let an AI Agent operate in a domain — managing real capital — where mistakes are expensive and trust has to be earned structurally, not assumed.


Getting Started

Getting a strategy running takes three steps: install the Skill, connect and fund your wallet, and start trading.

1. Install the Skill

ClawStock runs as a Skill inside an AI Agent client that supports the Skill pattern. Several Agent distributions are available; pick whichever fits how you already work.

ClientNotes
QClaw for PCRecommended; used as the reference client throughout this guide
MaxClaw (web)Cloud-hosted; may require a paid plan
ArkClaw (web)Cloud-hosted; may require a paid plan

Once your Agent client is installed and you're signed in, open Settings (the gear icon), then Upload Skill → Import from GitHub, and provide the ClawStock repository URL:

https://github.com/ClawStock/ClawStock

The simpler route is to skip the settings UI entirely and just ask your Agent directly:

"Install the ClawStock Skill from GitHub."

A Skill-aware Agent will fetch and install it from there.

2. Connect and fund your wallet

With the Skill installed, start a conversation with your Agent and send it your Web3 wallet address. The Agent calls the Skill's login endpoint and returns a login link. Open that link in your browser to complete a signature using MetaMask or any other Ethereum-compatible wallet — a mobile wallet can also scan the QR code shown on the login page to sign from your phone. Once signed, return to your Agent conversation; it checks your login status automatically and confirms once you're authenticated.

After logging in, you can deposit funds. Deposits currently support USDC on Arbitrum One. The deposit flow mirrors login: the Agent gives you a link, you complete the steps in your browser, and the process involves two signatures — one authorizing the ClawStock contract to move the specified USDC amount, and a second confirming the actual transfer.

3. Start trading

Once your deposit is confirmed, ask your Agent what strategies are currently available. Send the strategy you want — by number or name — along with the amount to allocate, and confirm with the Agent when asked. The server then moves that amount from your Main Account into the corresponding Strategy Account, and the strategy begins running.

Strategies run continuously on the server side; you can message your Agent at any time to check current performance. Withdrawing follows the same pattern as everything else — tell the Agent you want to withdraw, confirm, and funds are sent back on-chain to the wallet address you originally deposited from.


Roadmap

ClawStock is built as an open platform rather than a single fixed tool, and its scope is expected to grow along a few axes:

Broader Agent compatibility — opening interfaces to additional mainstream AI Agent platforms so ClawStock's financial capabilities aren't limited to a single client ecosystem.

A deeper strategy library — expanding from general quantitative strategies toward cross-cycle, multi-factor, and alternative-data-driven approaches, across both equities and crypto-native assets.

Cross-chain and multi-asset support — moving beyond a single chain and asset type toward a unified service spanning major chains such as Ethereum and Solana, alongside compliant digital assets.

Richer analytics — full account-level analysis, strategy performance attribution, and live risk monitoring, turning raw financial data into something both users and Agents can act on directly.

A developer ecosystem — an open core API paired with a support and incentive program for third-party teams building on ClawStock, growing a platform-developer-user loop where each side reinforces the others.


Have questions or run into an issue? Open an issue on the ClawStock GitHub repository.