forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
40 additions
and
111 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -264,6 +264,7 @@ | |
"xpla", | ||
"zeniq", | ||
"zilliqa", | ||
"zkfair", | ||
"zksync", | ||
"zyx" | ||
] |
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
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,9 @@ | ||
const { getLiquityTvl } = require('../helper/liquity') | ||
// const { staking } = require('../helper/staking') | ||
|
||
module.exports = { | ||
iotex: { | ||
tvl: getLiquityTvl('0xAeB0B38040aDdc4a2b520919f13944D9bC944435'), | ||
// staking: staking('0x109e342FE7132585abFa785887E2c05c85Fbcf71', '0x20143c45c2ce7984799079f256d8a68a918eeee6'), // disabled as backing of WEN is already counted towards tvl | ||
}, | ||
}; |
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,3 @@ | ||
const { uniTvlExport } = require('../helper/unknownTokens') | ||
|
||
module.exports = uniTvlExport('zkfair', '0x3F5a6e62cccD2C9AAF3dE431e127D65BC457000a') |
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 |
---|---|---|
@@ -1,29 +1,22 @@ | ||
const BigNumber = require('bignumber.js') | ||
const { getLogs } = require('../helper/cache/getLogs') | ||
const sdk = require('@defillama/sdk') | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
|
||
const v1TVL = require('./v1'); | ||
const v2TVL = require('./v2'); | ||
|
||
async function tvl(timestamp, block, _1, { api }) { | ||
const [v1, v2] = await Promise.all([v1TVL(timestamp, block, _1, { api }), v2TVL(timestamp, block, _1, { api })]); | ||
|
||
const tokenAddresses = new Set(Object.keys(v1).concat(Object.keys(v2))); | ||
|
||
const balances = ( | ||
Array | ||
.from(tokenAddresses) | ||
.reduce((accumulator, tokenAddress) => { | ||
const v1Balance = new BigNumber(v1[tokenAddress] || '0'); | ||
const v2Balance = new BigNumber(v2[tokenAddress] || '0'); | ||
accumulator[tokenAddress] = v1Balance.plus(v2Balance).toFixed(); | ||
|
||
return accumulator | ||
}, {}) | ||
); | ||
|
||
return balances; | ||
} | ||
const configs = [ | ||
{ governance: '0x02ecef526f806f06357659fFD14834fe82Ef4B04', main: '0x8ECa806Aecc86CE90Da803b080Ca4E3A9b8097ad', fromBlock: 11841962, }, | ||
{ governance: '0x86E527BC3C43E6Ba3eFf3A8CAd54A7Ed09cD8E8B', main: '0x6dE5bDC580f55Bc9dAcaFCB67b91674040A247e3', fromBlock: 12810001, }, | ||
] | ||
|
||
module.exports = { | ||
start: 1613135160, // 02/12/2021 @ 01:06pm UTC | ||
ethereum: { tvl }, | ||
ethereum: { | ||
tvl: sdk.util.sumChainTvls(configs.map(i => { | ||
return async function tvl(timestamp, block, _1, { api }) { | ||
const logs = await getLogs({ api, target: i.governance, eventAbi: 'event NewToken (address indexed token, uint16 indexed tokenId)', onlyArgs: true, fromBlock: i.fromBlock, }) | ||
const tokens = logs.map(log => log.token) | ||
tokens.push(ADDRESSES.null) | ||
return api.sumTokens({ owner: i.main, tokens }) | ||
} | ||
})) | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.