---
name: batch-swap
description: Execute multiple token swaps in sequence. Use when user wants to
  rebalance, swap into multiple tokens, or execute a multi-step trading plan.
  Each swap goes through full safety validation independently.
---


# Batch Swap

Execute multiple token swaps in sequence with independent safety validation per swap.

## Activation

Use this skill when the user says any of:
- "Swap X for Y and Z"
- "Rebalance to 50% ETH 50% USDC"
- "Buy 3 different tokens"
- "Execute these swaps: ..."

## Input Extraction

| Parameter | Required | Default | Source |
|-----------|----------|---------|--------|
| `swaps` | Yes | — | List of {tokenIn, tokenOut, amount} |
| `chain` | No | ethereum | Default chain for all swaps |
| `stopOnFailure` | No | true | Whether to halt on first failure |

## Workflow

1. **Parse all swaps** from the user's message. Confirm token symbols resolve.

2. **Pre-flight check**: Verify total spending within daily limits and sufficient balance for all swaps using `check_safety_status` and `get_agent_balance`.

3. **Sequential execution**: For each swap:
   - Launch `Task(subagent_type:trade-executor)` with swap parameters
   - Wait for confirmation before starting next swap
   - Update running balance between swaps
   - If `stopOnFailure=true` and swap fails, halt remaining swaps

4. **Report summary**:

```
Batch Swap Complete (3/3 succeeded)

  #  Swap              Amount In    Amount Out   Tx
  1  USDC → WETH      1,000 USDC   0.307 WETH   0xABC...
  2  USDC → WBTC      1,000 USDC   0.015 WBTC   0xDEF...
  3  USDC → UNI       1,000 USDC   142.3 UNI    0xGHI...

  Total gas: $1.26
```

## Error Handling

| Error | User Message | Suggested Action |
|-------|-------------|-----------------|
| `BATCH_PARTIAL_FAILURE` | "Swap #N failed. Remaining halted." | Review failed swap, re-run remaining |
| `INSUFFICIENT_BALANCE` | "Insufficient balance for full batch." | Reduce amounts |
| `SAFETY_AGGREGATE_LIMIT` | "Total batch exceeds daily limit." | Reduce total batch size |


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/batch-swap/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/batch-swap/SKILL.md
Attribution basis: Source repository record

Fields of work: Marketing, Sales
Roles: Growth Marketer, Product Marketer, Sales Engineer
Specialties: API
Tools: Ethereum
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 97e8ca6ee82d1ea4747656119a19b663308e8d9ed639cae7874fa5e5eda0f83b
