Grid Bot Break-Even With Fees and Gas
Calculate the sell price an on-chain grid needs to recover the buy cost. Compare the cost floor for small and larger legs.

Table of Contents
A grid leg breaks even only when its sale recovers the actual buy cost and execution costs. A spacing of 1% does not mean a net 1% gain. The exact threshold depends on what the buy delivered, the quote at the sell, both gas charges and the amount sold.
Start with the measured buy
Let C be the USDC that left your account on the purchase, Q the net ETH units received, F the proportional fee on the sale and G the total separate gas cost for both actions in USDC equivalent. An approximate minimum sell price before the sell fee is (C + G) ÷ (Q × (1 − F)). This formula excludes additional price impact and assumes you close all bought units. If your quote already returns a net amount, compare that output with C + G directly.
Use the actual quantity received. The purchase's pool fee and price impact already affect that quantity. Adding that fee again on top of the cash spent can double count it.
Compare two leg sizes
Assume a 0.05% sale fee, 0.16 USDC equivalent in total gas and an acquisition cost of 2,500 USDC per ETH before adding gas. These are model assumptions for illustrating the effect of order size.
| Measure | Small leg | Larger leg |
|---|---|---|
| Buy spend | 10 USDC | 50 USDC |
| Net ETH received | 0.004 | 0.020 |
| Approximate break-even price | 2,541.27 | 2,509.25 |
| Increase from 2,500 | 1.65% | 0.37% |
A hypothetical 1% rebound to 2,525 is insufficient for the small leg under these assumptions. The larger leg has more room before costs absorb the price move. If gas doubles, recalculate. When the larger trade crosses thinner liquidity, account for the difference in its quote rather than assuming identical cost per ETH.
Turn the formula into a grid rule
Record the expected dollar gain per completed buy and sell, and compare it with gas and other costs under several scenarios. Treat a spacing that barely covers the estimate as sensitive to ordinary quote changes. If the bot quotes output separately from price impact, use the expected output and a minimum-output stress case.
For multi-leg inventory, replace C and Q with the acquisition spend and units for the portion you plan to sell. If you sell a slice, exclude the units still held and document how you assigned purchase cost to that slice. Compare economics at the level of the leg and the whole bank before deciding that the grid is profitable.
For live execution, Uniswap explains how swaps change pool prices. For a no-funds walkthrough of strategies, open the DCA Bot demo page. Its basic DCA historical preview uses daily prices. The grid cost calculation here requires the actual execution quote or a clearly labeled assumption.
Ready to automate your crypto trading?
Set up DCA, grid, or limit-order strategies on Uniswap V3 for Arbitrum and Base — from your own Safe, with a free demo to start.