tron-swap

This skill should be used when the user asks to 'swap tokens on TRON', 'buy token on TRON', 'sell TRC-20 token', 'trade TRX for USDT', 'exchange tokens on SunSwap', 'DEX trade on TRON', 'get swap quote on TRON', 'best route for TRON swap', or mentions swapping, trading, buying, selling, or exchanging tokens on the TRON network. Aggregates liquidity from SunSwap V2/V3, Sun.io, and other TRON DEXes. Do NOT use for staking — use tron-staking. Do NOT use for token research — use tron-token.

3,891 stars

Best use case

tron-swap is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

This skill should be used when the user asks to 'swap tokens on TRON', 'buy token on TRON', 'sell TRC-20 token', 'trade TRX for USDT', 'exchange tokens on SunSwap', 'DEX trade on TRON', 'get swap quote on TRON', 'best route for TRON swap', or mentions swapping, trading, buying, selling, or exchanging tokens on the TRON network. Aggregates liquidity from SunSwap V2/V3, Sun.io, and other TRON DEXes. Do NOT use for staking — use tron-staking. Do NOT use for token research — use tron-token.

Teams using tron-swap should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tron-swap/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/bbsyaya/tronlink-skills/skills/tron-swap/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tron-swap/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tron-swap Compares

Feature / Agenttron-swapStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill should be used when the user asks to 'swap tokens on TRON', 'buy token on TRON', 'sell TRC-20 token', 'trade TRX for USDT', 'exchange tokens on SunSwap', 'DEX trade on TRON', 'get swap quote on TRON', 'best route for TRON swap', or mentions swapping, trading, buying, selling, or exchanging tokens on the TRON network. Aggregates liquidity from SunSwap V2/V3, Sun.io, and other TRON DEXes. Do NOT use for staking — use tron-staking. Do NOT use for token research — use tron-token.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# TRON DEX Swap

3 commands for swap quote, route optimization, and transaction status tracking (read-only queries).

## Pre-flight Checks

1. **Confirm Python & dependencies**:
   ```bash
   node -e "console.log('ok')"  # Node.js >= 18 required
   ```

2. **Check energy before swapping**: Swaps consume significant Energy (typically 50,000–200,000). Run:
   ```bash
   node scripts/tron_api.mjs resource-info --address <YOUR_ADDRESS>
   ```
   If energy is insufficient, consider freezing TRX first (`tron-staking`) or accept TRX burn cost.

## Commands

### 1. Swap Quote

```bash
node scripts/tron_api.mjs swap-quote \
  --from-token <FROM_CONTRACT_OR_TRX> \
  --to-token <TO_CONTRACT_OR_TRX> \
  --amount <HUMAN_READABLE_AMOUNT>
```

Returns: expected output amount, price impact, route path, minimum received (with slippage), estimated energy cost.

⚠️ **Amount is human-readable** — pass `100` for 100 TRX, NOT `100000000`.

Example:
```bash
# Quote: 100 TRX → USDT
node scripts/tron_api.mjs swap-quote \
  --from-token TRX \
  --to-token TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t \
  --amount 100
```

### 2. Best Route

```bash
node scripts/tron_api.mjs swap-route \
  --from-token <FROM_CONTRACT> \
  --to-token <TO_CONTRACT> \
  --amount <AMOUNT>
```

Returns: optimal route across SunSwap V2, V3, Sun.io — may include multi-hop routes (e.g., TRX → WTRX → USDT).

### 3. Transaction Status

```bash
node scripts/tron_api.mjs tx-status --txid <TRANSACTION_HASH>
```

Returns: confirmation status, block number, energy used, bandwidth used, result.

## DEX Router Addresses (Mainnet)

| DEX | Router Contract |
|-----|----------------|
| SunSwap V2 Router | `TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax` |
| SunSwap V3 Router | `TQAvWQpT9H916GckwWDJNhYZvQMkuRL7PN` |
| Sun.io Swap | `TKcEU8ekq2ZoFzLSGFYCUY6aocJBX9X31b` |

## Swap Cost Estimation

TRON swap costs differ from EVM chains:

| Operation | Bandwidth | Energy | TRX Burn (if no resources) |
|-----------|-----------|--------|---------------------------|
| TRX → TRC-20 | ~345 | ~65,000 | ~13 TRX |
| TRC-20 → TRX | ~345 | ~50,000 | ~10 TRX |
| TRC-20 → TRC-20 | ~345 | ~130,000 | ~26 TRX |
| Approve (first time) | ~345 | ~30,000 | ~6 TRX |

⚠️ Energy costs fluctuate. Always check current energy price:
```bash
node scripts/tron_api.mjs energy-price
```

## Slippage Guide

| Token Type | Recommended Slippage |
|-----------|---------------------|
| Stablecoins (USDT↔USDC) | 0.1% |
| Major tokens (TRX, JST, SUN) | 0.5% |
| Mid-cap tokens | 1-2% |
| Low-cap / Meme tokens | 3-5% |
| New launches | 5-10% (⚠️ high risk) |

## Safety Checks Before Swap

