impermax-sdk 2.1.462 → 2.1.463
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/offchain/lendingPool/nftlp/offchainNftlpGenericCL.js +5 -5
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlpUniswapV3.d.ts +0 -2
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlpUniswapV3.js +0 -7
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlpAeroCL.js +4 -1
- package/package.json +1 -1
|
@@ -32,11 +32,11 @@ class OffchainNftlpGenericCL extends offchainNftlp_1.default {
|
|
|
32
32
|
}
|
|
33
33
|
return priceA / priceB;
|
|
34
34
|
}
|
|
35
|
-
// get basic
|
|
35
|
+
// get basic pool info given the tickSpacing
|
|
36
36
|
// used for calculating the apr
|
|
37
37
|
async initializeGenericCLPool(tickSpacing) {
|
|
38
|
-
const
|
|
39
|
-
const pools =
|
|
38
|
+
const nftlpGenericCLData = await this.getNftlpData();
|
|
39
|
+
const pools = nftlpGenericCLData.uniswapV3Pools;
|
|
40
40
|
for (let pool of pools) {
|
|
41
41
|
if (parseInt(pool.tickSpacing) == tickSpacing) {
|
|
42
42
|
const liquidity = parseInt(pool.liquidity);
|
|
@@ -87,8 +87,8 @@ class OffchainNftlpGenericCL extends offchainNftlp_1.default {
|
|
|
87
87
|
return totalTvl > 0 ? totalCompoundedRate / totalTvl : 0;
|
|
88
88
|
}*/
|
|
89
89
|
async getGlobalTvl(tickSpacing) {
|
|
90
|
-
const
|
|
91
|
-
const pools =
|
|
90
|
+
const nftlpGenericCLData = await this.getNftlpData();
|
|
91
|
+
const pools = nftlpGenericCLData.uniswapV3Pools;
|
|
92
92
|
for (let pool of pools) {
|
|
93
93
|
if (parseInt(pool.tickSpacing) == tickSpacing) {
|
|
94
94
|
const reserve0 = parseFloat(pool.reserve0);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import GenericCLPosition from "../../../../utils/position/cl";
|
|
2
1
|
import OnchainAccountNftlpGenericCL from "./onchainAccountNftlpGenericCL";
|
|
3
2
|
import { UniswapV3PositionData } from "../../../onchainTypes";
|
|
4
3
|
export default class OnchainAccountNftlpUniswapV3 extends OnchainAccountNftlpGenericCL {
|
|
@@ -14,5 +13,4 @@ export default class OnchainAccountNftlpUniswapV3 extends OnchainAccountNftlpGen
|
|
|
14
13
|
unclaimedFees0: number;
|
|
15
14
|
unclaimedFees1: number;
|
|
16
15
|
}>;
|
|
17
|
-
getPositionObject(tokenId: number): Promise<GenericCLPosition>;
|
|
18
16
|
}
|
|
@@ -47,12 +47,5 @@ class OnchainAccountNftlpUniswapV3 extends onchainAccountNftlpGenericCL_1.defaul
|
|
|
47
47
|
unclaimedFees1: await this.getNftlp().getLendingPool().getBorrowableB().normalize(raw.unclaimedFees1),
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
async getPositionObject(tokenId) {
|
|
51
|
-
if (!this.cache.positionsObject)
|
|
52
|
-
this.cache.positionsObject = {};
|
|
53
|
-
if (!this.cache.positionsObject[tokenId])
|
|
54
|
-
this.cache.positionsObject[tokenId] = this.createPositionObject(tokenId);
|
|
55
|
-
return this.cache.positionsObject[tokenId];
|
|
56
|
-
}
|
|
57
50
|
}
|
|
58
51
|
exports.default = OnchainAccountNftlpUniswapV3;
|
|
@@ -25,11 +25,14 @@ class OnchainNftlpAeroCL extends onchainNftlpGenericCL_1.default {
|
|
|
25
25
|
}
|
|
26
26
|
async initializeCLPool(tickSpacing) {
|
|
27
27
|
const nftlp = this.getNftlp();
|
|
28
|
+
console.log("initializeCLPool", tickSpacing);
|
|
28
29
|
try {
|
|
29
30
|
const poolAddress = await nftlp.methods.getPool(tickSpacing).call();
|
|
31
|
+
console.log("poolAddress", poolAddress);
|
|
30
32
|
return this.getContractHelper().newUniswapV3Pool(poolAddress);
|
|
31
33
|
}
|
|
32
|
-
catch {
|
|
34
|
+
catch (e) {
|
|
35
|
+
console.log(e);
|
|
33
36
|
return null;
|
|
34
37
|
}
|
|
35
38
|
}
|