Agent skill

Moonpay Trading Automation

by moonpay in moonpay/skills

Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd).

MITAuto-check passedBusiness, Finance & HR

Install Moonpay Trading Automation

skills CLI
$ npx skills add moonpay/skills --skill moonpay-trading-automation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install moonpay/skills moonpay-trading-automation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/moonpay/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/moonpay-trading-automation .claude/skills/moonpay-trading-automation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
moonpay-trading-automation
GitHub stars
113
Token cost
~2.1k tokens
SKILL.md length
441 words
Files
1
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd).

  • Tasks that involve Trading and backtesting
  • SKILL.md covers Goal, Prerequisites, Shell script pattern and DCA (Dollar-Cost Averaging), plus 6 more sections
  • Calls jq; reaches apple.com; needs TO_TOKEN and SELL_TOKEN
  • Tasks that involve Scheduled and recurring tasks

What it does

Moonpay Trading Automation is an agent skill from moonpay/skills. Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd).

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Trading and backtesting and Scheduled and recurring tasks. The repository describes itself as: Skills for AI agents to move money — on-ramps, swaps, wallets, deposits, and more via the MoonPay CLI. The licence is MIT.

When your agent uses it

  • Tasks that involve Trading and backtesting
  • Tasks that involve Scheduled and recurring tasks

Example prompts

  • “/moonpay-trading-automation”

Requirements

  • A credential in FROM_TOKEN
  • A credential in SELL_TOKEN

What it can do on your machine

Read from SKILL.md and the folder at commit aa672ab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • apple.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • TO_TOKEN
    • SELL_TOKEN
    • FROM_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Moonpay Trading Automation loads about 2.1k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 441 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from moonpay/skills at commit aa672ab, republished under its MIT licence (© moonpay). 441 words, ~2,114 tokens.

Download SKILL.mdSave it as .claude/skills/moonpay-trading-automation/SKILL.md (or your agent's skills folder).
name
moonpay-trading-automation
description
Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd).
tags
trading, automation

Trading automation

Goal

Compose mp CLI commands with OS scheduling (cron/launchd) to run unattended trading strategies: dollar-cost averaging, limit orders, and stop losses. The agent generates shell scripts and schedules them — no new tools needed.

Prerequisites

  • Authenticated: mp user retrieve
  • Funded wallet: mp token balance list --wallet <name> --chain <chain>
  • mp binary on PATH: which mp (note the full path for scheduled scripts)
  • jq installed: which jq

Shell script pattern

Every strategy uses the same base pattern. Scripts live in ~/.config/moonpay/scripts/ and log to ~/.config/moonpay/logs/trading.log.

bash
#!/bin/bash
set -euo pipefail

MP="$(which mp)"  # absolute path for cron/launchd
LOG="$HOME/.config/moonpay/logs/trading.log"
mkdir -p "$(dirname "$LOG")"

log() { echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*" >> "$LOG"; }

# --- Config (agent fills these in) ---
WALLET="main"
CHAIN="solana"
FROM_TOKEN="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"  # USDC
TO_TOKEN="So11111111111111111111111111111111111111111"         # SOL
AMOUNT=5

# --- Execute ---
log "SWAP: $AMOUNT $FROM_TOKEN -> $TO_TOKEN on $CHAIN"
RESULT=$("$MP" --json token swap \
  --wallet "$WALLET" --chain "$CHAIN" \
  --from-token "$FROM_TOKEN" --from-amount "$AMOUNT" \
  --to-token "$TO_TOKEN" 2>&1) || {
  log "FAILED: $RESULT"
  exit 1
}
log "OK: $RESULT"

Key points:

  • mp --json outputs single-line JSON, ideal for jq parsing
  • Use $(which mp) and store as MP — cron/launchd have minimal PATH
  • Wallet names only in scripts — mp handles keychain decryption at runtime
  • If the user gives token names/symbols, resolve to addresses first with mp token search

DCA (Dollar-Cost Averaging)

"Buy $5 of SOL every day at 9am"

Script: ~/.config/moonpay/scripts/dca-sol.sh

Use the base pattern above with the user's token, amount, wallet, and chain.

Schedule with cron (Linux)
bash
# Buy $5 of SOL daily at 9am UTC — moonpay:dca-sol
0 9 * * * ~/.config/moonpay/scripts/dca-sol.sh

Add with: (crontab -l 2>/dev/null; echo '0 9 * * * ~/.config/moonpay/scripts/dca-sol.sh # moonpay:dca-sol') | crontab -

Common intervals:

  • Every hour: 0 * * * *
  • Every 4 hours: 0 */4 * * *
  • Daily at 9am: 0 9 * * *
  • Weekly Monday 9am: 0 9 * * 1
Schedule with launchd (macOS)

Write a plist to ~/Library/LaunchAgents/com.moonpay.dca-sol.plist:

xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.moonpay.dca-sol</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/bash</string>
    <string>/Users/USERNAME/.config/moonpay/scripts/dca-sol.sh</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Hour</key>
    <integer>9</integer>
    <key>Minute</key>
    <integer>0</integer>
  </dict>
  <key>StandardErrorPath</key>
  <string>/Users/USERNAME/.config/moonpay/logs/dca-sol.err</string>
</dict>
</plist>

Load with: launchctl load ~/Library/LaunchAgents/com.moonpay.dca-sol.plist

Important: Tilde (~) does NOT expand in plist files. Always use the full path (e.g., /Users/USERNAME/...). Get it with echo $HOME.

Limit order

"Buy SOL when price drops below $80"

Script: ~/.config/moonpay/scripts/limit-buy-sol.sh
bash
#!/bin/bash
set -euo pipefail

MP="$(which mp)"
LOG="$HOME/.config/moonpay/logs/trading.log"
mkdir -p "$(dirname "$LOG")"
log() { echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*" >> "$LOG"; }

# --- Config ---
WALLET="main"
CHAIN="solana"
TOKEN="So11111111111111111111111111111111111111111"
BUY_WITH="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"  # USDC
BUY_AMOUNT=50
TARGET_PRICE=80
SCRIPT_NAME="limit-buy-sol"

# --- Check price ---
PRICE=$("$MP" --json token search --query "$TOKEN" --chain "$CHAIN" | jq -r '.items[0].marketData.price')

if [ -z "$PRICE" ] || [ "$PRICE" = "null" ]; then
  log "LIMIT $SCRIPT_NAME: price fetch failed, skipping"
  exit 0
fi

# --- Compare ---
if (( $(echo "$PRICE < $TARGET_PRICE" | bc -l) )); then
  log "LIMIT $SCRIPT_NAME: price $PRICE < $TARGET_PRICE — executing buy"
  RESULT=$("$MP" --json token swap \
    --wallet "$WALLET" --chain "$CHAIN" \
    --from-token "$BUY_WITH" --from-amount "$BUY_AMOUNT" \
    --to-token "$TOKEN" 2>&1) || {
    log "LIMIT $SCRIPT_NAME FAILED: $RESULT"
    exit 1
  }
  log "LIMIT $SCRIPT_NAME OK: bought at $PRICE — $RESULT"

  # Self-disable after fill
  if [[ "$OSTYPE" == "darwin"* ]]; then
    launchctl unload "$HOME/Library/LaunchAgents/com.moonpay.${SCRIPT_NAME}.plist" 2>/dev/null || true
  else
    crontab -l | grep -v "$SCRIPT_NAME" | crontab -
  fi
  log "LIMIT $SCRIPT_NAME: disabled after fill"
else
  log "LIMIT $SCRIPT_NAME: price $PRICE >= $TARGET_PRICE — waiting"
fi

Schedule every 5 minutes:

  • Cron: */5 * * * * ~/.config/moonpay/scripts/limit-buy-sol.sh # moonpay:limit-buy-sol
  • Launchd: use <key>StartInterval</key><integer>300</integer> instead of StartCalendarInterval
Show full SKILL.md (188 more words)Show less

Stop loss

"Sell all my SOL if price drops below $70"

Same structure as limit order but sells instead of buys. For "sell all", query the balance first:

bash
# --- Config ---
SELL_TOKEN="So11111111111111111111111111111111111111111"   # SOL
TO_TOKEN="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" # USDC
TRIGGER_PRICE=70
SCRIPT_NAME="stop-loss-sol"

# --- Check price ---
PRICE=$("$MP" --json token search --query "$SELL_TOKEN" --chain "$CHAIN" | jq -r '.items[0].marketData.price')

if (( $(echo "$PRICE < $TRIGGER_PRICE" | bc -l) )); then
  # Get current balance to sell all
  BALANCE=$("$MP" --json token balance list --wallet "$WALLET" --chain "$CHAIN" \
    | jq -r --arg addr "$SELL_TOKEN" '.items[] | select(.address == $addr) | .balance.amount')

  if [ -n "$BALANCE" ] && (( $(echo "$BALANCE > 0" | bc -l) )); then
    log "STOP-LOSS $SCRIPT_NAME: price $PRICE < $TRIGGER_PRICE — selling $BALANCE"
    RESULT=$("$MP" --json token swap \
      --wallet "$WALLET" --chain "$CHAIN" \
      --from-token "$SELL_TOKEN" --from-amount "$BALANCE" \
      --to-token "$TO_TOKEN" 2>&1) || {
      log "STOP-LOSS $SCRIPT_NAME FAILED: $RESULT"
      exit 1
    }
    log "STOP-LOSS $SCRIPT_NAME OK: sold at $PRICE — $RESULT"
    # Self-disable (same pattern as limit order)
  fi
fi

Managing automations

List active automations
bash
# macOS
launchctl list | grep moonpay

# Linux
crontab -l | grep moonpay
Remove an automation
bash
# macOS
launchctl unload ~/Library/LaunchAgents/com.moonpay.dca-sol.plist
rm ~/Library/LaunchAgents/com.moonpay.dca-sol.plist

# Linux
crontab -l | grep -v "moonpay:dca-sol" | crontab -
View logs
bash
tail -50 ~/.config/moonpay/logs/trading.log
Pause / resume (macOS only)
bash
launchctl unload ~/Library/LaunchAgents/com.moonpay.dca-sol.plist   # pause
launchctl load ~/Library/LaunchAgents/com.moonpay.dca-sol.plist     # resume

Platform detection

Detect the OS and use the appropriate scheduler:

bash
if [[ "$OSTYPE" == "darwin"* ]]; then
  # macOS: use launchd (fires even if machine was asleep)
else
  # Linux: use crontab
fi

Tips

  • Start with a small DCA amount to verify the setup works before going bigger
  • Check logs after the first run: tail -20 ~/.config/moonpay/logs/trading.log
  • Scripts don't contain secrets — mp decrypts wallets via OS keychain at runtime
  • The machine must be logged in (user session active) for keychain access to work
  • Price checks via mp token search are free; swaps cost gas
  • Limit order checks every 5 minutes is reasonable — don't go below 1 minute
  • Use bc -l for decimal price comparison (bash can't compare floats natively)
  • If bc isn't available, use: awk "BEGIN {exit !($PRICE < $TARGET)}"
  • Always tag cron entries with # moonpay:{name} so they can be found and removed
  • moonpay-swap-tokens — Swap and bridge command syntax
  • moonpay-check-wallet — Check balances before setting up automation
  • moonpay-discover-tokens — Research tokens and resolve addresses
  • moonpay-price-alerts — Observe-only price notifications (no trading)

© moonpay, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/moonpay-trading-automation of moonpay/skills.

Open the folder on GitHubat commit aa672ab

Compare with similar skills

Moonpay Trading Automation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Moonpay Trading Automation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Moonpay Trading Automation this skillmoonpay/skills113—~2.1kAutomated safety check: PassMIT
Solana Sniper Botnpc-live/clawfirm156—~913Automated safety check: NotesNone
Okx Growth Competitioninternet-court/internet-court-skill6.6k2 repos~3kAutomated safety check: PassMIT
Memory Reconciledigipulse-engineering/GAAI-framework163—~2.8kAutomated safety check: PassCustom licence
PolymarketCraftOS-dev/CraftBot392—~1.6kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone

Similar skills

  • Solana Sniper Bot

    npc-live/clawfirm

    Autonomous Solana token sniper and trading bot. An agent skill from npc-live/clawfirm.

    156 GitHub stars~913 tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check: notes
  • Okx Growth Competition

    internet-court/internet-court-skill

    List OKX Agentic Wallet exclusive trading competitions, register users for contests, track participation and leaderboard rankings, and claim won rewards.

    6.6k GitHub starsUsed in 2 repos~3k tokens
    Business, Finance & HRAuto-check passed
  • Memory Reconcile

    digipulse-engineering/GAAI-framework

    Scan all memory files, documentation (/docs//.md), and README files (/README.md) for drift, contradictions, and stale references.

    163 GitHub stars~2.8k tokensUpdated 11 days ago
    Business, Finance & HRAuto-check passed
  • Polymarket

    CraftOS-dev/CraftBot

    Query Polymarket prediction markets - check odds, trending markets, search events, track prices and momentum.

    392 GitHub stars~1.6k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed

More from moonpay/skills

All 39 skills in this repo
  • A skill your agent uses when accessing Alchemy APIs for RPC calls, token balances, NFT metadata, asset transfers, transaction simulation, or Alchemy-specific features.

    113 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check: notes
  • Alchemy API

    moonpay/skills

    Integrates Alchemy blockchain APIs using an API key. An agent skill from moonpay/skills.

    113 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Allium Onchain Data

    moonpay/skills

    Query blockchain data via Allium APIs. An agent skill from moonpay/skills.

    113 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Corbits Marketplace

    moonpay/skills

    Paid API marketplace for AI agents via Corbits. An agent skill from moonpay/skills.

    113 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Dune Analytics

    moonpay/skills

    Blockchain analytics via Dune REST API — execute DuneSQL queries against live on-chain data, discover decoded contract tables, and monitor credit usage.

    113 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Moonpay Auth

    moonpay/skills

    Set up the MoonPay CLI, authenticate, and manage local wallets.

    113 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Moonpay Trading Automation

What does Moonpay Trading Automation do?

Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd). Moonpay Trading Automation is an agent skill from moonpay/skills. Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron/launchd).

When should I use Moonpay Trading Automation?

Moonpay Trading Automation fits situations like: tasks that involve Trading and backtesting; tasks that involve Scheduled and recurring tasks.

How do I install Moonpay Trading Automation in Claude Code?

Run `npx skills add moonpay/skills --skill moonpay-trading-automation -a claude-code`. Or copy the skill folder (skills/moonpay-trading-automation in moonpay/skills) into .claude/skills/moonpay-trading-automation in your project. Claude Code loads it when a task matches its description.

How do I install Moonpay Trading Automation in Codex?

Run `npx skills add moonpay/skills --skill moonpay-trading-automation -a codex`. Or copy the skill folder (skills/moonpay-trading-automation in moonpay/skills) into .agents/skills/moonpay-trading-automation in your project. Codex loads it when a task matches its description.

Can I use Moonpay Trading Automation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add moonpay/skills --skill moonpay-trading-automation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/moonpay-trading-automation, .gemini/skills/moonpay-trading-automation, .github/skills/moonpay-trading-automation and .opencode/skills/moonpay-trading-automation in your project.

What does Moonpay Trading Automation need to run?

Going by SKILL.md and its folder, Moonpay Trading Automation needs the command-line tools its instructions call (jq) and credentials named TO_TOKEN, SELL_TOKEN and FROM_TOKEN. Our summary lists: A credential in FROM_TOKEN; A credential in SELL_TOKEN.

Does Moonpay Trading Automation access the network?

SKILL.md names 1 domain. In commands or code: apple.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Moonpay Trading Automation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Moonpay Trading Automation use?

Moonpay Trading Automation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Moonpay Trading Automation use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Moonpay Trading Automation?

Skills that share tags, products or a category with Moonpay Trading Automation: Solana Sniper Bot (npc-live/clawfirm, 156 stars), Okx Growth Competition (internet-court/internet-court-skill, 6.6k stars), Memory Reconcile (digipulse-engineering/GAAI-framework, 163 stars) and Polymarket (CraftOS-dev/CraftBot, 392 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Moonpay Trading Automation?

moonpay (a GitHub organization) maintains it in moonpay/skills, which has 113 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on September 10, 2026.

Source: moonpay/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.