Skip to content

Commit

Permalink
fix(pools/evm): stabilize pool's fetch from chain
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKozAllB committed May 30, 2024
1 parent 645296c commit 1f14188
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/services/liquidity-pool/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ export class EvmPoolService extends ChainPoolService {

private async getPoolInfoPerProperty(token: TokenWithChainDetails): Promise<PoolInfo> {
const poolContract = this.getPoolContract(token.poolAddress);
const [aValue, dValue, tokenBalance, vUsdBalance, totalLpAmount, accRewardPerShareP] = await Promise.all([
poolContract.methods.a().call(),
poolContract.methods.d().call(),
poolContract.methods.tokenBalance().call(),
poolContract.methods.vUsdBalance().call(),
poolContract.methods.totalSupply().call(),
poolContract.methods.accRewardPerShareP().call(),
]);

const aValue = await poolContract.methods.a().call();
const dValue = await poolContract.methods.d().call();
const tokenBalance = await poolContract.methods.tokenBalance().call();
const vUsdBalance = await poolContract.methods.vUsdBalance().call();
const totalLpAmount = await poolContract.methods.totalSupply().call();
const accRewardPerShareP = await poolContract.methods.accRewardPerShareP().call();

const imbalance = calculatePoolInfoImbalance({ tokenBalance, vUsdBalance });

return {
Expand Down

0 comments on commit 1f14188

Please sign in to comment.