[PLAT-4935] Alter type comparison
[PLAT-4936] Factor curve code out of the valuation time loop