Skip to content

Commit 911bc82

Browse files
committed
update fx DefiLlama#12949
1 parent 97f5236 commit 911bc82

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

projects/fx-Protocol/index.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const ADDRESSES = require('../helper/coreAssets.json')
22
const treasuries = [
3-
"0x0e5CAA5c889Bdf053c9A76395f62267E653AFbb0",
4-
"0xED803540037B0ae069c93420F89Cd653B6e3Df1f",
5-
"0xcfEEfF214b256063110d3236ea12Db49d2dF2359",
6-
"0x781BA968d5cc0b40EB592D5c8a9a3A4000063885",
7-
"0x38965311507D4E54973F81475a149c09376e241e",
8-
"0x63Fe55B3fe3f74B42840788cFbe6229869590f83",
9-
"0xdFac83173A96b06C5D6176638124d028269cfCd2"
3+
"0x0e5CAA5c889Bdf053c9A76395f62267E653AFbb0",
4+
"0xED803540037B0ae069c93420F89Cd653B6e3Df1f",
5+
"0xcfEEfF214b256063110d3236ea12Db49d2dF2359",
6+
"0x781BA968d5cc0b40EB592D5c8a9a3A4000063885",
7+
"0x38965311507D4E54973F81475a149c09376e241e",
8+
"0x63Fe55B3fe3f74B42840788cFbe6229869590f83",
9+
"0xdFac83173A96b06C5D6176638124d028269cfCd2"
1010
];
1111
const baseTokenRate = [
1212
// '',
@@ -21,6 +21,9 @@ const cvxAddress = ADDRESSES.ethereum.CVX;
2121
const aCVX = "0xb0903Ab70a7467eE5756074b31ac88aEBb8fB777";
2222
const uniBTC = "0x004E9C3EF86bc1ca1f0bB5C7662861Ee93350568";
2323
const uniBTC_Genesis_Gauge = "0x1D20671A21112E85b03B00F94Fd760DE0Bef37Ba"
24+
const fxUSD_stabilityPool = "0x65C9A641afCEB9C0E6034e558A319488FA0FA3be"
25+
const fxUSD_stabilityPool_Gauge = "0xEd92dDe3214c24Ae04F5f96927E3bE8f8DbC3289"
26+
2427
module.exports = {
2528
doublecounted: true,
2629
ethereum: {
@@ -42,14 +45,6 @@ async function getACVXInfo(api) {
4245
return totalAssets / totalSupply
4346
}
4447

45-
async function getUniBTCTvl(api) {
46-
const totalSupply = await api.api.call(
47-
{
48-
target: uniBTC_Genesis_Gauge,
49-
abi: 'uint256:totalSupply',
50-
})
51-
return totalSupply
52-
}
5348
async function getBaseTokenRate(api) {
5449
const rates = await api.multiCall({ abi: 'uint256:getRate', calls: baseTokenRate })
5550
rates.splice(0, 0, 1e18);
@@ -63,13 +58,14 @@ async function tvl(api) {
6358
const tokens = await api.multiCall({ abi: 'address:baseToken', calls: treasuries })
6459
const bals = await api.multiCall({ abi: 'uint256:totalBaseToken', calls: treasuries })
6560
const decimals = await api.multiCall({ abi: 'erc20:decimals', calls: tokens })
66-
const uniBTCTvl = await getUniBTCTvl(api)
6761
bals.forEach((bal, i) => {
6862
if (tokens[i].toLowerCase() === aCVX.toLowerCase()) {
69-
api.add(cvxAddress, bal/(rates[i]/1e18)*aCvxRate / 10 ** (18 - decimals[i]))
63+
api.add(cvxAddress, bal / (rates[i] / 1e18) * aCvxRate / 10 ** (18 - decimals[i]))
7064
} else {
71-
api.add(tokens[i], bal/(rates[i]/1e18) / 10 ** (18 - decimals[i]))
65+
api.add(tokens[i], bal / (rates[i] / 1e18) / 10 ** (18 - decimals[i]))
7266
}
7367
})
74-
api.add(uniBTC, uniBTCTvl)
68+
69+
const tokensAndOwners = [[uniBTC, uniBTC_Genesis_Gauge], [ADDRESSES.ethereum.USDC, fxUSD_stabilityPool]]
70+
return api.sumTokens({ tokensAndOwners })
7571
}

0 commit comments

Comments
 (0)