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 Projects Data API base URL. |
|
Default requests per second. |
|
User-Agent header required by Cloudflare. |
|
Default HTTP request timeout in seconds. |
|
Project detail sections available for section snapshot fetching. |
|
Special slug used for the index-level aggregate PoL in the |
Functions
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_PATHenvironment variable override. Keeping the resolver next toCORE3_DATABASE_PATHavoids each caller repeating the same environment lookup and path expansion logic.- Returns
Path from
CORE3_DATABASE_PATHor the default Core3 DuckDB path.- Return type
- 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.Parallelor 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.