Skip to content

Commit 9ceaf6c

Browse files
committed
track palladium DefiLlama#15365
1 parent 3bd0adf commit 9ceaf6c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

projects/palladium/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { sumTokens2 } = require("../helper/unwrapLPs")
2+
3+
const ADMIN_ADDRESSES = {
4+
btnx: "0x741145aF40A46cD8B7653Be09EC59CEb9c6c45e1"
5+
}
6+
7+
async function tvl(api) {
8+
const adminContract = ADMIN_ADDRESSES[api.chain];
9+
const collAddresses = await api.call({ abi: "address[]:getValidCollateral", target: adminContract, })
10+
const activePool = await api.call({ abi: "address:activePool", target: adminContract, })
11+
await sumTokens2({ api, tokens: collAddresses, owner: activePool, })
12+
}
13+
14+
module.exports = {
15+
methodology: "Adds up the total value locked as collateral on the Palladium protocol",
16+
}
17+
18+
Object.keys(ADMIN_ADDRESSES).forEach((chain) => {
19+
module.exports[chain] = { tvl }
20+
})

0 commit comments

Comments
 (0)