diff --git a/src/strategies/sd-vote-boost-twavp-vsdcrv-crosschain/index.ts b/src/strategies/sd-vote-boost-twavp-vsdcrv-crosschain/index.ts index b7603eb12..19e0ec64d 100644 --- a/src/strategies/sd-vote-boost-twavp-vsdcrv-crosschain/index.ts +++ b/src/strategies/sd-vote-boost-twavp-vsdcrv-crosschain/index.ts @@ -34,7 +34,6 @@ async function getIDChainBlock(snapshot, provider, chainId) { return data.blocks[0].number; } - export async function strategy( space, network, @@ -65,7 +64,11 @@ export async function strategy( const destinationChainProvider = getProvider(options.targetChainId); // Get corresponding block number on the destination chain side - const destinationChainBlockTag = await getIDChainBlock(blockTag, provider, options.targetChainId); + const destinationChainBlockTag = await getIDChainBlock( + blockTag, + provider, + options.targetChainId + ); // Create block list const blockList = getPreviousBlocks( @@ -84,21 +87,35 @@ export async function strategy( const response: any[] = []; for (let i = 0; i < options.sampleStep; i++) { response.push( - await multicall(options.targetChainId, destinationChainProvider, abi, balanceOfQueries, { blockTag: blockList[i] }) + await multicall( + options.targetChainId, + destinationChainProvider, + abi, + balanceOfQueries, + { blockTag: blockList[i] } + ) ); } - const mainChainResponses = await multicall(network, provider, abi, [ - [options.veAddress, 'balanceOf', [options.locker]], - [options.sdTokenGauge, 'working_supply'], - [options.sdTokenGauge, 'working_balances', [options.booster]], - [options.vsdToken, 'totalSupply', []] - ], { blockTag }) + const mainChainResponses = await multicall( + network, + provider, + abi, + [ + [options.veAddress, 'balanceOf', [options.locker]], + [options.sdTokenGauge, 'working_supply'], + [options.sdTokenGauge, 'working_balances', [options.booster]], + [options.vsdToken, 'totalSupply', []] + ], + { blockTag } + ); const lockerVeBalance = mainChainResponses.shift()[0]; // Last response, latest block const workingSupply = mainChainResponses.shift()[0]; // Last response, latest block const workingBalances = mainChainResponses.shift()[0]; // Last response, latest block - const vsdCRVTotalSupply = parseFloat(formatUnits(BigNumber.from(mainChainResponses.shift()[0]), 18)); // Last response, latest block + const vsdCRVTotalSupply = parseFloat( + formatUnits(BigNumber.from(mainChainResponses.shift()[0]), 18) + ); // Last response, latest block const totalVP = (parseFloat(formatUnits(workingBalances, 18)) / @@ -113,7 +130,9 @@ export async function strategy( const userWorkingBalances: number[] = []; for (let j = 0; j < options.sampleStep; j++) { - const balanceOf = parseFloat(formatUnits(BigNumber.from(response[j].shift()[0]), 18)); + const balanceOf = parseFloat( + formatUnits(BigNumber.from(response[j].shift()[0]), 18) + ); // Add working balance to array. if (vsdCRVTotalSupply === 0) { @@ -165,7 +184,7 @@ function getPreviousBlocks( currentBlockNumber: number, numberOfBlocks: number, daysInterval: number, - blocksPerDay: number, + blocksPerDay: number ): number[] { // Calculate total blocks interval const totalBlocksInterval = blocksPerDay * daysInterval; diff --git a/src/strategies/sd-vote-boost-twavp-vsdtoken/index.ts b/src/strategies/sd-vote-boost-twavp-vsdtoken/index.ts index 603b43cad..6137b7e70 100644 --- a/src/strategies/sd-vote-boost-twavp-vsdtoken/index.ts +++ b/src/strategies/sd-vote-boost-twavp-vsdtoken/index.ts @@ -100,8 +100,12 @@ export async function strategy( const userWorkingBalances: number[] = []; for (let j = 0; j < options.sampleStep; j++) { - const balanceOf = parseFloat(formatUnits(BigNumber.from(response[j].shift()[0]), 18)); - const totalSupply = parseFloat(formatUnits(BigNumber.from(response[j].shift()[0]), 18)); + const balanceOf = parseFloat( + formatUnits(BigNumber.from(response[j].shift()[0]), 18) + ); + const totalSupply = parseFloat( + formatUnits(BigNumber.from(response[j].shift()[0]), 18) + ); // Add working balance to array. if (totalSupply === 0) {