Valuation of financial contracts