yearn / yearn-api-archived

Collection of serverless API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ySUSD pool to holdings endpoint and restructure poolBalanceUSD, restructure TVL to expose earnHoldings, vaultHoldings, StrategyHoldings. Include mUSD and SUSD vaults

miguel567 opened this issue · comments

ySUSD earn pool: https://etherscan.io/address/0xF61718057901F84C4eEC4339EF8f0D86D2B45600

earnHoldings:

  • create a earnHoldings object which contains the pools, with name and address.
  • remove the poolBalanceUSD key and move the items to earnHoldings.

update TVL endpoint so it adds up correctly earnHolding pieces.

expose the earnHoldings, vaultHoldings and strategyHoldings keys in the TVL endpoint

  • avoid breaking the TvlUSD key.

include mUSD and ySUSD vaults

update type in calculation key.

Going to add a type key in the holdings endpoint to differentiate the products.
type: 'earn' is the earn product.
type: 'vault' is V1 and V2(when they are added) vaults.

with these then I can iterate over all type === 'earn' and get the earnHoldings total easily.