redeem-auto — Watcher that auto-claims winning shares
Polls CLOB cash balance every 5 minutes, spawns redeem.js --live whenever balance dips below the threshold (default $20). Keeps a fleet of high-churn scalpers funded without manual redemption.
| Strategy type | Utility |
|---|---|
| Asset | All |
| Timeframe | — |
| Market type | All Polymarket markets |
| Minimum capital | $0 |
| Dependencies | @polymarket/clob-client-v2, @polymarket/builder-relayer-client, ethers |
What it does
redeem-auto is a long-running watcher that polls your CLOB cash (collateral) balance every 5 minutes by default. When balance drops below the threshold (default $20), it spawns tools/redeem.js --live to claim all redeemable positions on-chain. After the redeem completes, it logs the new balance and goes back to sleep.
The edge
The bots in this suite don't redeem on their own. They focus on trading. Without something polling the wallet, winning shares accumulate as outcome tokens that the CLOB doesn't count as collateral, and the bots run out of money even after a winning streak.
redeem-auto is the simplest possible solution: a tiny watcher that does one thing and stays out of the way. It's a 93-line file. Running it 24/7 alongside your trading bots means every winning trade becomes fresh capital within 5 minutes.
How it works
loop {
cash = await CLOB.getBalanceAllowance('COLLATERAL')
if cash < THRESHOLD:
spawn('node tools/redeem.js --live')
sleep INTERVAL_SEC
}
Implementation details:
- CLOB v2 client (
@polymarket/clob-client-v2) reads collateral balance viagetBalanceAllowance({ asset_type: 'COLLATERAL' }). Result is in 6-decimal USDC units, divided by 1e6 for display. - Spawn:
node tools/redeem.js --liveis spawned as a child process withstdio: 'inherit', so the redeemer's on-chain TX hashes appear in your monitor's log. - Block until redeem completes, then re-read the balance for a confirmation log line.
- Error handling: any failure in the balance check logs the error and continues. The loop never dies.
- --once mode: useful for cron-driven setups where the schedule is external.
Sample output
[25/05/2026, 17:00:00] Auto-redeem watcher started | threshold=$20 | interval=300s [25/05/2026, 17:00:01] Cash: $34.50 | Threshold: $20.00 [25/05/2026, 17:05:01] Cash: $28.75 | Threshold: $20.00 [25/05/2026, 17:10:01] Cash: $18.40 | Threshold: $20.00 [25/05/2026, 17:10:01] Cash below threshold — triggering redeem [25/05/2026, 17:10:18] Redeem complete. New cash: $41.20
Design targets
Latency: from a winning resolution to USDC back in CLOB collateral, ≤ INTERVAL_SEC + on-chain confirmation. With the default 5-min interval and ~3s confirmation, that's about 5 minutes 3 seconds worst case. Halve the interval to 150s if you run high-frequency scalpers; you'll spend slightly more on RPC calls but the bots will see fresh capital faster.
Capital recovered per cycle: as much as is currently redeemable. A high-volume scalper fleet (poly5m-v4 + poly15m-sniper + poly15m-v6 running together) typically generates 20-40 redeemable positions per day. Each redeem call batches them in groups of 20 (configurable via the underlying redeem.js).
FAQ
When to use this vs the manual redeemer?
Manual redeemer: fine if you run low-volume strategies (contrarian, no-bot, polyweather) and check things once a day. redeem-auto: required for scalpers that churn through 20+ resolutions per day, since they'll run out of collateral within hours otherwise.
When to use this vs redeem-convert-auto?
redeem-auto handles the redeem step. If your bots use markets that still settle in USDC.e (most pre-V2 markets), you also need the wrap step to convert USDC.e → pUSD. That's what redeem-convert-auto does: it's a superset.
If you only trade markets that settle directly in pUSD, redeem-auto is enough.
What's included
tools/redeem-auto.js(the watcher)tools/redeem.js(the on-chain redeemer it spawns)- README with pm2 ecosystem.config.js example and cron alternative
Configuration
| Flag | Default | Description |
|---|---|---|
| --threshold 20 | 20 | Cash balance threshold in USD. Triggers redeem when balance drops below. |
| --interval 300 | 300 | Seconds between balance checks. Default 5 minutes. |
| --once | — | Run one check then exit. Useful for cron-driven setups. |
Related bots
redeemer — On-chain position redeemer
Claims resolved Polymarket positions on-chain via the Safe relayer. Supports standard CTF and neg-risk adapter. Dry-run by default, --live to execute, batches of 20. Free in every bundle.
redeem-convert-auto — Auto-redeem plus USDC.e → pUSD wrapper
LIVESuperset of redeem-auto. Also wraps on-chain USDC.e into pUSD via Polymarket's CollateralOnramp using the builder relayer. Required after V2/pUSD migration if any market still pays USDC.e.