Japanese cryptocurrency exchange DMM Bitcoin plans to raise 50 billion yen ($320 million) and invest the money in buying bitcoin to compensate customers after suffering a major hack.

The company said in a statement on Wednesday that it will be careful to avoid impacting the bitcoin market through planned purchases, adding that an investigation into why cryptocurrencies were unauthorizedly exited from the exchange over the past week is still ongoing.

The coins exiting the exchange are equivalent to about 4,503 bitcoins, or $320 million based on the cryptocurrency’s native market price of $71,000 at 10:45 a.m. Wednesday in Tokyo.

The amount was the seventh-largest cryptocurrency hack ever, according to Chainalysis, a firm that tracks the flow of digital assets across blockchain networks.

Japan’s Financial Services Agency (FSA) has ordered Bitcoin to report the reasons and compensation policies for customers, while Finance Minister Shunichi Suzuki pledged that the government will seek to prevent similar security incidents at cryptocurrency exchanges.