Previous research has found diacetylmorphine, delivered under supervision, to be cost-effective in the treatment of severe opioid use disorder, but diacetylmorphine is not available in many settings. The Study to Assess Long-term Opioid Maintenance Effectiveness (SALOME) randomized controlled trial provided evidence that injectable hydromorphone is non-inferior to diacetylmorphine. The current study aimed to compare the cost-effectiveness of hydromorphone directly with diacetylmorphine and indirectly with methadone maintenance treatment. A within-trial analysis was conducted using the patient level data from the 6-month, double-blind, non-inferiority SALOME trial. A life-time analysis extrapolated costs and outcomes using a decision analytical cohort model. The model incorporated data from a previous trial to include an indirect comparison to methadone maintenance. A supervised clinic in Vancouver, British Columbia, Canada. A total of 202 long-term street opioid injectors who had at least two attempts at treatment, including one with methadone (or other substitution), were randomized to hydromorphone (n=100) or diacetylmorphine (n=102). We measured the utilization of drugs, visits to health professionals, hospitalizations, criminal activity, mortality and quality of life. This enabled us to estimate incremental costs, quality-adjusted life years (QALYs) and cost-effectiveness ratios from a societal perspective. Sensitivity analyses considered different sources of evidence, assumptions and perspectives. The within-trial analysis found hydromorphone provided similar QALYs to diacetylmorphine [0.377, 95% confidence interval (CI)=0.361-0.393 versus 0.375, 95% CI=0.357-0.391], but accumulated marginally greater costs [$49 830 ($28 401-73 637) versus $34 320 ($21 780-55 998)]. The life-time analysis suggested that both diacetylmorphine and hydromorphone provide more benefits than methadone [8.4 (7.4-9.5) and 8.3 (7.2-9.5) versus 7.4 (6.5-8.3) QALYs] at lower cost [$1.01million ($0.6-1.59million) and $1.02million ($0.72-1.51million) versus $1.15million ($0.71-1.84million)]. In patients with severe opioid use disorder enrolled into the SALOME trial, injectable hydromorphone provided similar outcomes to injectable diacetylmorphine. Modelling outcomes during a patient's life-time suggested that injectable hydromorphone might provide greater benefit than methadone alone and may be cost-saving, with drug costs being offset by costs saved from reduced involvement in criminal activity.