fix
This commit is contained in:
parent
560ccb7498
commit
ec7c66f617
@ -170,23 +170,12 @@ async def get_token_prices(token_addresses: List[str]) -> Dict[str, float]:
|
||||
prices[token] = 0.0
|
||||
logging.warning(f"Price not found for token {token}. Setting to 0.")
|
||||
|
||||
# update token info with prices
|
||||
# for token, price in prices.items():
|
||||
# if token in TOKENS_INFO:
|
||||
# TOKENS_INFO[token]['price'] = price
|
||||
# else:
|
||||
# TOKENS_INFO[token] = {'price': price}
|
||||
|
||||
for token, price in prices.items():
|
||||
if not token in TOKENS_INFO or not TOKENS_INFO[token].get('symbol'):
|
||||
token_name = await get_token_metadata_symbol(token)
|
||||
TOKENS_INFO[token]['symbol'] = token_name
|
||||
TOKENS_INFO[token]['priice'] = price
|
||||
# if mint_address in TOKENS_INFO:
|
||||
# TOKENS_INFO[mint_address].update(metadata)
|
||||
# else:
|
||||
# TOKENS_INFO[mint_address] = metadata
|
||||
# await save_token_info()
|
||||
token_info = TOKENS_INFO.setdefault(token, {})
|
||||
if 'symbol' not in token_info:
|
||||
token_info['symbol'] = await get_token_metadata_symbol(token)
|
||||
token_info['price'] = price
|
||||
|
||||
return prices
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user