tw-agent-skills: Command for Claude Code

.claude/commands/swap-quote.md

swap-quote is a command for Claude Code from trustwallet/tw-agent-skills. It costs 76 tokens per session (616 once invoked), scanned A, original, MIT.

A command for requesting and carrying out cryptocurrency token swaps, including exchanges within one blockchain network and transfers between networks. It uses the Amber aggregator to compare routes from multiple exchange and bridge providers.

In plain words
What is it for?
Use it to get swap quotes, compare available routes, exchange tokens on the same network, bridge assets between networks, or prepare a swap transaction.
Why use it?
It helps find a route for exchanging one asset for another and accounts for details such as chain, token address, amount, and acceptable price movement. It can also return the transaction data needed for the swap.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is trustwallet/tw-agent-skills's own configuration. It tells Claude Code how to work on tw-agent-skills itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tw-agent-skills configures →

Reuse

Borrowing it

Nothing to install: this file belongs to trustwallet/tw-agent-skills. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/trustwallet/tw-agent-skills/main/.claude/commands/swap-quote.md
Clone the repo
git clone --depth 1 https://github.com/trustwallet/tw-agent-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swap-quote

README.md
[![agentmods](https://agentmods.dev/badge/commands/trustwallet/tw-agent-skills/swap-quote/github.svg)](https://agentmods.dev/commands/trustwallet/tw-agent-skills/swap-quote)
Your own site
<a href="https://agentmods.dev/commands/trustwallet/tw-agent-skills/swap-quote"><img src="https://agentmods.dev/badge/commands/trustwallet/tw-agent-skills/swap-quote/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swap-quote

Your own site · 80×15
<a href="https://agentmods.dev/commands/trustwallet/tw-agent-skills/swap-quote"><img src="https://agentmods.dev/badge/commands/trustwallet/tw-agent-skills/swap-quote.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 616 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.00616
Opus 5 $0.00038 $0.00308
Sonnet 5 $0.00015 $0.00123
Haiku 4.5 $0.00008 $0.00062

Measured 10d ago against content hash 68c8221fb1f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

swap-quote scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/swap-quote.md · 56 lines

What it actually says

Swap Quotes

Get quotes and transaction data for same-chain and cross-chain token swaps via the Amber aggregator.

Base URL: https://tws.trustwallet.com Auth: HMAC-SHA256 (run /setup first if you haven't configured auth)

Key Concepts

Native token addresses:

  • EVM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
  • Solana (SOL): So11111111111111111111111111111111111111112
  • All others: use the contract/mint address

Domain IDs identify chains: ethereum, bsc, polygon, arbitrum, optimism, base, avalanche, solana, bitcoin, tron

Get Swap Quote — POST /amber-api/v1/route

Returns ranked routes sorted by output amount.

{
  "fromAsset": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
  "fromAddress": "0xYourAddress",
  "fromDomain": "base",
  "amount": "100000000000000000",
  "toAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "toAddress": "0xYourAddress",
  "toDomain": "base",
  "slippage": "1",
  "sortBy": "outcome",
  "contractCall": false
}

Optional fields: preferredProviders, ignoredProviders (arrays of provider IDs), thorchain: { "streaming": true } for streaming swaps.

Get Step Transaction — POST /amber-api/v1/route/step

Get executable transaction data for a specific step. Pass { "stepId": "step-uuid" }.

Returns transaction (the swap tx), approve (ERC-20 approval if needed), and revokeApproval (if needed).

Execution Flow

  1. POST /amber-api/v1/route — get quotes
  2. Pick the best route (first one is best by sortBy)
  3. For each step: POST /amber-api/v1/route/step
  4. Execute in order: revokeApproval (if any) → approve (if any) → main transaction

For full response schemas and provider details, read skills/api/references/swap-quote.md.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 56 lines · 76 tokens per session scan A 68c8221fb1f3

Subscribe to this mod's changes

swap-quote is a command published in the GitHub repository trustwallet/tw-agent-skills (97 stars, last pushed 3mo ago), licensed MIT. It adds 76 tokens to every session and 616 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.