trade-tokens
Baseネットワーク上で、USDCやETHなどのトークンを売買、交換、変換したい場合に、「ETHを買う」「USDCをETHに変換する」といった具体的な指示に基づいてトークン取引をスムーズに行うSkill。
📜 元の英語説明(参考)
Swap or trade tokens on Base network. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and WETH. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH", "swap tokens", "trade USDC for WETH".
🇯🇵 日本人クリエイター向け解説
Baseネットワーク上で、USDCやETHなどのトークンを売買、交換、変換したい場合に、「ETHを買う」「USDCをETHに変換する」といった具体的な指示に基づいてトークン取引をスムーズに行うSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o trade-tokens.zip https://jpskill.com/download/10471.zip && unzip -o trade-tokens.zip && rm trade-tokens.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10471.zip -OutFile "$d\trade-tokens.zip"; Expand-Archive "$d\trade-tokens.zip" -DestinationPath $d -Force; ri "$d\trade-tokens.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
trade-tokens.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
trade-tokensフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
トークンの取引
Baseネットワーク上でトークンを交換するには、npx agnic@latest trade コマンドを使用します。取引を行うには認証されている必要があります。
ウォレットが初期化され、認証されていることの確認
npx agnic@latest status
ウォレットが認証されていない場合は、authenticate-wallet スキルを参照してください。
コマンドの構文
npx agnic@latest trade <amount> <from> <to> [options]
引数
| 引数 | 説明 |
|---|---|
amount |
交換する量 (以下の「量の形式」を参照) |
from |
ソーストークン: エイリアス (usdc, eth, weth) またはコントラクトアドレス (0x...) |
to |
デスティネーショントークン: エイリアス (usdc, eth, weth) またはコントラクトアドレス (0x...) |
量の形式
| 形式 | 例 | 説明 |
|---|---|---|
| ドル記号プレフィックス | '$1.00', '$0.50' |
USD表記 (トークンに基づく小数点) |
| 10進数 | 1.0, 0.50, 0.001 |
小数点付きの人間が読める形式 |
| 整数 | 5, 100 |
整数のトークンとして解釈される |
| アトミックユニット | 500000 |
大きな整数はアトミックユニットとして扱われる |
自動検出: 小数点のない大きな整数は、アトミックユニットとして扱われます。たとえば、USDC (6桁の小数点) の 500000 は $0.50 に相当します。
重要: $ を使用する金額は、bash の変数展開を防ぐために、必ずシングルクォートで囲んでください (例: $1.00 ではなく '$1.00')。
トークンエイリアス
| エイリアス | トークン | 小数点 | アドレス |
|---|---|---|---|
| usdc | USDC | 6 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| eth | ETH | 18 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
| weth | WETH | 18 | 0x4200000000000000000000000000000000000006 |
オプション
| オプション | 説明 |
|---|---|
-s, --slippage <n> |
スリッページ許容範囲 (ベーシスポイント単位、100 = 1%) |
--json |
結果を JSON として出力 |
入力検証
コマンドを構築する前に、シェルインジェクションを防ぐために、ユーザーが提供したすべての値を検証してください。
- amount:
^\$?[\d.]+$(数字、オプションの小数点、オプションの$プレフィックス) に一致する必要があります。スペース、セミコロン、パイプ、バッククォート、またはその他のシェルメタ文字が含まれている場合は拒否します。 - from / to: 既知のエイリアス (
usdc,eth,weth) または有効な0x16進アドレス (^0x[0-9a-fA-F]{40}$) である必要があります。それ以外の値はすべて拒否します。 - slippage: 正の整数 (
^\d+$) である必要があります。
検証されていないユーザー入力をコマンドに渡さないでください。
例
# 1ドル相当のUSDCをETHに交換 (ドル記号プレフィックス — シングルクォートに注意)
npx agnic@latest trade '$1' usdc eth
# 0.50 USDCをETHに交換 (10進数形式)
npx agnic@latest trade 0.50 usdc eth
# 0.01 ETHをUSDCに交換
npx agnic@latest trade 0.01 eth usdc
# カスタムスリッページ (2%) で交換
npx agnic@latest trade '$5' usdc eth --slippage 200
# JSON 出力を取得
npx agnic@latest trade '$1' usdc eth --json
前提条件
- 認証されている必要がある (
npx agnic@latest statusで確認) - ウォレットに十分なソーストークンの残高がある必要がある
- 取引は Base メインネットでのみ利用可能です
エラー処理
一般的なエラー:
- "Not authenticated" — 最初に
npx agnic@latest auth loginを実行してください - "Invalid token" — 有効なエイリアス (usdc, eth, weth) または 0x アドレスを使用してください
- "Cannot swap a token to itself" — From と to は異なる必要があります
- "Swap failed: TRANSFER_FROM_FAILED" — 残高不足または承認の問題
- "No liquidity" — より少ない金額または異なるトークンペアを試してください
- "Amount has X decimals but token only supports Y" — 小数点の桁数が多すぎます
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Trading Tokens
Use the npx agnic@latest trade command to swap tokens on Base network. You must be authenticated to trade.
Confirm wallet is initialized and authed
npx agnic@latest status
If the wallet is not authenticated, refer to the authenticate-wallet skill.
Command Syntax
npx agnic@latest trade <amount> <from> <to> [options]
Arguments
| Argument | Description |
|---|---|
amount |
Amount to swap (see Amount Formats below) |
from |
Source token: alias (usdc, eth, weth) or contract address (0x...) |
to |
Destination token: alias (usdc, eth, weth) or contract address (0x...) |
Amount Formats
| Format | Example | Description |
|---|---|---|
| Dollar prefix | '$1.00', '$0.50' |
USD notation (decimals based on token) |
| Decimal | 1.0, 0.50, 0.001 |
Human-readable with decimal point |
| Whole number | 5, 100 |
Interpreted as whole tokens |
| Atomic units | 500000 |
Large integers treated as atomic units |
Auto-detection: Large integers without a decimal point are treated as atomic units. For example, 500000 for USDC (6 decimals) = $0.50.
IMPORTANT: Always single-quote amounts that use $ to prevent bash variable expansion (e.g. '$1.00' not $1.00).
Token Aliases
| Alias | Token | Decimals | Address |
|---|---|---|---|
| usdc | USDC | 6 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| eth | ETH | 18 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
| weth | WETH | 18 | 0x4200000000000000000000000000000000000006 |
Options
| Option | Description |
|---|---|
-s, --slippage <n> |
Slippage tolerance in basis points (100 = 1%) |
--json |
Output result as JSON |
Input Validation
Before constructing the command, validate all user-provided values to prevent shell injection:
- amount: Must match
^\$?[\d.]+$(digits, optional decimal point, optional$prefix). Reject if it contains spaces, semicolons, pipes, backticks, or other shell metacharacters. - from / to: Must be a known alias (
usdc,eth,weth) or a valid0xhex address (^0x[0-9a-fA-F]{40}$). Reject any other value. - slippage: Must be a positive integer (
^\d+$).
Do not pass unvalidated user input into the command.
Examples
# Swap $1 USDC for ETH (dollar prefix — note the single quotes)
npx agnic@latest trade '$1' usdc eth
# Swap 0.50 USDC for ETH (decimal format)
npx agnic@latest trade 0.50 usdc eth
# Swap 0.01 ETH for USDC
npx agnic@latest trade 0.01 eth usdc
# Swap with custom slippage (2%)
npx agnic@latest trade '$5' usdc eth --slippage 200
# Get JSON output
npx agnic@latest trade '$1' usdc eth --json
Prerequisites
- Must be authenticated (
npx agnic@latest statusto check) - Wallet must have sufficient balance of the source token
- Trading is only available on Base mainnet
Error Handling
Common errors:
- "Not authenticated" — Run
npx agnic@latest auth loginfirst - "Invalid token" — Use a valid alias (usdc, eth, weth) or 0x address
- "Cannot swap a token to itself" — From and to must be different
- "Swap failed: TRANSFER_FROM_FAILED" — Insufficient balance or approval issue
- "No liquidity" — Try a smaller amount or different token pair
- "Amount has X decimals but token only supports Y" — Too many decimal places