prepare_token_cache#

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

prepare_token_cache(cache_path, unit_testing=False)[source]#

Prepare token cache for this trade-executor.

  • Token cache stores ERC-20 token metadata (symbol, decimals, name) to avoid repeated RPC calls when working with vaults and token contracts

  • Uses SQLite for persistent storage across executor runs

  • Stored as {cache_path}/eth-defi-tokens.sqlite

Parameters:
  • cache_path (Path) – Cache directory path, already prepared by prepare_cache()

  • unit_testing (bool) – Pass through to get_default_token_cache() to ensure consistent cache location with tradingstrategy.Client in test fixtures

Returns:

Initialised token disk cache instance

Return type:

TokenDiskCache