Skip to content

Commit 634aca9

Browse files
committed
minor fix
1 parent 6051626 commit 634aca9

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

projects/degenPrime/index.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const assetToAddressMappingBase = {
3737
"DINO": "0x85E90a5430AF45776548ADB82eE4cD9E33B08077",
3838
"DRB": "0x3ec2156d4c0a9cbdab4a016633b7bcf6a8d68ea2",
3939
"CLANKER": "0x1bc0c42215582d5a085795f4badbac3ff36d1bcb",
40-
}
40+
}
4141

4242
// Base
4343
const USDC_POOL_TUP_CONTRACT = '0x2Fc7641F6A569d0e678C473B95C2Fc56A88aDF75';
@@ -56,13 +56,13 @@ const SMART_LOANS_FACTORY_TUP_BASE = '0x5A6a0e2702cF4603a098C3Df01f3F0DF56115456
5656
*/
5757
async function addAerodromePositions({ api, accounts }) {
5858
// Get all owned Aerodrome token IDs for each account
59-
const ownedTokenIds = await api.multiCall({
60-
abi: getOwnedStakedAerodromeTokenIdsAbi,
61-
calls: accounts
59+
const ownedTokenIds = await api.multiCall({
60+
abi: getOwnedStakedAerodromeTokenIdsAbi,
61+
calls: accounts
6262
});
6363

6464
const positionCalls = [];
65-
65+
6666
// Prepare calls for getPositionCompositionSimplified for each token ID
6767
ownedTokenIds.forEach((tokenIds, accountIndex) => {
6868
const account = accounts[accountIndex];
@@ -74,11 +74,6 @@ async function addAerodromePositions({ api, accounts }) {
7474
});
7575
});
7676

77-
if (positionCalls.length === 0) {
78-
sdk.log('No Aerodrome positions found');
79-
return;
80-
}
81-
8277
// Get position compositions
8378
const positionCompositions = await api.multiCall({
8479
abi: getPositionCompositionAbi,
@@ -87,12 +82,8 @@ async function addAerodromePositions({ api, accounts }) {
8782

8883
// Add token amounts to balances
8984
positionCompositions.forEach(({ token0, token1, token0Amount, token1Amount }) => {
90-
if (token0Amount > 0) {
91-
api.add(token0, token0Amount);
92-
}
93-
if (token1Amount > 0) {
94-
api.add(token1, token1Amount);
95-
}
85+
api.add(token0, token0Amount);
86+
api.add(token1, token1Amount);
9687
});
9788

9889
sdk.log(`Added ${positionCalls.length} Aerodrome positions to TVL`);
@@ -115,7 +106,7 @@ async function tvlBase(api) {
115106

116107
let accounts = [];
117108
const numberOfAccounts = await api.call({ abi: getPrimeAccountsLengthAbi, target: SMART_LOANS_FACTORY_TUP_BASE, });
118-
const batchSize = 500;
109+
const batchSize = 500;
119110
let batchIndex = 0;
120111
while (batchIndex * batchSize < numberOfAccounts) {
121112
let batchPrimeAccounts = await api.call({

0 commit comments

Comments
 (0)