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;