-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elma, equal(sv+lm)*3, thick@sonic, 2thick*3
- Loading branch information
Showing
12 changed files
with
3,569 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { uniV3Export } = require('../helper/uniswapV3') | ||
|
||
module.exports = uniV3Export({ | ||
fantom: { factory: '0x7Ca1dCCFB4f49564b8f13E18a67747fd428F1C40', fromBlock: 100367164 }, | ||
base : { factory: '0x7Ca1dCCFB4f49564b8f13E18a67747fd428F1C40', fromBlock: 23864326 }, | ||
sonic : { factory: '0x7Ca1dCCFB4f49564b8f13E18a67747fd428F1C40', fromBlock: 548461 }, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const { sumTokens2 } = require("../helper/unwrapLPs") | ||
const { staking } = require('../helper/staking') | ||
|
||
const VOTER = "0x46abb88ae1f2a35ea559925d99fdc5441b592687"; | ||
const ZEROA = "0x0000000000000000000000000000000000000000"; | ||
const USDbC = "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca" | ||
const USdec = 10**6; | ||
|
||
async function sumAllGauges(api) { | ||
// 1. Get Gauges Length | ||
// 2. Get all Pools | ||
// 3. Get all Gauges | ||
// 4. Does its customGauge exist? | ||
// 5. exists ? customGauge.tvl() : sum2tokens( gauge, gauge.totalSupply() ) | ||
|
||
// 1. | ||
const leng = await api.call({ target: VOTER, abi: 'function length() public view returns(uint)' }); | ||
///console.log({ leng }) | ||
|
||
// 2. | ||
const pools = await api.multiCall({ | ||
abi: "function pools(uint) public view returns(address)", | ||
calls: Array.from(Array(Number(leng))).map((e,i)=>({ target: VOTER, params: [i] }) ) | ||
}) | ||
//console.log({pools}) | ||
|
||
// 3. | ||
const gauges = await api.multiCall({ | ||
abi: "function gauges(address) public view returns(address)", | ||
calls: pools.map((e,i)=>({ target: VOTER, params: [e] }) ) | ||
}) | ||
///console.log({gauges}) | ||
|
||
// 4. | ||
const customGauges = await api.multiCall({ | ||
abi: "function customGauges(address) public view returns(address)", | ||
calls: gauges.map((e,i)=>({ target: VOTER, params: [e] }) ) | ||
}) | ||
///console.log({customGauges}) | ||
|
||
// 5. | ||
let filteredPools = [], filteredGauges = [], filteredFarmlands = []; | ||
for(i=0;i<pools.length;i++) { | ||
if(customGauges[i] == ZEROA) { | ||
filteredPools.push(pools[i]); | ||
filteredGauges.push(gauges[i]); | ||
} | ||
else { | ||
filteredFarmlands.push(customGauges[i]); | ||
} | ||
} | ||
///console.log({ filteredPools , filteredGauges , filteredFarmlands }) | ||
|
||
// 5.1 Default | ||
const filteredGaugesAmounts = await api.multiCall({ | ||
abi: "function totalSupply() public view returns(uint)", | ||
calls: filteredGauges.map((e,i)=>({ target: e }) ) | ||
}) | ||
///console.log({ filteredGaugesAmounts }) | ||
|
||
// 5.2 Custom | ||
const filteredFarmlandsTVL = (await api.multiCall({ | ||
abi: "function tvl() public view returns(uint)", | ||
calls: filteredFarmlands.map((e,i)=>({ target: e }) ), | ||
permitFailure: true | ||
})) | ||
.map( i=> isFinite(Number(i)) ? Number(i)/1e18 : 0 ) | ||
.reduce( (i,a) => (i+a) ) | ||
///console.log({ filteredFarmlandsTVL }) | ||
|
||
// 5.3 Total | ||
filteredGauges.forEach( (e,i) => api.addToken( filteredPools[i], filteredGaugesAmounts[i] )); | ||
api.addToken( USDbC , USdec * filteredFarmlandsTVL ) | ||
return sumTokens2({ api, resolveLP: true }) | ||
|
||
} | ||
|
||
module.exports = { | ||
methodology: 'On-chain TVL Sum of only Assets Staked into Voted Equalizer Gauges & Farmlands.', | ||
misrepresentedTokens: true, | ||
base: { | ||
tvl: sumAllGauges, | ||
staking: staking("0x28c9c71c776a1203000b56c0cca48bef1cd51c53", "0x54016a4848a38f257b6e96331f7404073fd9c32c"), | ||
} | ||
}; |
5 changes: 1 addition & 4 deletions
5
projects/Scale/index.js → projects/equalizer-base-svamm/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
const {uniTvlExport} = require('../helper/calculateUniTvl.js') | ||
const { staking } = require('../helper/staking') | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
base:{ | ||
tvl: uniTvlExport("0xEd8db60aCc29e14bC867a497D94ca6e3CeB5eC04", "base", undefined, undefined, { hasStablePools: true, useDefaultCoreAssets: true, }), | ||
staking: staking("0x28c9c71c776a1203000b56c0cca48bef1cd51c53", "0x54016a4848a38f257b6e96331f7404073fd9c32c"), | ||
}, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
const { sumTokens2 } = require("../helper/unwrapLPs") | ||
const { staking } = require('../helper/staking') | ||
|
||
const VOTERv1 = "0x4bebEB8188aEF8287f9a7d1E4f01d76cBE060d5b"; | ||
const VOTERv2 = "0xE3D1A117dF7DCaC2eB0AC8219341bAd92f18dAC1"; | ||
const ZEROA = "0x0000000000000000000000000000000000000000"; | ||
const USDbC = "0x1b6382dbdea11d97f24495c9a90b7c88469134a4" | ||
const USdec = 10**6; | ||
|
||
async function sumAllGauges(api) { | ||
// 1. Get Gauges Length | ||
// 2. Get all Pools | ||
// 3. Get all Gauges | ||
// 4. Does its customGauge exist? | ||
// 5. exists ? customGauge.tvl() : sum2tokens( gauge, gauge.totalSupply() ) | ||
|
||
// 1. | ||
const lengV1 = await api.call({ target: VOTERv1, abi: 'function length() public view returns(uint)' }); | ||
const lengV2 = await api.call({ target: VOTERv2, abi: 'function length() public view returns(uint)' }); | ||
///console.log({ leng }) | ||
|
||
// 2. | ||
const poolsV1 = await api.multiCall({ | ||
abi: "function pools(uint) public view returns(address)", | ||
calls: Array.from(Array(Number(lengV1))).map((e,i)=>({ target: VOTERv1, params: [i] }) ) | ||
}) | ||
const poolsV2 = await api.multiCall({ | ||
abi: "function pools(uint) public view returns(address)", | ||
calls: Array.from(Array(Number(lengV2))).map((e,i)=>({ target: VOTERv2, params: [i] }) ) | ||
}) | ||
//console.log({pools}) | ||
|
||
// 3. | ||
const gaugesV1 = await api.multiCall({ | ||
abi: "function gauges(address) public view returns(address)", | ||
calls: poolsV1.map((e,i)=>({ target: VOTERv1, params: [e] }) ) | ||
}) | ||
const gaugesV2 = await api.multiCall({ | ||
abi: "function gauges(address) public view returns(address)", | ||
calls: poolsV2.map((e,i)=>({ target: VOTERv2, params: [e] }) ) | ||
}) | ||
///console.log({gauges}) | ||
|
||
// 4. | ||
const customGauges = await api.multiCall({ | ||
abi: "function customGauges(address) public view returns(address)", | ||
calls: gaugesV2.map((e,i)=>({ target: VOTERv2, params: [e] }) ) | ||
}) | ||
///console.log({customGauges}) | ||
|
||
// 5. | ||
let filteredPools = [], filteredGauges = [], filteredFarmlands = []; | ||
for(i=0;i<poolsV1.length;i++) { | ||
filteredPools.push(poolsV1[i]); | ||
filteredGauges.push(gaugesV1[i]); | ||
} | ||
for(i=0;i<poolsV2.length;i++) { | ||
if(customGauges[i] == ZEROA) { | ||
filteredPools.push(poolsV2[i]); | ||
filteredGauges.push(gaugesV2[i]); | ||
} | ||
else { | ||
filteredFarmlands.push(customGauges[i]); | ||
} | ||
} | ||
///console.log({ filteredPools , filteredGauges , filteredFarmlands }) | ||
|
||
// 5.1 Default | ||
const filteredGaugesAmounts = await api.multiCall({ | ||
abi: "function totalSupply() public view returns(uint)", | ||
calls: filteredGauges.map((e,i)=>({ target: e }) ) | ||
}) | ||
///console.log({ filteredGaugesAmounts }) | ||
|
||
// 5.2 Custom | ||
const filteredFarmlandsTVL = (await api.multiCall({ | ||
abi: "function tvl() public view returns(uint)", | ||
calls: filteredFarmlands.map((e,i)=>({ target: e }) ), | ||
permitFailure: true | ||
})) | ||
.map( i=> isFinite(Number(i)) ? Number(i)/1e18 : 0 ) | ||
.reduce( (i,a) => (i+a) ) | ||
console.log({ filteredFarmlandsTVL }) | ||
|
||
// 5.3 Total | ||
filteredGauges.forEach( (e,i) => api.addToken( filteredPools[i], filteredGaugesAmounts[i] )); | ||
api.addToken( USDbC , USdec * filteredFarmlandsTVL ) | ||
return sumTokens2({ api, resolveLP: true }) | ||
|
||
} | ||
|
||
module.exports = { | ||
methodology: 'On-chain TVL Sum of only Assets Staked into Voted Equalizer Gauges & Farmlands.', | ||
misrepresentedTokens: true, | ||
fantom: { | ||
tvl: sumAllGauges, | ||
staking: staking("0x8313f3551C4D3984FfbaDFb42f780D0c8763Ce94", "0x3Fd3A0c85B70754eFc07aC9Ac0cbBDCe664865A6"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const {uniTvlExport} = require('../helper/calculateUniTvl.js') | ||
module.exports = { | ||
misrepresentedTokens: true, | ||
fantom:{ | ||
tvl: uniTvlExport("0xc6366EFD0AF1d09171fe0EBF32c7943BB310832a", "fantom", undefined, undefined, { hasStablePools: true, useDefaultCoreAssets: true, }), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const { sumTokens2 } = require("../helper/unwrapLPs") | ||
const { staking } = require('../helper/staking') | ||
|
||
const VOTER = "0x17fa9da6e01ad59513707f92033a6eb03ccb10b4"; | ||
const ZEROA = "0x0000000000000000000000000000000000000000"; | ||
const USDbC = "0x29219dd400f2Bf60E5a23d13Be72B486D4038894" | ||
const USdec = 10**6; | ||
|
||
async function sumAllGauges(api) { | ||
// 1. Get Gauges Length | ||
// 2. Get all Pools | ||
// 3. Get all Gauges | ||
// 4. Does its customGauge exist? | ||
// 5. exists ? customGauge.tvl() : sum2tokens( gauge, gauge.totalSupply() ) | ||
|
||
// 1. | ||
const leng = await api.call({ target: VOTER, abi: 'function length() public view returns(uint)' }); | ||
///console.log({ leng }) | ||
|
||
// 2. | ||
const pools = await api.multiCall({ | ||
abi: "function pools(uint) public view returns(address)", | ||
calls: Array.from(Array(Number(leng))).map((e,i)=>({ target: VOTER, params: [i] }) ) | ||
}) | ||
//console.log({pools}) | ||
|
||
// 3. | ||
const gauges = await api.multiCall({ | ||
abi: "function gauges(address) public view returns(address)", | ||
calls: pools.map((e,i)=>({ target: VOTER, params: [e] }) ) | ||
}) | ||
///console.log({gauges}) | ||
|
||
// 4. | ||
const customGauges = await api.multiCall({ | ||
abi: "function customGauges(address) public view returns(address)", | ||
calls: gauges.map((e,i)=>({ target: VOTER, params: [e] }) ) | ||
}) | ||
///console.log({customGauges}) | ||
|
||
// 5. | ||
let filteredPools = [], filteredGauges = [], filteredFarmlands = []; | ||
for(i=0;i<pools.length;i++) { | ||
if(customGauges[i] == ZEROA) { | ||
filteredPools.push(pools[i]); | ||
filteredGauges.push(gauges[i]); | ||
} | ||
else { | ||
filteredFarmlands.push(customGauges[i]); | ||
} | ||
} | ||
///console.log({ filteredPools , filteredGauges , filteredFarmlands }) | ||
|
||
// 5.1 Default | ||
const filteredGaugesAmounts = await api.multiCall({ | ||
abi: "function totalSupply() public view returns(uint)", | ||
calls: filteredGauges.map((e,i)=>({ target: e }) ) | ||
}) | ||
///console.log({ filteredGaugesAmounts }) | ||
|
||
// 5.2 Custom | ||
const filteredFarmlandsTVL = (await api.multiCall({ | ||
abi: "function tvl() public view returns(uint)", | ||
calls: filteredFarmlands.map((e,i)=>({ target: e }) ), | ||
permitFailure: true | ||
})) | ||
.map( i=> isFinite(Number(i)) ? Number(i)/1e18 : 0 ) | ||
.reduce( (i,a) => (i+a) ) | ||
///console.log({ filteredFarmlandsTVL }) | ||
|
||
// 5.3 Total | ||
filteredGauges.forEach( (e,i) => api.addToken( filteredPools[i], filteredGaugesAmounts[i] )); | ||
api.addToken( USDbC , USdec * filteredFarmlandsTVL ) | ||
return sumTokens2({ api, resolveLP: true }) | ||
|
||
} | ||
|
||
module.exports = { | ||
methodology: 'On-chain TVL Sum of only Assets Staked into Voted Equalizer Gauges & Farmlands.', | ||
misrepresentedTokens: true, | ||
sonic: { | ||
tvl: sumAllGauges, | ||
staking: staking("0x3045119766352fF250b3d45312Bd0973CBF7235a", "0xddF26B42C1d903De8962d3F79a74a501420d5F19"), | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const {uniTvlExport} = require('../helper/calculateUniTvl.js') | ||
module.exports = { | ||
misrepresentedTokens: true, | ||
sonic: { | ||
tvl: uniTvlExport("0xDDD9845Ba0D8f38d3045f804f67A1a8B9A528FcC", "sonic", undefined, undefined, { hasStablePools: true, useDefaultCoreAssets: true, stablePoolSymbol: 's-'}), | ||
} | ||
} |