Skip to content

Commit

Permalink
Automated lint (#1663)
Browse files Browse the repository at this point in the history
Co-authored-by: ChaituVR <[email protected]>
  • Loading branch information
github-actions[bot] and ChaituVR authored Dec 23, 2024
1 parent 47c9072 commit 97e9e93
Showing 1 changed file with 20 additions and 33 deletions.
53 changes: 20 additions & 33 deletions src/strategies/sd-gauge-less-vote-boost-crosschain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@ export async function strategy(
}

// Mainnet data
const mainnetProvider = getProvider("1");
const mainnetProvider = getProvider('1');

// Get corresponding block number on mainnet
let mainnetBlockTag = await getIDChainBlock(
blockTag,
provider,
"1"
);
let mainnetBlockTag = await getIDChainBlock(blockTag, provider, '1');

if (mainnetBlockTag === "latest") {
if (mainnetBlockTag === 'latest') {
mainnetBlockTag = await mainnetProvider.getBlockNumber();
}

Expand Down Expand Up @@ -113,7 +109,7 @@ export async function strategy(
calls.push([VE_SDT, 'totalSupply']);
}

let callResp: any[] = await multicall("1", mainnetProvider, abi, calls, {
let callResp: any[] = await multicall('1', mainnetProvider, abi, calls, {
blockTag: blockListMainnet[i]
});

Expand All @@ -138,33 +134,23 @@ export async function strategy(
}
}

callResp = await multicall(
network,
provider,
abi,
calls,
{ blockTag: blockList[i] }
);
callResp = await multicall(network, provider, abi, calls, {
blockTag: blockList[i]
});

if (isEnd) {
if (options.pools && Array.isArray(options.pools)) {
const poolsReverse = [...options.pools].reverse()
const poolsReverse = [...options.pools].reverse();
for (let i = 0; i < poolsReverse.length; i++) {
sumPoolsBalance += parseFloat(formatUnits(callResp.pop()[0], 18));
}
}

lockerVotingPower = parseFloat(
formatUnits(callResp.pop()[0], 18)
);
lockerVotingPower = parseFloat(formatUnits(callResp.pop()[0], 18));

sdTokenTotalSupply = parseFloat(
formatUnits(callResp.pop()[0], 18)
);
sdTokenTotalSupply = parseFloat(formatUnits(callResp.pop()[0], 18));

sdTokenGaugeTotalSupply = parseFloat(
formatUnits(callResp.pop()[0], 18)
);
sdTokenGaugeTotalSupply = parseFloat(formatUnits(callResp.pop()[0], 18));
}

responsesCurrentChain.push(callResp);
Expand All @@ -187,17 +173,13 @@ export async function strategy(
formatUnits(BigNumber.from(responsesMainnet[j].shift()[0]), 18)
);
const l = parseFloat(
formatUnits(
BigNumber.from(responsesCurrentChain[j].shift()[0]),
18
)
formatUnits(BigNumber.from(responsesCurrentChain[j].shift()[0]), 18)
);

let lim = (l * TOKENLESS_PRODUCTION) / 100;
if (veSDTTotalSupply > 0) {
lim +=
(((sdTokenGaugeTotalSupply * voting_balance) /
veSDTTotalSupply) *
(((sdTokenGaugeTotalSupply * voting_balance) / veSDTTotalSupply) *
(100 - TOKENLESS_PRODUCTION)) /
100;
}
Expand All @@ -206,7 +188,10 @@ export async function strategy(
}

let userVote = 0;
if(options.botAddress && addresses[i].toLowerCase() === options.botAddress.toLowerCase()) {
if (
options.botAddress &&
addresses[i].toLowerCase() === options.botAddress.toLowerCase()
) {
userVote = liquidityVoteFee * totalUserVotes;
} else {
// Get average working balance.
Expand Down Expand Up @@ -235,7 +220,9 @@ function getPreviousBlocks(
// Calculate total blocks interval
const totalBlocksInterval = blocksPerDay * daysInterval;
// Calculate block interval
const blockInterval = totalBlocksInterval / (numberOfBlocks > 1 ? numberOfBlocks - 1 : numberOfBlocks);
const blockInterval =
totalBlocksInterval /
(numberOfBlocks > 1 ? numberOfBlocks - 1 : numberOfBlocks);

// Init array of block numbers
const blockNumbers: number[] = [];
Expand Down

0 comments on commit 97e9e93

Please sign in to comment.