if you are worried about exact concentrations of sugar after adding caffeine to the solution, you also should start by calculating the initial concentration of sugar correctly: 150 g in (150 + 370g) equals w ~ 28.8 % ( and not 30%)
second, caffeine has a limited solubility in water (i.e in waterbased, diluted sugar solutions, too) : 20 g per liter of pure water (20°C), i.e. approx 0.1 mole / L max (M = 194,19 g/mole)
the density of a w=30% saccarose solution is 1,1270 g/mL , so with 158,57 g sugar and 370 g ( = mL) water around (which is a for real w=30% solution, V = 469 mL) you might come short on water
it might become difficult to create a 0.1 mole/L caffeine solution thereof, and you need to test this first
but let's say for a moment this would work:you still can't calculate your desired composition
precisely, as "mole/L " is density dependant ( which, again, is temperature dependant, additionally): you'd need density tables for caffeine/sugar/water systems for that
as I doubt that those are easily available, most probably you'd need to create those on your own, in the desired range.
however, if you're not in for exact values, you might also prepare a stock solution of ~ the desired concentrations/contents, and dilute accordingly
with low conc. of caffeine, these differences should be negligible. At 0.1 M and 0.01 M , however , this might give you some % off
it's up to you
regards
Ingo