Xiao and Sun. according to Justice Gordon's decision, were both born in China and moved to New Zealand in 2002.
The pair first met at the SkyCity Casino in late 2013 where they both gambled as members of its VIP programme.
Xiao was married and jointly owned an apartment and family home with her husband, Yang Pan.
Xiao, in her statement to the court, said that prior to 2014 she had gambled as a hobby, something her husband was not aware of as he disapproved of it.
In early 2014, Xiao gambled using her own funds, often playing blackjack or baccarat at the same tables as Sun. She told the court that the two became friends.
Although experiencing some early wins, Xiao suffered big losses in March of that year, losing about $35,800 in three days.
Xiao began withdrawing money from a Chinese bank account that contained about $100,000 as her losses escalated.
Over this time Xiao became closer with Sun, who allegedly told her she had been a dealer at SkyCity and knew how to count cards. Xiao said Sun began giving her advice on gambling techniques.
After Xiao had lost more money she alleged that Sun offered to leave her $10,000 worth of chips to gamble with while she was away in China - something Sun disputed during trial.
While she was away, Sun organised a further loan of $7,000 to Xiao which she lost gambling.
Upon her return and hearing that Xiao could not repay the loan immediately, Sun allegedly suggested Xiao borrow money from a "lender friend" of hers.
According to Xiao, a $30,000 loan with interest of $1200 a week (four per cent each week) was agreed upon.
Within the week Xiao had lost the money gambling and needed more to pay interest on the loan which was due.
Sun allegedly told Xiao that her friend, the lender, was associated with gangs.
Xiao said she was under the impression the pair would be in trouble if she could not pay back the interest.
Xiao told the court that Sun convinced her to take out another loan from the lender to pay the interest, but said interest on the new loan would be 5 per cent a week instead of four.
By early June 2014, Xiao had wracked up several loans worth $70,000 and said she owed interest on each loan every week.
According to a SkyCity incident report, on June 7, a staff member saw Xiao throw a chip onto the table after the winning hand had been dealt.
The incident resulted in an investigation by the casino and Xiao being spoken to by a staff member who told her this was a symptom of a gambling problem and banned her from the casino until they contacted her to tell her otherwise.
Xiao told the court this was a serious problem as she had to pay interest on the loans and could not think of another way to pay them back other than to win the money gambling.
Over this exclusion period, Sun gambled on behalf of Xiao. At the end of the day the pair would meet in the toilet to avoid detection and divide the winnings.
According to Xiao's statement, some days Sun would tell her she had lost her friend's money.
On other days, Sun allegedly would lose money but then continued to gamble with her own or her lender friend's money without consulting Xiao.
She would then allegedly tell Xiao this also needed to be paid back.
In October 2014, the pair attended an Auckland law firm where they drew up loan documents and Xiao signed a caveat on the apartment she owned with her husband.
The interest rate was left blank and a waiver was signed absolving the law firm of responsibility.
Later that month, when Xiao was excluded from the casino, her on-paper loan was $225,000.
To cover the interest payments Xiao said she was also relying on money taken from her husband's safe without his knowledge and on loans from other friends.
The gambling arrangement - with Sun allegedly gambling on her friend's behalf - continued for months after that.
Around the beginning of 2015, Sun allegedly told Xiao that the total amount borrowed was now $530,000 and the new amount was added to the loan agreement.
Later when the value of the Xiao's apartment did not cover the loan, her family home was added to the agreement as security.
By that stage, Xiao was paying Sun around $40,000 per week in interest.
Xiao repaid $100,000 but was not able to keep up with the interest payments and the pair fell out.
Sun's lawyers then made a demand for payment of $746,809.
At this point, Xiao took her case to the High Court.
In her evidence, Sun told the court she had made up the existence of the "lender friend" to avoid Xiao knowing how much money she had and to avoid any awkwardness in trying to recoup the loan. She denied threatening Xiao.
Sun also denied ever charging Xiao interest and said what was owed represented the full amount lent.
According to Sun, it was Xiao who suggested her friend gamble on her behalf while she was excluded.
While doing this, Sun said she borrowed money from other people.
Over this time, Sun was on a benefit.
Based on evidence provided to the court, Justice Gordon ruled that it was unlikely that Sun could have sourced $800,000 to loan to Xiao over this time,
As the withdrawals, deposits, loans and repayments were made at different times and not always through bank accounts, Justice Gordon said the case came down to "a credibility contest".
Most of the loans and repayments were not properly documented or documentation was not provided to the court.
SkyCity records from this time showed Xiao and Sun lost about $133,000 - far below the $800,000 being claimed.
Sun's lawyer claimed this was inaccurate.
In evidence given by a SkyCity representative, it was conceded that the numbers could be out by up to tens of thousands but it was not possible for it to be hundreds of thousands of dollars out.
"Even with possible inaccuracies accepted by [the SkyCity representative], the records are consistent with Ms Xiao's case that she did not receive the full amount of $800,000 purportedly loaned by Ms Sun and that the balance represented capitalised interest," Justice Gordon said.
Other evidence from witnesses - as well as deleted WeChat messages - also supported Xiao's claim that Sun charged her interest at 4 or 5 per cent a week or between 200 and 300 per cent per annum.
Justice Gordon said this was a clear sign of "oppression" and ruled the loans were illegal and provided under duress.
Sun had not complied with legal requirements when providing the loans, the judge said,
While Xiao had only given back about $100,000 of the estimated $133,000 of capital loaned, Justice Gordon ruled that the remaining amount did not need to be repaid.