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