Skip to content

Commit

Permalink
Add btcfi projects and token mappings for BFC (DefiLlama#9377)
Browse files Browse the repository at this point in the history
* add btcfi projects

* Add token mappings for BFC

---------

Co-authored-by: tlatkdgus1 <[email protected]>
  • Loading branch information
g1nt0ki and tlatkdgus1 committed Mar 15, 2024
1 parent 513de8a commit ba8c323
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 18 additions & 0 deletions projects/btcfi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { sumTokens2, } = require('../helper/unwrapLPs')

const chainPools = {
bfc: {
WBTC: { pool: '0xEa3b4a2dA5DbE8379AD4c60aaD5184df69D7C9AD', token: ADDRESSES.bfc.WBTC },
BTCB: { pool: '0x0B31FeE8bF53bFe2f5F7083B73A4c9C8B517E32F', token: ADDRESSES.bfc.BTCB }
},
}

Object.keys(chainPools).forEach(chain => {
const pools = chainPools[chain]
module.exports[chain] = {
tvl: async (_, _b, _cb, { api, }) => {
return sumTokens2({ api, tokensAndOwners: Object.values(pools).map(({ pool, token }) => ([token, pool,])) })
}
}
})
4 changes: 3 additions & 1 deletion projects/helper/coreAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,9 @@
"UnifiedDAI": "0xcDB9579Db96EB5C8298dF889D915D0FF668AfF2a",
"WITCH": "0xB1f3A83597Bce2AD842c29bD750AE17afc474137",
"SAT": "0x17102AC78a02a98fC78B0c29B7b0506f035A99E5",
"BIFI": "0x047938C3aD13c1eB821C8e310B2B6F889b6d0003"
"BIFI": "0x047938C3aD13c1eB821C8e310B2B6F889b6d0003",
"WBTC": "0x7b8FAC5F29E101BaaB33c5f9c39d4F85ba2cc7C1",
"BTCB": "0xd267F821F1b8344B5A63626c8c824697194A173E"
},
"scroll": {
"WETH": "0x5300000000000000000000000000000000000004",
Expand Down
6 changes: 5 additions & 1 deletion projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const fixBalancesTokens = {
"0x013e54bee29813bd786b24f9cb08f47c4b75955c": { coingeckoId: "usd-coin", decimals: 6 },
"0x3e4079ad76c83760e22b5c0105670ebab88b8d0e": { coingeckoId: "tether", decimals: 18 },
},
bfc: {
"0x7b8FAC5F29E101BaaB33c5f9c39d4F85ba2cc7C1": { coingeckoId: "wrapped-bitcoin", decimals: 8 },
"0xd267F821F1b8344B5A63626c8c824697194A173E": { coingeckoId: "bitcoin-avalanche-bridged-btc-b", decimals: 18 },
},
q: {
[ADDRESSES.q.WUSDC]: { coingeckoId: "usd-coin", decimals: 6 },
[ADDRESSES.q.WDAI]: { coingeckoId: "dai", decimals: 18 },
Expand Down Expand Up @@ -216,7 +220,7 @@ const anyswapTokenBlacklist = {
ADDRESSES.shiden.ETH,
ADDRESSES.telos.ETH,
ADDRESSES.telos.USDT
]
],
}

module.exports = {
Expand Down

0 comments on commit ba8c323

Please sign in to comment.