mcpField
T
ton-swap

ton-swap

github.com/ton-orgOther10110 installsUpdated 25w ago
Repository

About ton-swap

ton-swap is a skill for exchanging tokens on TON through a DEX aggregator. It guides users through quotes, transaction simulation, confirmation, and status checks.

Key features

  1. 01Request quotes using token addresses
  2. 02Enter amounts in human-readable form
  3. 03Simulate swaps and inspect fund flows
  4. 04Execute after confirmation and poll status

Use cases

  1. 01Swap native TON and jettons
  2. 02Resolve a known jetton's address
  3. 03Review a simulation before sending a swap

MCP support

The skill uses TON MCP tools to request quotes, simulate and send transactions, and check status; get_known_jettons can resolve token addresses.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ton-org/skills --skill ton-swap

After installing, type/ton-swapin Claude Code to confirm it loaded.

Details

From the project README

Swap TON Tokens

Swap tokens on TON via DEX aggregator. Two-step flow: get a quote, confirm with the user, then execute.

MCP Tools

ToolRequiredOptional
get_swap_quotefromToken, toToken, amountwalletSelector
emulate_transactionmessagesvalidUntil
send_raw_transactionmessageswalletSelector
get_known_jettons——

Workflow

  1. If the user mentions a token by name (e.g., "USDT", "jUSDC"), call get_known_jettons to resolve the jetton address
  2. Call get_swap_quote with fromToken, toToken, and amount
    • Use "TON" for native TON, or the jetton master contract address for tokens
    • Amount is human-readable (e.g., "1.5" = 1.5 TON)
  3. Call emulate_transaction with the quote's transaction.messages to dry-run the swap — verify the expected money flow (TON/jetton balance changes) before sending
  4. Show the quote details and emulation results to the user and ask one short yes/no confirmation
  5. Call send_raw_transaction with the transaction params returned by the quote
  6. Poll get_transaction_status with the returned normalizedHash until status is completed or failed (see ton-balance skill). User can ask to skip polling.

Notes

  • Always confirm the swap with the user before executing; prefer the host client's structured confirmation UI when available, otherwise accept natural-language yes/no and do not require a fixed confirmation phrase
  • The quote returns transaction messages ready for send_raw_transaction
  • After execution, poll get_transaction_status by default. User can specify whether to check status.
  • If no wallet is configured, use the ton-create-wallet skill first

Comments

Markdown supported