Skip to content

Commit

Permalink
fix broken adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 14, 2025
1 parent 735a27b commit 0b11fa6
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
5 changes: 3 additions & 2 deletions projects/burve-protocol/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ Object.keys(config).forEach(chain => {
module.exports[chain] = {
tvl: async (api) => {
const tokens = await getLogs2({ api, factory, eventAbi: 'event LogTokenDeployed (string tokenType, string bondingCurveType, uint256 tokenId, address deployedAddr)', fromBlock, transform: i => i.deployedAddr })
const uTokens = await api.multiCall({ abi: 'address:getRaisingToken', calls: tokens })
return api.sumTokens({ tokensAndOwners2: [uTokens, tokens], blacklistedTokens: tokens })
const uTokens = await api.multiCall({ abi: 'address:getRaisingToken', calls: tokens, permitFailure: true })
const tokensAndOwners = uTokens.map((u, i) => [u, tokens[i]]).filter(t => t[0])
return api.sumTokens({ tokensAndOwners, blacklistedTokens: tokens })
}
}
})
10 changes: 6 additions & 4 deletions projects/chaingpt/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { stakings } = require("../helper/staking");
const { getLogs } = require('../helper/cache/getLogs')
const { PromisePool } = require('@supercharge/promise-pool')
const { PromisePool } = require('@supercharge/promise-pool');
const { blake2b } = require("blakejs");
const { sumTokens2 } = require("../helper/unwrapLPs");

const cgpt = "0x9840652DC04fb9db2C43853633f0F62BE6f00f98";
const stakingpool1 = "0x765a6ee976137801F2661c3644E1fde369A8ED18";
Expand Down Expand Up @@ -32,7 +34,7 @@ const config = {
{ factory: '0x9840652DC04fb9db2C43853633f0F62BE6f00f98', fromBlock: 15191500, blacklistedTokens: ['0xcE87100A1dBAf576ebd063EB0890840346338689'] },
],
base: [
{ factory: '0xFB5cd8426FBC3b1f2ea4B113A5A37752B3098C79', fromBlock: 15137100 },
{ factory: '0xFB5cd8426FBC3b1f2ea4B113A5A37752B3098C79', fromBlock: 15137100, },
],
xlayer: [
{ factory: '0x9840652DC04fb9db2C43853633f0F62BE6f00f98', fromBlock: 2353300 },
Expand All @@ -52,7 +54,7 @@ async function tvl(api) {
let blacklistedTokens = []

for (const chainConfig of chainConfigs) {
const { factory, fromBlock, blacklistedTokens: configBlacklistedTokens } = chainConfig
const { factory, fromBlock, blacklistedTokens: configBlacklistedTokens } = chainConfig

if (configBlacklistedTokens) {
blacklistedTokens = blacklistedTokens.concat(configBlacklistedTokens)
Expand Down Expand Up @@ -100,7 +102,7 @@ async function tvl(api) {
})
}

return api.sumTokens({ ownerTokens, blacklistedTokens })
return sumTokens2({ api, ownerTokens, blacklistedTokens, permitFailure: true, })

}

Expand Down
1 change: 1 addition & 0 deletions projects/dfs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async function dfs() {
}

module.exports = {
timetravel: false,
methodology: `DFS TVL is achieved by querying token balances from DFS's AMM swap liquidity smart contract.`,
eos: {
tvl: eos,
Expand Down
3 changes: 2 additions & 1 deletion projects/donaswap-v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ module.exports = {
methodology: "Factory address (0x8e5dff1c121F661971d02950698f8c5EFc3DfA78) is used to find the LP pairs. TVL is equal to the liquidity on the AMM.",
};

chains.forEach(chain => module.exports[chain] = { tvl })
chains.forEach(chain => module.exports[chain] = { tvl })
module.exports.cmp.tvl = () => ({})
2 changes: 1 addition & 1 deletion projects/helper/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DEFAULTS = {
ANKR_API_KEY: '79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01',
RENEC_RPC: "https://api-mainnet-beta.renec.foundation:8899/",
RPC_PROXY_URL: "https://rpc-proxy.llama.fi",
FLOW_RPC: "https://mainnet.evm.nodes.onflow.org",
FLOW_RPC: "https://rest-mainnet.onflow.org",
SONEIUM_RPC: "https://rpc.soneium.org",
SONEIUM_RPC_MULTICALL: "0xcA11bde05977b3631167028862bE2a173976CA11",
}
Expand Down
1 change: 1 addition & 0 deletions projects/lumin-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async function borrowed(api) {
tokens.forEach((token, i) => api.add(token, deposit[i][1]))
}
async function staking(api) {
return; // this is broken
const stakingBalance = await api.call({
abi: abi.v2.stakeStats,
target: LUMIN_V2_CONTRACT,
Expand Down
9 changes: 7 additions & 2 deletions projects/lunggens-dex/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
const { uniTvlExport } = require('../helper/unknownTokens')
module.exports = uniTvlExport('lung', '0x78725F781C861938Ff11aCedcB0D69Da7Ae4581B')
// const { uniTvlExport } = require('../helper/unknownTokens')
// module.exports = uniTvlExport('lung', '0x78725F781C861938Ff11aCedcB0D69Da7Ae4581B')

module.exports = {
lung: { tvl: () => ({}) },
// deadFrom: '2025-01-13',
}
3 changes: 2 additions & 1 deletion projects/synonym-finance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ chains.forEach(chain => {

async function getTokenInfos(api, requestedChain) {
const registry = await api.call({ abi: 'address:getAssetRegistry', target: hub })
const tokenBridge = await api.call({ abi: 'address:tokenBridge', target: hub })
const wormholeTunnel = await api.call({ abi: 'address:getWormholeTunnel', target: hub })
const tokenBridge = await api.call({ abi: 'address:tokenBridge', target: wormholeTunnel })
const assets = await api.call({ abi: 'address[]:getRegisteredAssets', target: registry })
const isBridged = await api.multiCall({ abi: 'function isWrappedAsset(address) view returns (bool)', calls: assets, target: tokenBridge })
const arbiAssets = []
Expand Down

0 comments on commit 0b11fa6

Please sign in to comment.