dex-skills v0.1.0

SunPump

SunPump is a token launchpad on the TRON blockchain. It uses TronWeb for contract interaction and requires a polling loop to detect the newly created token address after launch (up to 10 attempts at 3-second intervals). Social links are appended to the token description rather than stored in dedicated contract fields.

Chain

TRON Mainnet

Key Details

Property Value
SDK TronWeb
Launch Flow Contract call → polling loop (10 attempts, 3s interval)
Token Standard TRC-20
Private Key Format Hex (no prefix)
Social Links Appended to token description
Required Environment TRON_FULL_HOST, TRON_API_KEY (optional)

Setup

Initialize dex-skills for SunPump
import { createSkills, getSkill } from "dex-skills";

const skills = createSkills({
  wallets: {
    tron: {
      privateKey: "hex-private-key-no-prefix",
      fullHost: "https://api.trongrid.io",
      apiKey: process.env.TRON_API_KEY, // optional
    },
  },
});

const sunpump = getSkill(skills, "sunpump");
TRON Node Configuration
The TRON_FULL_HOST should point to a TronGrid or compatible TRON full node endpoint. The TRON_API_KEY is optional but recommended for higher rate limits on TronGrid.

Launch a Token

Token creation on SunPump submits a contract call via TronWeb. After the transaction is confirmed, dex-skills enters a polling loop that checks for the new token address up to 10 times at 3-second intervals. Social links are automatically appended to the description text since the SunPump contract does not have dedicated fields for them.

Launch Example
const result = await sunpump.launch({
  name: "Sun Token",
  symbol: "SUNT",
  description: "A token launched on SunPump via dex-skills.",
  imageUrl: "https://example.com/token-logo.png",
  initialBuyAmount: "100",
  links: {
    twitter: "https://x.com/suntoken",
    telegram: "https://t.me/suntoken",
    website: "https://suntoken.xyz",
  },
});

console.log("Token address:", result.tokenAddress);
console.log("Transaction:", result.txHash);

Launch Parameters

Parameter Type Description
name * string Display name of the token.
symbol * string Token ticker symbol.
description string Description of the token. Social links are appended to this.
imageUrl string URL to the token image. Must be publicly accessible.
initialBuyAmount string Amount of TRX to spend on an initial buy immediately after launch.
links object Social links object with optional keys: twitter, telegram, website. Appended to description.

Query Token Info

Get Token Info
const token = await sunpump.getTokenInfo("TTokenContractAddress...");

console.log("Name:", token.name);
console.log("Symbol:", token.symbol);
console.log("Total Supply:", token.totalSupply);
console.log("Description:", token.description);

List Tokens

List Tokens
const tokens = await sunpump.listTokens({
  limit: 20,
  sortBy: "createdAt",
  sortOrder: "desc",
});

for (const token of tokens) {
  console.log(token.symbol, token.tokenAddress);
}

Buy Tokens

Purchase tokens on SunPump by specifying the token address, TRX amount, and optional slippage.

Buy Example
const result = await sunpump.buy({
  tokenAddress: "TTokenContractAddress...",
  amount: "100",
  slippage: 10,
});

console.log("Tx Hash:", result.txHash);
console.log("Tokens received:", result.tokenAmount);

Sell Tokens

Sell tokens on SunPump by specifying the token address and amount of tokens to sell.

Sell Example
const result = await sunpump.sell({
  tokenAddress: "TTokenContractAddress...",
  amount: "1000000",
  slippage: 10,
});

console.log("Tx Hash:", result.txHash);
console.log("TRX received:", result.nativeAmount);

Get Trending

Trending Tokens
const trending = await sunpump.getTrending({
  category: "gainers",
  limit: 20,
});

for (const token of trending) {
  console.log(token.symbol, token.marketCap);
}

Supported Methods

Method Supported
launch() Yes
getTokenInfo() Yes
listTokens() Yes
buy() Yes
sell() Yes
getTrending() Yes
getTradeHistory() No
getHolders() No
estimatePrice() No

Platform Notes

Polling for Token Address
After the launch transaction is submitted, the token address is not immediately available from the transaction receipt. dex-skills polls the TRON network up to 10 times at 3-second intervals to detect the newly created token. If the token is not found within 30 seconds, the launch will fail with a timeout error.
Social Links in Description
The SunPump smart contract does not provide dedicated fields for social links. Instead, dex-skills appends the provided links (twitter, telegram, website) to the end of the token description string. When querying token info, these links appear as part of the description text.
Private Key Format
TRON private keys are provided in hex format without a prefix. Do not include 0x at the beginning. This differs from EVM chains like Base and BNB Chain.
TronGrid Rate Limits
Without a TRON_API_KEY, TronGrid enforces strict rate limits. Since the launch flow involves multiple polling requests, you may encounter rate limiting during the token address detection phase. Providing an API key is recommended for reliable operation.

Supported Social Links

Social links are appended to the token description text rather than stored in dedicated contract fields.

Field Description
twitter Twitter/X profile URL (appended to description)
telegram Telegram group or channel URL (appended to description)
website Project website URL (appended to description)