yearn-sdk icon indicating copy to clipboard operation
yearn-sdk copied to clipboard

feat: add ability to fetch strategy harvest info

Open jstashh opened this issue 2 years ago • 1 comments

Description

Add a getHarvests function to StrategiesInterface that returns data about the harvests of a strategy, optionally within a specified window of blocks

Data returned about each Harvest:

export interface HarvestData {
  transactionId: string;
  gain: BigNumber;
  gainUsdc: BigNumber;
  loss: BigNumber;
  time: Date;
  estimatedTotalAssets: BigNumber;
  apr: number;
}

Motivation and Context

Adding more functionality to the SDK for rendering data about vaults/strategies.

How Has This Been Tested?

added unit tests

jstashh avatar May 24 '22 16:05 jstashh

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 48.05 KB (+1.17% 🔺)
dist/sdk.esm.js 48.39 KB (+1.18% 🔺)

github-actions[bot] avatar May 24 '22 16:05 github-actions[bot]