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

Commit

Permalink
fix(lido): Fix stETH pricePerShare (#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin committed Sep 29, 2023
1 parent 1166d0a commit c25d03c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/apps/lido/ethereum/lido.steth.token-fetcher.ts
Expand Up @@ -3,7 +3,6 @@ import { Inject } from '@nestjs/common';
import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface';
import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator';
import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher';
import { GetPricePerShareParams } from '~position/template/app-token.template.types';

import { LidoContractFactory } from '../contracts';
import { LidoSteth } from '../contracts/ethers/LidoSteth';
Expand Down Expand Up @@ -31,15 +30,7 @@ export class EthereumLidoStethTokenFetcher extends AppTokenTemplatePositionFetch
return [{ address: '0x0000000000000000000000000000000000000000', network: this.network }];
}

async getPricePerShare({ appToken, multicall }: GetPricePerShareParams<LidoSteth>) {
const oracleContract = this.contractFactory.lidoStethEthOracle({
address: '0x86392dc19c0b719886221c78ab11eb8cf5c52812',
network: this.network,
});

const latestRound = await multicall.wrap(oracleContract).latestRound();
const pricePerShareRaw = await multicall.wrap(oracleContract).getAnswer(latestRound);

return [Number(pricePerShareRaw) / 10 ** appToken.decimals];
async getPricePerShare() {
return [1];
}
}

0 comments on commit c25d03c

Please sign in to comment.