code: def exchange(mock_exchange_class):
      exchange = mock_exchange_class.return_value
      exchange.base_instrument = USD
      exchange.id = "fake_id"
  
      exchange.clock = Clock()
  
      def quote_price(pair):
          if exchange.clock.step == 0:
              d = {
                  ("USD", "BTC"): 7117.00,
                  ("USD", "ETH"): 143.00,
                  ("USD", "XRP"): 0.22,
              }
              return d[(pair.base.symbol, pair.quote.symbol)]
          d = {
              ("USD", "BTC"): 6750.00,
              ("USD", "ETH"): 135.00,
              ("USD", "XRP"): 0.30,
          }
          return d[(pair.base.symbol, pair.quote.symbol)]
  
      exchange.quote_price = mock.Mock(side_effect=quote_price)
  
      return exchange
  
imports: import pytest
  import unittest.mock
  from tensortrade.core.base import Clock
  from tensortrade.oms.wallets import Wallet, Portfolio
  from tensortrade.oms.instruments import USD, BTC, ETH, XRP, BCH
label_desc: Use image node_id 1 for calling a global function with example usage: exchange(mock_exchange_class) and returns: exchange, d, d