Skip to content

Commit 4f69138

Browse files
0xpeluche0xpelucheg1nt0ki
authored
feat: Adapter, defi.money (DefiLlama#11330)
* feat:Adapter, defi-money * add methodology * add yield part * doublecounted: true * split project in two different products * code refactor * remove pool2 --------- Co-authored-by: 0xpeluche <[email protected]> Co-authored-by: g1nt0ki <[email protected]>
1 parent 88221ee commit 4f69138

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

projects/defi-money/index.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const { sumTokens2 } = require("../helper/unwrapLPs")
2+
3+
const config = {
4+
optimism: {
5+
controller: "0x1337F001E280420EcCe9E7B934Fa07D67fdb62CD",
6+
MONEY: "0x7e803F4edd6528caFBf5C5d03Cc106b04379C24b",
7+
stakeLPs: [
8+
// "0x7e803F4edd6528caFBf5C5d03Cc106b04379C24b", // MONEY - already included in tvl
9+
"0xE8f00491afa68B4A653C77e5f92DBA0F8df3a185", // crvUSD/MONEY
10+
"0xa398a48C2738fd6c79F5654823Fb93456B0fDaF6", // USDT/MONEY
11+
"0x36afCD1083eE9186A2b984E10d75C1E14b99B75e", // USDC/MONEY
12+
"0xcf38a66DeD7825cfEF66046c256Aa0EDbd41BEf5", // DAI/MONEY
13+
"0x73C3eC2b8e00929824a529e60fb6ed8aF193c7cc", // FRAX/MONEY
14+
],
15+
},
16+
arbitrum: {
17+
controller: "0x1337F001E280420EcCe9E7B934Fa07D67fdb62CD",
18+
MONEY: "0xEbE54BEE7A397919C53850bA68E126b0A6b295ed",
19+
stakeLPs: [
20+
// "0xEbE54BEE7A397919C53850bA68E126b0A6b295ed", // MONEY - already included in tvl
21+
"0xF2852d7e810d3EC7094bFE1D7DDCa5044c259c25", // crvUSD/MONEY
22+
"0x6e59b326984fC132F16a977cd20E38641A9043De", // USDT/MONEY
23+
"0xdE718A791226c93B53C77D60E5D4693C05a31422", // USDC/MONEY
24+
"0xE3763d545707F435e21eeBbe75070495c806B744", // DAI/MONEY
25+
"0x07aDF588508b923B8eA0389d27b61b9CB8a197Cb", // FRAX/MONEY
26+
],
27+
},
28+
}
29+
30+
const tvl = async (api) => {
31+
const { controller, } = config[api.chain]
32+
const colls = await api.call({ target: controller, abi: 'address[]:get_all_collaterals' })
33+
const amms = await api.multiCall({ abi: 'function get_amm(address) view returns (address)', calls: colls, target: controller })
34+
return sumTokens2({ api, tokensAndOwners2: [colls, amms]})
35+
}
36+
37+
const pool2 = async (api) => {
38+
const { stakeLPs = [], } = config[api.chain]
39+
const tokens = await api.multiCall({ abi: 'address:STAKE_TOKEN', calls: stakeLPs })
40+
return sumTokens2({ api, tokensAndOwners2: [tokens, stakeLPs]})
41+
}
42+
43+
module.exports = {
44+
methodology: "TVL corresponds to the collateral deposited in the markets",
45+
}
46+
47+
Object.keys(config).forEach((chain) => {
48+
module.exports[chain] = {
49+
tvl, pool2,
50+
}
51+
})

0 commit comments

Comments
 (0)