{
  "repo": "tidbcloud/ccxt-web3-bot",
  "binary": "importer",
  "binary_path": "main.py",
  "dependencies": {
    "CLI python main.py": {
      "infrastructure": {
        "filesystem": {
          "conditions": ["Always"],
          "operations": [
            {
              "operation": "READ FILE",
              "trigger": "Load database config and create-table SQL",
              "conditions": ["CLI starts"],
              "implementation": "load_config(CONFIG_FILE); open(CREATE_TABLE_SQL_FILE)"
            }
          ]
        },
        "mysql": {
          "conditions": ["Always after DB connection succeeds"],
          "operations": [
            {
              "operation": "CREATE TABLE / INSERT",
              "trigger": "Initialize the target table and insert OHLCV rows",
              "conditions": ["Database connection established"],
              "implementation": "create_crypto_table_if_non_exist(); insert_crypto_trends_data()"
            }
          ]
        }
      },
      "services": [
        {
          "name": "binanceusdm",
          "target_repo": "external/ccxt",
          "target_interface": "fetch_ohlcv",
          "operation_type": "http_api",
          "conditions": ["Always for each configured symbol and segment"],
          "operations": [
            {
              "operation": "FETCH MARKET DATA",
              "trigger": "Import historical OHLCV candles",
              "conditions": ["exchange.load_markets() succeeded"],
              "implementation": "ccxt.binanceusdm(...).fetch_ohlcv(crypto, timeframe='1d', since=segment_start, limit=limit_days)"
            }
          ]
        }
      ]
    }
  }
}
