vault.fee

Documentation for eth_defi.vault.fee Python module.

Vault fee modes.

Module Attributes

VAULT_PROTOCOL_FEE_MATRIX

Different vault fee extraction methods by different protocols

BROKEN_FEE_DATA

Could not read fee data from the smart contract / unsupported protocol

Functions

get_vault_fee_mode(vault_protocol_name, address)

Get vault fee mode by protocol name.

Classes

FeeData

Track vault fee parameters

VaultFeeMode

How vault protocol account its fees.

class VaultFeeMode

Bases: enum.Enum

How vault protocol account its fees.

  • Externalised fees: fees are deducted from the redemption amount when user withdraws.

  • Internalised fees: fees are baked into the share price (asset amount) and continuously taken from the profit. There are no fees on withdraw.

internalised_skimming = 'internalised_skimming'

Vault fees are baked into the share price (asset amount).

Fees are taken from the profit at the moment profit is made, and send to another address.

Example protocols: Yearn, Harvest Finance, USDAi.

internalised_minting = 'internalised_minting'

Vault fees are baked into the share price (asset amount).

Fees are taken from the profit at the moment profit is made. and corresponding number of shares is minted to the vault owner.

Example protocols: AUTO Finance

externalised = 'externalised'

Vault fees are taken from the user explicitly at the redemption time.

Example protocols: Lagoon Finance.

feeless = 'feeless'

This protocol has no fees.

is_internalised()

Are the fees internalised in the share price?

Return type

bool

VAULT_PROTOCOL_FEE_MATRIX = {'AUTO Finance': VaultFeeMode.internalised_minting, 'Accountable': VaultFeeMode.internalised_skimming, 'Altura': VaultFeeMode.feeless, 'Avant': VaultFeeMode.feeless, 'Brink': None, 'Curvance': VaultFeeMode.internalised_skimming, 'D2 Finance': VaultFeeMode.internalised_skimming, 'Dolomite': VaultFeeMode.internalised_skimming, 'ETH Strategy': VaultFeeMode.feeless, 'Enzyme': VaultFeeMode.internalised_skimming, 'Ethena': VaultFeeMode.feeless, 'Euler': VaultFeeMode.internalised_skimming, 'Fluid': VaultFeeMode.internalised_skimming, 'Frax': VaultFeeMode.internalised_skimming, 'Gains': VaultFeeMode.feeless, 'Gearbox': VaultFeeMode.internalised_skimming, 'Goat Protocol': VaultFeeMode.internalised_skimming, 'Harvest Finance': VaultFeeMode.internalised_skimming, 'Hyperlend': VaultFeeMode.internalised_skimming, 'HypurrFi': VaultFeeMode.internalised_skimming, 'Lagoon': VaultFeeMode.externalised, 'Llama Lend': VaultFeeMode.internalised_skimming, 'Mainstreet Finance': None, 'Morpho': VaultFeeMode.internalised_skimming, 'NashPoint': VaultFeeMode.internalised_skimming, 'Ostium': VaultFeeMode.feeless, 'Peapods': None, 'Plutus': VaultFeeMode.internalised_skimming, 'Renalta': None, 'Resolv': VaultFeeMode.feeless, 'Royco': None, 'Sentiment': VaultFeeMode.internalised_skimming, 'Silo Finance': VaultFeeMode.internalised_minting, 'Singularity Finance': VaultFeeMode.internalised_minting, 'Sky': VaultFeeMode.feeless, 'Summer.fi': VaultFeeMode.internalised_minting, 'Term Finance': VaultFeeMode.internalised_skimming, 'USDX Money': VaultFeeMode.internalised_skimming, 'USDai': VaultFeeMode.internalised_skimming, 'Umami': VaultFeeMode.externalised, 'Untangle Finance': VaultFeeMode.externalised, 'Velvet Capital': VaultFeeMode.internalised_skimming, 'Yearn': VaultFeeMode.internalised_skimming, 'YieldFi': None, 'YieldNest': None, 'Yo': None, 'Yuzu Money': VaultFeeMode.feeless, 'aarnâ': None, 'cSigma Finance': VaultFeeMode.feeless, 'infiniFi': None}

Different vault fee extraction methods by different protocols

See eth_defi.erc_4626.core.get_vault_protocol_name() for the names list.

class FeeData

Bases: object

Track vault fee parameters

  • Offer methods to calculate gross/net fees based on the vault fee mode

  • None means fee unknown: protocol not recognized, or fee data not available

How fees are presented:

  • Gross fees are what vaults track internally. They are not exposed to an investor, and only useful for internal profit calculations of the vault. Gross fees have already been deducted when the vault share price is updated.

  • Net fees are deduced at a redemption. A vault investor receives less than the value of their shares back.

  • For comparing the profitability of vaults, you need to reduce the net fees of an investment period from the vault share price.

  • Common vault fee mechanisms implementations are: externalised (net fees, deducted from an investor at a redemption),

    skimming (redirected from profits at the time of trade) and minting (new shares minted to the vault owner at the time of trade).

fee_mode: eth_defi.vault.fee.VaultFeeMode | None

Determines is the vault share price is fees-net or fees-gross

management: float | None

Fee for this class

performance: float | None

Fee for this class

deposit: float | None

Fee for this class

withdraw: float | None

Fee for this class

get_net_fees()

Get net fees paid by the user on deposit/withdraw.

  • Determined by the vault fee mode

Return type

eth_defi.vault.fee.FeeData

__init__(fee_mode, management, performance, deposit, withdraw)
Parameters
Return type

None

BROKEN_FEE_DATA = FeeData(fee_mode=None, management=None, performance=None, deposit=None, withdraw=None)

Could not read fee data from the smart contract / unsupported protocol

get_vault_fee_mode(vault_protocol_name, address)

Get vault fee mode by protocol name.

Returns

None if unknown

Parameters
Return type

eth_defi.vault.fee.VaultFeeMode | None