ethereumdegen/stark-bot/swap
Claude Code and agent skill by ethereumdegen/stark-bot
- community
Checking that the SKILL.md file is still in the repository.
Swap ERC20 tokens on Base using 0x DEX aggregator via quoter.defirelay.com
Install
npx vskill@latest install ethereumdegen/stark-bot/swapSKILL.md
Token Swap Skill
CRITICAL RULES
- ONE TASK AT A TIME. Only do the work described in the CURRENT task. Do NOT work ahead.
- Do NOT call `say_to_user` with `finished_task: true` until the current task is truly done. Using
finished_task: trueadvances the task queue — if you use it prematurely, tasks get skipped. - Use `say_to_user` WITHOUT `finished_task` for progress updates. Only set
finished_task: trueOR calltask_fully_completedwhen ALL steps in the current task are done. - Sequential tool calls only. Never call two tools in parallel when the second depends on the first (e.g., never call
swap_executeanddecode_calldatain the same response). - Use exact parameter values shown. Especially
cache_as: "swap"— not "swap_params", not "swap_data", exactly"swap".
Step 1: Define the seven tasks
Call define_tasks with all 7 tasks in order:
Task 1: Prepare — look up tokens, check balances, check allowance
1a. Select network (if user specified one)
1b. Look up SELL token
If selling ETH: use WETH as the sell token instead:
- Lookup WETH:
{"tool": "token_lookup", "symbol": "WETH", "cache_as": "sell_token"} - Check WETH balance:
{"tool": "web3_preset_function_call", "preset": "weth_balance", "network": "<network>", "call_only": true} - Check ETH balance:
{"tool": "x402_rpc", "preset": "get_balance", "network": "<network>"} - If WETH insufficient, wrap:
{"tool": "to_raw_amount", "amount": "<human_amount>", "decimals": 18, "cache_as": "wrap_amount"}{"tool": "web3_preset_function_call", "preset": "weth_deposit", "network": "<network>"}- Broadcast the wrap tx and wait for confirmation
1c. Look up BUY token
1d. Check AllowanceHolder allowance
Do NOT proceed to approval or quoting in this task. Just report findings.
Task 2: Approve sell token for AllowanceHolder
If Task 1 determined allowance is already sufficient, SKIP this task:
Otherwise, approve:
Broadcast and wait for confirmation:
After the approval is confirmed:
Task 3: Convert sell amount to raw units
One tool call (auto-completes on success):
Task 4: Fetch swap quote
One tool call (auto-completes on success):
If this fails after retries, STOP and tell the user.
Task 5: Decode the swap quote
IMPORTANT: Use `calldata_register` (NOT raw `calldata`). Use `cache_as: "swap"` exactly.
This step reads the swap_quote register and extracts: swap_contract, swap_param_0–swap_param_4, swap_value. Task 6 depends on these registers being set.
One tool call (auto-completes on success):
Task 6: Execute the swap
Exactly 2 tool calls, SEQUENTIALLY (one at a time, NOT in parallel):
Do NOT call `decode_calldata` in this task — it was already done in Task 5. The registers swap_contract, swap_param_0–swap_param_4, swap_value should already be set.
6a. Create the swap transaction (FIRST call)
Wait for the result. Extract the uuid from the response.
6b. Broadcast it (SECOND call — after 6a succeeds)
The task auto-completes when broadcast_web3_tx succeeds.
Task 7: Verify the swap
Call verify_tx_broadcast to poll for the receipt, decode token transfer events, and confirm the result matches the user's intent:
Read the output:
- "TRANSACTION VERIFIED" → The swap succeeded AND the AI confirmed it matches the user's intent. Report success with tx hash and explorer link.
- "TRANSACTION CONFIRMED — INTENT MISMATCH" → Confirmed on-chain but AI flagged a concern. Tell the user to check the explorer.
- "TRANSACTION REVERTED" → The swap failed. Tell the user.
- "CONFIRMATION TIMEOUT" → Tell the user to check the explorer link.
Call task_fully_completed when verify_tx_broadcast returned VERIFIED or CONFIRMED.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/swap/SKILL.md
Popularity
- Repository stars
- 46
- Repository forks
- 20
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ethereumdegen/stark-bot/swap)