Simplify markets
This commit is contained in:
parent
506fe82801
commit
0ba5cc38b3
|
@ -75,6 +75,7 @@ class Markets(util.Base):
|
|||
|
||||
our_ads = [ad for ad in public_ads_filtered if ad[1] == username]
|
||||
if not our_ads:
|
||||
self.log.warning(f"No ads found in public listing for {asset} {currency} {provider}")
|
||||
continue
|
||||
new_margin = self.autoprice(username, min_margin, max_margin, public_ads_filtered, currency)
|
||||
# self.log.info("New rate for {currency}: {rate}", currency=currency, rate=new_margin)
|
||||
|
@ -212,9 +213,7 @@ class Markets(util.Base):
|
|||
currencies = self.sinks.currencies
|
||||
if not account_info:
|
||||
account_info = self.sinks.account_info
|
||||
# First, let's get the ads we can't support
|
||||
all_currencies = self.get_all_currencies()
|
||||
supported_currencies = [currency for currency in currencies if currency in all_currencies]
|
||||
supported_currencies, currency_account_info_map = self.get_valid_account_details(platform)
|
||||
|
||||
# not_supported = [currency for currency in all_currencies if currency not in supported_currencies]
|
||||
|
||||
|
@ -224,13 +223,6 @@ class Markets(util.Base):
|
|||
|
||||
not_supported_ads = [ad for ad in our_ads if ad[3] not in supported_currencies]
|
||||
|
||||
currency_account_info_map = {}
|
||||
for currency in supported_currencies:
|
||||
for bank, accounts in account_info.items():
|
||||
for account in accounts:
|
||||
if account["currency"] == currency:
|
||||
currency_account_info_map[currency] = account["account_number"]
|
||||
|
||||
for ad in supported_ads:
|
||||
asset = ad[0]
|
||||
countrycode = ad[2]
|
||||
|
@ -272,7 +264,7 @@ class Markets(util.Base):
|
|||
"""
|
||||
platforms = ("agora", "lbtc")
|
||||
for platform in platforms:
|
||||
self.distribute_account_details(platform, currencies=currencies, account_info=account_info)
|
||||
self._distribute_account_details(platform, currencies=currencies, account_info=account_info)
|
||||
|
||||
def format_ad(self, asset, currency, payment_details_text):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue