Place the onion in a blender with the water and blend until slushy. An immersible blender makes this especially easy. Strain mixture through a cheesecloth, squeezing it until you obtain 1/2 cup juice.
Whisk ketchup, onion juice, and other wet ingredients in a medium bowl, omitting oil. Set aside.
Heat oil in a large saucepan over medium heat. Add in garlic and spices and cook until fragrant. Whisk in wet ingredient mixture and bring to a boil, then reduce heat to medium-low and simmer gently until the mixture thickens, about 20-30 minutes. Cool to room temperature before serving.