-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:hoomp3/DefiLlama-Adapters
- Loading branch information
Showing
57 changed files
with
901 additions
and
301 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { sumTokensExport } = require("../helper/unwrapLPs"); | ||
const coreAssets = require("../helper/coreAssets.json"); | ||
|
||
const routers = [ | ||
"0xF6Af6C034E92694A4c79569B03543d580df402D7", | ||
"0x992D40d9ED8937Bb0Ad3c0Ba99713072Ae0a05b3", | ||
"0x135De7F9223C76b7d0278FFe854eC480D37FE906" | ||
]; | ||
|
||
const tokens = [coreAssets.null]; | ||
|
||
module.exports = { | ||
base: { | ||
tvl: sumTokensExport({ owners: routers, tokens }) | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { sumTokens2 } = require('../helper/unwrapLPs') | ||
|
||
const config = { | ||
btr: { pairInfo: '0xb6d73e9a9cf70ddf396afcd677fdafe7073aa026' }, | ||
} | ||
|
||
Object.keys(config).forEach(chain => { | ||
const { pairInfo } = config[chain] | ||
module.exports[chain] = { | ||
tvl: async (api) => { | ||
let pairs = [] | ||
let hasMore = true | ||
let length = 999 | ||
let offset = 0 | ||
do { | ||
const { pagePairs, } = await api.call({ abi: 'function fetchPairsAddressListPaginate(uint256 start, uint256 end) view returns (address[] pagePairs, uint256 pairCount)', target: pairInfo, params: [offset, length] }) | ||
pairs = pairs.concat(pagePairs) | ||
offset += length | ||
hasMore = pagePairs.length === length | ||
} while (hasMore) | ||
const tokenXs = await api.multiCall({ abi: 'address:xToken', calls: pairs }) | ||
const tokenYs = await api.multiCall({ abi: 'address:yToken', calls: pairs }) | ||
const tokensAndOwners2 = [tokenXs.concat(tokenYs), pairs.concat(pairs)] | ||
return sumTokens2({ tokensAndOwners2, api }) | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const { sumTokens2, } = require('../helper/unwrapLPs') | ||
|
||
async function tvl(api) { | ||
|
||
return sumTokens2({ owners: [ | ||
'0x37fc73b4dda9f7263926590838e32e05e4e051e9', | ||
], tokens: ['0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f'], api, }) | ||
} | ||
|
||
module.exports = { | ||
btr: { tvl, } | ||
} | ||
/* | ||
const config = { | ||
btr: { query: '0x3622a84D5861d25aA064512E3F244Dd8e67Dc22B', }, | ||
} | ||
const abis = { | ||
"listCollaterals": "function listCollaterals() view returns ((string name, uint256 maxLTV, uint256 liquidationFeeRate, uint256 stabilityFeeRate, bytes32 collateralId, (address tokenAddress, uint256 safetyFactor, uint256 totalDebt, uint256 totalLocked, uint256 vaultMaxDebt, uint256 vaultMinDebt, uint256 maxDebt) collateral)[] collateralInfos)", | ||
} | ||
Object.keys(config).forEach(chain => { | ||
const { query,} = config[chain] | ||
module.exports[chain] = { | ||
tvl: async (api) => { | ||
const res = await api.call({ abi: abis.listCollaterals, target: query}) | ||
res.forEach(({ collateral}) => api.add(collateral.tokenAddress, collateral.totalLocked)) | ||
} | ||
} | ||
}) */ |
Oops, something went wrong.