/uniswap-trading-tools:dca-botfrom uniswap-trading-tools
Automates dollar-cost averaging into a token on a schedule, optionally gated on a price condition. Delegates execution to swap and viem integrations for Uniswap trading.
Ships in uniswap-trading-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Dollar-cost-average a fixed amount into a token on a schedule on the operator's target chain, optionally gated on a price condition such as "only buy when ETH is below a threshold".
Runtime Compatibility: This skill uses
AskUserQuestionfor interactive prompts (mode selection, per-transaction confirmation). IfAskUserQuestionis not available in your runtime, collect the same parameters and confirmations through natural language conversation instead.
This is a thin strategy layer. It owns cadence, idempotency, the optional condition check, and guardrails. It does NOT own execution. Every quote, approval, swap, and signature is delegated to swap-integration and viem-integration. The skill never builds quote, approval, swap, or signing logic itself.
The skill does not run a scheduler. The host agent's scheduler (a cron entry or the runtime's wake mechanism) invokes the skill on a cadence. Each invocation is a single, self-contained run that reads state, decides whether to act, optionally acts, and writes state.
check_approval then quote then swap, then sign and broadcast). Do not reimplement any of it.Read these plugin references before acting and treat them as ground truth:
../../references/robinhood-chain.md.../../references/execution-model.md: the Trading API requirement, execution modes, restrictions, and disclaimer rules.../../references/strategy-state.md: the shared state file and scheduler pattern.The selected target-chain template must provide:
Read the bot's JSON state file (see State). If it does not exist, treat this as the first run.
Compute the current period from the configured cadence (for example the UTC day for a daily DCA). If the state file shows a successful buy already recorded for the current period, skip and exit. This makes repeated wakes within one period safe (no double buys).
Resolve the target token to an address by reading the selected target-chain template and its token source. Resolve the fixed buy amount from config. Validate both before use (see Input validation). Do not maintain a local token registry; reuse the template-provided token list or resolver.
Read the configured guardrails. If the per-run spend cap or per-period spend cap is missing, ask the operator for those caps using AskUserQuestion (or natural language if unavailable); include the funding token or denomination used for comparison. If either cap remains unset, do not enter autonomous mode. In confirm mode, proceed only with the per-transaction confirmation gate and report that autonomous mode remains unavailable.
If a condition is configured (for example "only when the last daily candle is red"), evaluate it before buying:
/quote (via swap-integration). Do not use venue-specific APIs or non-Uniswap price feeds for execution data; see ../../references/execution-model.md (Data and pricing). If the condition needs market data Uniswap does not expose, treat that data source as unavailable rather than adding an external dependency.price < 3000 USDC).Be honest about what is satisfiable today. A price-threshold condition (for example "only buy when ETH is below X") works out of the box, because the current price comes from the Trading API /quote.
Before any spend, enforce the guardrails for the active execution mode (see Execution mode): spend cap per run and per period, token allowlist, and the kill switch. If any guardrail blocks the buy, stop and report why.
Also check the wallet can cover the buy: it must hold enough of the funding token (tokenIn) for the buy amount and enough native gas to broadcast. If either is short, skip the buy and report it. Follow the selected template's funding constraints; the skill does not auto-fund, bridge, or top up unless that behavior is explicitly provided outside the skill.
Hand execution to the swap-integration Trading API flow. Pass the target chain id and that chain's router / token addresses from the selected template. The skill MUST NOT build quote, approval, swap, or signing logic of its own; it only supplies parameters (swapper, tokenIn, tokenOut, amount, chain id) and reads back the result.
If the selected template has RPC or raw-transaction constraints, treat them as template caveats. Skills always execute through the Trading API / router path regardless of chain, so router-compatible constraints should not block them.
On a successful broadcast, write the current period, timestamp, and the resulting transaction hash to the state file so the next wake is idempotent. On failure, record the error and leave the period unmarked so a later wake can retry.
The operator who runs the agent chooses an execution mode. See ../../references/execution-model.md for the full model.
| Mode | Behavior |
|---|---|
confirm (default) | Ask the user to approve the transaction before broadcast via AskUserQuestion, showing token, amount, chain, and estimated gas. Reuses the swap-integration spend gate. |
autonomous | Execute without per-transaction prompts, only within guardrails. |
Default to confirm. autonomous mode requires all of: a spend cap (per run and per period), a token allowlist, a dry-run first, and a kill switch. Without all four, fall back to confirm.
Follow the shared pattern in ../../references/strategy-state.md. The dca-bot keeps a small JSON state file so a run knows what previous runs did. Suggested shape:
lastBuyPeriod is the idempotency key: a run buys at most once per period. Compare the current period against lastBuyPeriod before acting, and update it only after a confirmed broadcast.lastAction is the last action taken: a swap, or a skip due to a guardrail or condition. Record the action type, transaction hash, and amount.RWA gating is template-specific and may be enforced at the token level (transfer-restricted ERC-20s), so a swap can revert at transfer time even when the router accepts it. See ../../references/execution-model.md. The skill must:
DISCLAIMER.md to the operator.Before interpolating ANY user-provided or config value into a command, API call, or generated code:
^0x[a-fA-F0-9]{40}$; reject otherwise.^[0-9]+\.?[0-9]*$.;, |, &, $, `, (, ), >, <, \, ', ", or newlines.What SKILL.md sets; muted values are Claude Code's defaults
sonnetThree short reads, in order
3 skills in this plugin
/copy-tradeThis skill should be used when the user asks to "copy trades from" a wallet, "mirror a wallet", "follow this address", set up "copy trading", "track and replicate a trader", or mirror another account's swaps bounded by guardrails. Watches a target wallet and mirrors its trades, filtered by chain, asset match, position size, and the follower's own portfolio state./index-botThis skill should be used when the user asks to "create an index", "build a basket of top assets", "buy a weighted basket", "make a portfolio of assets", "equal-weight basket", "rebalance my portfolio", "track the top N tokens", or wants an automated, weighted multi-asset basket that buys in one pass and rebalances on a cadence. Builds the basket spec, delegates each buy and rebalance swap to the swap-integration Trading API flow, and records target weights in state.npx claudepluginhub uniswap/uniswap-ai --plugin uniswap-trading-toolsOther plugins' skills for the same job