Catalysis of the reactions: 2-dimethylallyl-(6aS,11aS)-3,6a,9-trihydroxypterocarpan + NADPH + H+ + O2 = glyceollin + NADP+ + 2 H2O, and 4-dimethylallyl-(6aS,11aS)-3,6a,9-trihydroxypterocarpan + NADPH + H+ + O2 = glyceollin + NADP+ + 2 H2O.