A Brisbane real estate agent and racing identity defrauded his clients of more than $1.6 million to fund a multimillion-dollar gambling habit.

James Robert Ray Lyons, 38, earned as much as $2 million a year as a commercial real estate agent, but even that was not enough to cover the cost of an addiction that led him to gamble away almost $3.5 million over two years.

Lyons confessed to his fraud only when one of his victims confronted him in 2013 and threatened to reveal the scale of of his crime to his other clients.

Lyons pleaded guilty in Brisbane District Court on Tuesday to three fraud-related charges relating to nine victims from his time working for Chase Commercial between 2011-13.

The aspiring horse trainer, who is the grandson and nephew of Melbourne Cup-winning jockeys Billy Cook and Peter Cook respectively, was on a base salary of $800,000 a year and with commissions that would reach as high as $2 million during his betting spree.

Crown prosecutor Jane Shaw told Judge Brad Farr that more than $1.05 million had been paid to the victims out of a compensation fund although Lyons had not yet made any repayments.

The maximum amount a victim can receive in compensation is $200,000.

Lyons sat ashen-faced during his two-hour sentencing hearing in which his legal-aid barrister, Saul Holt, asked for leniency because his client had been diagnosed with bipolar disorder and was a pathological gambler.

He said was not motivated by greed and his client had been undergoing counselling for his gambling addiction for the past four months.

Mr Holt said Chase Commercial had become aware of Lyons having a gambling problem in 2011 when it withheld $150,000 of his commission to repay a client.

Ms Shaw cited similar cases to Lyons in which the maximum penalty available at the time, which was 10 years, had been handed down.

She said Lyons’ bipolar disorder did not stop him functioning well as a successful commercial real estate agent in a highly competitive industry.

Lyons has been remanded in custody, and will be sentenced shortly.