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.
Merge branch 'DefiLlama:main' into main
- Loading branch information
Showing
32 changed files
with
385 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const abi = { | ||
"getSupportedTokens": "function getSupportedTokens() view returns (address[] supportedTokens)" | ||
} | ||
|
||
const config = { | ||
kava: { | ||
CofferCityKAVA: '0x860880862Ee1B74D00E2F94B1C81A67C2c58117E' | ||
} | ||
} | ||
|
||
module.exports = { | ||
methodology: 'Counts TVL of all the assets supported by the Coffer City smart contracts' | ||
}; | ||
|
||
Object.keys(config).forEach(chain => { | ||
module.exports[chain] = { | ||
tvl: async (_, _b, _cb, { api, }) => { | ||
const vaults = Object.values(config[chain]) | ||
const tokens = await api.multiCall({ abi: abi.getSupportedTokens, calls: vaults }) | ||
const ownerTokens = vaults.map((v, i) => [tokens[i], v]) | ||
return api.sumTokens({ ownerTokens }) | ||
} | ||
} | ||
}) |
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,14 @@ | ||
const { fetchURL } = require("../helper/utils"); | ||
|
||
module.exports = { | ||
timetravel: false, | ||
methodology: | ||
"The displayed value represents the Total Value Locked (TVL) in USD of all assets secured within the davincigraph token locker smart contracts, accessible at https://davincigraph.io/devs/locks/contracts", | ||
fetch: async () => { | ||
const response = await fetchURL( | ||
"https://davincigraph.network/api/v1/locks/statistics" | ||
); | ||
|
||
return response.data.tvl.locked.liquidity; | ||
}, | ||
}; |
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,14 +1,12 @@ | ||
const { sumTokens2, nullAddress } = require("../helper/unwrapLPs"); | ||
const { nullAddress, sumTokensExport } = require("../helper/unwrapLPs"); | ||
|
||
const contract = "0x1e70972EC6c8a3FAe3aC34C9F3818eC46Eb3BD5D"; | ||
|
||
async function tvl(time, ethBlock, _b, { api }) { | ||
return sumTokens2({ tokens: [nullAddress], owner: contract, api }); | ||
const config = { | ||
bsc: '0x1e70972EC6c8a3FAe3aC34C9F3818eC46Eb3BD5D', | ||
op_bnb: '0x2C5bF6f0953ffcDE678A35AB7d6CaEBC8B6b29F0', | ||
} | ||
|
||
module.exports = { | ||
methodology: `We count the ETH on ${contract}`, | ||
bsc: { | ||
tvl, | ||
}, | ||
}; | ||
Object.keys(config).forEach(chain => { | ||
module.exports[chain] = { | ||
tvl: sumTokensExport({ tokens: [nullAddress], owner: config[chain] }) | ||
} | ||
}) |
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,13 +1,33 @@ | ||
const ADDRESSES = require('../helper/coreAssets.json') | ||
const { sumTokensExport } = require("../helper/unwrapLPs"); | ||
|
||
const SimpleGToken = "0x0729e806f57CE71dA4464c6B2d313E517f41560b"; // SimpleGToken | ||
const Treasury = "0x1fb8611064a09469F808263C398623A86e7Aa883"; // Treasury | ||
const SimpleGToken = { | ||
era: "0x0729e806f57CE71dA4464c6B2d313E517f41560b", | ||
arbitrum: "0xAC29F414FB40BA4e29Ab8504a55cBfFD315D2430" | ||
} | ||
const Treasury = { | ||
era: "0x1fb8611064a09469F808263C398623A86e7Aa883", | ||
arbitrum: "0x15c80BbC0D05656002BD922BFbf46e185BCa5A9e" | ||
} | ||
const Staking = { | ||
arbitrum: "0x05027E21F6cEfb38970f4e0c04cD6DacA15aCBcE", | ||
} | ||
|
||
const CNG_ADDRESS = { | ||
ethereum: "0x5C1d9aA868a30795F92fAe903eDc9eFF269044bf", | ||
arbitrum: "0x4e7e5023656863E26f50E2E6E59489A852C212c1", | ||
} | ||
|
||
module.exports = { | ||
methodology: `Count the USDC that has been deposited on Gambit`, | ||
era: { | ||
tvl: sumTokensExport({ owners: [SimpleGToken, Treasury], tokens: [ADDRESSES.era.USDC], }), | ||
}, | ||
methodology: `Count the USDC that has been deposited on Gambit`, | ||
era: { | ||
tvl: sumTokensExport({ owners: [SimpleGToken.era, Treasury.era], tokens: [ADDRESSES.era.USDC], }), | ||
}, | ||
arbitrum: { | ||
tvl: sumTokensExport({ | ||
owners: [SimpleGToken.arbitrum, Treasury.arbitrum], | ||
tokens: [ADDRESSES.arbitrum.USDC_CIRCLE], | ||
}), | ||
staking: sumTokensExport({ owners: [Staking.arbitrum], tokens: [CNG_ADDRESS.arbitrum], }), | ||
}, | ||
}; | ||
|
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
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,25 @@ | ||
const sui = require("../helper/chain/sui"); | ||
|
||
const WHUSDCE_VAULT_ID = | ||
"0x7a2f75a3e50fd5f72dfc2f8c9910da5eaa3a1486e4eb1e54a825c09d82214526"; | ||
const WHUSDCE_TYPE_ARG = '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN' | ||
|
||
async function tvl(_, _1, _2, { api }) { | ||
const res = await sui.getObject(WHUSDCE_VAULT_ID) | ||
|
||
let tvl = BigInt(res.fields.free_balance) | ||
for (const strategy of res.fields.strategies.fields.contents) { | ||
tvl += BigInt(strategy.fields.value.fields.borrowed) | ||
} | ||
tvl += BigInt(res.fields.free_balance) | ||
|
||
api.add(WHUSDCE_TYPE_ARG, Number(tvl)) | ||
} | ||
|
||
module.exports = { | ||
timetravel: false, | ||
sui: { | ||
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,16 @@ | ||
const { compoundExports2 } = require("../helper/compound"); | ||
const { staking } = require('../helper/staking') | ||
|
||
module.exports = { | ||
scroll: compoundExports2({ | ||
comptroller: '0xA27CDE1F3dcaaF653624049Fc3b1a720eC1D4e91', | ||
fetchBalances: true, | ||
cether: '0xBC7fA7C2dF265d073Be6D1c88468AEB5c06ba07c', | ||
}), | ||
}; | ||
|
||
module.exports.scroll.staking = staking( | ||
['0xca4fb5541D0f2899549e5f454155E1B34acc9379', '0x578E4f84663260e5C5c64d5310Dd76aA3CEC633c'], | ||
'0x3e6c99915803631D200441CdF6D84786912b0871', | ||
'scroll' | ||
) |
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,35 @@ | ||
const { Program } = require("@project-serum/anchor"); | ||
const { getProvider, sumTokens2 } = require("../helper/solana"); | ||
const idl = require("./idl.json"); | ||
|
||
async function depositsTvl() { | ||
const provider = getProvider(); | ||
const program = new Program( | ||
idl, | ||
"4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg", | ||
provider, | ||
); | ||
const banks = await program.account.bank.all(); | ||
return sumTokens2({ tokenAccounts: banks.map((i) => i.account.vault) }); | ||
} | ||
async function borrowed() { | ||
const { api } = arguments[3]; | ||
const provider = getProvider(); | ||
const program = new Program( | ||
idl, | ||
"4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg", | ||
provider, | ||
); | ||
const banks = await program.account.bank.all(); | ||
banks.forEach(({ account: i }) => { | ||
api.add( | ||
i.mint.toString(), | ||
i.indexedBorrows.val.mul(i.borrowIndex.val).toString() / 2 ** (48 * 2), | ||
); | ||
}); | ||
} | ||
|
||
module.exports = { | ||
depositsTvl, | ||
borrowed, | ||
}; |
Oops, something went wrong.