Point it at a mint. It buys low and sells high inside a rolling price window, banks profit on the way up, and runs unattended. Strong defaults out of the box — dozens of knobs when you want them.
Live proof
These are live numbers from CyberLeek — one autonomous instance of exactly this bot on a public Solana token. They refresh every few minutes and move with the market. Not a backtest, not a projection.
Live from cyberleek.rhchain.network. Shown straight: this stretch has been chop-and-recovery, where a grid beats holding — in a straight vertical pump the same bot would lag holding, and this number can go negative. That is the strategy shown honestly, not a cherry-pick.
What it is
The bot is token-agnostic: the same engine trades any SPL token you give it a mint for. It holds a rolling window of recent prices, works out where the current price sits in that window, and does the boring, profitable thing — accumulate low, distribute high, keep a fenced moonbag, and ratchet realized profit off the table.
It signs from a burner wallet you control. Nobody deposits into it. No accounts, no custody.
Set one field — the token mint — and the same decision engine trades it. Run several tokens from one wallet with allocation caps.
A cost-basis guard means a sell can’t fire below what the bag cost. Trades only clear when the move beats round-trip fees.
When total value crosses a trigger, it moves SOL to a separate profit wallet and keeps trading the rest.
How it works
Every cycle (~60s) the bot runs the same four steps. Nothing about it is clever; the edge is discipline and doing it consistently without emotion.
Deepest priced pool from DexScreener / Jupiter, plus optional on-chain vault math for a true 1-second price.
Where does price sit in the rolling window? Low → buy. High → sell. Dead chop → hold.
Route the buy or sell through Jupiter with a slippage bound. One swap per cycle, max.
Persist window, cost basis, last-sell price, realized P&L, skim total. Survives restarts.
↻ repeat every cooldown window — arm it once and walk away
Quickstart
Generate a new keypair used only for this bot. Put in SOL you can lose entirely — this is an all-or-nothing wallet, not your savings.
Verify mintAuthority = null (and ideally freezeAuthority = null). A live mint authority means the dev can print supply and rug you — see Safety.
Drop the default config in, set mint, wallet and skim_wallet. Leave everything else alone until you have a reason.
Let it print its decisions (buy/sell/hold + reason) for a while with armed:false. Confirm the calls look sane on your token before it spends a cent.
Set armed:true. It trades on its own cadence from here. Watch the first few round-trips, then let it work.
Configuration
These are battle-tested balanced defaults — a moderate window, room to accumulate, a fenced moonbag, and a profit ratchet. Copy this, set the three YOUR_… fields, and you have a working bot.
# the only three you MUST set: mint, wallet, skim_wallet
{
"mint": "YOUR_TOKEN_MINT_ADDRESS",
"circ_supply": null, # optional, for market-cap display
"wallet": "YOUR_BURNER_WALLET_PUBKEY",
"skim_wallet": "YOUR_PROFIT_WALLET_PUBKEY",
"window_n": 40, # rolling price window (cycles)
"warmup_n": 8, # samples before it trades
"buy_zone": 0.40, # buy in the low 40% of the window
"sell_zone": 0.60, # sell in the high 40%
"confirm_tick": 0.01, # wait for a 1% reversal off the extreme
"round_trip_margin": 0.04, # sell must clear the rebuy floor by 4%
"min_spread": 0.02, # ignore windows tighter than 2% (chop)
"reserve_frac": 0.20, # keep 20% of value in SOL as dry powder
"half_kelly": 0.5, # max fraction of the active side per trade
"moonbag_frac": 0.15, # never sell below 15% of peak bag
"trend_tilt": 0.0, # 0 = pure mean reversion; up = ride trends
"vol_size": true, # size up when volatility is higher
"rebuy_below_sell": true, # never rebuy back above your own sell
"rebuy_lockout_s": 14400, # ...for 4h, then the guard releases
"sol_alloc_frac": 1.0, # share of wallet SOL this token may spend
"cooldown_s": 45, # min seconds between trades
"slippage_bps": 150, # 1.5% max slippage
"sol_fee_reserve": 0.02, # never spend SOL below this (gas)
"min_trade_sol": 0.01, # no dust trades (fee drag)
"min_trade_usd": 3.0,
"skim_trigger_usd": 1000.0, # when total value crosses this...
"skim_amount_usd": 500.0, # ...bank this much SOL to skim_wallet
"breakdown_mcap": null, # optional hard stop; null = no loss limit
"armed": false # flip to true when you're ready
}
Everything below skim_wallet has a sane default — you can delete any line you don’t override and the engine fills it in.
Reference
The whole strategy is these parameters. Two dials matter most: the window (how far back it looks) and the zones (how eagerly it buys and sells). The rest protect you from fees, dust, and your own past trades.
| Param | What it does | Default | Tune up / down | Safe range |
|---|---|---|---|---|
| window_n | Length of the rolling price window. The whole “range” is derived from it. | 40 | ↑ smoother, longer swings, fewer trades. ↓ reacts to micro-moves, trades more (and churns more). | 20–120 |
| buy_zone | Buy when price sits at or below this position in the window (0 = the low). | 0.40 | ↑ buys more eagerly / higher. ↓ waits for deeper dips. | 0.25–0.45 |
| sell_zone | Sell when price is at or above this position (1 = the high). The buy→sell gap is the “no-trade” deadband. | 0.60 | ↓ sells sooner, more trades. ↑ holds for the top, rides more. | 0.55–0.90 |
| confirm_tick | Require a reversal this far off the extreme before acting (anti-knife-catch). | 0.01 | ↑ stronger confirmation, fewer false entries. ↓ faster, twitchier. | 0.005–0.02 |
| round_trip_margin | A sell must clear the rebuy floor (window low) by this much — guarantees room to buy back lower. | 0.04 | ↑ only sells with fat margin. ↓ sells closer to the floor. | 0.015–0.06 |
| min_spread | Skip windows narrower than this — dead chop where the move can’t beat fees. | 0.02 | ↑ only trade real volatility. ↓ trade tighter ranges (riskier vs cost). | 0.02–0.05 |
| reserve_frac | Keep at least this share of tradeable value in SOL as dry powder. Caps buying, never selling. | 0.20 | ↑ more powder for dips, slower accumulation. ↓ deploys harder, can get stuck long. | 0.15–0.35 |
| half_kelly | Max fraction of the active side traded per order; scales position size. | 0.5 | ↑ bigger, bolder slices. ↓ smaller, steadier. | 0.4–0.9 |
| moonbag_frac | Fenced share of the peak token bag that is never sold — your free ride if it moons. | 0.15 | ↑ hold more for the moon, less to trade. ↓ scalp everything. | 0.0–0.25 |
| trend_tilt | Bias the zones with the trend: raise buy_zone in an uptrend so it holds/rides instead of selling into strength. | 0.0 | ↑ rides pumps (less mean-reversion). 0 = pure buy-low/sell-high. | 0.0–0.5 |
| vol_size | Scale trade size up when recent volatility is high. | true | Turn off for uniform sizing. | true/false |
| rebuy_below_sell | The anti-leak guard: after a sell, refuse to buy back above that sell price (minus round_trip_margin). Dips still buy. | true | Turn off only for a fast two-way scalper that intentionally re-enters quickly. | true/false |
| rebuy_lockout_s | How long that guard holds before releasing (so a genuine breakout isn’t blocked forever). | 14400 | ↑ stricter. ↓ re-enters sooner. | 1h–8h |
| sol_alloc_frac | Cap this token’s spend to a fraction of the shared wallet’s SOL — run several tokens from one wallet. | 1.0 | Split across tokens so they sum to ≤ 1.0. | 0.1–1.0 |
| cooldown_s | Minimum seconds between any two trades. | 45 | ↑ calmer, fewer trades. ↓ more aggressive. | 30–180 |
| slippage_bps | Max slippage tolerated on a swap (150 = 1.5%). | 150 | Raise for illiquid tokens; keep tight where you can. | 50–300 |
| sol_fee_reserve | Never let wallet SOL drop below this — always keep gas. | 0.02 | Raise if you fire many trades per hour. | 0.01–0.05 |
| min_trade_sol / min_trade_usd | Floor on trade size so gas doesn’t eat micro-trades. | 0.01 / 3 | ↑ on tiny wallets so each round-trip clears gas. | $3–$10 |
| skim_trigger_usd / skim_amount_usd | Profit ratchet: when total value crosses the trigger, move this much SOL to the profit wallet. | 1000 / 500 | Lower the trigger to bank sooner. | your call |
| breakdown_mcap | Optional hard stop: dump if market cap falls below this. Off by default. | null | Set a number to add a stop-loss (see Safety). | null / mcap |
Strategy presets
Same engine, three personalities. Run two side-by-side on the same token from different wallets and let the market tell you which fits it.
{
"window_n": 60,
"buy_zone": 0.35,
"sell_zone": 0.85,
"trend_tilt": 0.3,
"moonbag_frac": 0.10,
"min_spread": 0.04,
"cooldown_s": 120,
"rebuy_below_sell": true
}Pick when: the token is trending up or you believe in it long-term and want to lag hold as little as possible while still harvesting swings.
Use the strong defaults as-is. Moderate window, moderate zones, 15% moonbag, profit ratchet on. Watch a day of decisions, then nudge one knob at a time.
{
"window_n": 20,
"buy_zone": 0.44,
"sell_zone": 0.56,
"trend_tilt": 0.0,
"moonbag_frac": 0.0,
"half_kelly": 0.85,
"cooldown_s": 60,
"min_spread": 0.022,
"round_trip_margin": 0.015,
"min_trade_usd": 6,
"rebuy_below_sell": false
}Pick when: the token is ranging sideways with steady volatility and you want to farm the chop rather than wait for a top. It will underperform in a straight pump — that’s the trade-off.
Safety
curl -s https://api.mainnet-beta.solana.com -X POST \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo",
"params":["<MINT>",{"encoding":"jsonParsed"}]}' \
| python3 -c 'import sys,json; i=json.load(sys.stdin)["result"]["value"]["data"]["parsed"]["info"]; \
print("mintAuthority:", i["mintAuthority"], " freezeAuthority:", i["freezeAuthority"])'
# mintAuthority: None freezeAuthority: None <- SAFE (renounced)
# anything else -> do NOT attach the bot
Fund a dedicated burner with only what you’re willing to lose completely. Never your main wallet, never rent money.
Every round-trip pays ~1% LP + slippage plus a bit of gas. If the captured spread doesn’t beat that, you bleed. Keep min_spread and trade floors honest.
A sell can never fire below the bag’s average cost. It would rather hold underwater than lock a loss — which is why there’s no panic-selling.
If you show performance publicly, report realized P&L from actual fills. Don’t credit unrealized or double-count skimmed profit.
For AI agents
If you’re an AI building this bot, implement the loop below verbatim. It is the exact decision logic behind the defaults above — no hidden magic.
# run every cooldown_s seconds, one swap per cycle max
window = last window_n prices # need >= warmup_n first
r_lo, r_hi = min(window), max(window)
pos = (price - r_lo) / (r_hi - r_lo) # 0 = low, 1 = high
spread = (r_hi - r_lo) / price
if spread < min_spread: return HOLD # dead chop
# --- SELL: high in range, confirmed, profitable, clear of the floor ---
if pos >= sell_zone
and price <= r_hi * (1 - confirm_tick) # ticked down off the high
and price >= r_lo * (1 + round_trip_margin) # above the rebuy floor
and price >= avg_cost * (1 + sell_margin): # never sell below cost
size = half_kelly * (0.4 + 0.6*pos) * vol_boost
sell min(tradeable, bag*size) # tradeable excludes moonbag
record last_sell_price = price; return
# --- BUY: low in range, ticked up, dry powder, not above our own sell ---
spendable = wallet_sol - sol_fee_reserve
keep reserve_frac of total value in SOL # -> spend_room
blocked = rebuy_below_sell and last_sell_price
and now - last_sell_ts < rebuy_lockout_s
and price > last_sell_price*(1 - round_trip_margin)
if pos <= buy_zone
and price >= r_lo * (1 + confirm_tick) # ticked up off the low
and spend_room > 0 and not blocked:
size = half_kelly * (0.4 + 0.6*(1-pos)) * vol_boost
buy min(spendable*size, spend_room) * sol_alloc_frac
return
return HOLD
# after any cycle: if sol_bal*price_val + bag*price >= skim_trigger_usd:
# move skim_amount_usd of SOL -> skim_wallet (bank profit, keep trading)
mint: string(required) circ_supply: number|null wallet: pubkey skim_wallet: pubkey
window_n:int warmup_n:int buy_zone:0..1 sell_zone:0..1 confirm_tick:0..1
round_trip_margin:0..1 min_spread:0..1 reserve_frac:0..1 half_kelly:0..1
moonbag_frac:0..1 trend_tilt:0..1 vol_size:bool rebuy_below_sell:bool
rebuy_lockout_s:int sol_alloc_frac:0..1 cooldown_s:int slippage_bps:int
sol_fee_reserve:number min_trade_sol:number min_trade_usd:number
skim_trigger_usd:number skim_amount_usd:number breakdown_mcap:number|null armed:bool
Dependencies to wire: a price source (DexScreener or Jupiter quote for the deepest priced pool), Jupiter for swaps, a Solana RPC for balances and the mint-authority safety read, and a small JSON state file per token (window, avg_cost, last_sell_price, realized_pnl, skim_total, peak_token).
FAQ