def METHOD_NAME(
    data: dataBlob,
    system: System,
    instrument_code: str,
    lower_position: float,
    upper_position: float,
) -> bufferedOptimalPositions:
    diag_contracts = dataContracts(data)
    reference_price = system.rawdata.get_daily_prices(instrument_code).iloc[-1]
    reference_contract = diag_contracts.get_priced_contract_id(instrument_code)
    position_entry = bufferedOptimalPositions(
        date=datetime.datetime.now(),
        lower_position=lower_position,
        upper_position=upper_position,
        reference_price=reference_price,
        reference_contract=reference_contract,
    )
    return position_entry