
Dust Sweeper
- 2 installs
- 1 repo stars
- Updated July 29, 2026
- starchild-ai-agent/community-skills
Scan a wallet for small ERC-20 or SPL token balances and swap the profitable ones to ETH, USDC, or SOL via Odos or Jupiter.
About
A skill that scans a wallet for small-balance 'dust' tokens across Ethereum, Base, Arbitrum, and Solana and swaps them to ETH/USDC/SOL via Odos or Jupiter. A developer uses it to consolidate low-value token holdings only when the swap clears gas cost.
- Sweeps small ERC-20/SPL balances via Odos (EVM) and Jupiter (Solana)
- Profitability filter skips swaps where gas exceeds token value
Dust Sweeper by the numbers
- 2 all-time installs (skills.sh)
- Ranked #408 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/starchild-ai-agent/community-skills --skill dust-sweeperAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2 |
|---|---|
| repo stars | ★ 1 |
| Last updated | July 29, 2026 |
| Repository | starchild-ai-agent/community-skills ↗ |
What it does
Scan a wallet for small ERC-20 or SPL token balances and swap the profitable ones to ETH, USDC, or SOL via Odos or Jupiter.
Files
Dust Sweeper v2
Identify and swap low-value tokens ("dust") to ETH, USDC, USDT, or SOL — across EVM chains and Solana. Uses Odos for EVM (batch-optimized, better execution than 1inch for multi-token sweeps) and Jupiter for Solana. No middlemen, no discount haircut, no 24h wait.
---
Prerequisites — Wallet Policy
Before executing any swaps or approvals, the wallet policy must be active. Load the wallet-policy skill and propose the standard wildcard policy (deny key export + allow *). This covers all Odos approvals and swaps.
---
Supported Chains
| Chain | Aggregator | Native Output |
|---|---|---|
| Ethereum mainnet | Odos | ETH |
| Base | Odos | ETH |
| Arbitrum | Odos | ETH |
| Solana | Jupiter | SOL |
Ask the user which chain(s) to scan. Default: all chains (scan everything, sweep what's profitable).
---
Workflow
Phase 1 — Discovery
EVM chains (Ethereum, Base, Arbitrum): 1. Call wallet_balance(chain=<chain>) without an asset filter for each chain — returns ALL tokens with non-zero balances. 2. For each token, get a USD value:
- Use
cg_token_price(platform=<chain>, contract_addresses=<address>)for price. - Fallback: Odos quote with full balance to probe the market.
3. Flag tokens as dust if their USD value is below the dust threshold (default: $50).
Solana: 1. Call wallet_sol_balance() without an asset filter — returns ALL SPL tokens. 2. Price each SPL token via cg_token_price(platform="solana", contract_addresses=<mint_address>). 3. Flag as dust if below threshold.
Show the user the full dust inventory before executing anything. Format: chain | token symbol | balance | USD value
---
Phase 2 — Profitability Filter
For each dust token: 1. Quote the full balance via the appropriate aggregator:
- EVM: Odos quote,
dst = native ETH(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) or USDC/USDT if user prefers. - Solana: Jupiter quote,
outputMint = SOLor USDC.
2. Estimate gas cost:
- EVM: approve (~$1–3) + swap (~$3–8 mainnet, ~$0.10–0.50 Base/Arbitrum). Assume $10 on mainnet, $1 on L2s if no live data.
- Solana: ~$0.001 per transaction.
3. Skip if: quoted_output_usd < gas_cost_usd + MIN_PROFIT_USD (default MIN_PROFIT = $2). 4. Report skipped tokens with reason ("gas would eat the value").
L2 advantage: On Base and Arbitrum, gas is cheap enough ($0.10–0.50) that tokens as small as ~$3–5 can be worth sweeping.
---
Phase 3 — Execution
EVM (Odos): 1. Check allowance: skip approval if already approved for Odos router. 2. odos_approve(chain=<chain>, token_address=...) — approve Odos router. 3. odos_swap(chain=<chain>, input_token=token_address, output_token=0xEeee..., amount=..., slippage=2.0). 4. Odos supports multi-token batch swaps — if multiple tokens need sweeping on the same chain, batch them into a single transaction where possible. This cuts gas vs. one-by-one. 5. After each swap/batch: report tokens swept, ETH/USDC received, tx hash.
Solana (Jupiter): 1. Use Jupiter swap route for each SPL token → SOL (or USDC). 2. Sign and send via wallet_sol_transfer. 3. Report: token name, amount swapped, SOL/USDC received, tx signature.
---
Phase 4 — Summary
Report per chain:
- Tokens swept, total USD recovered
- Tokens skipped (unpriced, unprofitable, errored)
- Net ETH/SOL received
Final line: "Swept N tokens across X chains, recovered ~$Y in ETH/SOL."
---
Key Parameters (ask user if not specified)
| Parameter | Default | Notes |
|---|---|---|
| Dust threshold | $50 USD | Tokens above this are NOT dust |
| Min profit after gas | $2 USD | Skip swaps that barely cover gas |
| Slippage | 2% | Dust tokens often have thin liquidity |
| Output token (EVM) | Native ETH | Or USDC/USDT if user prefers |
| Output token (Solana) | SOL | Or USDC |
| Chains to scan | All (ETH + Base + ARB + SOL) | User can narrow to specific chains |
---
Token Addresses
Native ETH (all EVM chains): 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Ethereum mainnet:
- WETH:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - USDC:
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 - USDT:
0xdAC17F958D2ee523a2206206994597C13D831ec7
Base:
- USDC:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Arbitrum:
- USDC:
0xaf88d065e77c8cC2239327C5EDb3A432268e5831
Solana:
- USDC mint:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - SOL mint (native):
So11111111111111111111111111111111111111112
---
Gotchas
Odos vs 1inch: Odos is optimized for multi-token routing and typically gives better execution on dust sweeps with thin liquidity. Prefer Odos for EVM. If Odos is unavailable, fall back to 1inch with same parameters.
Unpriced tokens: If CoinGecko returns no price and Odos/Jupiter return no quote, skip — don't waste gas on un-routable tokens.
Fee-on-transfer tokens: If a swap fails, log the error and move on. Don't abort the whole sweep.
Batch vs single: Odos PathFinder can handle multi-input single-output routes (many tokens → ETH in one tx). Use this when available — it's significantly cheaper on mainnet.
Approvals are permanent. Unlimited approvals to Odos router are standard practice. Offer exact-amount approvals if user is security-conscious.
Gas spikes (mainnet): If ETH gas > 30 gwei, warn the user. L2 sweeps (Base, Arbitrum) are almost always worth it regardless. Offer to schedule mainnet sweep for off-peak hours.
Don't touch tokens the user might want. Always confirm the sweep list before Phase 3. Never auto-execute without showing the inventory first.
Solana dust is cheap to sweep. At ~$0.001/tx, even $1 tokens can be worth sweeping on Solana. Lower the MIN_PROFIT threshold to $0.50 for Solana by default.
---
Dry Run Mode
If the user says "what dust do I have?" or "show me my dust" without asking to sweep — run Phase 1 + Phase 2 only. Show the inventory and what would be profitable to sweep, but don't execute Phase 3.
---
Scheduling
For recurring sweeps (e.g. "sweep my dust every Sunday"), use schedule_task with cron 0 10 * * 0 (Sunday 10am UTC). Note: wallet policy must be persistent. L2 chains are good candidates for frequent scheduled sweeps given low gas costs.
DustSweeper — Complete Reference for Starchild
Status: Deprecated (~2025). Superseded by EIP-7702 (Pectra upgrade), which enables native batching in EOA wallets.
Archived for reference and as the basis for a modern Starchild dust-sweeping agent capability.
---
1. What It Is
DustSweeper is a maker-taker DEX for ERC-20 "dust" — small token balances not worth swapping individually due to gas costs. Won top hackathon prize at ETHDenver 2022. Built by Paymagic Labs (corbpage).
Core insight: Gas cost is the blocker for small swaps. The protocol solves this by separating who approves from who pays gas for the swap.
- Users (makers): Pay ~$8 for
approve()only. Never pay swap gas. - Bots (takers): Scan for approved dust, batch-execute
sweepDust(), pay all swap gas. Profit from buying dust at a discount to market price.
---
2. Contract
Address: 0x78106f7db3EbCEe3D2CFAC647f0E4c9b06683B39 (Ethereum Mainnet) License: UNLICENSED Compiler: Solidity ^0.8.13 Verified: Yes — Etherscan
Dependencies
@rari-capital/solmate/src/utils/SafeTransferLib.sol@rari-capital/solmate/src/utils/ReentrancyGuard.sol@openzeppelin/contracts/access/Ownable.sol./Trustus.sol— custom off-chain price oracle (signed attestations)
Key Data Structures
struct Token {
bool tokenSetup;
uint8 decimals;
uint8 takerDiscountTier; // discount bot gets when buying dust
}
struct CurrentToken {
address tokenAddress;
uint8 decimals;
uint256 price; // price from Trustus oracle
}
struct TokenPrice {
address addr;
uint256 price;
}
struct Native {
uint256 balance; // ETH to pay out to maker
uint256 total;
uint256 protocol; // protocol fee split
}
struct Order {
uint256 nativeAmount; // ETH maker receives
uint256 tokenAmount; // dust tokens transferred out
uint256 distribution; // fee distribution
}Key Events
event Sweep(
address indexed makerAddress,
address indexed tokenAddress,
uint256 tokenAmount,
uint256 ethAmount
);
event ProtocolPayout(uint256 protocolSplit, uint256 governorSplit);Key Errors
error ZeroAddress();
error NoBalance();
error NotContract();
error NoTokenPrice(address tokenAddress);
error NoSweepableOrders();
error InsufficientNative(uint256 sendAmount, uint256 remainingBalance);
error OutOfRange(uint256 param);Core Function: sweepDust()
Called by taker bots. Bot provides: 1. Array of maker addresses + token addresses 2. Signed price attestation from Trustus oracle 3. ETH (msg.value) to pay makers
The contract:
- Verifies the oracle signature (Trustus)
- Checks each maker's token balance + approval
- Transfers tokens from maker → bot
- Sends ETH from bot → maker
- Takes protocol fee cut
Admin Functions (Owner)
toggleSweepWhitelist()— enable/disable bot whitelisttoggleSweepWhitelistAddress(address)— add/remove bot from whitelisttoggleIsTrusted(address)— manage Trustus oracle signerswithdrawToken(address)— recover stuck tokens
---
3. The Trustus Oracle
Off-chain price attestation system. A trusted server: 1. Fetches token prices from DEX aggregators / CoinGecko 2. Signs price data with a private key 3. Bots include the signed payload in sweepDust() calls 4. Contract verifies signature on-chain before accepting prices
For Starchild: This role is naturally replaced by the agent itself querying live prices via CoinGecko/1inch and constructing the swap logic directly.
---
4. Taker Discount Tiers
Bots buy dust at a discount from market price. Tiers likely range ~5–20% depending on token liquidity/risk. This discount:
- Compensates bots for gas costs
- Scales to make unprofitable batches uneconomical (self-regulating)
- Creates the "dust is worth something, just not face value" market
---
5. Version History
| Version | Tokens Supported | Key Changes |
|---|---|---|
| v1 (ETHDenver 2022) | ~80 | Initial concept, fixed token list |
| v2 (2023) | 5,000+ | Trustus oracle for dynamic pricing, gas optimizations, major token expansion |
---
6. Why It Was Deprecated
EIP-7702 (Ethereum Pectra upgrade, 2025): Allows EOAs (externally owned accounts) to temporarily set code, enabling wallets to:
- Batch
approve + swapinto a single atomic transaction - Pay gas once for many operations
- Do natively what DustSweeper did via a protocol middleman
The core UX problem (gas-too-expensive-for-dust) is now solvable at the wallet layer.
---
7. Links
| Resource | URL |
|---|---|
| Site (deprecated) | https://dustsweeper.xyz |
| PRD (Mirror) | https://launch.mirror.xyz/EwldfOSzRyv2uwOg8hCctXdvfps4LygGZnIR2j_mrJk |
| V2 Announcement | https://launch.mirror.xyz/nZL8_LUPRmvKGJJnD3KSXyZtP-iDkkG5ie9_Dl5yvPo |
| Dune Dashboard | https://dune.com/corbpage/DustSweeper-Dashboard |
| Contract (Etherscan) | https://etherscan.io/address/0x78106f7db3ebcee3d2cfac647f0e4c9b06683b39#code |
| DoraHacks | https://dorahacks.io/buidl/2101 |
| Builder | Paymagic Labs (corbpage) |
---
8. Starchild Agent Capability Design
Concept: "Sweep My Dust"
A native Starchild capability that: 1. Scans a user's wallet for dust tokens (small USD-value ERC-20 balances) 2. Gets live quotes for each token via 1inch 3. Filters to profitable swaps (value > gas cost) 4. Executes swaps (either directly or via 1inch aggregator) 5. Reports what was swept and total ETH recovered
Two Implementation Approaches
A. Post-EIP-7702 (Modern — Recommended)
User: "Sweep my dust"
Agent:
1. wallet_balance(chain="ethereum") → discover all ERC-20 tokens
2. For each token with balance < $50:
a. coin_price() / birdeye_token_overview() → get market price
b. oneinch_quote() → get actual swap quote + gas estimate
c. Filter: keep only swaps where output > gas cost + min threshold
3. For profitable tokens:
a. oneinch_approve() → approve 1inch router
b. oneinch_swap() → execute swap to ETH/USDC
4. Report: "Swept 12 tokens, recovered $47.23 ETH"B. DustSweeper Protocol-Compatible (Legacy, educational)
Interact with the existing contract (still deployed, bots may no longer be active):
approve()tokens to0x78106f7db3EbCEe3D2CFAC647f0E4c9b06683B39- Monitor for
Sweepevents to confirm bot execution
Key Thresholds (configurable)
- Dust threshold: Token balance < $50 USD (configurable)
- Min sweep value: Must recover > $2 after gas (otherwise skip)
- Gas price gate: Pause sweeping if gas > 20 gwei (configurable)
- Slippage: Default 2% for dust tokens (often low liquidity)
What Makes This a Good Agent Task
- Requires no real-time user interaction (fire and forget)
- Benefits from batching (check all tokens in one pass)
- Agent can price-check, gas-check, and execute atomically
- Natural fit for scheduling: "sweep my dust every Sunday"
---
9. Starchild Skill Plan
Skill name: dust-sweeper Tools needed:
wallet_balance— discover ERC-20 holdingsbirdeye_token_overview— get USD value of tokensoneinch_quote— get swap quotes with gas estimatesoneinch_approve+oneinch_swap— execute swapscoin_price— fallback pricing for mainstream tokens
Trigger phrases:
- "Sweep my dust"
- "Clean up my wallet"
- "What dust do I have?"
- "Sell my small token balances"
Skill file path: skills/dust-sweeper/SKILL.md
#!/usr/bin/env python3
"""
discover_dust.py — Offline dust discovery helper.
NOT called directly by the agent (agent uses native tools).
This is a reference/test script for validating dust discovery logic
against a known wallet address using the Etherscan token API.
Usage:
python3 skills/dust-sweeper/scripts/discover_dust.py <wallet_address>
Requires:
ETHERSCAN_API_KEY in environment (optional — uses free tier if absent)
pip install requests
Output:
JSON list of {token, contract, balance_raw, balance_human}
for all ERC-20 tokens with non-zero balance.
Agent then prices each one via birdeye_token_overview / oneinch_quote.
"""
import sys
import json
import os
import requests
ETHERSCAN_API = "https://api.etherscan.io/api"
DUST_THRESHOLD_USD = 50.0
def get_token_list(wallet: str, api_key: str = "") -> list[dict]:
"""Fetch ERC-20 token transfer history to infer current holdings."""
params = {
"module": "account",
"action": "tokentx",
"address": wallet,
"startblock": 0,
"endblock": 99999999,
"sort": "desc",
"apikey": api_key or "YourApiKeyToken",
}
resp = requests.get(ETHERSCAN_API, params=params, timeout=15)
resp.raise_for_status()
data = resp.json()
if data.get("status") != "1":
return []
# Deduplicate by contract address
seen = {}
for tx in data["result"]:
addr = tx["contractAddress"].lower()
if addr not in seen:
seen[addr] = {
"symbol": tx["tokenSymbol"],
"name": tx["tokenName"],
"contract": addr,
"decimals": int(tx["tokenDecimal"]),
}
return list(seen.values())
def main():
if len(sys.argv) < 2:
print("Usage: discover_dust.py <wallet_address>")
sys.exit(1)
wallet = sys.argv[1]
api_key = os.environ.get("ETHERSCAN_API_KEY", "")
print(f"Scanning {wallet} for ERC-20 tokens...", file=sys.stderr)
tokens = get_token_list(wallet, api_key)
print(f"Found {len(tokens)} unique ERC-20 contracts in history", file=sys.stderr)
print(json.dumps(tokens, indent=2))
if __name__ == "__main__":
main()