code: def get_onchain_exchange_rates(deposit_crypto=None, withdraw_crypto=None, **modes):
      
      from moneywagon.onchain_exchange import ALL_SERVICES
  
      rates = []
      for Service in ALL_SERVICES:
          srv = Service(verbose=modes.get('verbose', False))
          rates.extend(srv.onchain_exchange_rates())
  
      if deposit_crypto:
          rates = [x for x in rates if x['deposit_currency']['code'] == deposit_crypto.upper()]
  
      if withdraw_crypto:
          rates = [x for x in rates if x['withdraw_currency']['code'] == withdraw_crypto.upper()]
  
      if modes.get('best', False):
          return max(rates, key=lambda x: float(x['rate']))
  
      return rates
docs: Gets exchange rates for all defined on-chain exchange services.