Skip to content

Commit

Permalink
Merge pull request #94 from bancorprotocol/26-more-verbose-info-on-st…
Browse files Browse the repository at this point in the history
…artup

Adds complete runtime configuration to startup logs. Adds logging to …
  • Loading branch information
mikewcasale authored Aug 30, 2023
2 parents b72b2ac + 2c9373f commit b3b8a9c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,41 @@ def main(
# Format the exchanges
exchanges = handle_exchanges(cfg, exchanges)

# Log the run configuration
cfg.logger.info(
f"""
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Starting fastlane bot with the following configuration:
cache_latest_only: {cache_latest_only}
backdate_pools: {backdate_pools}
arb_mode: {arb_mode}
flashloan_tokens: {flashloan_tokens}
config: {config}
n_jobs: {n_jobs}
exchanges: {exchanges}
polling_interval: {polling_interval}
alchemy_max_block_fetch: {alchemy_max_block_fetch}
static_pool_data_filename: {static_pool_data_filename}
reorg_delay: {reorg_delay}
logging_path: {logging_path}
loglevel: {loglevel}
static_pool_data_sample_sz: {static_pool_data_sample_sz}
use_cached_events: {use_cached_events}
run_data_validator: {run_data_validator}
randomizer: {randomizer}
limit_bancor3_flashloan_tokens: {limit_bancor3_flashloan_tokens}
default_min_profit_bnt: {default_min_profit_bnt}
timeout: {timeout}
target_tokens: {target_tokens}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""
)

# Get the static pool data, tokens and uniswap v2 event mappings
static_pool_data, tokens, uniswap_v2_event_mappings = get_static_data(
cfg, exchanges, static_pool_data_filename, static_pool_data_sample_sz
Expand Down Expand Up @@ -403,6 +438,19 @@ def run(
mgr.cfg.logger.info("Timeout hit... stopping bot")
break

if loop_idx == 1:
mgr.cfg.logger.info(
"""
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Finished first iteration of data sync. Now starting main loop arbitrage search.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""
)

except Exception as e:
mgr.cfg.logger.error(f"Error in main loop: {e}")
time.sleep(polling_interval)
Expand Down

0 comments on commit b3b8a9c

Please sign in to comment.