Skip to content

Commit a45f8e0

Browse files
committed
curve edit
1 parent 66ab5a9 commit a45f8e0

File tree

1 file changed

+35
-31
lines changed

1 file changed

+35
-31
lines changed

projects/curve/index.js

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ async function getPools(block, chain) {
6161
})).output;
6262
}
6363

64-
let allPools = {}
65-
Object.entries(pools).map(([key, list])=>{
66-
pools[key] = list.filter(p=>{
67-
if(allPools[p.output] === undefined){
68-
allPools[p.output] = true
69-
return true
64+
let allPools = {};
65+
Object.entries(pools).map(([key, list]) => {
66+
pools[key] = list.filter(p => {
67+
if (allPools[p.output] === undefined) {
68+
allPools[p.output] = true;
69+
return true;
7070
} else {
71-
return false
71+
return false;
7272
}
73-
})
74-
})
73+
});
74+
});
7575

7676
return pools;
7777
}
@@ -138,10 +138,14 @@ async function fixWrappedTokenBalances(balances, block, chain, transform) {
138138
await unwrapSdTokens(balances, contracts[chain].sdTokens, chain);
139139
}
140140

141-
const stDOT = "moonbeam:0xfa36fe1da08c89ec72ea1f0143a35bfd5daea108"
142-
if(stDOT in balances){
143-
balances["bsc:0x7083609fce4d1d8dc0c979aab8c869ea2c873402"] = BigNumber(balances[stDOT]).times(1e8).toFixed(0)
144-
delete balances[stDOT]
141+
const stDOT = "moonbeam:0xfa36fe1da08c89ec72ea1f0143a35bfd5daea108";
142+
if (stDOT in balances) {
143+
balances["bsc:0x7083609fce4d1d8dc0c979aab8c869ea2c873402"] = BigNumber(
144+
balances[stDOT]
145+
)
146+
.times(1e8)
147+
.toFixed(0);
148+
delete balances[stDOT];
145149
}
146150
}
147151

@@ -197,7 +201,7 @@ function mapGaugeTokenBalances(calls, chain) {
197201
//"0xe7a24ef0c5e95ffb0f6684b813a78f2a3ad7d171": "0x19793b454d3afc7b454f206ffe95ade26ca6912c", // maybe not? 4 0s poly
198202
"0x7f90122bf0700f9e7e1f688fe926940e8839f353": {
199203
to: "0xbf7e49483881c76487b0989cd7d9a8239b20ca41",
200-
pools: ["0x30df229cefa463e991e29d42db0bae2e122b2ac7"],
204+
pools: [],
201205
chains: []
202206
}, // need a pool conditional - only for (1) ['0x30dF229cefa463e991e29D42DB0bae2e122B2AC7']
203207
"0xd02a30d33153877bc20e5721ee53dedee0422b2f": {
@@ -210,11 +214,6 @@ function mapGaugeTokenBalances(calls, chain) {
210214
pools: [],
211215
chains: ["avax"]
212216
},
213-
"0x7f90122bf0700f9e7e1f688fe926940e8839f353": {
214-
to: "0xbF7E49483881C76487b0989CD7d9A8239B20CA41",
215-
pools: [],
216-
chains: ["arbitrum"]
217-
},
218217
"0x27e611fd27b276acbd5ffd632e5eaebec9761e40": {
219218
to: "0x8866414733F22295b7563f9C5299715D2D76CAf4",
220219
pools: [],
@@ -349,7 +348,7 @@ function tvl(chain) {
349348
let balances = {};
350349
const transform = await getChainTransform(chain);
351350
const poolList = await getPools(chainBlocks[chain], chain);
352-
const block = await getBlock(_t, chain, chainBlocks, true)
351+
const block = await getBlock(_t, chain, chainBlocks, true);
353352

354353
for (let registry of Object.keys(poolList)) {
355354
await unwrapPools(
@@ -378,27 +377,32 @@ const chainTypeExports = chains => {
378377

379378
exports.harmony = {
380379
tvl: async (ts, ethB, chainB) => {
381-
if(ts > 1655989200) { // harmony hack
382-
return {}
380+
if (ts > 1655989200) {
381+
// harmony hack
382+
return {};
383383
}
384-
const block = await getBlock(ts, "harmony", chainB, true)
385-
const balances = {}
386-
await sumTokensSharedOwners(balances,
387-
["0xef977d2f931c1978db5f6747666fa1eacb0d0339", "0x3c2b8be99c50593081eaa2a724f0b8285f5aba8f"],
384+
const block = await getBlock(ts, "harmony", chainB, true);
385+
const balances = {};
386+
await sumTokensSharedOwners(
387+
balances,
388+
[
389+
"0xef977d2f931c1978db5f6747666fa1eacb0d0339",
390+
"0x3c2b8be99c50593081eaa2a724f0b8285f5aba8f"
391+
],
388392
["0xC5cfaDA84E902aD92DD40194f0883ad49639b023"],
389393
block,
390394
"harmony",
391-
addr=>`harmony:${addr}`
392-
)
393-
return balances
395+
addr => `harmony:${addr}`
396+
);
397+
return balances;
394398
}
395-
}
399+
};
396400
exports.hallmarks = [
397401
[1597446675, "CRV Launch"],
398402
[1621213201, "Convex Launch"],
399403
[1642374675, "MIM depeg"],
400404
[1651881600, "UST depeg"],
401-
[1654822801, "stETH depeg"],
405+
[1654822801, "stETH depeg"]
402406
];
403407
return exports;
404408
};

0 commit comments

Comments
 (0)