Swap tokens on TON via swap.coffee DEX aggregator -- finds the best rate across STON.fi, DeDust, Tonco, Coffee DEX, and 15+ other DEXes.
Read tools use the swap.coffee REST API. Write tools sign transactions from the agent wallet.
| Tool | Description |
|---|---|
swap_quote |
Get optimal swap route with expected output, price impact, and gas estimate |
swap_execute |
Execute a token swap -- finds best route, signs and sends from agent wallet |
swap_status |
Check swap execution status (poll after swap_execute) |
swap_tokens |
Search/lookup tokens by symbol or address with USD price |
swap_price |
Get current USD prices for multiple tokens |
swap_pools |
Browse liquidity pools sorted by TVL, volume, or APR |
mkdir -p ~/.teleton/plugins
cp -r plugins/swapcoffee ~/.teleton/plugins/Ask the AI:
- "What's the best rate to swap 10 TON to USDT?"
- "Swap 5 TON to USDT"
- "Check the status of my swap" (with route_id)
- "Search for the NOT token"
- "What's the price of TON and USDT?"
- "Show me the top pools by TVL"
- "Show pools on DeDust sorted by APR"
- Search tokens with
swap_tokensto find addresses - Get a quote with
swap_quoteto preview the rate - Execute with
swap_executeto send the swap - Monitor with
swap_statusuntil terminal
Requires at runtime (provided by teleton):
@ton/core-- Cell parsing, Address@ton/ton-- WalletContractV5R1, TonClient@ton/crypto-- mnemonicToPrivateKey
Agent wallet at ~/.teleton/wallet.json is used for signing all on-chain transactions.
Get optimal swap route with expected output, price impact, and gas estimate.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
input_token |
string | Yes | -- | Input token address or "native" for TON |
output_token |
string | Yes | -- | Output token address or "native" for TON |
input_amount |
string | Yes | -- | Amount in human-readable units (e.g. "10") |
max_splits |
integer | No | 4 | Route splits for better price (1-20) |
Execute a token swap. Finds the best route, signs and sends the transaction from the agent wallet.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
input_token |
string | Yes | -- | Input token address or "native" for TON |
output_token |
string | Yes | -- | Output token address or "native" for TON |
input_amount |
string | Yes | -- | Amount in human-readable units |
slippage |
number | No | 0.05 | Slippage tolerance (0.05 = 5%) |
max_splits |
integer | No | 4 | Route splits (1-20) |
Check swap execution status. Poll after swap_execute until terminal.
| Param | Type | Required | Description |
|---|---|---|---|
route_id |
integer | Yes | Route ID from swap_execute response |
Search/lookup tokens by symbol or address.
| Param | Type | Required | Description |
|---|---|---|---|
search |
string | Yes | Token symbol (e.g. "USDT") or address |
Get current USD prices for multiple tokens.
| Param | Type | Required | Description |
|---|---|---|---|
tokens |
array | Yes | Token addresses (use "native" for TON) |
Browse liquidity pools sorted by TVL, volume, or APR.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
search |
string | No | -- | Search by token address or ticker |
order |
string | No | "tvl" | Sort by: "tvl", "volume", or "apr" |
limit |
integer | No | 10 | Results per page (1-50) |
page |
integer | No | 1 | Page number |
dexes |
array | No | -- | Filter by DEX names (e.g. ["stonfi", "dedust"]) |