1. **Security audit**: Run `node scripts/tron_api.mjs token-security --contract <TOKEN>` before trading unfamiliar tokens
2. **Liquidity check**: Run `node scripts/tron_api.mjs pool-info --contract <TOKEN>` — avoid tokens with < $10k liquidity
3. **Energy check**: Run `node scripts/tron_api.mjs resource-info --address <YOUR_ADDRESS>` — swap without energy burns TRX
4. **Price impact**: If price impact > 3%, consider splitting into smaller trades

Related Skills

china-electronic-components-sourcing

3891
from openclaw/skills

Comprehensive electronic components industry sourcing guide for international buyers – provides detailed information about China's semiconductor, passive component, PCB, connector, and sensor manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Data & Research

china-consumer-electronics-sourcing

3891
from openclaw/skills

Comprehensive consumer electronics industry sourcing guide for international buyers – provides detailed information about China's smartphone, wearable, audio, smart home, and AR/VR manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Data & Research

sushiswap-sdk

3891
from openclaw/skills

TypeScript SDK for interacting with the SushiSwap Aggregator and related primitives. This SDK is a typed wrapper over the SushiSwap API, providing ergonomic helpers for token amounts, prices, quotes, and swap transaction generation. USE THIS SKILL WHEN: - Building TypeScript or JavaScript applications - You want strongly typed token, amount, and fraction primitives - You need to request swap quotes or executable swap transactions via code - You want safer arithmetic, formatting, and comparisons without floating point errors - You prefer SDK-based integration over raw HTTP requests

sushiswap-api

3891
from openclaw/skills

REST API for optimized token swapping (including executable transaction generation), swap quoting, and pricing using the SushiSwap Aggregator. Use this skill when the user wants to: - Get a swap quote between two tokens on 40+ evm networks - Generate executable swap transaction data - Fetch token prices for a specific network or token - Retrieve token metadata - Discover supported AMM liquidity sources - Integrate SushiSwap swapping or pricing logic via HTTP/REST (and not the SushiSwap Javascript API)

DeFi & Crypto

tron-token

3891
from openclaw/skills

This skill should be used when the user asks to 'find a token on TRON', 'search TRC-20 token', 'token info on TRON', 'who holds this TRON token', 'is this TRON token safe', 'top TRON tokens', 'trending tokens on TRON', 'token market cap on TRON', 'holder distribution', 'verify TRON contract', or mentions searching for TRC-20 tokens, checking token metadata, holder analysis, contract verification, or discovering trending tokens on the TRON network. For live prices and K-line charts, use tron-market. For swap execution, use tron-swap.

tron-staking

3891
from openclaw/skills

This skill should be used when the user asks to 'stake TRX', 'freeze TRX', 'unfreeze TRX', 'vote for SR', 'TRON super representative', 'claim TRON rewards', 'TRON staking rewards', 'how to earn with TRX', 'delegate TRX', 'Stake 2.0', 'unfreeze period', or mentions staking, freezing, unfreezing, voting for Super Representatives, claiming rewards, or Stake 2.0 on the TRON network. Do NOT use for resource queries — use tron-resource. Do NOT use for balance checks — use tron-wallet.

tron-resource

3891
from openclaw/skills

This skill should be used when the user asks about 'TRON energy', 'TRON bandwidth', 'how much energy do I need', 'energy cost on TRON', 'bandwidth insufficient', 'resource delegation on TRON', 'rent energy on TRON', 'TRON transaction fee', 'why is my TRON transaction expensive', 'optimize TRON costs', or mentions Energy, Bandwidth, resource management, fee estimation, or cost optimization on the TRON network. This is a TRON-specific concept with no direct equivalent on EVM chains. Do NOT use for staking/voting — use tron-staking. Do NOT use for balance queries — use tron-wallet.

tron-market

3891
from openclaw/skills

This skill should be used when the user asks for 'TRX price', 'TRON token price', 'price chart on TRON', 'K-line data for USDT/TRX', 'TRON trade history', 'TRON whale activity', 'large transfers on TRON', 'smart money on TRON', 'TRON DEX volume', or mentions checking real-time prices, candlestick data, trading volume, whale monitoring, or smart money signals on the TRON network. For token search and metadata, use tron-token. For swap execution, use tron-swap.

tron-wallet

3891
from openclaw/skills

This skill should be used when the user asks to 'check my TRX balance', 'show my TRON holdings', 'what tokens do I have on TRON', 'check my TRON wallet', 'TronLink balance', 'view my TRC-20 tokens', 'TRON transaction history', 'account info on TRON', or mentions checking wallet balance, viewing transaction history, or managing a TronLink wallet. Do NOT use for swap/trading — use tron-swap instead. Do NOT use for staking — use tron-staking instead.

ZeroEx Swap Skill

3891
from openclaw/skills

⚠️ **SECURITY WARNING:** This skill involves real funds. Review all parameters before executing swaps.

tempo-stable-uniswap-swaps

3891
from openclaw/skills

Tempo stablecoin and token swap operations for agents. Use when working with pathUSD/USDC.e balances, swapping between USDC.e and pathUSD, or executing any-token swaps via Uniswap on Tempo with quote, Permit2 approvals, simulation, and broadcast.

faceswap

3891
from openclaw/skills

AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili URLs, auto-download, real-time progress tracking.