build_core3_vault_section

Documentation for eth_defi.core3.vault_protocol.build_core3_vault_section function.

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 Core3ExportRecord structure (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(), or None if the protocol has no Core3 data.

Returns

A Core3VaultSection dict, or None if record is None. Individual keys are None when the corresponding Core3 field is absent.

Return type

Optional[eth_defi.core3.vault_protocol.Core3VaultSection]