Georgie Norton was described as a "trusted" member of a drugs gang as he was handed a 7.5 year prison sentence at Leeds Crown Court.
The 26-year-old admitted multiple drug-dealing charges after being caught out by police three times.
Outlining the case, Carmel Pearson said that police first executed a warrant at a house on Plumpton Place, near Wakefield city centre, on August 19, 2019. Norton was living there at the time of the raid.
Officers covered the front and back of the property and even removed a toilet pipe from the outside of the building beforehand. As suspected, the occupants tried to flush the drugs as police entered.
Four packages were recovered from the pipe, while drugs were also found around the property.
In total, officers found 72.3g of Class A drugs, including cocaine, crack and heroin separated into hundreds of dealer bags. They also found 259g of cannabis.
The total value of the drugs seized was estimated to be more than £5,400.
Norton was arrested along with two others whose cases are yet to be brought to court.
On August 6 last year, while Norton was still on bail, police raided the property of his grandmother in the Eastmoor area of Wakefield. They discovered a padlocked shed and Norton was found to have the key around his neck.
Inside the shed, officers found four packages of cocaine weighing a total of 1.75kg. Some contained cocaine that was 90 per cent pure.
They also found £53,000 in cash in bundles of £10 notes and a quantity of caffeine, usually used to cut the drug and maximise profits.
While Norton remained on bail, police returned to the property on August 26. They found him with another quantity of cocaine and cannabis.
They also seized a mobile phone on which Norton had been sending out messages to customers about high-quality drugs for sale.
He was finally held on remand at HMP Leeds after appearing before magistrates.
Norton, of Coniston Crescent, Wakefield, has since admitted three counts of possession of cocaine with an intent to supply, one of possessing heroin with intent to supply and two of possessing cannabis with intent to supply. He also admitted possession of criminal property in relation to the bundles of cash.
Mitigating, Abdul Shakoor said Norton had got involved with a gang and was ordered to pick up the cash as well as the large amount of drugs found in the garden shed.
He said that like many, Norton had got involved in drug dealing because of his own issues with taking drugs.
Mr Shakoor added: "He has not been in custody before and has found it difficult. He wants to draw a line under these matters and move on with his life."
The Recorder of Leeds, Judge Guy Kearl QC, told Norton: "It's plain you were trusted by people further up the ladder. You were playing a fully-operational role, you understood the scale of the operation and it was a considerable operation."
This story was first published by the Wakefield Express.