yearn / yearn-api-archived

Collection of serverless API
23 stars 24 forks source link

2 Vaults + 1 Earn product + Uniquote priceFeed + Historical TVL #69

Closed miguel567 closed 3 years ago

miguel567 commented 3 years ago

for the /holdings and /holdings/save endpoints

  1. Added mUSD/3CRV vault
  2. Added gUSD/3CRV vault
  3. Added ySUSD earn product
  4. Restructured holdings endpoint to contain a key "type" where values can be "vault" or "earn". This is used to Sum up VaultHoldings and EarnHoldings.
  5. Added keys in the holdings output object for totalVaultHoldings and totalEarnHoldings. With this we know exactly the holdings for each of the 2 big Yearn products.
  6. Added uniquote support for pricing. No need of coingecko anymore. For stablecoins pricing I'm assuming price_usd = 1 as uniquote doesn't provide these prices.

TASK: Holdings/save should be called daily.

Work on /tvl and (new) /tvl/save endpoints

  1. Created a /tvl/save endpoint which stores in a new table the values from final TVL calculation.
  2. Modified /tvl so it reads from DB the most recent TVL stored.
  3. Added a param "?historic=true" which delivers not only the latest TVL, but the full list of TVLs stored in DB.

Task: /tvl/save should be called daily right after /holdings/save