VaultPortfolio
Documentation for eth_defi.vault.base.VaultPortfolio Python class.
- class VaultPortfolio
Bases:
objectTrack assets and balances in a vault.
Offchain method to track what assets a vault contains
Takes
TradingUniverseas an input and resolves all relevant balances the vault holds for this trading universeBecause of brainrotten and awful ERC-20 token standard, the vault does not know what tokens it owns and this needs to be specific offchain
Attributes summary
Get list of tokens held in this portfolio
Methods summary
__init__(spot_erc20[, dex_hints])get_position_count()get_raw_spot_balances(web3)Convert spot balances to raw token balances
Do we have only ERC-20 hold positions in this portfolio
- __init__(spot_erc20, dex_hints=<factory>)
- Parameters
spot_erc20 (eth_defi.vault.lower_case_dict.LowercaseDict) –
dex_hints (dict[eth_typing.evm.HexAddress, list[str]]) –
- Return type
None
- get_raw_spot_balances(web3)
Convert spot balances to raw token balances
- Parameters
web3 (web3.main.Web3) –
- Return type
- is_spot_only()
Do we have only ERC-20 hold positions in this portfolio
- Return type
- property tokens: set[eth_typing.evm.HexAddress]
Get list of tokens held in this portfolio