Skip to content

Commit 1f632fb

Browse files
g1nt0kitlatkdgus1
andauthored
Co-authored-by: Ss5h <[email protected]>
1 parent dde73a9 commit 1f632fb

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

projects/btcfi-cdp/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const ADDRESSES = require('../helper/coreAssets.json')
22
const { sumTokensExport, } = require('../helper/unwrapLPs')
3+
const { sumTokens } = require("../helper/chain/bitcoin");
4+
const bitcoinAddressBook = require('../helper/bitcoin-book/index.js')
35

46
const chainPools = {
57
bfc: {
@@ -8,10 +10,16 @@ const chainPools = {
810
},
911
}
1012

13+
async function bitcoinTvl() {
14+
return sumTokens({ owners: await bitcoinAddressBook.btcfi_cdp() })
15+
}
16+
1117
Object.keys(chainPools).forEach(chain => {
1218
const pools = chainPools[chain]
1319
const tokensAndOwners = Object.values(pools).map(({ pool, token }) => ([token, pool,]))
1420
module.exports[chain] = {
1521
tvl: sumTokensExport({ tokensAndOwners })
1622
}
17-
})
23+
})
24+
25+
module.exports["bitcoin"] = { tvl: bitcoinTvl }

projects/helper/bitcoin-book/fetchers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const sdk = require('@defillama/sdk')
77
const abi = { getQualifiedUserInfo: 'function getQualifiedUserInfo(address _user) view returns ((bool locked, string depositAddress, string withdrawalAddress) info)' }
88

99
module.exports = {
10+
btcfi_cdp: async () => {
11+
const target = "0x0000000000000000000000000000000000000100";
12+
const api = new sdk.ChainApi({ chain: 'bfc' })
13+
const round = await api.call({ abi: 'uint32:current_round', target})
14+
return api.call({ abi: 'function vault_addresses(uint32 pool_round) view returns (string[])', target, params: round })
15+
},
1016
bedrock: async () => {
1117
const API_URL = 'https://raw.githubusercontent.com/Bedrock-Technology/uniBTC/refs/heads/main/data/tvl/reserve_address.json'
1218
const { btc } = await getConfig('bedrock.btc_address', API_URL)

projects/ixswap/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { getUniTVL } = require("../helper/unknownTokens");
22
const { staking } = require('../helper/staking')
33

44
const IXS_POLYGON = "0x1BA17C639BdaeCd8DC4AAc37df062d17ee43a1b8"
5+
const IXS_BASE = "0xfe550bffb51eb645ea3b324d772a19ac449e92c5"
56
const STAKING_CONTRACTS = [
67
"0xad644F3cC768bc6dceF97096790e2210D5191cec", // stake bank
78
]
@@ -11,4 +12,7 @@ module.exports = {
1112
tvl: getUniTVL({ factory: '0xc2D0e0bc81494adB71Ce9Aa350cC875DaE12D81D', blacklistedTokens: [IXS_POLYGON] }),
1213
staking: staking(STAKING_CONTRACTS, IXS_POLYGON),
1314
},
15+
base:{
16+
staking: staking(['0x44F07B446e14127136f3554A16014b49BC67D9E6'], IXS_BASE),
17+
},
1418
}

0 commit comments

Comments
 (0)