Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategy performance chart - add benchmark #356

Closed
Tracked by #350
kenkunz opened this issue Feb 14, 2023 · 1 comment · Fixed by #811
Closed
Tracked by #350

Strategy performance chart - add benchmark #356

kenkunz opened this issue Feb 14, 2023 · 1 comment · Fixed by #811
Assignees
Labels
enhancement New feature or request priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus. size: M An ordinary task that can be completed in a few days or in a week

Comments

@kenkunz
Copy link
Contributor

kenkunz commented Feb 14, 2023

Depends on #355

Goal

Add a benchmark indicator to the Strategy performance chart. The benchmark should show the buy-and-hold performance for the same trading pair being traded by the strategy.

Details

For v1, we can show some hard-coded tokens (BTC, ETH, MATIC). In the future, each strategy can include info in the metadata API payload to indicate which benchmark tokens to show.

We currently have this "hack" for determining which tokens a strategy trades (displayed in the upper-left corder of strategy tiles) – we could use this to identify which benchmarks to display as well:

// FIXME: hack to infer list of tokens based on strategy ID;
// In the future this will come from the strategy configuration.
function getStrategyTokens({ id }: StrategyRuntimeState) {
const tokens: string[] = [];
for (const token of ['eth', 'btc', 'matic']) {
if (id.includes(token)) tokens.push(token);
}
return [...tokens, 'usdc'];
}

One thing we'll need to do is to "normalize" the benchmark price data to a profitability % (which is what we show for strategies). For any given timeframe that we display (1w, 1m, 3m, etc.) I would assume we'd want to basline the benchmark price to the same starting value as the strategy (so the two lines start at the same point on the left), then calculate the % profitability change from that baseline forward – so you get a genuine comparison of how the strategy performed relative to the benchmark for that time period.

@kenkunz kenkunz mentioned this issue Feb 14, 2023
11 tasks
@kenkunz kenkunz self-assigned this Feb 14, 2023
@kenkunz kenkunz added enhancement New feature or request priority: P2 Default priority. An issue might not yet be fixed in the next release. size: M An ordinary task that can be completed in a few days or in a week labels Feb 14, 2023
@kenkunz
Copy link
Contributor Author

kenkunz commented Mar 1, 2023

Preferred benchmark:

  • For single pair strategy, e.g, AVAX-USDC, show the buy/hold of AVAX.
  • if portfolio of assets, should take ETH or Bitcoin as benchmark, or highest market cap asset in the portfolio.
  • Based on our own data, we should use ETH instead of Bitcoin (ETH-USCD)

For this ticket, just do the single-pair buy/hold benchmark.

@kenkunz kenkunz added priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus. and removed priority: P2 Default priority. An issue might not yet be fixed in the next release. labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: P1 An important issue that must be fixed before the next release, but does nto require immediate focus. size: M An ordinary task that can be completed in a few days or in a week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant