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

Commit

Permalink
fix(dhedge-v2): Fix Polygon vaults underlying tokens (#1463)
Browse files Browse the repository at this point in the history
Co-authored-by: gaulois <[email protected]>
  • Loading branch information
gdeschryver and gaulois authored Sep 28, 2022
1 parent 93bd3c3 commit 6096b80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apps/dhedge-v2/polygon/dhedge-v2.pool.token-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class PolygonDhedgeV2PoolTokenFetcher implements PositionFetcher<AppToken
constructor(
@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit,
@Inject(DhedgeV2ContractFactory) private readonly contractFactory: DhedgeV2ContractFactory,
) {}
) { }

async getPositions() {
const endpoint = 'https://api.thegraph.com/subgraphs/name/dhedge/dhedge-v2-polygon';
Expand All @@ -69,7 +69,7 @@ export class PolygonDhedgeV2PoolTokenFetcher implements PositionFetcher<AppToken
]);
const supply = Number(supplyRaw) / 10 ** decimals;
const tokens = filter(
pool.assets.map(asset => baseTokens.find(t => t.address === asset.id.toLowerCase())),
pool.assets.map(asset => baseTokens.find(t => t.address === asset.id.toLowerCase().split("-").pop())),
) as BaseToken[];
const pricePerShare = Number(pool.tokenPrice) / 10 ** decimals;
const price = pricePerShare * dUSD.price;
Expand Down

0 comments on commit 6096b80

Please sign in to comment.