You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: contract_stat.rb
    path of file: ./repos/cryptoexchange/lib/cryptoexchange/exchanges/huobi_dm/services
    
    the code of the file until where you have to start completion: module Cryptoexchange::Exchanges
  module HuobiDm
    module Services
      class ContractS
    
        def fetch(market_pair)
          contract_interval = market_pair.contract_interval
          if contract_interval == "perpetual"
            open_interest = super(swap_open_interest_url(market_pair))
            index = super(swap_index_url(market_pair))
            contract_info = super(swap_contract_info_url(market_pair))
            funding_rate = super(swap_funding_rate_url(market_pair))
          else
            open_interest = super(open_interest_url(market_pair))
            index = super(index_url(market_pair))
            contract_info = super(contract_info_url(market_pair))
            funding_rate = nil
          end