classify_vault
Documentation for eth_defi.vault_report.sections.classify_vault function.
- classify_vault(vault)
Classify a vault into one of the report’s vault groups.
Every vault belongs to exactly one group, which decides its best-performing section, its table thresholds in
select_group()and whether it counts as stablecoin yield. The rules are checked in priority order, the first match wins:AMM: the scanner’samm_pool_likevault feature. Theammstrategy tag is deliberately not used: vaults taggedamm, such as Gains Network gTrade and KiloEx, stay in their other groups.PERP_DEX: theperp_dex_trading_vaultflag, precomputed asis_perp_dex.TOKENISED_FUND: thetokenised_fundflag, so funds financing real-world credit stay with the other funds.RWA: an RWA strategy tag, checked before lending so RWA lending vaults count as RWA, seeRWA_STRATEGY_TAGS.LENDING: a lending strategy tag, or a known lending protocol for adapters that set no tags, seeLENDING_PROTOCOL_SLUGS.OTHER: everything else.
Applied row by row with
pandas.DataFrame.apply()ineth_defi.vault_report.data.prepare_vault_metrics(). List columns come from JSON and areNaNorNonewhen missing, hence theisinstancechecks.- Parameters
vault (pandas.Series) – Vault metrics row with
features,is_perp_dex,flags,strategy_tagsandprotocol_slug.features,flagsandstrategy_tagsare lists of enum values or missing.- Returns
AMM,PERP_DEX,TOKENISED_FUND,RWA,LENDINGorOTHER.- Return type