trade-tokens
3
总安装量
3
周安装量
#62636
全站排名
安装命令
npx skills add https://github.com/agnicpay/agnic-wallet-skills --skill trade-tokens
Agent 安装分布
opencode
3
gemini-cli
3
antigravity
3
github-copilot
3
codex
3
kimi-cli
3
Skill 文档
Trade Tokens
Swap tokens on Base mainnet using AgnicPay’s DEX integration.
Steps
-
Verify authentication:
npx agnic@latest status --json -
Check balance to ensure sufficient funds:
npx agnic@latest balance --network base --json -
Preview the trade (optional but recommended):
npx agnic@latest trade <amount> <sell_token> <buy_token> --dry-run --json -
Confirm with the user: amount, tokens, and estimated output.
-
Execute the trade:
npx agnic@latest trade <amount> <sell_token> <buy_token> --json
Supported Tokens
USDC, ETH, WETH, cbETH, DAI, AERO (case-insensitive)
Parameters
<amount>â Amount of the sell token<sell_token>â Token to sell (e.g.,usdc)<buy_token>â Token to buy (e.g.,eth)--slippage <percent>â Max slippage (default:1.0)--dry-runâ Show quote without executing
Example
# Preview
npx agnic@latest trade 10 usdc eth --dry-run --json
# Execute
npx agnic@latest trade 10 usdc eth --json
Expected Output
{
"success": true,
"sellAmount": "10",
"sellToken": "USDC",
"buyAmount": "0.00396",
"buyToken": "ETH",
"price": "2525.25",
"transactionHash": "0xabc123...",
"explorerUrl": "https://basescan.org/tx/0xabc123..."
}
Error Handling
- Always preview with
--dry-runfirst to show the user expected output - If slippage is too high, suggest a lower amount or higher slippage tolerance
- Trading is only available on Base mainnet