TON AI Agent: Automate DeFi Trading & Wallet Management on TON Blockchain
Teleton is the first open-source AI agent purpose-built for the TON blockchain. Use natural language to swap jettons on STON.fi and DeDust, manage your TON wallet, bid on DNS auctions, transfer NFTs, and automate complex DeFi strategies — all without writing a single line of code.
Table of Contents
- What Is a TON AI Agent?
- Why the TON Ecosystem Needs AI Agents
- How Teleton's TON Integration Works
- DeFi Trading: STON.fi & DeDust Automation
- TON Wallet Management
- TON DNS & NFT Operations
- Real-World Use Cases
- How to Set Up Your TON AI Agent
- Security Architecture
- Comparison: TON AI Agent Solutions
- Frequently Asked Questions
What Is a TON AI Agent?
A TON AI Agent is an autonomous software agent that interacts with the TON (The Open Network) blockchain using artificial intelligence. Unlike traditional blockchain tools that require manual transaction construction, a TON AI Agent understands natural language commands and translates them into on-chain actions.
For example, instead of navigating a DEX interface, connecting a wallet, setting slippage, and confirming a swap, you simply tell the agent: "Swap 10 TON for USDT on STON.fi with 1% slippage." The agent handles the rest — quoting prices, constructing the transaction, signing it locally, and confirming execution.
Teleton is the first open-source TON AI Agent. It combines Telegram AI Agent capabilities with native TON blockchain integration, giving you a single interface to manage both messaging and DeFi operations through your Telegram account.
Why the TON Ecosystem Needs AI Agents
The TON blockchain has grown rapidly since its integration with Telegram's 900+ million users. With this growth comes complexity:
- Multiple DEXs with different interfaces — STON.fi and DeDust have separate UIs, token listings, and liquidity pools. Comparing rates manually is time-consuming.
- Wallet management overhead — Checking balances, sending jettons, managing multiple tokens, and tracking transaction history across different tools.
- DNS auction complexity — TON DNS domains are auctioned on-chain with specific bidding mechanics that require careful timing and gas management.
- NFT ecosystem fragmentation — Different NFT collections use different standards, and managing them requires interacting with various smart contracts.
- DeFi strategy execution — Implementing multi-step strategies (e.g., swap → provide liquidity → monitor) requires constant attention.
A TON AI Agent solves these problems by providing a unified natural language interface to the entire TON ecosystem. You describe what you want in plain English, and the agent figures out the optimal execution path.
How Teleton's TON Integration Works
Teleton's TON integration is built on three pillars:
1. Native Wallet Management (W5R1)
During setup, Teleton generates a W5R1 (Wallet V5 Revision 1) contract — the most modern TON wallet version with gas-optimized transfers. The wallet is created from a 24-word BIP39 mnemonic that never leaves your machine.
# The setup wizard handles wallet generation automatically
$ teleton setup
? Choose wallet option:
❯ Generate new wallet (W5R1)
Import existing mnemonic
✓ Wallet generated
Address: EQB...your-address
Mnemonic saved to ~/.teleton/wallet.json (0600 permissions)
You can also import an existing wallet using a 24-word mnemonic. Since Teleton derives a W5R1 wallet, the address may differ from your original if it used a different contract version.
2. DEX Integration Layer
Teleton includes 10 dedicated DEX tools — 5 for STON.fi and 5 for DeDust:
- Swap execution — Execute token swaps with configurable slippage
- Quote comparison — Get real-time price quotes before swapping
- Token search — Find jettons by name, symbol, or contract address
- Pool analytics — View liquidity pool data, TVL, and volume
- Cross-DEX comparison — The
dex_quotetool queries both DEXs in parallel and recommends the best rate
3. Agentic Reasoning Loop
Teleton doesn't just execute single commands — it reasons through complex multi-step operations using an agentic loop with tool calling. When you say "Find the best rate for swapping 100 TON to USDT and execute it," the agent:
- Queries STON.fi for a swap quote
- Queries DeDust for a swap quote
- Compares rates, fees, and slippage impact
- Selects the optimal DEX
- Constructs and signs the swap transaction locally
- Submits to the TON network and confirms execution
- Reports the result back to you in Telegram
DeFi Trading: STON.fi & DeDust Automation
DeFi trading is where a TON AI Agent truly shines. Here are the operations you can perform through natural language:
Jetton Swaps
The most common DeFi operation. Tell the agent what to swap and it handles the rest:
"Swap 50 TON for USDT on STON.fi"
"Buy 1000 DOGS with TON using the best rate"
"Swap all my SCALE to TON on DeDust with 2% slippage"
The agent checks your balance, gets a quote, validates the parameters, and executes the swap. Gas fees are typically 0.25–0.5 TON per swap.
Price Monitoring
"What's the current price of SCALE in TON?"
"Compare USDT/TON rates on STON.fi vs DeDust"
"Get a quote for swapping 10 TON to NOT"
Pool Research
"Show me the top 10 liquidity pools on STON.fi by TVL"
"What's the 24h volume on the TON/USDT pool on DeDust?"
"Find all pools containing the DOGS token"
TON Wallet Management
Your TON AI Agent serves as a complete wallet manager:
- Balance checking — "What's my TON balance?" / "Show all my jetton balances"
- Sending TON — "Send 5 TON to EQB...address" / "Send 100 USDT to @username's wallet"
- Transaction history — "Show my last 10 transactions" / "What was my last swap?"
- Address resolution — Supports raw addresses, friendly addresses, and TON DNS domains
- Multi-token management — Track and manage all jettons in your wallet from one interface
All transaction signing happens locally on your machine. Private keys are never transmitted over the network or shared with any LLM provider.
TON DNS & NFT Operations
TON DNS
TON DNS provides human-readable domain names (like alice.ton) that resolve to wallet addresses. Your AI agent can:
- Search for available .ton domains
- Place bids on domain auctions
- Resolve domain names to addresses
- Manage owned domains
"Search for available .ton domains containing 'crypto'"
"Bid 5 TON on the domain crypto.ton"
"What address does alice.ton resolve to?"
NFT Management
The agent interacts with TON NFT smart contracts for viewing, transferring, and managing digital collectibles in your wallet.
Real-World Use Cases
DeFi Trader
A trader who monitors TON ecosystem tokens and executes swaps can use the agent to quickly compare rates across STON.fi and DeDust, execute trades through simple Telegram messages, and set up scheduled price checks using Teleton's task scheduling system.
TON Developer
Developers building on TON can use the agent to test contract interactions, manage deployment wallets, and automate repetitive tasks like sending test transactions or checking contract states.
Community Manager
Telegram group admins in the TON ecosystem can combine Teleton's Telegram messaging capabilities with TON wallet features — for example, automating airdrop distributions, verifying holder status, or rewarding community members with jetton transfers.
Portfolio Manager
Track your TON portfolio across multiple tokens, get regular balance reports, and execute rebalancing trades — all through natural language commands in Telegram.
How to Set Up Your TON AI Agent
Setting up Teleton for TON operations takes about 10 minutes:
Step 1: Install Teleton
npm install -g teleton@latest
Requires Node.js 20+. Also available via Docker (ghcr.io/tonresistor/teleton-agent) or from source on GitHub.
Step 2: Run the Setup Wizard
teleton setup
The wizard guides you through:
- LLM provider — Choose from Claude, GPT-4, Gemini, Grok, Groq, or OpenRouter
- Telegram authentication — Enter your API credentials from my.telegram.org
- TON wallet — Generate a new W5R1 wallet or import an existing mnemonic
- Access policies — Configure who can interact with the agent
Step 3: Fund Your Wallet
Send at least 0.05 TON to the generated wallet address to activate it. For DeFi trading, 1+ TON is recommended (swap gas is ~0.25–0.5 TON per trade).
Step 4: Start Trading
teleton start
Open Telegram and send a message to the agent account:
"What's my TON balance?"
"Swap 1 TON for USDT on STON.fi"
"Show the top pools on DeDust"
Security Architecture
Security is critical when an AI agent manages real financial assets. Teleton implements multiple layers of protection:
- Local key storage — The 24-word mnemonic is stored with
0600file permissions (owner-only read). Keys never leave your machine. - Frozen SDK — Plugins access the wallet through a frozen (immutable) SDK object. They cannot access private keys or bypass the signing process.
- DM-only financial tools — All TON financial tools (send, swap, bid) are restricted to DM scope. They cannot be triggered from group chats, preventing social engineering attacks.
- Address validation — All recipient addresses are validated before sending. The agent checks address format, workchain, and bounceable/non-bounceable flags.
- Prompt injection defense — Input sanitization strips control characters and invisible Unicode. User messages are wrapped in tagged envelopes. Personality files are immutable at runtime.
- Transaction confirmation — The agent reports transaction details before and after execution, giving you full visibility into every on-chain operation.
Comparison: TON AI Agent Solutions
| Feature | Teleton | Generic AI Agents | Manual DEX Trading |
|---|---|---|---|
| TON native integration | Yes — built-in wallet + DEX tools | No — requires custom plugins | Yes — manual interaction |
| Natural language control | Yes — multi-model AI reasoning | Yes | No |
| STON.fi + DeDust support | 10 dedicated tools | No built-in support | Separate UIs for each |
| Cross-DEX rate comparison | Automatic parallel quotes | Not available | Manual comparison |
| Open source | MIT license | Varies | N/A |
| Self-hosted | Your server, your keys | Usually cloud-hosted | N/A |
| Telegram integration | Full userbot (MTProto) | Bot API only | None |
| Persistent memory | Vector + FTS hybrid search | Varies | No |
| Plugin extensibility | SDK + hot-reload | Varies | No |
| Cost | Free + LLM API costs | Subscription-based | Free + gas fees |
Frequently Asked Questions
What is a TON AI Agent?
A TON AI Agent is an autonomous software agent that interacts with the TON blockchain using artificial intelligence. It can manage wallets, execute DeFi trades, swap jettons, bid on DNS auctions, and manage NFTs — all through natural language commands instead of manual transactions.
Can the TON AI Agent trade on DEXs automatically?
Yes. Teleton integrates with STON.fi and DeDust with 5 tools each (swap, quote, search, pools, analytics). A smart dex_quote tool compares quotes from both exchanges in parallel and recommends the best rate before executing.
How does the TON AI Agent manage wallets?
Teleton generates a W5R1 (Wallet V5 Revision 1) contract during setup with a 24-word BIP39 mnemonic. All transaction signing happens locally — keys never leave your machine. The agent can send/receive TON, check balances, and manage jetton tokens.
Is the TON AI Agent free and open source?
Yes. Teleton is fully open source under the MIT license, available on GitHub. You only pay for the LLM provider you choose (Claude, GPT-4, Gemini, etc.) and minimal TON transaction fees (0.005-0.01 TON per transfer).
How much TON do I need to start using the AI Agent?
About 0.05 TON to activate the wallet. For practical use: ~0.1 TON covers dozens of transfers, 1+ TON for DEX trading (swap gas is ~0.25–0.5 TON), and 0.5+ TON for NFT operations.
Which DEXs does the TON AI Agent support?
STON.fi and DeDust, the two largest TON DEXs. Each has 5 dedicated tools: swap execution, quote comparison, token search, pool analytics, and liquidity data. The agent compares rates across both before trading.
Can the TON AI Agent handle NFTs?
Yes. The agent can view, transfer, and manage TON NFTs. It interacts with NFT smart contracts natively through the TON SDK integration.
How secure is the TON AI Agent for DeFi?
The mnemonic is stored with 0600 file permissions (owner-only). Plugins access the wallet through a frozen SDK and cannot access private keys. Financial tools are restricted to DM scope only. All addresses are validated before sending transactions.
Get Started with Your TON AI Agent
Ready to automate your TON blockchain operations? Install Teleton in under 5 minutes:
npm install -g teleton@latest
teleton setup
teleton start
Join the Telegram community for support, or explore the source code on GitHub.
Learn more about Teleton's Telegram AI Agent capabilities or browse the plugin directory for additional TON tools.