main

Documentation for eth_defi.vault.top_vaults_json.main function.

main(data_dir=None, vault_db_path=None, parquet_path=None, output_path=None, core3_db_path=None, feed_db_path=None)

Main execution function for vault analysis and JSON export.

All four arguments are independently overridable. When a path argument is None, it is derived from data_dir so that a caller passing only data_dir reads and writes under that directory consistently — never a mix of data_dir for reads and ~/.tradingstrategy/vaults for writes.

Parameters
  • data_dir (Optional[pathlib.Path]) – Pipeline data directory. When None, falls back to the DATA_DIR env var (default ~/.tradingstrategy/vaults). Acts as the anchor for both parquet_path and output_path defaults when those are also None.

  • vault_db_path (Optional[pathlib.Path]) – Path to the vault metadata pickle. When None, VaultDatabase.read() uses eth_defi.vault.vaultdb.DEFAULT_VAULT_DATABASE.

  • parquet_path (Optional[pathlib.Path]) – Path to the cleaned vault prices parquet. When None, defaults to data_dir / "cleaned-vault-prices-1h.parquet".

  • output_path (Optional[pathlib.Path]) – Destination JSON path. When None, defaults to data_dir / DEFAULT_OUTPUT_FILENAME. The OUTPUT_JSON env var is honoured by _resolve_defaults_from_env() in the __main__ entrypoint, not by main() itself, so in-process callers get deterministic path anchoring with no env var surprises.

  • core3_db_path (Optional[pathlib.Path]) – Path to the Core3 risk intelligence DuckDB database. When None, resolved from CORE3_DATABASE_PATH env var, then the default constant. The database is only opened if the resolved file exists on disk.

  • feed_db_path (Optional[pathlib.Path]) – Path to the vault post feed DuckDB database. When None, resolved from FEED_DB_PATH env var, falling back to DB_PATH (used by the feed collector), then DEFAULT_VAULT_POST_DATABASE. The database is only opened if the resolved file exists on disk.