Atomic Transaction
Transaction primitives
An atomic transaction is one that either completes in full or has no effect. A Solana transaction is atomic: its instructions run in order, and if any instruction fails, every change the transaction made is rolled back, although the fee is still charged. Atomicity is what lets a bot send several swap legs in one transaction without being left holding half a trade.
Detailed explanation
A Solana transaction holds one or more instructions. The runtime executes them in order, and treats the transaction as a unit. If the last instruction fails, the changes made by the first ones are undone. Nothing is partly applied.
That is the property arbitrage and flash-loan bots rely on. Put the buy and the sell in one transaction, and if the second price has moved, the whole transaction fails and the bot holds the same tokens it started with. Without atomicity, a failure between the legs would leave it with a position it did not want.
Atomicity has a cost and limits. A transaction that lands and then fails still pays its base fee and any priority fee. A transaction is limited in size and in compute units, and in the number of accounts it can lock, so there is a ceiling on how many legs fit in one. Simulating before sending shows whether it would fail without paying for the attempt.
Jito bundles stretch the same idea across transactions. A bundle of up to five transactions executes in order and all-or-nothing, which lets a sender split a large route over several transactions without losing the guarantee.
When you'll see this
You rely on it whenever a bot puts several swaps, a borrow and a repay, or a trade and a tip in one transaction, and you see it described in simulation results that show a whole transaction failing on one instruction.
How NoLimitNodes uses this
Every arbitrage bot we build sends its legs in one transaction and simulates first, so a route that has stopped paying fails instead of leaving a leg open. Sending goes through our RPC, a Jito bundle or UltraSend.
Related terms
- Jito Bundle · Up to five transactions a Jito block engine executes in order and atomically, with a tip that sets how it ranks.
- Flash Loan · A collateral-free loan borrowed and repaid inside one transaction. If it is not repaid, the transaction fails.
- Compute Unit Budget · The CU limit and price you set with the ComputeBudget program to control how much work and priority fee a transaction uses.
- Durable Nonce · A System Program nonce account that lets a transaction stay valid past the 150-slot recent-blockhash window.
- Triangular Arbitrage · Three swaps through three tokens that end where they began, so a price gap anywhere on the cycle can pay.