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

Added bitcoin lrt pools for zerolend #11629

Closed
wants to merge 2 commits into from
Closed
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
47 changes: 40 additions & 7 deletions projects/zerolend/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
const { aaveExports } = require("../helper/aave");
const { staking } = require("../helper/staking");
const { pool2s } = require("../helper/pool2");
const { mergeBalances } = require("@defillama/sdk/build/generalUtil");

const config = {
era: "0xB73550bC1393207960A385fC8b34790e5133175E",
manta: "0x67f93d36792c49a4493652B91ad4bD59f428AD15",
blast: "0xc6DF4ddDBFaCb866e78Dcc01b813A41C15A08C10",
linea: "0x67f93d36792c49a4493652B91ad4bD59f428AD15",
xlayer: "0x97e59722318F1324008484ACA9C343863792cBf6",
ethereum: "0x47223D4eA966a93b2cC96FFB4D42c22651FADFcf",
era: ["0xB73550bC1393207960A385fC8b34790e5133175E"],
manta: ["0x67f93d36792c49a4493652B91ad4bD59f428AD15"],
blast: ["0xc6DF4ddDBFaCb866e78Dcc01b813A41C15A08C10"],
linea: [
"0x67f93d36792c49a4493652B91ad4bD59f428AD15", // main linea market
'0x9aFB91a3cfB9aBc8Cbc8429aB57b6593FE36E173', // croak linea market
'0xEe9ec60657B714E3FAC5255a5443AC5EC7Ba5bB0', // foxy linea market
],
xlayer: ["0x97e59722318F1324008484ACA9C343863792cBf6"],
ethereum: [
"0x47223D4eA966a93b2cC96FFB4D42c22651FADFcf", // ethereum lrt market
'0x31063F7CA8ef4089Db0dEdf8D6e35690B468A611' // bitcoin lrt market
],
};

const linea = {
Expand All @@ -23,7 +31,32 @@ const linea = {

const data = {};
Object.keys(config).forEach((chain) => {
data[chain] = aaveExports(chain, undefined, undefined, [config[chain]]);
const pools = config[chain]

// iterate over each chain's pool for tvl
const tvl = async (api) => {
const balances = {}
await Promise.all(pools.map(async (address) => {
const data = aaveExports(chain, undefined, undefined, [address]);
mergeBalances(balances, await data.tvl(api))
}))
return balances
};

// iterate over each chain's pool for borrowed
const borrowed = async (api) => {
const balances = {}
await Promise.all(pools.map(async (address) => {
const data = aaveExports(chain, undefined, undefined, [address]);
mergeBalances(balances, await data.borrowed(api))
}))
return balances
};

data[chain] = {
tvl,
borrowed
}
});

data.linea.staking = staking(linea.zeroLocker, linea.zero, "linea");
Expand Down
Loading