create_client#

API documentation for tradeexecutor.cli.bootstrap.create_client Python function.

create_client(mod, web3config, trading_strategy_api_key, cache_path, test_evm_uniswap_v2_factory, test_evm_uniswap_v2_router, test_evm_uniswap_v2_init_code_hash, clear_caches)[source]#

Create a Trading Strategy client instance.

  • Read env inputs to determine which kind of enviroment/client we need to have

  • May create mock client if we run e2e tests

  • Otherwise create a real client

Returns:

Client, routing model tuple.

Routing model is only returned if a test EVM routing set up is used (smart contracts deployed in the test).

Parameters:
Return type:

Tuple[tradingstrategy.client.BaseClient | None, tradeexecutor.strategy.routing.RoutingModel | None]