File tree Expand file tree Collapse file tree 2 files changed +63
-4
lines changed Expand file tree Collapse file tree 2 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 1+ const { sumTokens } = require ( '../helper/chain/bitcoin' )
2+ const bitcoinAddressBook = require ( '../helper/bitcoin-book/index.js' )
3+ const { sumTokensExport } = require ( '../helper/unwrapLPs' )
4+ const { getConfig } = require ( '../helper/cache' )
5+
6+ // Lombard protocol design requires mixed wallets for LBTC(/lombard adapter) and BTC.b (/avalanche-btc adapter)
7+
8+ async function tvl ( api ) {
9+ const lombardOwners = await bitcoinAddressBook . lombard ( )
10+ const avalancheOwners = bitcoinAddressBook . avalanche
11+ const allOwners = [ ...lombardOwners , ...avalancheOwners ]
12+
13+ const balances = await sumTokens ( { owners : allOwners , forceCacheUse : true } )
14+
15+ const data = await getConfig (
16+ 'lombard-staking-vault' ,
17+ 'https://ledger-mainnet.lombard-fi.com:1317/lombard-finance/ledger/btcstaking/staking_vault_base_balance'
18+ )
19+
20+ const lbtcBackingInBTC = Number ( data . balance ) / 1e8
21+
22+ if ( balances . bitcoin ) {
23+ balances . bitcoin = balances . bitcoin - lbtcBackingInBTC
24+ }
25+
26+ return balances
27+ }
28+
29+ module . exports = {
30+ doublecounted : true ,
31+ timetravel : false ,
32+ isHeavyProtocol : true ,
33+ bitcoin : { tvl } ,
34+ ethereum : { tvl : sumTokensExport ( { owners : [ '0x838f0c257ab27856ee9be57f776b186140834b58' ] , tokens : [ '0xfe4ecd930a1282325aef8e946f17c0e25744de45' ] } ) }
35+ }
36+
37+ module . exports . hallmarks = [
38+ [ 1761782400 , 'Lombard has acquired BTC.b' ] , //2025-10-30
39+ ]
Original file line number Diff line number Diff line change 11const { sumTokens } = require ( '../helper/chain/bitcoin' )
22const bitcoinAddressBook = require ( '../helper/bitcoin-book/index.js' )
33const { sumTokensExport } = require ( '../helper/unwrapLPs' )
4+ const { getConfig } = require ( '../helper/cache' )
45
5- async function tvl ( ) {
6- return sumTokens ( { owners : await bitcoinAddressBook . lombard ( ) , forceCacheUse : true } )
6+ // Lombard protocol design requires mixed wallets for LBTC(/lombard adapter) and BTC.b (/avalanche-btc adapter)
7+
8+ async function tvl ( api ) {
9+ const lombardOwners = await bitcoinAddressBook . lombard ( )
10+ const avalancheOwners = bitcoinAddressBook . avalanche
11+ const allOwners = [ ...lombardOwners , ...avalancheOwners ]
12+
13+ const balances = await sumTokens ( { owners : allOwners , forceCacheUse : true } )
14+
15+ const data = await getConfig (
16+ 'lombard-staking-vault' ,
17+ 'https://ledger-mainnet.lombard-fi.com:1317/lombard-finance/ledger/btcstaking/staking_vault_base_balance'
18+ )
19+
20+ const lbtcBackingInBTC = Number ( data . balance ) / 1e8
21+
22+ if ( balances . bitcoin ) {
23+ balances . bitcoin = Math . min ( balances . bitcoin , lbtcBackingInBTC )
24+ }
25+
26+ return balances
727}
828
929module . exports = {
10- doublecounted :true ,
30+ doublecounted : true ,
1131 timetravel : false ,
1232 isHeavyProtocol : true ,
1333 bitcoin : { tvl } ,
1434 ethereum : { tvl : sumTokensExport ( { owners : [ '0x838f0c257ab27856ee9be57f776b186140834b58' ] , tokens : [ '0xfe4ecd930a1282325aef8e946f17c0e25744de45' ] } ) }
15- }
35+ }
You can’t perform that action at this time.
0 commit comments