Skip to content

Commit

Permalink
Feat: Add UniBTC (#11236)
Browse files Browse the repository at this point in the history
* add uniBTC adapter

* sum underlyings tokens in vault instead of uniBTC

* add native btc addresses

* rm address on merlin

* add native + wbtc tokens coreAssets

* use address null

---------

Co-authored-by: Trisome-Bedrock <trisome@bedrock-technology>
Co-authored-by: 0xpeluche <[email protected]>
  • Loading branch information
3 people authored Aug 8, 2024
1 parent 00d4328 commit 02687bb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/helper/coreAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,9 @@
"TBTC": "0xbba2ef945d523c4e2608c9e1214c2cc64d4fc2e2"
},
"btr": {
"ETH": "0xef63d4e178b3180beec9b0e143e0f37f4c93f4c2"
"ETH": "0xef63d4e178b3180beec9b0e143e0f37f4c93f4c2",
"WBTC": "0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f"

},
"taiko": {
"USDC": "0x07d83526730c7438048D55A4fc0b850e2aaB6f0b",
Expand Down
41 changes: 41 additions & 0 deletions projects/unibtc/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const ADDRESSES = require('../helper/coreAssets.json')
const defaultVault = '0xF9775085d726E782E83585033B58606f7731AB18'

const config = {
ethereum: {
vault: '0x047D41F2544B7F63A8e991aF2068a363d210d6Da',
tokens: [ADDRESSES['ethereum'].WBTC, '0xc96de26018a54d51c097160568752c4e3bd6c364']
},
optimism: {
vault: defaultVault,
tokens: [ADDRESSES['optimism'].WBTC]
},
mantle: {
vault: defaultVault,
tokens: ['0xC96dE26018A54D51c097160568752c4E3BD6C364']
},
bsquared: {
vault: defaultVault,
tokens: [ADDRESSES.null,ADDRESSES['bsquared'].WBTC]
},
merlin: {
vault: defaultVault,
tokens: [ADDRESSES.null,ADDRESSES['merlin'].WBTC_1]
},
btr: {
vault: defaultVault,
tokens: [ADDRESSES.null, ADDRESSES['btr'].WBTC]
},
}

const tvl = (chainConfig) => {
return async (api) => {
return api.sumTokens({ tokens: chainConfig.tokens, owner: chainConfig.vault })
}
}

Object.keys(config).forEach(chain => {
module.exports[chain] = {
tvl: tvl(config[chain])
}
})

0 comments on commit 02687bb

Please sign in to comment.