impermax-sdk 2.1.227 → 2.1.229
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/account/lendingPool/nftlp/offchainAccountNftlpUniswapV3.d.ts +2 -2
- package/lib/offchain/account/lendingPool/nftlp/offchainAccountNftlpUniswapV3.js +3 -3
- package/lib/offchain/queries/apis/ponder/index.js +2 -2
- package/lib/utils/position/uniswapV3/index.js +1 -1
- package/package.json +1 -1
|
@@ -10,8 +10,8 @@ interface PositionData {
|
|
|
10
10
|
feeGrowthInside1LastX128: number;
|
|
11
11
|
unclaimedFees0: number;
|
|
12
12
|
unclaimedFees1: number;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
storedTotalFeesEarned0: number;
|
|
14
|
+
storedTotalFeesEarned1: number;
|
|
15
15
|
}
|
|
16
16
|
export type UniswapV3PositionData = NftlpPosition & {
|
|
17
17
|
nftlp: PositionData;
|
|
@@ -81,11 +81,11 @@ class OffchainAccountNftlpUniswapV3 extends offchainAccountNftlp_1.default {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
async getTotalAccruedFees(tokenId) {
|
|
84
|
-
const {
|
|
84
|
+
const { storedTotalFeesEarned0, storedTotalFeesEarned1 } = (await this.getPositionData(tokenId));
|
|
85
85
|
const { uncollectedFees0, uncollectedFees1 } = await this.getUncollectedFees(tokenId);
|
|
86
86
|
return {
|
|
87
|
-
accruedFees0: Number(
|
|
88
|
-
accruedFees1: Number(
|
|
87
|
+
accruedFees0: Number(storedTotalFeesEarned0) + uncollectedFees0,
|
|
88
|
+
accruedFees1: Number(storedTotalFeesEarned1) + uncollectedFees1,
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -259,7 +259,7 @@ class UniswapV3Position {
|
|
|
259
259
|
if (this.getOptimalWithdrawForDeleverage(avgLeverage) !== null)
|
|
260
260
|
return this.getMinLeverageInRange(lowLeverage, avgLeverage);
|
|
261
261
|
else
|
|
262
|
-
return this.getMinLeverageInRange(avgLeverage,
|
|
262
|
+
return this.getMinLeverageInRange(avgLeverage, highLeverage);
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
265
|
* PUBLIC SETTERS
|