Skip to content

Commit 186bda5

Browse files
antonklyrg1nt0ki
andauthored
Add Z Protocol (DefiLlama#11456)
Co-authored-by: g1ntoki <[email protected]>
1 parent cae67c5 commit 186bda5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

projects/zprotocol-dex/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { uniTvlExports } = require('../helper/unknownTokens')
2+
module.exports = uniTvlExports({
3+
'scroll': '0xED93e976d43AF67Cc05aa9f6Ab3D2234358F0C81'
4+
})
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// const {zProtocolScrollFarmingExports} = require("./scroll");
2+
const { staking, } = require('../helper/unknownTokens');
3+
const { sumTokens2 } = require('../helper/unwrapLPs');
4+
5+
const FACTORY = "0xED93e976d43AF67Cc05aa9f6Ab3D2234358F0C81";
6+
const FARM_MASTER = "0x7a757614fEFA05f40456016Af74262Fe53546DBa";
7+
const ZP_TOKEN = "0x2147a89fb4608752807216D5070471c09A0DcE32";
8+
// const export1 = zProtocolScrollFarmingExports(FARM_MASTER, FACTORY, 'scroll', ZP_TOKEN);
9+
const farmAbi = {
10+
poolInfo: "function poolInfo(uint256) view returns (address token, uint256 catId, uint256 allocPoint, uint256 lastRewardTime, uint256 accZPPerShare, uint256 depositFeeBP, uint256 harvestInterval)",
11+
}
12+
13+
module.exports = {
14+
methodology: "count value of staked tokens except of z-dex LP tokens",
15+
misrepresentedTokens: true,
16+
scroll: {
17+
tvl,
18+
staking: staking({ tokens: [ZP_TOKEN], owner: FARM_MASTER, useDefaultCoreAssets: true, lps: ['0xb74806780Ac59D0d7567bE66Ff23511400bD9cf8']})
19+
}
20+
}
21+
22+
async function tvl(api) {
23+
let blacklistedTokens = await api.fetchList({ lengthAbi: 'allPairsLength', itemAbi: 'allPairs', target: FACTORY })
24+
blacklistedTokens.push(ZP_TOKEN)
25+
const poolInfo = await api.fetchList({ lengthAbi: 'poolsLength', itemAbi: farmAbi.poolInfo, target: FARM_MASTER })
26+
await sumTokens2({ api, owner: FARM_MASTER, tokens: poolInfo.map(pool => pool.token), resolveLP: true, blacklistedTokens, })
27+
api.removeTokenBalance(ZP_TOKEN)
28+
}

0 commit comments

Comments
 (0)