@Override
  public CompiledFunctionDefinition compile(
      final FunctionCompilationContext context, final Instant atInstant) {
    final ZonedDateTime atZDT = ZonedDateTime.ofInstant(atInstant, ZoneOffset.UTC);
    final CurveConstructionConfiguration curveConstructionConfiguration =
        _curveConstructionConfigurationSource.getCurveConstructionConfiguration(_configurationName);
    if (curveConstructionConfiguration == null) {
      throw new OpenGammaRuntimeException(
          "Could not get curve construction configuration called " + _configurationName);
    }
    // TODO also return any exogenous configs
    final ValueProperties properties =
        createValueProperties().with(CURVE_CONSTRUCTION_CONFIG, _configurationName).get();
    final ValueSpecification spec =
        new ValueSpecification(
            ValueRequirementNames.CURVE_CONSTRUCTION_CONFIG,
            ComputationTargetSpecification.NULL,
            properties);
    final Set<ComputedValue> result =
        Collections.singleton(new ComputedValue(spec, curveConstructionConfiguration));
    return new AbstractInvokingCompiledFunction(
        atZDT.with(LocalTime.MIDNIGHT),
        atZDT.plusDays(1).with(LocalTime.MIDNIGHT).minusNanos(1000000)) {

      @Override
      public Set<ComputedValue> execute(
          final FunctionExecutionContext executionContext,
          final FunctionInputs inputs,
          final ComputationTarget target,
          final Set<ValueRequirement> desiredValues)
          throws AsynchronousExecution {
        return result;
      }

      @Override
      public ComputationTargetType getTargetType() {
        return ComputationTargetType.NULL;
      }

      @Override
      public Set<ValueSpecification> getResults(
          final FunctionCompilationContext myContext, final ComputationTarget target) {
        return Collections.singleton(spec);
      }

      @Override
      public Set<ValueRequirement> getRequirements(
          final FunctionCompilationContext myContext,
          final ComputationTarget target,
          final ValueRequirement desiredValue) {
        return Collections.emptySet();
      }
    };
  }
 @Override
 public void init(final FunctionCompilationContext context) {
   _curveConstructionConfigurationSource =
       ConfigDBCurveConstructionConfigurationSource.init(context, this);
 }