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
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