forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DefiLlama:main' into main
- Loading branch information
Showing
9 changed files
with
100 additions
and
20 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
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,22 +1,27 @@ | ||
const config = { | ||
arbitrum: { | ||
"AAPL.d": { oracle: "0x8d0CC5f38f9E802475f2CFf4F9fc7000C2E1557c", token: '0xCe38e140fC3982a6bCEbc37b040913EF2Cd6C5a7' }, | ||
"AMZN.d": { oracle: "0xd6a77691f071E98Df7217BED98f38ae6d2313EBA", token: '0x5a8A18673aDAA0Cd1101Eb4738C05cc6967b860f' }, | ||
"GOOGL.d": { oracle: "0x1D1a83331e9D255EB1Aaf75026B60dFD00A252ba", token: '0x9bd7A08cD17d10E02F596Aa760dfE397C57668b4' }, | ||
"META.d": { oracle: "0xcd1bd86fDc33080DCF1b5715B6FCe04eC6F85845", token: '0xa40c0975607BDbF7B868755E352570454b5B2e48' }, | ||
"MSFT.d": { oracle: "0xDde33fb9F21739602806580bdd73BAd831DcA867", token: '0x20f11c1aBca831E235B15A4714b544Bb968f8CDF' }, | ||
"TSLA.d": { oracle: "0x3609baAa0a9b1f0FE4d6CC01884585d0e191C3E3", token: '0x2888c0aC959484e53bBC6CdaBf2b8b39486225C6' }, | ||
"SPY.d": { oracle: "0x46306F3795342117721D8DEd50fbcF6DF2b3cc10", token: '0xF4BD09B048248876E39Fcf2e0CDF1aee1240a9D2' }, | ||
// "COIN.d": { oracle: "", token: '0x46b979440AC257151EE5a5bC9597B76386907FA1' }, | ||
factory: "0xB4Ca72eA4d072C779254269FD56093D3ADf603b8", | ||
getTokensAbi: "function getDShares() external view returns (address[] memory, address[] memory)", | ||
processor: "0xFA922457873F750244D93679df0d810881E4131D", | ||
latestPriceAbi: "function latestFillPrice(address assetToken, address paymentToken) view returns (tuple(uint256 price, uint64 blocktime))", | ||
usdplus: "0xfc90518D5136585ba45e34ED5E1D108BD3950CFa" | ||
} | ||
} | ||
|
||
Object.keys(config).forEach(chain => { | ||
const tokens = Object.values(config[chain]).map(v => v.token) | ||
async function getTokens(api, chain) { | ||
return (await api.call({ | ||
chain: chain, | ||
target: config[chain].factory, | ||
abi: config[chain].getTokensAbi | ||
}))[0]; | ||
} | ||
|
||
Object.keys(config).forEach( chain => { | ||
module.exports[chain] = { | ||
tvl: async (api) => { | ||
const tokens = await getTokens(api, chain) | ||
const bals = await api.multiCall({ abi: 'erc20:totalSupply', calls: tokens}) | ||
api.add(tokens, bals) | ||
} | ||
} | ||
}) | ||
}) |
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 DETH_DEPOSIT_POOL = "0x8a1229eDB53f55Bb09D472aFc95D12154590108E"; | ||
const DUSD_DEPOSIT_POOL = "0x634598473B91a6870c1DB151142db0b61C5de8CC"; | ||
|
||
async function tvl(api) { | ||
const res = await api.multiCall({ abi: 'function getTotalDeposits() external view returns (address[], uint256[])', calls: [DETH_DEPOSIT_POOL, DUSD_DEPOSIT_POOL] }) | ||
res.forEach(i => api.add(...i)) | ||
} | ||
|
||
module.exports = { | ||
doublecounted: true, | ||
methodology: | ||
"Deposited assets (LSTs, LRTs, stables, Pendle tokens, Karak tokens, etc.) in deposit pools", | ||
ethereum: { | ||
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
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,18 @@ | ||
|
||
const { get } = require('../helper/http') | ||
const { toUSDTBalances } = require('../helper/balances') | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
icp: { tvl }, | ||
} | ||
|
||
async function tvl() { | ||
let result = await get('https://metrics.icpex.org/llama/tvl'); | ||
if (result.retCode === 1 && result.retMsg === "success") { | ||
const tvl = result.data; | ||
return toUSDTBalances(tvl); | ||
} else { | ||
throw new Error(`API error! message: ${result.retMsg}`); | ||
} | ||
} |
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,18 @@ | ||
const config = { | ||
ethereum: '0xB67D637B1301EEb56Dba4555bBd15Cd220F1aaD6', | ||
arbitrum: '0xB67D637B1301EEb56Dba4555bBd15Cd220F1aaD6', | ||
}; | ||
|
||
module.exports = { | ||
methodology: 'Obtaining all authorized assets on deployed project contracts', | ||
} | ||
|
||
Object.keys(config).forEach(chain => { | ||
const contract = config[chain] | ||
module.exports[chain] = { | ||
tvl: async (api) => { | ||
const tokens = await api.fetchList({ lengthAbi: 'acceptableTokensArrayLength', itemAbi: 'acceptableTokensArray', target: contract}) | ||
return api.sumTokens({ tokens, owner: contract }) | ||
} | ||
} | ||
}) |