core3.vault_protocol
Documentation for eth_defi.core3.vault_protocol Python module.
Look up Core3 risk intelligence for our vault protocols.
Resolves our vault protocol slugs to Core3 project slugs via
CORE3_MAPPINGS, then fetches the
latest snapshot from the local DuckDB database.
Example:
from pathlib import Path
from eth_defi.core3.database import Core3Database
from eth_defi.core3.constants import CORE3_DATABASE_PATH
from eth_defi.core3.vault_protocol import get_core3_protocol_record
db = Core3Database(CORE3_DATABASE_PATH)
record = get_core3_protocol_record(db, "morpho")
if record:
print(f"PoL score: {record['pol']['score']}")
print(f"Top risks: {len(record['top_risks'])}")
db.close()
Functions
|
Build a protocol-slug-keyed dict of Core3 records for the JSON export. |
|
Flatten a Core3 export record into a compact per-vault risk summary. |
|
Look up the latest Core3 risk record for a vault protocol. |
Classes
Core3 project category classification. |
|
A blockchain network where the project is deployed. |
|
Core3 data coverage indicator. |
|
Serialised Core3 project record for JSON export. |
|
Project external links from Core3. |
|
Market capitalisation data from Core3. |
|
Latest per-category Probability of Loss (PoL) sub-scores. |
|
Core3 Probability of Loss (PoL) score and rating. |
|
A recent change detected by Core3 monitoring. |
|
Full Core3 project record from the latest DuckDB snapshot. |
|
A single Core3 trust seal status. |
|
Core3 trust seals for a project. |
|
A social link entry from Core3. |
|
A top risk finding from Core3's risk assessment. |
|
Compact per-vault Core3 risk summary. |
- class Core3Seal
Bases:
TypedDictA single Core3 trust seal status.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Seals
Bases:
TypedDictCore3 trust seals for a project.
Verifiable marks awarded by Core3 based on project practices.
- security_measures: eth_defi.core3.vault_protocol.Core3Seal
Whether the project demonstrates adequate security measures (audits, monitoring, bug bounty).
- independent_certificates: eth_defi.core3.vault_protocol.Core3Seal
Whether the project holds independent certifications (ISO 27001, CCSS, SOC 2).
- self_regulation: eth_defi.core3.vault_protocol.Core3Seal
Whether the project participates in self-regulation initiatives (KYC, KYT, legal compliance).
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3PolScore
Bases:
TypedDictCore3 Probability of Loss (PoL) score and rating.
PoL is a data-driven, non-price risk metric. Lower scores indicate less risk of loss.
- rating: Optional[str]
Credit-style letter rating:
"AAA","AA","A","BBB","BB","B","CCC","CC","C","DDD","DD","D", orNoneif not yet rated.
- confidence: Optional[str]
Human-readable confidence label:
"Exceptional","High","Medium","Low","Critical", orNone.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3PolCategories
Bases:
TypedDictLatest per-category Probability of Loss (PoL) sub-scores.
Core3 assesses PoL across five risk categories, each with its own sub-score on the same 0 (Exceptional) to 100 (Critical) scale as the overall PoL. Sourced from the API-native category breakdown (
/v1/{slug}/pol/by_category), stored daily inpol_category_daily. Any sub-score may beNonefor less-covered projects.- ts: Optional[str]
ISO 8601 timestamp of the category snapshot these scores come from.
Noneif not available.
- security: Optional[float]
Security sub-score: audits, bug bounty, contract verification, monitoring.
- financial: Optional[float]
Financial sub-score: revenue sources, treasury quality, token inflation.
- reputational: Optional[float]
Reputational sub-score: auditor ratings, incidents, social metrics, insurance.
- regulatory: Optional[float]
Regulatory sub-score: KYC/KYT, jurisdiction, legal documentation, transparency.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3MarketCap
Bases:
TypedDictMarket capitalisation data from Core3.
Values are returned as strings from the API (not numbers).
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Chain
Bases:
TypedDictA blockchain network where the project is deployed.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Social
Bases:
TypedDictA social link entry from Core3.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Links
Bases:
TypedDictProject external links from Core3.
- socials: list[eth_defi.core3.vault_protocol.Core3Social]
List of social media and external resource links.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3TopRisk
Bases:
TypedDictA top risk finding from Core3’s risk assessment.
Core3 surfaces the most significant risk factors identified across security, financial, operational, reputational, and regulatory categories.
- content: str
Human-readable risk description, e.g.
"A treasury composed entirely of the project's own native token...".
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3RecentChange
Bases:
TypedDictA recent change detected by Core3 monitoring.
Tracks notable metric movements like traffic drops or engagement changes.
- content: str
Human-readable change description, e.g.
"Website traffic has dropped to below-average levels...".
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Category
Bases:
TypedDictCore3 project category classification.
- name: str
Category display name, e.g.
"Decentralized Finance","Lending/Borrowing","Decentralized Exchange","Layer 1","Layer 2","RWA".
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3DataCoverage
Bases:
TypedDictCore3 data coverage indicator.
Shows how much of the project’s data Core3 has been able to collect and verify.
- percentage: float
Percentage of data coverage, 0–100. Higher values mean more comprehensive risk assessment.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3Record
Bases:
TypedDictFull Core3 project record from the latest DuckDB snapshot.
Contains the complete JSON payload stored by
insert_project_snapshot(), plus database metadata fields.See README-core3 for the API documentation that produces this data.
- pol: eth_defi.core3.vault_protocol.Core3PolScore
Probability of Loss score, rating, and confidence level.
- pol_categories: Optional[eth_defi.core3.vault_protocol.Core3PolCategories]
Latest per-category PoL sub-scores (security, financial, etc.).
Noneif the project has no category breakdown in the database. Added by the database layer, not present in the original API response.
- ticker: Optional[str]
Token ticker symbol, e.g.
"MORPHO","EUL". Some projects omit this key entirely from the API response.
- coingecko_id: Optional[str]
CoinGecko ID for cross-referencing, e.g.
"morpho","euler". Some projects omit this key entirely from the API response.
- link: Optional[str]
Core3 project page link (note: may have malformed URLs like
"https://core3.iomorpho"— missing/).
- category: Optional[eth_defi.core3.vault_protocol.Core3Category]
Project category classification.
- data_coverage: Optional[eth_defi.core3.vault_protocol.Core3DataCoverage]
Data coverage percentage indicator.
- market_cap: Optional[eth_defi.core3.vault_protocol.Core3MarketCap]
Market capitalisation data.
- chains: list[eth_defi.core3.vault_protocol.Core3Chain]
Blockchain networks where the project is deployed.
- links: Optional[eth_defi.core3.vault_protocol.Core3Links]
External links (website, legal, whitepaper, socials).
- top_risks: list[eth_defi.core3.vault_protocol.Core3TopRisk]
Top risk findings from Core3’s assessment. Typically 10–30 risk items covering security, financial, operational, reputational, and regulatory concerns.
- recent_changes: list[eth_defi.core3.vault_protocol.Core3RecentChange]
Recent monitoring changes detected by Core3.
- seals: Optional[eth_defi.core3.vault_protocol.Core3Seals]
Trust seals status (security measures, independent certs, self-regulation).
- fetched_at: datetime.datetime
Timestamp when this snapshot was fetched from the Core3 API. Added by the database layer, not present in the original API response.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- get_core3_protocol_record(db, vault_protocol_slug)
Look up the latest Core3 risk record for a vault protocol.
Resolves our vault protocol slug to a Core3 project slug using
CORE3_MAPPINGS, then reads the most recent project snapshot from the DuckDB database.- Parameters
db (eth_defi.core3.database.Core3Database) – Open Core3 DuckDB database connection.
vault_protocol_slug (str) – Our vault protocol slug, e.g.
"morpho","fluid","maple". Must match a key inCORE3_MAPPINGS.
- Returns
The latest
Core3Recordfor the protocol, orNoneif the protocol has no Core3 mapping or the Core3 slug is not found in the database.- Return type
- class Core3ExportRecord
Bases:
TypedDictSerialised Core3 project record for JSON export.
Same structure as
Core3Recordbut withfetched_atas an ISO 8601 string instead ofdatetime, since the JSON export cannot contain raw datetime objects.- pol: eth_defi.core3.vault_protocol.Core3PolScore
Probability of Loss score, rating, and confidence level.
- pol_categories: Optional[eth_defi.core3.vault_protocol.Core3PolCategories]
Latest per-category PoL sub-scores (security, financial, etc.).
Noneif the project has no category breakdown in the database.
- category: Optional[eth_defi.core3.vault_protocol.Core3Category]
Project category classification.
- data_coverage: Optional[eth_defi.core3.vault_protocol.Core3DataCoverage]
Data coverage percentage indicator.
- market_cap: Optional[eth_defi.core3.vault_protocol.Core3MarketCap]
Market capitalisation data.
- chains: list[eth_defi.core3.vault_protocol.Core3Chain]
Blockchain networks where the project is deployed.
- links: Optional[eth_defi.core3.vault_protocol.Core3Links]
External links (website, legal, whitepaper, socials).
- top_risks: list[eth_defi.core3.vault_protocol.Core3TopRisk]
Top risk findings from Core3’s assessment.
- recent_changes: list[eth_defi.core3.vault_protocol.Core3RecentChange]
Recent monitoring changes detected by Core3.
- seals: Optional[eth_defi.core3.vault_protocol.Core3Seals]
Trust seals status.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- class Core3VaultSection
Bases:
TypedDictCompact per-vault Core3 risk summary.
A flattened subset of
Core3ExportRecordembedded under thecore3key of each vault record produced byeth_defi.research.vault_metrics.calculate_vault_record(). Individual values areNonewhen the underlying Core3 field is missing; the whole section isNonewhen the vault’s protocol has no Core3 data (seebuild_core3_vault_section()).- __init__(*args, **kwargs)
- __new__(**kwargs)
- clear()
Remove all items from the dict.
- copy()
Return a shallow copy of the dict.
- fromkeys(value=None, /)
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)
Return the value for key if key is in the dictionary, else default.
- items()
Return a set-like object providing a view on the dict’s items.
- keys()
Return a set-like object providing a view on the dict’s keys.
- pop(k[, d]) v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from mapping/iterable E and F.
If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()
Return an object providing a view on the dict’s values.
- build_core3_vault_section(record)
Flatten a Core3 export record into a compact per-vault risk summary.
Picks the handful of headline risk fields the frontend shows on each vault row, flattening the nested
Core3ExportRecordstructure (pol.score,market_cap.in_usd,data_coverage.percentage) into a single flat dict.- Parameters
record (Optional[eth_defi.core3.vault_protocol.Core3ExportRecord]) – The Core3 export record for the vault’s protocol, as returned by
build_core3_protocols_for_export(), orNoneif the protocol has no Core3 data.- Returns
A
Core3VaultSectiondict, orNoneifrecordisNone. Individual keys areNonewhen the corresponding Core3 field is absent.- Return type
- build_core3_protocols_for_export(db, protocol_slugs)
Build a protocol-slug-keyed dict of Core3 records for the JSON export.
Looks up each vault protocol slug in the Core3 database and returns a dict suitable for embedding as the top-level
core3_protocolskey in the vault metrics JSON export. Records are keyed by our internal protocol slugs (e.g."fluid"), not Core3’s own slugs (e.g."instadapp").- Parameters
db (eth_defi.core3.database.Core3Database) – Open Core3 DuckDB database connection.
protocol_slugs (collections.abc.Iterable[str]) – Iterable of our vault protocol slugs to look up.
- Returns
Dict mapping protocol slug to
Core3ExportRecord. Slugs with no Core3 mapping or no database record are excluded.- Return type