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 fromdata_dirso that a caller passing onlydata_dirreads and writes under that directory consistently — never a mix ofdata_dirfor reads and~/.tradingstrategy/vaultsfor writes.- Parameters
data_dir (Optional[pathlib.Path]) – Pipeline data directory. When
None, falls back to theDATA_DIRenv var (default~/.tradingstrategy/vaults). Acts as the anchor for bothparquet_pathandoutput_pathdefaults when those are alsoNone.vault_db_path (Optional[pathlib.Path]) – Path to the vault metadata pickle. When
None,VaultDatabase.read()useseth_defi.vault.vaultdb.DEFAULT_VAULT_DATABASE.parquet_path (Optional[pathlib.Path]) – Path to the cleaned vault prices parquet. When
None, defaults todata_dir / "cleaned-vault-prices-1h.parquet".output_path (Optional[pathlib.Path]) – Destination JSON path. When
None, defaults todata_dir / DEFAULT_OUTPUT_FILENAME. TheOUTPUT_JSONenv var is honoured by_resolve_defaults_from_env()in the__main__entrypoint, not bymain()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 fromCORE3_DATABASE_PATHenv 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 fromFEED_DB_PATHenv var, falling back toDB_PATH(used by the feed collector), thenDEFAULT_VAULT_POST_DATABASE. The database is only opened if the resolved file exists on disk.