throw new OpenGammaRuntimeException("Couldnt get credit curve");
}
//final CDSAnalytic analytic = CDSAnalyticConverter.create(cds, now.toLocalDate());
final CDSAnalyticVisitor visitor = new CDSAnalyticVisitor(now.toLocalDate(), _holidaySource, _regionSource, recoveryRate);
final CDSAnalytic analytic = security.accept(visitor);
final BuySellProtection buySellProtection = security.isBuy() ? BuySellProtection.BUY : BuySellProtection.SELL;
final Double cdsQuoteDouble = (Double) inputs.getValue(MarketDataRequirementNames.MARKET_VALUE);
if (cdsQuoteDouble == null) {
throw new OpenGammaRuntimeException("Couldn't get spread for " + security);
}
final CDSQuoteConvention quote = SpreadCurveFunctions.getQuotes(security.getMaturityDate(), new double[] {cdsQuoteDouble}, security.getParSpread(), quoteConvention, true)[0];
final double notional = security.getNotional().getAmount();
final double coupon = security.getParSpread() * ONE_BPS;
final PointsUpFront puf = getPointsUpfront(quote, buySellProtection, yieldCurve, analytic, creditCurve);
final double accruedPremium = analytic.getAccruedPremium(coupon) * notional;
final int accruedDays = analytic.getAccuredDays();
final double quotedSpread = getQuotedSpread(quote, puf, buySellProtection, yieldCurve, analytic).getQuotedSpread();
final double upfrontAmount = getUpfrontAmount(analytic, puf, notional, buySellProtection);
final double cleanPV = puf.getPointsUpFront() * notional;
final double cleanPrice = getCleanPrice(puf);
final TenorLabelledMatrix1D bucketedCS01 = getBucketedCS01(analytic, bucketCDSs, spreadObject.getXData(), quote, notional, yieldCurve, creditCurve);