Skip to content

Commit 2eadd0f

Browse files
authored
feat: add new chains/pools for panoptic v1.1, fix univ3 calculation (#16719)
1 parent 92a8dc1 commit 2eadd0f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

projects/panoptic-v1_1/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ async function tvl(api) {
5656
const isV4 = {}
5757

5858
for (const poolDeployedLog of poolDeployedLogs) {
59-
if (poolDeployedLog.poolAddress !== '0x36a3088B94f73853a3964a0352B47605C6354f27') continue
6059
// get underlying token from each collateral tracker
6160
const tokens = await api.multiCall({ abi:'function asset() external view returns (address)', calls: [{target: poolDeployedLog.collateralTracker0, params: []}, {target: poolDeployedLog.collateralTracker1, params: []}] })
6261

@@ -72,7 +71,7 @@ async function tvl(api) {
7271
const chunks = await cachedGraphQuery(`panoptic/v1_1/${chain}/sfpm-chunks`, graphUrl, SFPMChunksQuery, { api, useBlock: true, fetchById: true, safeBlockLimit, })
7372
chunks.forEach(chunk => {
7473
if (!isV4[chunk.panopticPool.id.toLowerCase()]) return
75-
addUniV3LikePosition({ api, token0: chunk.pool.token0.id, token1: chunk.pool.token1.id, tick: chunk.pool.tick, liquidity: chunk.netLiquidity, tickUpper: chunk.tickUpper, tickLower: chunk.tickLower, })
74+
addUniV3LikePosition({ api, token0: chunk.pool.token0.id, token1: chunk.pool.token1.id, tick: Number(chunk.pool.tick), liquidity: Number(chunk.netLiquidity), tickUpper: Number(chunk.tickUpper), tickLower: Number(chunk.tickLower), })
7675
})
7776
}
7877

projects/panoptic/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function tvl(api) {
7474
chunks.forEach(chunk => {
7575
const { token0, token1, tick, } = poolData[chunk.pool.id.toLowerCase()] ?? {}
7676
if (!tick) return;
77-
addUniV3LikePosition({ api, token0, token1, tick, liquidity: chunk.netLiquidity, tickUpper: chunk.tickUpper, tickLower: chunk.tickLower, })
77+
addUniV3LikePosition({ api, token0, token1, tick: Number(tick), liquidity: Number(chunk.netLiquidity), tickUpper: Number(chunk.tickUpper), tickLower: Number(chunk.tickLower), })
7878
})
7979

8080
const usdValue = await api.getUSDValue()

0 commit comments

Comments
 (0)