Quant lib risk calculation solution