SoftBank is set to gain more than $34 billion by cutting its stake in Alibaba\n \n (BABA), the crown jewel of its investment portfolio, after posting record losses on its tech bets this year. The Japanese company said Wednesday that it would reduce its stake in the Chinese e-commerce giant to 14.6% from 23.7% by settling some derivatives contracts early. It comes just two days after SoftBank dumped its shares in Uber\n \n (UBER). The estimated total gain from the Alibaba transaction amounts to 4.6 trillion Japanese yen ($34.1 billion), including 2.4 trillion Japanese yen ($17.8 billion) from a revaluation of the stock, according to SoftBank’s filing. “The current equity market environment is challenging and may be prolonged,” SoftBank\n \n (SFTBF) said in the filing, adding that the settlement of the forward contracts in Alibaba shares is the best option for the company at the moment. “By settling these contracts early, SoftBank will be able to eliminate concerns about future cash outflows, and furthermore, reduce costs associated with these prepaid forward contracts. These will further strengthen our defense against the severe market environment,” it said. Alibaba also reported the SoftBank transaction in an exchange filing late on Wednesday. A spokesperson said Alibaba would not be commenting beyond what was contained in its filing. SoftBank founder and CEO Masayoshi Son invested $20 million in Alibaba in 2000, a bet that was worth $60 billion when Alibaba went public in 2014. SoftBank’s move to slash its Alibaba stake comes at a tumultuous time for both companies. SoftBank on Monday unveiled a record $23 billion net loss for the April-June quarter, as a market rout hammered tech stocks and hit the valuations of investments at its Vision Fund unit. The company has exited companies to raise cash, including Uber\n \n (UBER) and Opendoor. Alibaba, meanwhile, has lost about $600 billion in market value since its peak in October 2020. A yearlong regulatory crackdown by Chinese authorities, coupled with economic headwinds, has hurt Alibaba’s growth and forced the company to look for ways to reduce costs, including layoffs. SoftBank is also trying to cut costs and raise cash to ride out the market downturn. On Monday, Son signaled cuts to headcount at the Vision Fund, saying there were no “sacred areas.” “SoftBank is clearly in defense mode,” Jefferies analysts said in a note earlier this week. Its willingness to sell assets suggests that when “push comes to shove, SoftBank will do or sell anything to protect its own shareholders,” they said, noting that the company is willing to monetize any asset at “a reasonable price.” “For SoftBank, there are few as liquid and large assets as Alibaba,” they added.