trade-tokens

📁 agnicpay/agnic-wallet-skills 📅 6 days ago
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

  1. Verify authentication:

    npx agnic@latest status --json
    
  2. Check balance to ensure sufficient funds:

    npx agnic@latest balance --network base --json
    
  3. Preview the trade (optional but recommended):

    npx agnic@latest trade <amount> <sell_token> <buy_token> --dry-run --json
    
  4. Confirm with the user: amount, tokens, and estimated output.

  5. 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-run first 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