STOCK BASED COMPENSATION - Option activity for company's stock incentive plans (Details) - USD ($)
$ / shares in Units, $ in Thousands
12 Months Ended
Jun. 30, 2019
Jun. 30, 2018
Jun. 30, 2017
Jun. 30, 2016
Number of Shares        
Beginning balance (in shares) 137,491 1,621,601 2,125,307  
Exercised (in shares) (92,644) (1,484,110) (502,350)  
Forfeitures and cancellations (in shares)     (1,356)  
Ending balance (in shares) 44,847 137,491 1,621,601 2,125,307
Weighted Average Exercise Price        
Beginning balance (in dollars per share) $ 9.15 $ 1.76 $ 2.03  
Exercised (in dollars per share) 8.99 1.08 2.86  
Forfeitures and cancellations (in dollars per share)     11.72  
Ending balance (in dollars per share) $ 9.50 $ 9.15 $ 1.76 $ 2.03
Options outstanding, weighted average remaining contractual term 2 years 9 months 10 days 3 years 7 months 13 days 1 year 6 months 18 days 2 years 7 months 24 days
Options outstanding, intrinsic value $ 5,472,000 $ 10,390 $ 81,413 $ 77,850
Number of shares, vested and expected to vest, ending balance (in shares) 44,847      
Options, weighted average exercise price, vested and expected to vest (in dollars per share) $ 9.50      
Options, remaining contractual term, vested and expected to vest 2 years 9 months 10 days      
Options, aggregate intrinsic value, vested and expected to vest $ 5,472,000      
Number of shares, vested and exercisable, ending balance (in shares) 44,847      
Options, weighted average exercise price, vested and exercisable (in dollars per share) $ 9.50      
Options, weighted average remaining contractual term, vested and exercisable 2 years 9 months 10 days      
Options, aggregate intrinsic value, vested and exercisable $ 5,472,000