<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SunLend]]></title><description><![CDATA[SunLend]]></description><link>https://sunlend.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 20:38:40 GMT</lastBuildDate><atom:link href="https://sunlend.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Which TRON wallets are worth sweeping? A small script that does the math before you pay]]></title><description><![CDATA[Every USDT transfer on TRON costs the same no matter the amount. Moving 30,000 USDT and moving 3 USDT both need about 65,000 Energy. For a sweep from many…]]></description><link>https://sunlend.hashnode.dev/which-tron-wallets-are-worth-sweeping-a-small-script-that-does-the-math-before-you-pay</link><guid isPermaLink="true">https://sunlend.hashnode.dev/which-tron-wallets-are-worth-sweeping-a-small-script-that-does-the-math-before-you-pay</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Web3]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[tron]]></category><dc:creator><![CDATA[SunLend]]></dc:creator><pubDate>Fri, 04 Dec 2026 13:42:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b12bfe66e986732a7f05e39/6a4ad527-92df-4764-9c0d-c43380cea33b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every USDT transfer on TRON costs the same no matter the amount. Moving 30,000 USDT and moving 3 USDT both need about 65,000 Energy. For a sweep from many wallets into one address that means the small balances can cost more to move than they are worth.</p>
<p>We run SunLend, a TRON Energy rental service, and this is the check we suggest before any sweep. The script reads public chain data only: USDT balances, the Energy each sender already has, and whether the collector holds USDT. No keys, no orders.</p>
<h2>The cost model</h2>
<p>Energy is spent by the sending address, so each sender needs its own rental. A SunLend order in November 2026 cost volume × price per unit + 0.4 TRX, with the price moving between 18 and 29 sun. For 65,000 Energy that's 1.57–2.29 TRX. Without Energy the network burns TRX instead, about 6.85 TRX per transfer by our estimate.</p>
<p>Two details change the numbers:</p>
<ul>
<li>If the collector holds no USDT, the first transfer into it needs about 131,000 Energy (2.76–4.20 TRX to rent, about 13.35 TRX burned). After that the rest need 65,000.</li>
<li>A sender that already has 65,000 Energy of its own costs nothing to sweep.</li>
</ul>
<p>The rule in the script: sweep a wallet if the rental cost in dollars is at most 10% of its USDT balance. Set your own threshold with MAX_FEE_SHARE.</p>
<h2>The script</h2>
<pre><code class="language-bash">npm install tronweb
</code></pre>
<pre><code class="language-js">const { TronWeb } = require('tronweb');

const tronWeb = new TronWeb({ fullHost: 'https://api.trongrid.io' });
const USDT = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t';

// SunLend, November 2026: price per Energy unit moved between 18 and 29 sun,
// plus a fixed 0.4 TRX per order. Pass today's numbers through env.
const PRICE_SUN = Number(process.env.PRICE_SUN ?? 29);
const ORDER_FEE_TRX = 0.4;
const TRX_USD = Number(process.env.TRX_USD ?? 0.306);
const MAX_FEE_SHARE = Number(process.env.MAX_FEE_SHARE ?? 0.1); // 10% of the balance

const rentTrx = (energy) =&gt; (energy * PRICE_SUN) / 1e6 + ORDER_FEE_TRX;
// Burn without Energy, SunLend's November 2026 estimate per USDT transfer
const burnTrx = (energy) =&gt; (energy === 65_000 ? 6.85 : 13.35);

async function plan(senders, collector) {
  tronWeb.setAddress(collector); // read-only calls still need an owner address
  const usdt = await tronWeb.contract().at(USDT);
  const balanceOf = async (a) =&gt; Number((await usdt.balanceOf(a).call()).toString()) / 1e6;
  let collectorHasUsdt = (await balanceOf(collector)) &gt; 0;
  const rows = [];
  for (const from of senders) {
    const usdtAmount = await balanceOf(from);
    if (usdtAmount === 0) continue;
    const need = collectorHasUsdt ? 65_000 : 131_000;
    const r = await tronWeb.trx.getAccountResources(from);
    const ownEnergy = (r.EnergyLimit ?? 0) - (r.EnergyUsed ?? 0);
    const costTrx = ownEnergy &gt;= need ? 0 : rentTrx(need);
    const share = (costTrx * TRX_USD) / usdtAmount;
    const sweep = share &lt;= MAX_FEE_SHARE;
    rows.push({
      from,
      usdt: usdtAmount,
      need,
      ownEnergy,
      costTrx: +costTrx.toFixed(2),
      share: `${(share * 100).toFixed(1)}%`,
      sweep,
      burnTrx: burnTrx(need),
    });
    if (sweep) collectorHasUsdt = true; // later transfers need only ~65,000
  }
  return rows;
}

