Regression-discontinuity (RD) designs estimate treatment effects at a cutoff. This paper shows what can be learned about average treatment effects for the treated (ATT), untreated (ATUT), and population (ATE) if the cutoff was chosen to maximize the net gain from treatment. The ATT must be positive. Without capacity constraints, the RD estimate bounds the ATT from below and the ATUT from above, implying bounds for the ATE. Optimality of the cutoff rules out constant treatment effects. Testable implications of cutoff optimality are derived. Bounds are looser if the capacity constraint binds. The results are applied to existing RD studies.