core3.constants

Documentation for eth_defi.core3.constants Python module.

Shared constants for Core3 integration.

Centralises API URLs, default paths, and configuration values used by eth_defi.core3.session, eth_defi.core3.database, and eth_defi.core3.scanner.

Module Attributes

CORE3_API_URL

Core3 Projects Data API base URL.

CORE3_DEFAULT_REQUESTS_PER_SECOND

Default requests per second.

CORE3_USER_AGENT

User-Agent header required by Cloudflare.

CORE3_DEFAULT_TIMEOUT

Default HTTP request timeout in seconds.

SECTIONS

Project detail sections available for section snapshot fetching.

INDEX_SLUG

Special slug used for the index-level aggregate PoL in the pol_daily table.

Functions

resolve_core3_database_path()

Resolve the Core3 DuckDB database path.

CORE3_API_URL: str = 'https://api.core3.io/projects_data'

Core3 Projects Data API base URL.

All endpoint paths are appended to this, e.g. CORE3_API_URL + "/v1/list".

CORE3_DATABASE_PATH: pathlib.Path = PosixPath('/home/runner/.tradingstrategy/vaults/core3/core3.duckdb')

Default DuckDB path for Core3 risk data.

resolve_core3_database_path()

Resolve the Core3 DuckDB database path.

Core3 scripts share the same CORE3_DATABASE_PATH environment variable override. Keeping the resolver next to CORE3_DATABASE_PATH avoids each caller repeating the same environment lookup and path expansion logic.

Returns

Path from CORE3_DATABASE_PATH or the default Core3 DuckDB path.

Return type

pathlib.Path

CORE3_RATE_LIMIT_SQLITE_DATABASE: pathlib.Path = PosixPath('/home/runner/.tradingstrategy/vaults/core3/rate-limit.sqlite')

Default SQLite database path for rate limiting state.

Using SQLite ensures thread-safe rate limiting across multiple threads when using joblib.Parallel or similar parallel processing.

CORE3_DEFAULT_REQUESTS_PER_SECOND: float = 5.0

Default requests per second.

Conservative; Core3 docs do not specify a quota. The API is behind Cloudflare so aggressive rates may trigger blocks.

CORE3_USER_AGENT: str = 'eth-defi/core3'

User-Agent header required by Cloudflare.

Requests without a User-Agent get blocked with HTTP 403 / error code 1010.

CORE3_DEFAULT_TIMEOUT: float = 60.0

Default HTTP request timeout in seconds.

Core3 history endpoints can be slow when backfilling large ranges, so we allow a generous per-request timeout.

SECTIONS: tuple[str, ...] = ('security', 'financial', 'operational', 'reputational', 'regulatory')

Project detail sections available for section snapshot fetching.

INDEX_SLUG: str = '__index__'

Special slug used for the index-level aggregate PoL in the pol_daily table.