Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit b55e4dc

Browse files
committed
Add xaqua-vaults-treasury strategy
1 parent fca3543 commit b55e4dc

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

src/strategies/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ const strategies = {
501501
'erc20-balance-of-saevo': erc20BalanceOfSaevo,
502502
livepeer,
503503
'spooky-lp-sonic': spookyLpSonic,
504-
'xaqua-vaults-treasury' : xaqua,
504+
'xaqua-vaults-treasury': xaqua,
505505
'delegatexyz-erc721-balance-of': delegatexyzErc721BalanceOf,
506506
'giveth-balances-supply-weighted': givethBalancesSupplyWeighted,
507507
'giveth-gnosis-balance-supply-weighted-v3':

src/strategies/xaqua-vaults-treasury/examples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"name": "Custom vault + treasury strategy",
44
"strategy": {
5-
"name": "xaqua-vaults-treasury",
5+
"name": "xaqua-vaults-treasury",
66
"params": {
77
"vault1": "0x8f0d1a8d2f2f0d9b297e6d4d7cd234ab638df51f",
88
"vault2": "0x589fad2960b93efdfc0f86fcb5606cf625d8f755",

src/strategies/xaqua-vaults-treasury/index.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ import { multicall } from '../../utils';
44
export const author = 'pepperati224';
55
export const version = '0.1.0';
66

7-
function chunk(array, chunkSize) {
8-
const tempArray: any[] = [];
9-
for (let i = 0, len = array.length; i < len; i += chunkSize)
10-
tempArray.push(array.slice(i, i + chunkSize));
11-
return tempArray;
12-
}
13-
147
export async function strategy(
158
space,
169
network,
@@ -35,13 +28,9 @@ export async function strategy(
3528
callData.push([options.treasury, 'usersAllocation', [address]]);
3629
}
3730

38-
const chunks = chunk(callData, 2000); // to prevent overload
39-
const response: any[] = [];
40-
41-
for (const chunkPart of chunks) {
42-
const temp = await multicall(network, provider, abi, chunkPart, { blockTag });
43-
response.push(...temp);
44-
}
31+
const response = await multicall(network, provider, abi, callData, {
32+
blockTag
33+
});
4534

4635
// Aggregate scores
4736
const scores: Record<string, number> = {};
@@ -59,8 +48,10 @@ export async function strategy(
5948

6049
const total = BigInt(vault1Bal) + BigInt(vault2Bal) + BigInt(treasuryBal);
6150

62-
scores[address] = parseFloat(formatUnits(total.toString(), options.decimals));
51+
scores[address] = parseFloat(
52+
formatUnits(total.toString(), options.decimals)
53+
);
6354
}
6455

6556
return scores;
66-
}
57+
}

0 commit comments

Comments
 (0)