FAIR VALUE MEASUREMENTS - Schedule of financial assets and financial liabilities measured at fair value on a recurring basis (Details) - USD ($) $ in Thousands | Mar. 31, 2022 | Jun. 30, 2021 |
U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | $ 35,252 | $ 28,838 |
Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 89,807 | 51,899 |
Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 22,796 | 21,836 |
Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 21,971 | 10,376 |
Fair Value, Recurring | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 1,880,485 | 670,315 |
Fair Value, Recurring | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 35,252 | 28,838 |
Fair Value, Recurring | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 89,807 | 51,899 |
Fair Value, Recurring | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 22,796 | 21,836 |
Fair Value, Recurring | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 21,971 | 10,376 |
Fair Value, Recurring | Level 1 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 1,710,659 | 557,366 |
Fair Value, Recurring | Level 1 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 2 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 169,826 | 112,949 |
Fair Value, Recurring | Level 2 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 35,252 | 28,838 |
Fair Value, Recurring | Level 2 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 89,807 | 51,899 |
Fair Value, Recurring | Level 2 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 22,796 | 21,836 |
Fair Value, Recurring | Level 2 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 21,971 | 10,376 |
Fair Value, Recurring | Level 3 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 0 | 0 |
Fair Value, Recurring | Level 3 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Demand deposit accounts and other cash equivalents | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 1,710,659 | 557,366 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 1,710,659 | 557,366 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 1 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 1,710,659 | 557,366 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 2 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 0 | 0 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 3 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | $ 0 | $ 0 |