Documentation index

Solana Arbitrage Bot

The same token can trade at slightly different prices on two pools. The Solana Arbitrage Bot watches the tokens on your watchlist and, when it finds such a gap, buys the token on the cheaper pool and sells it on the other in one transaction that starts and ends in SOL. That is one round trip: two swaps, SOL in and SOL out.

The transaction carries your minimum profit. It fails unless it returns the SOL that went in plus every cost plus your minimum, so a trade that would make less doesn't go through, and a failed trade costs only its network and priority fee. Nothing here is a promise of profit.

Set it up

  1. Deploy the bot. Choose the Solana Arbitrage Bot on allenhark.com/bots and pay. Your server is set up and your bot wallet is created on it; Quick start shows each screen.
  2. Fill your watchlist with the tokens to arbitrage (below), and pick a starter.
  3. Practise first. The bot starts in practice: it looks at real pools and records what each round trip would have returned, with virtual SOL. Nothing is sent.
  4. Add SOL and go live. Send SOL to your bot wallet from Wallet, then press Go live and confirm with your PIN, like every AllenHark bot.

Your watchlist

The bot only trades tokens on your watchlist, each against SOL. Paste token contract addresses (CAs) on the Strategy page, one or several at a time. SOL itself doesn't go on the list: every round trip starts and ends in it. In Expert settings you can also name the pools to use for a token.

The watchlist holds 100 tokens by default; AllenHark can set a different limit for your deployment, and the page shows how many you have, for example "12 of 100".

When the list is full, an add is refused with "Your watchlist is full", and nothing is added: remove a token to add another, or ask support if you need more room. An add of several tokens is all or nothing, so if only some would fit, none are added and the page says how many more fit. A token listed twice, or an address that isn't a token's, is refused too.

How it works

1. It finds your tokens' pools

The bot learns each token's pools from the token's own transactions: as they happen on the transaction stream, and from its recent transactions. Each pool it finds is checked on chain before it is used, and remembered. Pools it trades:

  • PumpSwap;
  • Raydium CPMM and Raydium AMM v4;
  • Meteora DAMM v2 and Meteora DAMM v1.

Orca, Raydium CLMM and Meteora DLMM pools are not traded.

2. It prices the round trip

When a pool changes, the bot works out what buying on one pool and selling on another would return, after every cost: both pools' fees, the network and priority fee, the relay tip, and any token-account rent kept. It sizes the trade between your smallest trade and your per-trade cap. A pool whose state is too old isn't traded on.

3. It checks before it sends

A round trip is sent only when it would make at least your minimum profit per trade after every cost. In live trading, every round trip is simulated first and refused if the simulation comes out under your minimum.

The tip is paid only on trades worth it. A round trip pays the relay tip (and your fast senders' tips) only when it would make more than the tip plus your minimum profit. Then the tip is counted in its costs and in the floor written into the transaction. A smaller round trip goes without a tip, through the AllenHark relay alone, when your deployment has a relay key that sends tip-free. Without one, a relay send must pay its 0.001 SOL tip, so a round trip too small for the tip is skipped, and the app says so.

4. One transaction, back to SOL

The buy and the sell go in the same transaction. The sell's minimum output is set to the SOL that went in, plus every cost, plus your minimum profit. If the price has moved by the time it lands, the transaction fails instead of trading at a loss, and you pay only its network and priority fee. The token account the trade opens is closed in the same transaction, so no token is held between trades and there are no open positions, take profit or stop loss to manage.

5. Racing

With Racing on (to start with), the bot reacts to the newest (processed) pool state. Off, it waits for confirmed state. Either way, it never trades ahead of anyone's pending trade: it doesn't sandwich or move a price against someone else's trade.

Lookup tables

A round trip names many accounts. With Reuse lookup tables other transactions use on, the bot can use the address lookup tables other transactions on these pools already use, so the transaction fits. It checks each table on chain before using it.

Tokens it refuses

Some Token-2022 tokens can't be traded safely in one transaction. The bot refuses a token whose mint has a transfer fee, a transfer hook, is non-transferable, makes new accounts frozen by default, or can be paused. The app says which, and the token can come off your watchlist.

Practice and going live

Every bot starts in practice. A practice trade is the exact quoted result of the same round trip at the same moment, after every cost, with virtual SOL. Practice results are not indicative of live results: practice can't see the other bots chasing the same gaps, so it can't tell you how often a live round trip would land first or fail.

When you're ready, add SOL to your bot wallet and press Go live. The bot checks your wallet, your PIN and your funds, the same as for the other bots. You can switch back to practice at any time.

Limits

These are checked before every trade. You set them within the ceilings your deployment allows:

  • Per-trade cap: the most SOL one round trip puts in.
  • Fees and tips per day at most, and Failed trades' fees per day at most: trading stops for the day once either is reached. Days run from your local midnight. Off (0) to start with.
  • Trades per minute at most.
  • Stop after this many failed trades in a row: trading stops until you start the bot again. Off (0) to start with.

Many trades fail, and that's expected. Other bots race for the same gaps. What counts is that your returns beat every fee and tip, failed trades included, so the daily fee caps and the failure stop start off. Every trade the bot sends must still be worth more than its own cost plus your minimum profit. Your PnL is your returns less every fee and tip, failed trades included, and the fees line under it shows how much of today's fees went on failed trades.

  • Your plan: if it is in sell-only or halted, the bot makes no new trades, and it stops when the plan lapses.
  • Pause and Stop, like every bot. See Limits and safety.

What it costs

CostWhen
Network fee and priority feeEvery round trip sent, landed or failed.
Relay tipOnly when a round trip lands, and only on round trips that make more than the tip plus your minimum profit. At least 0.001 SOL.
Pool feesInside each landed round trip; counted before it is sent.
Failed round tripsTheir network and priority fee only. No daily cap unless you set one.
The planYour monthly subscription.

Every landed trade's costs are already inside your minimum profit: the transaction fails rather than land under it.

Your settings, grouped

Simple mode has what most people need: the watchlist, the minimum profit per trade, the per-trade cap, the daily caps, trades per minute, the failure stop and racing. It starts from one of three starters (Balanced is the bot's own defaults):

StarterWhat it does
CautiousA 0.0001 SOL minimum profit, a 0.2 SOL per-trade cap and daily caps on fees. Stops after 100 failed trades in a row.
BalancedThe bot's own defaults: 0.000001 SOL minimum profit, a 0.5 SOL per-trade cap, no daily fee caps and no failure stop.
AggressiveThe same minimum profit, a 1 SOL per-trade cap and more trades a minute. More trades, more fees.

Expert settings has every setting, in these groups:

  • Watchlist: your tokens.
  • Profit and size: the minimum profit and the per-trade cap, and (Advanced) the smallest trade, how old a pool's state may be, when to read the pools, closing the token account, the wait before the same pools and pool reads per second.
  • Limits: the daily caps, trades per minute, the failure stop, and (Advanced) your time zone.
  • Racing and Lookup tables.
  • Discovery (Advanced): how the bot finds pools.
  • Fees: the relay tip and fast senders, and (Advanced) the priority fee and compute limit.
  • Execution and Practice (Advanced): the pools it trades on, the transaction format and the practice balance.

The Solana Arbitrage Bot settings reference lists every setting with its range and starting value.

Risks

  • Practice is not indicative. Practice can't see the other bots chasing the same gaps.
  • Failed trades cost money. A round trip another trade gets to first fails and still pays its network and priority fee. The daily cap and the failure stop, if you turn them on, bound that cost; they don't remove it.
  • Gaps close. Most price gaps are smaller than the costs, so many are skipped.

See the Risk disclosure.

Related