Building a More Robust V3/V4 Liquidity Provision Bot
Summary
This account of an automated liquidity provision strategy focuses on the practical risks that emerged while moving from simulation to live trading on V3 and V4 pools. Early trades encountered tokens that could not be sold or pools whose liquidity disappeared before the bot could establish its position. The author separates token restrictions from liquidity loss and revises accounting so that estimated value, realized fees, costs, and completed cash flows are tracked separately. Pending transactions are also checked after restarts to avoid duplicate actions.
The bot broadens pool discovery through a paginated directory API, uses market statistics to screen candidates, and verifies selected pools and transaction state on-chain. It then measures gas across complete entry and exit cycles using transaction receipts, while keeping unresolved assets and transactions in a ledger. The article reports highly variable gas costs in small live trials and describes checks for pagination issues, quote failures, and recovery. These experiments do not establish profitability: pool quality filters, fee forecasts, and execution costs still require calibration against operating data.
Key ideas
- A pool price in simulation does not establish that a live position can be exited at that price.
- The strategy distinguishes estimated returns, realized fees, costs, and completed cash flows.
- Pool discovery, market statistics, and on-chain verification serve separate roles in candidate selection.
- Gas costs should be calculated from transaction receipts across the full liquidity cycle.
- Restart recovery should inspect submitted transactions and unresolved assets before resuming execution.
- The small live trials expose execution risks but do not establish the strategy’s profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.