Market participants who have the task of acquiring a certain position in a listed security at a predetermined price on behalf of a third party with no time urgency, ie, to fill a perpetual limit order, can optimize the profitability of their trading strategy in order to accomplish this task.We study the statistical properties of the profit distribution of a particular market-making strategy: one that increments the inventory as the underlying price approaches the limit order price So and locks in profits by gradually liquidating the inventory as the market drifts away from So. We do so by adopting a simple model of market microstructure, in which an unobservable continuous stochastic process, the microprice, drives the dynamics of limit and market orders. In this model, the arrival of market orders and updates of the limit order book are determined by the microprice crossing a discrete set of n equidistant levels between the price ticks. Assuming normal dynamics for the microprice and adopting a standard mean-variance framework, we are able to derive a remarkably simple closed-form solution for the optimal inventory profile: the cumulative amount held when the market price is Si is inversely proportional to Si - So, the distance in price terms from the limit order price. Finally, we show that n represents a sort of microvolatility of the market that is distinct from the diffusive volatility of the microprice and is a measure of the intensity of the bid-ask bounce.