[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CHVMQA0B08FWW0B5SNQ88":3,"skill-same:01M78CHVMQA0B08FWW0B5SNQ88":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M78CHVMQA0B08FWW0B5SNQ88","moonpay-trading-automation",null,"Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron\u002Flaunchd).","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fmoonpay-trading-automation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: moonpay-trading-automation\ndescription: Set up automated trading strategies — DCA, limit orders, and stop losses — by composing mp CLI commands with OS scheduling (cron\u002Flaunchd).\ntags: [trading, automation]\n---\n\n# Trading automation\n\n## Goal\n\nCompose `mp` CLI commands with OS scheduling (cron\u002Flaunchd) 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.\n\n## Prerequisites\n\n- Authenticated: `mp user retrieve`\n- Funded wallet: `mp token balance list --wallet \u003Cname> --chain \u003Cchain>`\n- `mp` binary on PATH: `which mp` (note the full path for scheduled scripts)\n- `jq` installed: `which jq`\n\n## Shell script pattern\n\nEvery strategy uses the same base pattern. Scripts live in `~\u002F.config\u002Fmoonpay\u002Fscripts\u002F` and log to `~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log`.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n\nMP=\"$(which mp)\"  # absolute path for cron\u002Flaunchd\nLOG=\"$HOME\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\"\nmkdir -p \"$(dirname \"$LOG\")\"\n\nlog() { echo \"[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*\" >> \"$LOG\"; }\n\n# --- Config (agent fills these in) ---\nWALLET=\"main\"\nCHAIN=\"solana\"\nFROM_TOKEN=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"  # USDC\nTO_TOKEN=\"So11111111111111111111111111111111111111111\"         # SOL\nAMOUNT=5\n\n# --- Execute ---\nlog \"SWAP: $AMOUNT $FROM_TOKEN -> $TO_TOKEN on $CHAIN\"\nRESULT=$(\"$MP\" --json token swap \\\n  --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n  --from-token \"$FROM_TOKEN\" --from-amount \"$AMOUNT\" \\\n  --to-token \"$TO_TOKEN\" 2>&1) || {\n  log \"FAILED: $RESULT\"\n  exit 1\n}\nlog \"OK: $RESULT\"\n```\n\nKey points:\n- `mp --json` outputs single-line JSON, ideal for `jq` parsing\n- Use `$(which mp)` and store as `MP` — cron\u002Flaunchd have minimal PATH\n- Wallet names only in scripts — `mp` handles keychain decryption at runtime\n- If the user gives token names\u002Fsymbols, resolve to addresses first with `mp token search`\n\n## DCA (Dollar-Cost Averaging)\n\n\"Buy $5 of SOL every day at 9am\"\n\n### Script: `~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh`\n\nUse the base pattern above with the user's token, amount, wallet, and chain.\n\n### Schedule with cron (Linux)\n\n```bash\n# Buy $5 of SOL daily at 9am UTC — moonpay:dca-sol\n0 9 * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh\n```\n\nAdd with: `(crontab -l 2>\u002Fdev\u002Fnull; echo '0 9 * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh # moonpay:dca-sol') | crontab -`\n\nCommon intervals:\n- Every hour: `0 * * * *`\n- Every 4 hours: `0 *\u002F4 * * *`\n- Daily at 9am: `0 9 * * *`\n- Weekly Monday 9am: `0 9 * * 1`\n\n### Schedule with launchd (macOS)\n\nWrite a plist to `~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist`:\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n  \u003Ckey>Label\u003C\u002Fkey>\n  \u003Cstring>com.moonpay.dca-sol\u003C\u002Fstring>\n  \u003Ckey>ProgramArguments\u003C\u002Fkey>\n  \u003Carray>\n    \u003Cstring>\u002Fbin\u002Fbash\u003C\u002Fstring>\n    \u003Cstring>\u002FUsers\u002FUSERNAME\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh\u003C\u002Fstring>\n  \u003C\u002Farray>\n  \u003Ckey>StartCalendarInterval\u003C\u002Fkey>\n  \u003Cdict>\n    \u003Ckey>Hour\u003C\u002Fkey>\n    \u003Cinteger>9\u003C\u002Finteger>\n    \u003Ckey>Minute\u003C\u002Fkey>\n    \u003Cinteger>0\u003C\u002Finteger>\n  \u003C\u002Fdict>\n  \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n  \u003Cstring>\u002FUsers\u002FUSERNAME\u002F.config\u002Fmoonpay\u002Flogs\u002Fdca-sol.err\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\n```\n\nLoad with: `launchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist`\n\n**Important:** Tilde (`~`) does NOT expand in plist files. Always use the full path (e.g., `\u002FUsers\u002FUSERNAME\u002F...`). Get it with `echo $HOME`.\n\n## Limit order\n\n\"Buy SOL when price drops below $80\"\n\n### Script: `~\u002F.config\u002Fmoonpay\u002Fscripts\u002Flimit-buy-sol.sh`\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n\nMP=\"$(which mp)\"\nLOG=\"$HOME\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\"\nmkdir -p \"$(dirname \"$LOG\")\"\nlog() { echo \"[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*\" >> \"$LOG\"; }\n\n# --- Config ---\nWALLET=\"main\"\nCHAIN=\"solana\"\nTOKEN=\"So11111111111111111111111111111111111111111\"\nBUY_WITH=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"  # USDC\nBUY_AMOUNT=50\nTARGET_PRICE=80\nSCRIPT_NAME=\"limit-buy-sol\"\n\n# --- Check price ---\nPRICE=$(\"$MP\" --json token search --query \"$TOKEN\" --chain \"$CHAIN\" | jq -r '.items[0].marketData.price')\n\nif [ -z \"$PRICE\" ] || [ \"$PRICE\" = \"null\" ]; then\n  log \"LIMIT $SCRIPT_NAME: price fetch failed, skipping\"\n  exit 0\nfi\n\n# --- Compare ---\nif (( $(echo \"$PRICE \u003C $TARGET_PRICE\" | bc -l) )); then\n  log \"LIMIT $SCRIPT_NAME: price $PRICE \u003C $TARGET_PRICE — executing buy\"\n  RESULT=$(\"$MP\" --json token swap \\\n    --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n    --from-token \"$BUY_WITH\" --from-amount \"$BUY_AMOUNT\" \\\n    --to-token \"$TOKEN\" 2>&1) || {\n    log \"LIMIT $SCRIPT_NAME FAILED: $RESULT\"\n    exit 1\n  }\n  log \"LIMIT $SCRIPT_NAME OK: bought at $PRICE — $RESULT\"\n\n  # Self-disable after fill\n  if [[ \"$OSTYPE\" == \"darwin\"* ]]; then\n    launchctl unload \"$HOME\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.${SCRIPT_NAME}.plist\" 2>\u002Fdev\u002Fnull || true\n  else\n    crontab -l | grep -v \"$SCRIPT_NAME\" | crontab -\n  fi\n  log \"LIMIT $SCRIPT_NAME: disabled after fill\"\nelse\n  log \"LIMIT $SCRIPT_NAME: price $PRICE >= $TARGET_PRICE — waiting\"\nfi\n```\n\nSchedule every 5 minutes:\n- Cron: `*\u002F5 * * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Flimit-buy-sol.sh # moonpay:limit-buy-sol`\n- Launchd: use `\u003Ckey>StartInterval\u003C\u002Fkey>\u003Cinteger>300\u003C\u002Finteger>` instead of `StartCalendarInterval`\n\n## Stop loss\n\n\"Sell all my SOL if price drops below $70\"\n\nSame structure as limit order but sells instead of buys. For \"sell all\", query the balance first:\n\n```bash\n# --- Config ---\nSELL_TOKEN=\"So11111111111111111111111111111111111111111\"   # SOL\nTO_TOKEN=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" # USDC\nTRIGGER_PRICE=70\nSCRIPT_NAME=\"stop-loss-sol\"\n\n# --- Check price ---\nPRICE=$(\"$MP\" --json token search --query \"$SELL_TOKEN\" --chain \"$CHAIN\" | jq -r '.items[0].marketData.price')\n\nif (( $(echo \"$PRICE \u003C $TRIGGER_PRICE\" | bc -l) )); then\n  # Get current balance to sell all\n  BALANCE=$(\"$MP\" --json token balance list --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n    | jq -r --arg addr \"$SELL_TOKEN\" '.items[] | select(.address == $addr) | .balance.amount')\n\n  if [ -n \"$BALANCE\" ] && (( $(echo \"$BALANCE > 0\" | bc -l) )); then\n    log \"STOP-LOSS $SCRIPT_NAME: price $PRICE \u003C $TRIGGER_PRICE — selling $BALANCE\"\n    RESULT=$(\"$MP\" --json token swap \\\n      --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n      --from-token \"$SELL_TOKEN\" --from-amount \"$BALANCE\" \\\n      --to-token \"$TO_TOKEN\" 2>&1) || {\n      log \"STOP-LOSS $SCRIPT_NAME FAILED: $RESULT\"\n      exit 1\n    }\n    log \"STOP-LOSS $SCRIPT_NAME OK: sold at $PRICE — $RESULT\"\n    # Self-disable (same pattern as limit order)\n  fi\nfi\n```\n\n## Managing automations\n\n### List active automations\n\n```bash\n# macOS\nlaunchctl list | grep moonpay\n\n# Linux\ncrontab -l | grep moonpay\n```\n\n### Remove an automation\n\n```bash\n# macOS\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist\nrm ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist\n\n# Linux\ncrontab -l | grep -v \"moonpay:dca-sol\" | crontab -\n```\n\n### View logs\n\n```bash\ntail -50 ~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\n```\n\n### Pause \u002F resume (macOS only)\n\n```bash\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist   # pause\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist     # resume\n```\n\n## Platform detection\n\nDetect the OS and use the appropriate scheduler:\n\n```bash\nif [[ \"$OSTYPE\" == \"darwin\"* ]]; then\n  # macOS: use launchd (fires even if machine was asleep)\nelse\n  # Linux: use crontab\nfi\n```\n\n## Tips\n\n- Start with a small DCA amount to verify the setup works before going bigger\n- Check logs after the first run: `tail -20 ~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log`\n- Scripts don't contain secrets — `mp` decrypts wallets via OS keychain at runtime\n- The machine must be logged in (user session active) for keychain access to work\n- Price checks via `mp token search` are free; swaps cost gas\n- Limit order checks every 5 minutes is reasonable — don't go below 1 minute\n- Use `bc -l` for decimal price comparison (bash can't compare floats natively)\n- If `bc` isn't available, use: `awk \"BEGIN {exit !($PRICE \u003C $TARGET)}\"`\n- Always tag cron entries with `# moonpay:{name}` so they can be found and removed\n\n## Related skills\n\n- **moonpay-swap-tokens** — Swap and bridge command syntax\n- **moonpay-check-wallet** — Check balances before setting up automation\n- **moonpay-discover-tokens** — Research tokens and resolve addresses\n- **moonpay-price-alerts** — Observe-only price notifications (no trading)\n","# Trading automation\n\n## Goal\n\nCompose `mp` CLI commands with OS scheduling (cron\u002Flaunchd) 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.\n\n## Prerequisites\n\n- Authenticated: `mp user retrieve`\n- Funded wallet: `mp token balance list --wallet \u003Cname> --chain \u003Cchain>`\n- `mp` binary on PATH: `which mp` (note the full path for scheduled scripts)\n- `jq` installed: `which jq`\n\n## Shell script pattern\n\nEvery strategy uses the same base pattern. Scripts live in `~\u002F.config\u002Fmoonpay\u002Fscripts\u002F` and log to `~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log`.\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n\nMP=\"$(which mp)\"  # absolute path for cron\u002Flaunchd\nLOG=\"$HOME\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\"\nmkdir -p \"$(dirname \"$LOG\")\"\n\nlog() { echo \"[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*\" >> \"$LOG\"; }\n\n# --- Config (agent fills these in) ---\nWALLET=\"main\"\nCHAIN=\"solana\"\nFROM_TOKEN=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"  # USDC\nTO_TOKEN=\"So11111111111111111111111111111111111111111\"         # SOL\nAMOUNT=5\n\n# --- Execute ---\nlog \"SWAP: $AMOUNT $FROM_TOKEN -> $TO_TOKEN on $CHAIN\"\nRESULT=$(\"$MP\" --json token swap \\\n  --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n  --from-token \"$FROM_TOKEN\" --from-amount \"$AMOUNT\" \\\n  --to-token \"$TO_TOKEN\" 2>&1) || {\n  log \"FAILED: $RESULT\"\n  exit 1\n}\nlog \"OK: $RESULT\"\n```\n\nKey points:\n- `mp --json` outputs single-line JSON, ideal for `jq` parsing\n- Use `$(which mp)` and store as `MP` — cron\u002Flaunchd have minimal PATH\n- Wallet names only in scripts — `mp` handles keychain decryption at runtime\n- If the user gives token names\u002Fsymbols, resolve to addresses first with `mp token search`\n\n## DCA (Dollar-Cost Averaging)\n\n\"Buy $5 of SOL every day at 9am\"\n\n### Script: `~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh`\n\nUse the base pattern above with the user's token, amount, wallet, and chain.\n\n### Schedule with cron (Linux)\n\n```bash\n# Buy $5 of SOL daily at 9am UTC — moonpay:dca-sol\n0 9 * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh\n```\n\nAdd with: `(crontab -l 2>\u002Fdev\u002Fnull; echo '0 9 * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh # moonpay:dca-sol') | crontab -`\n\nCommon intervals:\n- Every hour: `0 * * * *`\n- Every 4 hours: `0 *\u002F4 * * *`\n- Daily at 9am: `0 9 * * *`\n- Weekly Monday 9am: `0 9 * * 1`\n\n### Schedule with launchd (macOS)\n\nWrite a plist to `~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist`:\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n  \u003Ckey>Label\u003C\u002Fkey>\n  \u003Cstring>com.moonpay.dca-sol\u003C\u002Fstring>\n  \u003Ckey>ProgramArguments\u003C\u002Fkey>\n  \u003Carray>\n    \u003Cstring>\u002Fbin\u002Fbash\u003C\u002Fstring>\n    \u003Cstring>\u002FUsers\u002FUSERNAME\u002F.config\u002Fmoonpay\u002Fscripts\u002Fdca-sol.sh\u003C\u002Fstring>\n  \u003C\u002Farray>\n  \u003Ckey>StartCalendarInterval\u003C\u002Fkey>\n  \u003Cdict>\n    \u003Ckey>Hour\u003C\u002Fkey>\n    \u003Cinteger>9\u003C\u002Finteger>\n    \u003Ckey>Minute\u003C\u002Fkey>\n    \u003Cinteger>0\u003C\u002Finteger>\n  \u003C\u002Fdict>\n  \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n  \u003Cstring>\u002FUsers\u002FUSERNAME\u002F.config\u002Fmoonpay\u002Flogs\u002Fdca-sol.err\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\n```\n\nLoad with: `launchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist`\n\n**Important:** Tilde (`~`) does NOT expand in plist files. Always use the full path (e.g., `\u002FUsers\u002FUSERNAME\u002F...`). Get it with `echo $HOME`.\n\n## Limit order\n\n\"Buy SOL when price drops below $80\"\n\n### Script: `~\u002F.config\u002Fmoonpay\u002Fscripts\u002Flimit-buy-sol.sh`\n\n```bash\n#!\u002Fbin\u002Fbash\nset -euo pipefail\n\nMP=\"$(which mp)\"\nLOG=\"$HOME\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\"\nmkdir -p \"$(dirname \"$LOG\")\"\nlog() { echo \"[$(date -u +%Y-%m-%dT%H:%M:%SZ)] $*\" >> \"$LOG\"; }\n\n# --- Config ---\nWALLET=\"main\"\nCHAIN=\"solana\"\nTOKEN=\"So11111111111111111111111111111111111111111\"\nBUY_WITH=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\"  # USDC\nBUY_AMOUNT=50\nTARGET_PRICE=80\nSCRIPT_NAME=\"limit-buy-sol\"\n\n# --- Check price ---\nPRICE=$(\"$MP\" --json token search --query \"$TOKEN\" --chain \"$CHAIN\" | jq -r '.items[0].marketData.price')\n\nif [ -z \"$PRICE\" ] || [ \"$PRICE\" = \"null\" ]; then\n  log \"LIMIT $SCRIPT_NAME: price fetch failed, skipping\"\n  exit 0\nfi\n\n# --- Compare ---\nif (( $(echo \"$PRICE \u003C $TARGET_PRICE\" | bc -l) )); then\n  log \"LIMIT $SCRIPT_NAME: price $PRICE \u003C $TARGET_PRICE — executing buy\"\n  RESULT=$(\"$MP\" --json token swap \\\n    --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n    --from-token \"$BUY_WITH\" --from-amount \"$BUY_AMOUNT\" \\\n    --to-token \"$TOKEN\" 2>&1) || {\n    log \"LIMIT $SCRIPT_NAME FAILED: $RESULT\"\n    exit 1\n  }\n  log \"LIMIT $SCRIPT_NAME OK: bought at $PRICE — $RESULT\"\n\n  # Self-disable after fill\n  if [[ \"$OSTYPE\" == \"darwin\"* ]]; then\n    launchctl unload \"$HOME\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.${SCRIPT_NAME}.plist\" 2>\u002Fdev\u002Fnull || true\n  else\n    crontab -l | grep -v \"$SCRIPT_NAME\" | crontab -\n  fi\n  log \"LIMIT $SCRIPT_NAME: disabled after fill\"\nelse\n  log \"LIMIT $SCRIPT_NAME: price $PRICE >= $TARGET_PRICE — waiting\"\nfi\n```\n\nSchedule every 5 minutes:\n- Cron: `*\u002F5 * * * * ~\u002F.config\u002Fmoonpay\u002Fscripts\u002Flimit-buy-sol.sh # moonpay:limit-buy-sol`\n- Launchd: use `\u003Ckey>StartInterval\u003C\u002Fkey>\u003Cinteger>300\u003C\u002Finteger>` instead of `StartCalendarInterval`\n\n## Stop loss\n\n\"Sell all my SOL if price drops below $70\"\n\nSame structure as limit order but sells instead of buys. For \"sell all\", query the balance first:\n\n```bash\n# --- Config ---\nSELL_TOKEN=\"So11111111111111111111111111111111111111111\"   # SOL\nTO_TOKEN=\"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\" # USDC\nTRIGGER_PRICE=70\nSCRIPT_NAME=\"stop-loss-sol\"\n\n# --- Check price ---\nPRICE=$(\"$MP\" --json token search --query \"$SELL_TOKEN\" --chain \"$CHAIN\" | jq -r '.items[0].marketData.price')\n\nif (( $(echo \"$PRICE \u003C $TRIGGER_PRICE\" | bc -l) )); then\n  # Get current balance to sell all\n  BALANCE=$(\"$MP\" --json token balance list --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n    | jq -r --arg addr \"$SELL_TOKEN\" '.items[] | select(.address == $addr) | .balance.amount')\n\n  if [ -n \"$BALANCE\" ] && (( $(echo \"$BALANCE > 0\" | bc -l) )); then\n    log \"STOP-LOSS $SCRIPT_NAME: price $PRICE \u003C $TRIGGER_PRICE — selling $BALANCE\"\n    RESULT=$(\"$MP\" --json token swap \\\n      --wallet \"$WALLET\" --chain \"$CHAIN\" \\\n      --from-token \"$SELL_TOKEN\" --from-amount \"$BALANCE\" \\\n      --to-token \"$TO_TOKEN\" 2>&1) || {\n      log \"STOP-LOSS $SCRIPT_NAME FAILED: $RESULT\"\n      exit 1\n    }\n    log \"STOP-LOSS $SCRIPT_NAME OK: sold at $PRICE — $RESULT\"\n    # Self-disable (same pattern as limit order)\n  fi\nfi\n```\n\n## Managing automations\n\n### List active automations\n\n```bash\n# macOS\nlaunchctl list | grep moonpay\n\n# Linux\ncrontab -l | grep moonpay\n```\n\n### Remove an automation\n\n```bash\n# macOS\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist\nrm ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist\n\n# Linux\ncrontab -l | grep -v \"moonpay:dca-sol\" | crontab -\n```\n\n### View logs\n\n```bash\ntail -50 ~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log\n```\n\n### Pause \u002F resume (macOS only)\n\n```bash\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist   # pause\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.moonpay.dca-sol.plist     # resume\n```\n\n## Platform detection\n\nDetect the OS and use the appropriate scheduler:\n\n```bash\nif [[ \"$OSTYPE\" == \"darwin\"* ]]; then\n  # macOS: use launchd (fires even if machine was asleep)\nelse\n  # Linux: use crontab\nfi\n```\n\n## Tips\n\n- Start with a small DCA amount to verify the setup works before going bigger\n- Check logs after the first run: `tail -20 ~\u002F.config\u002Fmoonpay\u002Flogs\u002Ftrading.log`\n- Scripts don't contain secrets — `mp` decrypts wallets via OS keychain at runtime\n- The machine must be logged in (user session active) for keychain access to work\n- Price checks via `mp token search` are free; swaps cost gas\n- Limit order checks every 5 minutes is reasonable — don't go below 1 minute\n- Use `bc -l` for decimal price comparison (bash can't compare floats natively)\n- If `bc` isn't available, use: `awk \"BEGIN {exit !($PRICE \u003C $TARGET)}\"`\n- Always tag cron entries with `# moonpay:{name}` so they can be found and removed\n\n## Related skills\n\n- **moonpay-swap-tokens** — Swap and bridge command syntax\n- **moonpay-check-wallet** — Check balances before setting up automation\n- **moonpay-discover-tokens** — Research tokens and resolve addresses\n- **moonpay-price-alerts** — Observe-only price notifications (no trading)\n",{"name":5,"tags":24,"description":7},[25,26],"trading","automation","main","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fmoonpay-trading-automation","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Solizardking\u002Fskillhub-main --skill moonpay-trading-automation",{"tool":42,"command":43},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill moonpay-trading-automation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill moonpay-trading-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fmoonpay-trading-automation\u002FSKILL.md",true,[],[51,58,65,72,79,87],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]