async function main() {
  const [collector, ...senders] = process.argv.slice(2);
  const rows = await plan(senders, collector);
  console.table(rows.map(({ from, ...rest }) =&gt; ({ from: from.slice(0, 6) + '…', ...rest })));
  const picked = rows.filter((r) =&gt; r.sweep);
  const rent = picked.reduce((s, r) =&gt; s + r.costTrx, 0);
  const burn = picked.reduce((s, r) =&gt; s + r.burnTrx, 0);
  console.log(
    `sweep ${picked.length} of ${rows.length}: ~${rent.toFixed(2)} TRX with rented Energy, ~${burn.toFixed(2)} TRX if burned`,
  );
}

main().catch(console.error);
</code></pre>
<p>Run it with the collector first, then the senders:</p>
<pre><code class="language-bash">PRICE_SUN=29 TRX_USD=0.306 node plan.js &lt;collector&gt; &lt;sender1&gt; &lt;sender2&gt; ...
</code></pre>
<p>PRICE_SUN=29 is the pessimistic end of the November 2026 range; TRX_USD=0.306 matches the rate our site used that month (1.57 TRX ≈ $0.48). Pass current values when you run it.</p>
<h2>A real run</h2>
<p>Three public addresses holding USDT, collector also holding USDT:</p>
<pre><code class="language-text">from     usdt         need   ownEnergy  costTrx  share  sweep  burnTrx
TQrY8t…  1046.433141  65000  29         2.29     0.1%   true   6.85
TNXoiA…  5481.140561  65000  1254       2.29     0.0%   true   6.85
TAUN6F…  26.092493    65000  9          2.29     2.7%   true   6.85
sweep 3 of 3: ~6.87 TRX with rented Energy, ~20.55 TRX if burned
</code></pre>
<p>The 26 USDT wallet still passes at 2.7%. Drop it to 3 USDT and the share jumps to about 23%; at 1 USDT it's around 70%. Those are the wallets to leave until they hold more.</p>
<h2>Reading the result</h2>
<table>
<thead>
<tr>
<th><strong>Balance on the sender</strong></th>
<th><strong>Rental share (2.29 TRX ≈ $0.70)</strong></th>
<th><strong>Burn share (6.85 TRX ≈ $2.10)</strong></th>
</tr>
</thead>
<tbody><tr>
<td>1,000 USDT</td>
<td>0.07%</td>
<td>0.2%</td>
</tr>
<tr>
<td>50 USDT</td>
<td>1.4%</td>
<td>4.2%</td>
</tr>
<tr>
<td>3 USDT</td>
<td>23%</td>
<td>70%</td>
</tr>
<tr>
<td>1 USDT</td>
<td>70%</td>
<td>210%</td>
</tr>
</tbody></table>
<p>The fixed 0.4 TRX per order is a big part of the small-wallet problem: on ten wallets it's 4 TRX that a single shared package would avoid, but Energy can't be shared between addresses.</p>
<h2>What the script leaves out</h2>
<ul>
<li>Prices change during the day. The script uses the numbers you pass, not live quotes.</li>
<li>Bandwidth: one transfer takes about 350, an activated address gets 600 free per day. A wallet that already sent today will burn some TRX for Bandwidth.</li>
<li>Exchange deposits: if the collector is an exchange deposit address, we advise planning 131,000 for every transfer. Set need accordingly.</li>
<li>Large frozen stake: if you have one, delegating its Energy to your own senders makes costTrx zero for them.</li>
</ul>
<p>The actual sweep (one order per sender, safe retries with an idempotency key) is a separate step. The decision of which wallets to include is the one worth making first. Our <a href="https://sunlend.io/blog/how-much-energy-for-usdt">Energy cost breakdown</a> has the background on 65,000 vs 131,000.</p>
]]></content:encoded></item></channel></rss>