Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(curve): Fix Curve label for cases with a single app token like ib…
Browse files Browse the repository at this point in the history
…EUR / sEUR
  • Loading branch information
immasandwich committed Jul 1, 2022
1 parent e1846d0 commit f95426b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/apps/curve/helpers/curve.pool.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ export class CurvePoolTokenHelper {

private async resolvePoolLabel(tokens: Token[]) {
// Determine source app prefix from underlying tokens (Aave V2, Yearn, etc.)
const appSourcesAll = tokens.filter(isAppToken).map(v => v.appId);
const appTokens = tokens.filter(isAppToken);
const appSourcesAll = appTokens.map(v => v.appId);
const appSources = uniq(appSourcesAll).filter(v => v !== CURVE_DEFINITION.id);
const appSource = appSources.length === 1 ? await this.appToolkit.getApp(appSources[0]) : null;

const hasSingleAppSource = appTokens.length === tokens.length && appSources.length === 1;
const appSource = hasSingleAppSource ? await this.appToolkit.getApp(appSources[0]) : null;
const appSourcePrefix = appSource?.name.replace(/V\d$/, '').trim();

// Determine the pool label from the underlying labels
Expand Down

0 comments on commit f95426b

Please sign in to comment.