SolstackDocs

Tools

Grid Trading Bot

A bot with a wallet of its own that buys a token as its price falls through a ladder of lines and sells one line higher, around the clock until you stop it. Devnet only for now.

Open Grid Trading Bot ↗Solana Grid Trading Bot overview

Step by step

  1. Step 1Connect walletDevnet only for now. The wallet that funds the bot is the only one that can pause or stop it.
  2. Step 2Token, band, lines, order sizeThe preview draws the ladder and works out the SOL and tokens the bot starts with.
  3. Step 3Fund it in one transactionIts SOL, its tokens and a 0.02 SOL reserve move to the bot's own wallet, with the 0.1 SOL fee and a memo naming the bot.
  4. Step 4It trades on its ownIt checks the price about every 15 seconds, day and night. No tab needs to stay open.
  5. Step 5Stop and withdrawEvery token and every lamport goes back to the wallet that funded it.

How a grid trades

You set a price band in SOL per token and how many lines to draw across it, each the same percentage above the last. The gaps between lines are slots: 10 lines make 9. A slot holding SOL buys your order size's worth of the token when the price falls to its lower line, then sells exactly those tokens when the price rises to its upper line. Each round trip turns the order size into the order size × (1 + the line spacing), less fees, and the profit lands in SOL.

It trades only when other people's trades move the price across one of its lines, never to make volume.

What it starts with

Slots above the price start with tokens, counted as bought at their lower line; the rest start with SOL. So the bot needs SOL for the buy slots and tokens for the sell slots. The form works out both at the price now, and your wallet has to hold the tokens. A band whose top sits closer to the price needs fewer.

Settings

TokenAny token priced against SOL, picked from your wallet or pasted.
Price bandBottom and top, in SOL per token. Presets set it ±10%, 20%, 35% or 50% around the price now.
Lines3 to 60 (presets 6, 10, 16, 24). More lines trade more often for less each time.
Each orderSOL per buy, at least 0.01 (presets 0.05, 0.1, 0.25, 0.5). Each sell sells what the buy one line lower got.
Where it tradesOn mainnet, a Jupiter swap routed for the best price. On devnet, where Jupiter doesn't run, a Meteora DLMM pool you pick.

Reading the preview

Lime slots buy on the way down, blue slots sell on the way up, and yellow marks the price now. Beside the ladder: the gap between lines, what a round trip makes after an estimated 0.4% swap cost each way, and the starting funds. Lines under 1.5% apart get a warning, since little is left after fees; under 0.5% is refused.

Guards on every fill

  • A fill may land at most half a line-step past its line, kept between 0.3% and 3%; a worse quote waits for the next check.
  • An order that would move the price more than a quarter of the line spacing waits, so in a thin pool it can't set off its own next line. Smaller orders or a deeper pool fix that.
  • In a fast move it fills at most 4 lines per check and catches up on the next.
  • Outside the band it holds, all tokens below it or all SOL above it, and picks up again when the price returns.

Watching and stopping it

Each bot has a page anyone with the link can open: its status, what it holds and its worth in SOL, how that compares with just holding the deposit, a value chart with a point every 10 minutes, the grid as it stands, and every action with a Solscan link. The Your bots tab lists bots started in this browser and, after you sign in, those from other devices.

Pause, Resume and Stop and withdraw ask your wallet to sign a message, not a transaction. Paused, it makes no trades. Stop is final: every token and every lamport goes back to the funding wallet. To change the band, stop it and start a new bot.

What it costs

Solstack fee0.1 SOL once per bot, in the funding transaction. Trading, pausing, resuming and stopping carry no Solstack fee.
Swap feesEach order pays the pool's fee, and on mainnet Jupiter's: 0.1% on most pairs, 0.5% for tokens under 24 hours old. Neither goes to Solstack.
Reserve0.02 SOL stays in the bot's wallet for network fees and rent. What's left comes back when it stops.
Token accountAbout 0.002 SOL for the bot's token account, opened by the funding transaction and refunded on stop.

Risks and limits

  • It can lose money. If the price leaves the band downward, the bot ends up holding tokens bought on the way down; if it leaves upward, it holds only SOL and stops earning.
  • Your wallet's keys stay in your wallet. The bot trades from a separate wallet of its own, holding only what you put in it, and stopping it sends everything back to you. Solstack's server keeps that wallet's key sealed and uses it only for that bot.
  • Up to 100 SOL per bot. A token with a live freeze authority needs a tick, since it could freeze the bot's tokens. Token-2022 tokens with a transfer hook, non-transferable ones and ones whose new accounts start frozen are refused.
Devnet only for now: mainnet opens after the bots have been watched with real trades. Try it with free SOL from the devnet faucet. Not financial advice.

FAQ

What does it cost?

A 0.1 SOL Solstack fee, once per bot, paid in the funding transaction. Trading, pausing, resuming and stopping cost nothing more from Solstack. Each swap pays the pool's fee, and on mainnet Jupiter's (0.1% on most pairs, 0.5% for tokens under 24 hours old). Network fees come out of the bot's 0.02 SOL reserve, and what's left of it comes back when the bot stops.

How does it make money?

Each gap between two lines is a slot. A slot holding SOL buys your order size of the token when the price falls to its lower line, then sells exactly those tokens when the price rises to its upper line. A round trip turns the order size into the order size × (1 + the line spacing), less fees, and the profit lands in SOL. It trades only when other people's trades move the price across a line.

Why does it need tokens as well as SOL?

Slots above the price start out holding tokens, as if bought at their lower line, so they can sell as the price rises. The rest start with SOL. The form works out both amounts at the price now.

Who holds the funds?

Your wallet's keys stay in your wallet. The bot trades from a separate wallet of its own, holding only what you put in it, and stopping it sends everything back to you. Solstack's server keeps that wallet's key sealed and uses it only for that bot.

Do I need to keep this tab open?

No. It runs on Solstack's server around the clock and checks the price about every 15 seconds. Its page shows every action it has taken, with Solscan links.

What if the price leaves the band?

It holds. Below the bottom it has bought at every line and holds tokens; above the top it has sold them all and holds SOL. It picks up again when the price comes back.

How do I stop it?

Stop and withdraw on the bot's page, after a wallet sign-in (a message, not a transaction). Every token and every lamport goes back to the wallet that funded it. A stopped bot can't be restarted; start a new one to carry on.

Can it lose money?

Yes. A grid the price leaves downward ends up holding tokens bought on the way down; one it leaves upward is all SOL and stops earning. Lines set close together leave little after swap fees. Not financial advice.

Is it on mainnet?

Not yet. It runs on devnet only for now, and mainnet opens after the bots have been watched with real trades. On devnet it trades through a Meteora DLMM pool you pick, since Jupiter doesn't run there.

NextDLMM Liquidity Bot →
Your keys stay in your wallet · every job starts with your approval · fees shown before you sign← Back to solstack.xyz