Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lfbtc tvl #12229

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions projects/bedrock/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
const { sumTokens } = require('../helper/chain/bitcoin')
const { sumTokens2 } = require('../helper/unwrapLPs')
const bitcoinAddressBook = require('../helper/bitcoin-book/index.js')

async function tvl() {
return sumTokens({ owners: await bitcoinAddressBook.bedrock() })
async function tvlBitcoin(api) {
const addrBook = await bitcoinAddressBook.bedrock()
return sumTokens({ owners: addrBook.btc })
}

async function tvlEvm(api) {
const addrBook = await bitcoinAddressBook.bedrock()
const chain = api.chain == 'btr' ? 'bitlayer' : api.chain
const a = addrBook.evm[chain]
if (!a || !a["tokens"]) {
return
}
return sumTokens2({ api: api, owner: a.vault, tokens: a.tokens})
}

module.exports = {
timetravel: false,
doublecounted:true,
doublecounted: true,
bitcoin: {
tvl
tvl: tvlBitcoin
},
};

['btr', 'ethereum', 'bsc', 'arbitrum', 'mantle', 'merlin', 'optimism', 'bob', 'bsquared', 'zeta', 'mode'].forEach(chain => {
module.exports[chain] = {
tvl: tvlEvm
}
}
});
6 changes: 3 additions & 3 deletions projects/helper/bitcoin-book/fetchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const abi = { getQualifiedUserInfo: 'function getQualifiedUserInfo(address _user

module.exports = {
bedrock: async () => {
const API_URL = 'https://bedrock-datacenter.rockx.com/uniBTC/reserve/address'
const { btc } = await getConfig('bedrock.btc_address', API_URL)
return btc
const API_URL = 'https://raw.githubusercontent.com/Bedrock-Technology/uniBTC/refs/heads/main/data/tvl/reserve_address.json'
const { btc, evm } = await getConfig('bedrock.btc_address', API_URL)
return { btc, evm }
},
exsatCreditStaking: async () => {
const { data: response } = await axios.post('https://rpc-us.exsat.network/v1/chain/get_table_rows', {
Expand Down
Loading