Skip to content

Commit

Permalink
Fixed _TOKEN_BALANCE on tokens.json reload
Browse files Browse the repository at this point in the history
  • Loading branch information
tsarbuig committed Feb 10, 2022
1 parent f7d24f8 commit 5198be0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions LimitSwap.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,7 @@ def reload_tokens_file(tokens_path, load_message=True):
'_FAILED_TRANSACTIONS': _TOKENS_saved[token['SYMBOL']]['_FAILED_TRANSACTIONS'],
'_SUCCESS_TRANSACTIONS': _TOKENS_saved[token['SYMBOL']]['_SUCCESS_TRANSACTIONS'],
'_REACHED_MAX_SUCCESS_TX': _TOKENS_saved[token['SYMBOL']]['_REACHED_MAX_SUCCESS_TX'],
# set _TOKEN_BALANCE to 0 to avoid divide by 0 when calculating COST_PER_TOKEN
# TODO : to fix it
'_TOKEN_BALANCE': 0,
'_TOKEN_BALANCE': _TOKENS_saved[token['SYMBOL']]['_TOKEN_BALANCE'],
'_PREVIOUS_TOKEN_BALANCE': _TOKENS_saved[token['SYMBOL']]['_PREVIOUS_TOKEN_BALANCE'],
'_BASE_BALANCE': _TOKENS_saved[token['SYMBOL']]['_BASE_BALANCE'],
'_BASE_PRICE': _TOKENS_saved[token['SYMBOL']]['_BASE_PRICE'],
Expand Down

0 comments on commit 5198be0

Please sign in to comment.