Beispiel #1
0
        public Either <Error, CurvePoint> GetPoint(IEnumerable <PublishedPricing> pricings, Date asOfDate)
        {
            var minDate = asOfDate.Ultimum(DateLag);
            var match   = pricings
                          .Where(x => x.InstrumentId == InstrumentId && x.AsOfDate >= minDate && x.AsOfDate <= asOfDate)
                          .OrderByDescending(x => x.AsOfDate)
                          .FirstOrDefault();

            if (match is null)
            {
                return(new Error("Not found"));
            }

            return(new CurvePoint(Tenor.GetMaturity(), match.Price));
        }