Under adverse conditions, Caenorhabditis elegans enters a diapause stage called the dauer larva. External cues signal the nuclear hormone receptor DAF-12, the activity of which is regulated by its ligands: dafachronic acids (DAs). DAs are synthesized from cholesterol, with the last synthesis step requiring NADPH, and their absence stimulates dauer formation. Here we show that NADPH levels determine dauer formation in a regulatory mechanism involving key carbohydrate and redox metabolic enzymes. Elevated trehalose biosynthesis diverts glucose-6-phosphate from the pentose phosphate pathway, which is the major source of cellular NADPH. This enhances dauer formation due to the decrease in the DA level. Moreover, DAF-12, in cooperation with DAF-16/FoxO, induces negative feedback of DA synthesis via activation of the trehalose-producing enzymes TPS-1/2 and inhibition of the NADPH-producing enzyme IDH-1. Thus, the dauer developmental decision is controlled by integration of the metabolic flux of carbohydrates and cellular redox potential.