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
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_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.
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
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
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.
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.
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
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
0x at the beginning.
This differs from EVM chains like Base and BNB Chain.
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/X profile URL (appended to description) | |
| telegram | Telegram group or channel URL (appended to description) |
| website | Project website URL (appended to description) |