In a saucepan, heat the oil. Add the onion and cook over moderately high heat until lightly browned, 4 minutes. Add the ginger and cook over moderately low heat until softened, 3 minutes. Add the sugar, ketchup and chile bean sauce and simmer over low heat until the sauce is thickened, 5 minutes.
Transfer the sauce to a blender and add 1/2 cup of water. Blend until smooth. With the machine on, add another 1/2 cup of water. Scrape the sauce into the saucepan and simmer over low heat for 3 minutes. Transfer to a bowl and refrigerate until chilled.
Squeeze lemon over the shrimp and serve with the sauce and more lemon wedges.