Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pools #10793

Merged
merged 2 commits into from Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
[ADDRESSES.taiko.WETH]: { coingeckoId: 'ethereum', decimals: 18 },
[ADDRESSES.taiko.USDC]: { coingeckoId: 'usd-coin', decimals: 6 },
},
blast: {

Check failure on line 163 in projects/helper/tokenMapping.js

View workflow job for this annotation

GitHub Actions / test

Duplicate key 'blast'
'0x0000000000000000000000000000000000000001': { coingeckoId: 'ethereum', decimals: 18 },
},
sei: {
'0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1': { coingeckoId: 'usd-coin', decimals: 6 },
'0xb75d0b03c06a926e488e2659df1a861f860bd3d1': { coingeckoId: 'tether', decimals: 6 },
Expand Down
33 changes: 11 additions & 22 deletions projects/kalax/index.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { sumTokens2 } = require("../helper/unwrapLPs");
const { sumTokens2 } = require("../helper/unwrapLPs")

const KALAX = "0x2F67F59b3629Bf24962290DB9edE0CD4127e606D";
const KALAX = "0x2F67F59b3629Bf24962290DB9edE0CD4127e606D"
const farms = ['0xE63153C3360aCa0F4e7Ca7A1FC61c2215FAEF5A1', '0xFe899401A1d86cC1113020fb40878c76239142a5']

async function tvl(api) {
const FARM = "0xE63153C3360aCa0F4e7Ca7A1FC61c2215FAEF5A1";

let pools = await api.call({ abi: abiInfo.poolInfos, target: FARM });
let pools = (await api.multiCall({ abi: abiInfo.poolInfos, calls: farms })).flat()
pools
.filter((i) => i.assets !== KALAX)
.forEach((i) => {
if (i.assets === ADDRESSES.linea.WETH_1) {
i.assets = ADDRESSES.null;
}
api.add(i.assets, i.tvl);
});
return await sumTokens2({ api, resolveLP: true });
.forEach((i) => api.add(i.assets, i.tvl))

return sumTokens2({ api, resolveLP: true })
}

async function staking(api) {
const FARM = "0xE63153C3360aCa0F4e7Ca7A1FC61c2215FAEF5A1";

let pools = await api.call({ abi: abiInfo.poolInfos, target: FARM });
let target = pools.find((i) => i.assets === KALAX);

api.add(target.assets, target.tvl);
return api.getBalances();
let pools = (await api.multiCall({ abi: abiInfo.poolInfos, calls: farms })).flat()
pools.filter((i) => i.assets === KALAX).forEach((i) => api.add(i.assets, i.tvl))
}

module.exports = {
blast: {
tvl,
staking,
},
};
}

const abiInfo = {
poolInfos:
"function getPoolTotalTvl() view returns (tuple(uint256 pid, address assets, uint256 tvl)[])",
};
}
Loading