vault.valuation

Documentation for eth_defi.vault.valuation Python module.

Net asset valuation calculations for token portfolios and vaults.

  • Calculate the value of vault portfolio using only onchain data, available from JSON-RPC

  • Find best routes to buy tokens, which result to the best price, using brute force

  • See NetAssetValueCalculator for usage

Classes

NetAssetValueCalculator

Calculate valuation of all vault spot assets, assuming we would sell them on Uniswap market sell or similar.

PortfolioValuation

Valuation calulated for a portfolio.

Route

One potential swap path.

SwapMatrix

Brute-forced route swap result for a portfolio of buying multiple tokens.

UniswapV2Router02Quoter

Handle Uniswap v2 quoters using Router02 contract.

UniswapV3Quoter

Handle Uniswap v3 quoters using QuoterV2 contract.

ValuationMulticallWrapper

Wrap the undertlying Multicall with diagnostics data.

ValuationQuoter

Handle asset valuation on a specific DEX/quoter.

Exceptions

NoRouteFound

We could not route some of the spot tokens to get any valuations for them.