@sonarwatch/portfolio-plugins 0.12.39 → 0.12.41
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1863 -1855
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/Cache.js +2 -7
- package/src/Cache.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bonkrewards/constants.js +1 -1
- package/src/plugins/bonkrewards/constants.js.map +1 -1
- package/src/plugins/cropper/constants.js +1 -1
- package/src/plugins/cropper/constants.js.map +1 -1
- package/src/plugins/drift/constants.d.ts +1 -0
- package/src/plugins/drift/constants.js +2 -1
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/depositsFetcher.js +3 -10
- package/src/plugins/drift/depositsFetcher.js.map +1 -1
- package/src/plugins/drift/perpHelpers/constants.d.ts +1 -0
- package/src/plugins/drift/perpHelpers/constants.js +95 -1
- package/src/plugins/drift/perpHelpers/constants.js.map +1 -1
- package/src/plugins/drift/perpHelpers/getMintFromOracle.d.ts +2 -0
- package/src/plugins/drift/perpHelpers/getMintFromOracle.js +40 -0
- package/src/plugins/drift/perpHelpers/getMintFromOracle.js.map +1 -0
- package/src/plugins/drift/spotMarketsJob.js +10 -0
- package/src/plugins/drift/spotMarketsJob.js.map +1 -1
- package/src/plugins/flowx/constants.js +1 -1
- package/src/plugins/flowx/constants.js.map +1 -1
- package/src/plugins/kriya/constants.js +1 -1
- package/src/plugins/kriya/constants.js.map +1 -1
- package/src/plugins/meteora/dlmmHelper.js +17 -31
- package/src/plugins/meteora/dlmmHelper.js.map +1 -1
- package/src/plugins/meteora/dlmmPositionsFetcher.js +27 -5
- package/src/plugins/meteora/dlmmPositionsFetcher.js.map +1 -1
- package/src/plugins/meteora/poolsJob.js +3 -5
- package/src/plugins/meteora/poolsJob.js.map +1 -1
- package/src/plugins/phoenix/helpers/deserializeMarketData.js +5 -11
- package/src/plugins/phoenix/helpers/deserializeMarketData.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +3 -2
- package/src/plugins/zeta/airdropFetcher.js.map +1 -1
- package/src/utils/misc/arrayToMap.js +2 -0
- package/src/utils/misc/arrayToMap.js.map +1 -1
- package/src/utils/misc/toBN.d.ts +3 -0
- package/src/utils/misc/toBN.js +22 -0
- package/src/utils/misc/toBN.js.map +1 -0
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -11,11 +11,12 @@ const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
11
11
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
12
12
|
const types_1 = require("./types");
|
13
13
|
const constants_1 = require("./constants");
|
14
|
+
const toBN_1 = require("../../utils/misc/toBN");
|
14
15
|
exports.MAX_BIN_ARRAY_SIZE = new bn_js_1.default(70);
|
15
16
|
exports.SCALE_OFFSET = 64;
|
16
17
|
exports.BASIS_POINT_MAX = 10000;
|
17
18
|
function binIdToBinArrayIndex(binId) {
|
18
|
-
const tempBinId =
|
19
|
+
const tempBinId = (0, toBN_1.toBN)(binId);
|
19
20
|
const { div: idx, mod } = tempBinId.divmod(exports.MAX_BIN_ARRAY_SIZE);
|
20
21
|
return tempBinId.isNeg() && !mod.isZero() ? idx.sub(new bn_js_1.default(1)) : idx;
|
21
22
|
}
|
@@ -75,33 +76,18 @@ function processPosition(program, version, lbPair, position, baseTokenDecimal, q
|
|
75
76
|
positionYAmount: positionYAmount.toString(),
|
76
77
|
});
|
77
78
|
});
|
78
|
-
|
79
|
-
|
80
|
-
// program,
|
81
|
-
// version,
|
82
|
-
// position,
|
83
|
-
// lowerBinArray,
|
84
|
-
// upperBinArray
|
85
|
-
// );
|
86
|
-
// const { rewardOne, rewardTwo } = getClaimableLMReward(
|
87
|
-
// program,
|
88
|
-
// version,
|
89
|
-
// lbPair,
|
90
|
-
// new Date(Date.now()).getTime(),
|
91
|
-
// position,
|
92
|
-
// lowerBinArray,
|
93
|
-
// upperBinArray
|
94
|
-
// );
|
79
|
+
const { feeX, feeY } = getClaimableSwapFee(program, version, position, lowerBinArray, upperBinArray);
|
80
|
+
const { rewardOne, rewardTwo } = getClaimableLMReward(program, version, lbPair, new Date(Date.now()).getTime(), position, lowerBinArray, upperBinArray);
|
95
81
|
return {
|
96
82
|
totalXAmount: new bignumber_js_1.default(totalXAmount.toString()),
|
97
83
|
totalYAmount: new bignumber_js_1.default(totalYAmount.toString()),
|
98
84
|
positionBinData: positionData,
|
99
85
|
lowerBinId,
|
100
86
|
upperBinId,
|
101
|
-
feeX
|
102
|
-
feeY
|
103
|
-
rewardOne
|
104
|
-
rewardTwo
|
87
|
+
feeX,
|
88
|
+
feeY,
|
89
|
+
rewardOne,
|
90
|
+
rewardTwo,
|
105
91
|
};
|
106
92
|
}
|
107
93
|
exports.processPosition = processPosition;
|
@@ -170,8 +156,8 @@ function getClaimableLMReward(program, positionVersion, lbPair, onChainTimestamp
|
|
170
156
|
const binIdxInPosition = i - position.lowerBinId;
|
171
157
|
const positionRewardInfo = position.rewardInfos[binIdxInPosition];
|
172
158
|
const liquidityShare = positionVersion === types_1.PositionVersion.V1
|
173
|
-
?
|
174
|
-
:
|
159
|
+
? (0, toBN_1.toBN)(position.liquidityShares[binIdxInPosition])
|
160
|
+
: (0, toBN_1.toBN)(position.liquidityShares[binIdxInPosition]).shrn(64);
|
175
161
|
for (let j = 0; j < 2; j++) {
|
176
162
|
const pairRewardInfo = lbPair.rewardInfos[j];
|
177
163
|
if (!pairRewardInfo.mint.equals(web3_js_1.PublicKey.default)) {
|
@@ -193,7 +179,7 @@ function getClaimableLMReward(program, positionVersion, lbPair, onChainTimestamp
|
|
193
179
|
const delta = rewardPerTokenStored.minus(j === 0
|
194
180
|
? positionRewardInfo.rewardPerTokenCompletesX
|
195
181
|
: positionRewardInfo.rewardPerTokenCompletesY);
|
196
|
-
const newReward = mulShr(
|
182
|
+
const newReward = mulShr((0, toBN_1.toBN)(delta), liquidityShare, exports.SCALE_OFFSET, Rounding.Down);
|
197
183
|
rewards[j] = rewards[j]
|
198
184
|
.plus(newReward)
|
199
185
|
.plus(j === 0
|
@@ -223,18 +209,18 @@ function getClaimableSwapFee(program, positionVersion, position, lowerBinArray,
|
|
223
209
|
const binIdxInPosition = i - position.lowerBinId;
|
224
210
|
const feeInfos = position.feeInfos[binIdxInPosition];
|
225
211
|
const liquidityShare = positionVersion === types_1.PositionVersion.V1
|
226
|
-
?
|
227
|
-
:
|
212
|
+
? (0, toBN_1.toBN)(position.liquidityShares[binIdxInPosition])
|
213
|
+
: (0, toBN_1.toBN)(position.liquidityShares[binIdxInPosition]).shrn(64);
|
228
214
|
if (liquidityShare.isZero())
|
229
215
|
continue;
|
230
216
|
const feeXPerToken = binState.feeAmountXPerTokenStored.minus(feeInfos.feeXPerTokenComplete);
|
231
217
|
if (!feeXPerToken.isZero()) {
|
232
|
-
const newFeeX = mulShr(liquidityShare,
|
218
|
+
const newFeeX = mulShr(liquidityShare, (0, toBN_1.toBN)(feeXPerToken), exports.SCALE_OFFSET, Rounding.Down);
|
233
219
|
feeX = feeX.plus(newFeeX).plus(feeInfos.feeXPending);
|
234
220
|
}
|
235
|
-
const feeYPerToken = binState.
|
221
|
+
const feeYPerToken = binState.feeAmountYPerTokenStored.minus(feeInfos.feeYPerTokenComplete);
|
236
222
|
if (!feeYPerToken.isZero()) {
|
237
|
-
const newFeeY = mulShr(liquidityShare,
|
223
|
+
const newFeeY = mulShr(liquidityShare, (0, toBN_1.toBN)(feeYPerToken), exports.SCALE_OFFSET, Rounding.Down);
|
238
224
|
feeY = feeY.plus(newFeeY).plus(feeInfos.feeYPending);
|
239
225
|
}
|
240
226
|
}
|
@@ -243,7 +229,7 @@ function getClaimableSwapFee(program, positionVersion, position, lowerBinArray,
|
|
243
229
|
exports.getClaimableSwapFee = getClaimableSwapFee;
|
244
230
|
function getBinFromBinArray(binId, binArray) {
|
245
231
|
const [lowerBinId, upperBinId] = getBinArrayLowerUpperBinId(binArray.index);
|
246
|
-
let index
|
232
|
+
let index;
|
247
233
|
if (binId > 0) {
|
248
234
|
index = binId - lowerBinId.toNumber();
|
249
235
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dlmmHelper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/dlmmHelper.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA2B;AAC3B,6CAA4C;AAC5C,kDAAuB;AACvB,4DAAiC;AACjC,gEAAqC;AACrC,mCAOiB;AAEjB,2CAA4C;AAE/B,QAAA,kBAAkB,GAAG,IAAI,eAAE,CAAC,EAAE,CAAC,CAAC;AAChC,QAAA,YAAY,GAAG,EAAE,CAAC;AAClB,QAAA,eAAe,GAAG,KAAK,CAAC;AAErC,SAAgB,oBAAoB,CAAC,KAAgB;IACnD,MAAM,SAAS,GAAG,IAAI,eAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3C,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACvE,CAAC;AAJD,oDAIC;AAED,SAAgB,6BAA6B,CAC3C,MAAiB,EACjB,SAAoB;IAEpB,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,EACzC,SAAS,CACV,CAAC;AACJ,CAAC;AARD,sEAQC;AAED,SAAgB,cAAc,CAC5B,MAAiB,EACjB,KAAS,EACT,SAAoB;IAEpB,IAAI,aAAyB,CAAC;IAC9B,IAAI,KAAK,CAAC,KAAK,EA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AAChB,CAAC;AAND,oDAMC;AAED,SAAgB,6BAA6B,CAC3C,QAAsB,EACtB,IAAY,EACZ,aAAuB,EACvB,aAAuB,EACvB,gBAAwB,EACxB,iBAAyB;IAEzB,MAAM,eAAe,GAAG,uBAAe,CAAC,EAAE,CAAC;IAE3C,MAAM,YAAY,GAAG,eAAe,CAClC,yBAAa,EACb,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,aAAa,CACd,CAAC;IAEF,IAAI,CAAC,YAAY;QACf,OAAO,EAAE,YAAY,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5E,OAAO;QACL,YAAY,EAAE,YAAY,CAAC,YAAY;QACvC,YAAY,EAAE,YAAY,CAAC,YAAY;KACxC,CAAC;AACJ,CAAC;AA5BD,sEA4BC"}
|
1
|
+
{"version":3,"file":"dlmmHelper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/dlmmHelper.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA2B;AAC3B,6CAA4C;AAC5C,kDAAuB;AACvB,4DAAiC;AACjC,gEAAqC;AACrC,mCAOiB;AAEjB,2CAA4C;AAC5C,gDAA6C;AAEhC,QAAA,kBAAkB,GAAG,IAAI,eAAE,CAAC,EAAE,CAAC,CAAC;AAChC,QAAA,YAAY,GAAG,EAAE,CAAC;AAClB,QAAA,eAAe,GAAG,KAAK,CAAC;AAErC,SAAgB,oBAAoB,CAAC,KAAgB;IACnD,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,C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AG,IAAI,oBAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,oBAAO,CAAC,uBAAe,CAAC,CAAC,CAAC;IAC1E,OAAO,IAAI,oBAAO,CAAC,CAAC,CAAC;SAClB,GAAG,CAAC,IAAI,oBAAO,CAAC,UAAU,CAAC,CAAC;SAC5B,GAAG,CAAC,IAAI,oBAAO,CAAC,KAAK,CAAC,CAAC;SACvB,QAAQ,EAAE,CAAC;AAChB,CAAC;AAND,oDAMC;AAED,SAAgB,6BAA6B,CAC3C,QAAsB,EACtB,IAAY,EACZ,aAAuB,EACvB,aAAuB,EACvB,gBAAwB,EACxB,iBAAyB;IAEzB,MAAM,eAAe,GAAG,uBAAe,CAAC,EAAE,CAAC;IAE3C,MAAM,YAAY,GAAG,eAAe,CAClC,yBAAa,EACb,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,aAAa,CACd,CAAC;IAEF,IAAI,CAAC,YAAY;QACf,OAAO,EAAE,YAAY,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAE5E,OAAO;QACL,YAAY,EAAE,YAAY,CAAC,YAAY;QACvC,YAAY,EAAE,YAAY,CAAC,YAAY;KACxC,CAAC;AACJ,CAAC;AA5BD,sEA4BC"}
|
@@ -66,6 +66,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
66
66
|
const lbPairAcc = struct_1.lbPairStruct.deserialize(rawAccount.data)[0];
|
67
67
|
mints.add(lbPairAcc.tokenXMint.toString());
|
68
68
|
mints.add(lbPairAcc.tokenYMint.toString());
|
69
|
+
if (lbPairAcc.rewardInfos[0].mint)
|
70
|
+
mints.add(lbPairAcc.rewardInfos[0].mint.toString());
|
71
|
+
if (lbPairAcc.rewardInfos[1].mint)
|
72
|
+
mints.add(lbPairAcc.rewardInfos[1].mint.toString());
|
69
73
|
lbPairById.set(lbPairKeys[i - binArrayKeys.length].toBase58(), lbPairAcc);
|
70
74
|
}
|
71
75
|
}
|
@@ -89,8 +93,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
89
93
|
});
|
90
94
|
const liquidities = [];
|
91
95
|
for (let idx = 0; idx < positions.length; idx++) {
|
92
|
-
const
|
93
|
-
const account = position;
|
96
|
+
const account = positions[idx];
|
94
97
|
const { upperBinId, lowerBinId, lbPair } = account;
|
95
98
|
const lowerBinArrayIndex = (0, dlmmHelper_1.binIdToBinArrayIndex)(new bignumber_js_1.default(lowerBinId));
|
96
99
|
const upperBinArrayIndex = (0, dlmmHelper_1.binIdToBinArrayIndex)(new bignumber_js_1.default(upperBinId));
|
@@ -103,6 +106,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
103
106
|
continue;
|
104
107
|
const tokenPriceX = tokenPriceById.get(lbPairAcc.tokenXMint.toString());
|
105
108
|
const tokenPriceY = tokenPriceById.get(lbPairAcc.tokenYMint.toString());
|
109
|
+
const tokenPriceRewardX = lbPairAcc.rewardInfos[0].mint
|
110
|
+
? tokenPriceById.get(lbPairAcc.rewardInfos[0].mint.toString())
|
111
|
+
: undefined;
|
112
|
+
const tokenPriceRewardY = lbPairAcc.rewardInfos[1].mint
|
113
|
+
? tokenPriceById.get(lbPairAcc.rewardInfos[1].mint.toString())
|
114
|
+
: undefined;
|
106
115
|
if (!tokenPriceX || !tokenPriceY)
|
107
116
|
continue;
|
108
117
|
const baseTokenDecimal = tokenPriceX.decimals;
|
@@ -110,6 +119,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
110
119
|
const positionVersion = idx < positionsV1.length ? types_1.PositionVersion.V1 : types_1.PositionVersion.V2;
|
111
120
|
const positionData = (0, dlmmHelper_1.processPosition)(constants_1.dlmmProgramId, positionVersion, lbPairAcc, account, baseTokenDecimal, quoteTokenDecimal, lowerBinArray, upperBinArray);
|
112
121
|
const assets = [];
|
122
|
+
const rewardAssets = [];
|
113
123
|
if (positionData &&
|
114
124
|
(!positionData.totalXAmount.isZero() ||
|
115
125
|
!positionData.totalYAmount.isZero())) {
|
@@ -119,12 +129,24 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
119
129
|
assets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceY.address, positionData.totalYAmount
|
120
130
|
.dividedBy(Math.pow(10, tokenPriceY.decimals))
|
121
131
|
.toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceY));
|
132
|
+
if (positionData.feeX.isGreaterThan(0))
|
133
|
+
rewardAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceX.address, positionData.feeX.dividedBy(Math.pow(10, tokenPriceX.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceX));
|
134
|
+
if (positionData.feeY.isGreaterThan(0))
|
135
|
+
rewardAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceY.address, positionData.feeY.dividedBy(Math.pow(10, tokenPriceY.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceY));
|
136
|
+
if (positionData.rewardOne.isGreaterThan(0) && tokenPriceRewardX)
|
137
|
+
rewardAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceRewardX.address, positionData.rewardOne
|
138
|
+
.dividedBy(Math.pow(10, tokenPriceRewardX.decimals))
|
139
|
+
.toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceRewardX));
|
140
|
+
if (positionData.rewardTwo.isGreaterThan(0) && tokenPriceRewardY)
|
141
|
+
rewardAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPriceRewardY.address, positionData.rewardTwo
|
142
|
+
.dividedBy(Math.pow(10, tokenPriceRewardY.decimals))
|
143
|
+
.toNumber(), portfolio_core_1.NetworkId.solana, tokenPriceRewardY));
|
122
144
|
liquidities.push({
|
123
145
|
assets,
|
124
146
|
assetsValue: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
125
|
-
rewardAssets
|
126
|
-
rewardAssetsValue:
|
127
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
147
|
+
rewardAssets,
|
148
|
+
rewardAssetsValue: (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((asset) => asset.value)),
|
149
|
+
value: (0, portfolio_core_1.getUsdValueSum)([...assets, ...rewardAssets].map((asset) => asset.value)),
|
128
150
|
yields: [],
|
129
151
|
});
|
130
152
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dlmmPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/dlmmPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAwD;AACxD,iDAAsD;AACtD,+CAI4B;AAC5B,qCAOkB;AAClB,uCAGmB;AACnB,6CAIsB;AACtB,mCAA0C;AAC1C,gGAA6F;AAC7F,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,UAAU,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;IAExC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnD,IAAA,iCAAwB,EACtB,MAAM,EACN,6BAAoB,EACpB,yBAAa,EACb,IAAA,mCAAyB,EAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CACjD;QACD,IAAA,iCAAwB,EACtB,MAAM,EACN,6BAAoB,EACpB,yBAAa,EACb,IAAA,qCAA2B,EAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CACnD;KACF,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC;IAC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,+BAAc,EACnB,CAAC,GAAG,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CACzD;gBACD,MAAM,EAAE,EAAE;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,KAAK,EAAE,eAAe;YACtB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,iBAAiB;IAClC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -31,13 +31,11 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
31
|
...constantPoolsAccounts,
|
32
32
|
];
|
33
33
|
const poolsAccounts = poolsAcountsUnfiltered.filter((poolAccount) => {
|
34
|
-
if (poolAccount.enabled
|
34
|
+
if (!poolAccount.enabled)
|
35
35
|
return false;
|
36
|
-
|
36
|
+
return !(poolAccount.tokenAMint.toString() ===
|
37
37
|
'11111111111111111111111111111111' ||
|
38
|
-
poolAccount.tokenBMint.toString() === '11111111111111111111111111111111')
|
39
|
-
return false;
|
40
|
-
return true;
|
38
|
+
poolAccount.tokenBMint.toString() === '11111111111111111111111111111111');
|
41
39
|
});
|
42
40
|
// Store all tokens, lpmint, lpVaults
|
43
41
|
const vaultsLpAddresses = new Set();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAC5C,2CAAyD;AACzD,iDAAsD;AACtD,+CAO4B;AAC5B,qCAAsD;AACtD,uCAAqE;AAGrE,qGAA6E;AAC7E,mHAA2F;AAE3F,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,yCAAyC;IACzC,MAAM,qBAAqB,GAAG,MAAM,IAAA,iCAAwB,EAC1D,MAAM,EACN,wBAAe,EACf,0BAAc,EACd,8BAAoB,CACrB,CAAC;IACF,MAAM,mBAAmB,GAAG,MAAM,IAAA,iCAAwB,EACxD,MAAM,EACN,wBAAe,EACf,0BAAc,EACd,4BAAkB,CACnB,CAAC;IAEF,MAAM,sBAAsB,GAAgB;QAC1C,GAAG,mBAAmB;QACtB,GAAG,qBAAqB;KACzB,CAAC;IAEF,MAAM,aAAa,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;QAClE,IAAI,WAAW,CAAC,OAAO
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAC5C,2CAAyD;AACzD,iDAAsD;AACtD,+CAO4B;AAC5B,qCAAsD;AACtD,uCAAqE;AAGrE,qGAA6E;AAC7E,mHAA2F;AAE3F,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,yCAAyC;IACzC,MAAM,qBAAqB,GAAG,MAAM,IAAA,i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require("bn.js"));
|
|
8
8
|
const web3_js_1 = require("@solana/web3.js");
|
9
9
|
const misc_1 = require("../structs/misc");
|
10
10
|
const marketHeader_1 = require("../structs/marketHeader");
|
11
|
+
const toBN_1 = require("../../../utils/misc/toBN");
|
11
12
|
function getNodeIndices(data, keyDeserializer, valueDeserializer) {
|
12
13
|
const indexMap = new Map();
|
13
14
|
const treeNodes = deserializeRedBlackTreeNodes(data, keyDeserializer, valueDeserializer);
|
@@ -22,17 +23,11 @@ function getNodeIndices(data, keyDeserializer, valueDeserializer) {
|
|
22
23
|
return indexMap;
|
23
24
|
}
|
24
25
|
function getUiOrderSequenceNumber(orderId) {
|
25
|
-
const twosComplement = toBN(orderId.orderSequenceNumber).fromTwos(64);
|
26
|
+
const twosComplement = (0, toBN_1.toBN)(orderId.orderSequenceNumber).fromTwos(64);
|
26
27
|
return twosComplement.isNeg()
|
27
28
|
? twosComplement.neg().sub(new bn_js_1.default(1))
|
28
29
|
: twosComplement;
|
29
30
|
}
|
30
|
-
function toBN(n) {
|
31
|
-
if (typeof n === 'number') {
|
32
|
-
return new bn_js_1.default(n);
|
33
|
-
}
|
34
|
-
return new bn_js_1.default(n.toString());
|
35
|
-
}
|
36
31
|
function sign(n) {
|
37
32
|
if (n.lt(new bn_js_1.default(0))) {
|
38
33
|
return -1;
|
@@ -87,8 +82,7 @@ function deserializeRedBlackTreeNodes(data, keyDeserializer, valueDeserializer)
|
|
87
82
|
// If there's an infinite loop here, that means that the state is corrupted
|
88
83
|
while (freeListHead < bumpIndex) {
|
89
84
|
// We need to subtract 1 because the node allocator is 1-indexed
|
90
|
-
|
91
|
-
[indexToRemove, freeListHead] = next;
|
85
|
+
[indexToRemove, freeListHead] = freeListPointers[freeListHead - 1];
|
92
86
|
freeNodes.add(indexToRemove);
|
93
87
|
counter += 1;
|
94
88
|
if (counter > bumpIndex) {
|
@@ -156,7 +150,7 @@ function deserializeMarketData(data) {
|
|
156
150
|
const asksUnsorted = deserializeRedBlackTree(askBuffer, misc_1.orderIdBeet, misc_1.restingOrderBeet);
|
157
151
|
// Sort bids in descending order of price, and ascending order of sequence number
|
158
152
|
const bids = [...bidsUnsorted].sort((a, b) => {
|
159
|
-
const priceComparison = sign(toBN(b[0].priceInTicks).sub(toBN(a[0].priceInTicks)));
|
153
|
+
const priceComparison = sign((0, toBN_1.toBN)(b[0].priceInTicks).sub((0, toBN_1.toBN)(a[0].priceInTicks)));
|
160
154
|
if (priceComparison !== 0) {
|
161
155
|
return priceComparison;
|
162
156
|
}
|
@@ -164,7 +158,7 @@ function deserializeMarketData(data) {
|
|
164
158
|
});
|
165
159
|
// Sort asks in ascending order of price, and ascending order of sequence number
|
166
160
|
const asks = [...asksUnsorted].sort((a, b) => {
|
167
|
-
const priceComparison = sign(toBN(a[0].priceInTicks).sub(toBN(b[0].priceInTicks)));
|
161
|
+
const priceComparison = sign((0, toBN_1.toBN)(a[0].priceInTicks).sub((0, toBN_1.toBN)(b[0].priceInTicks)));
|
168
162
|
if (priceComparison !== 0) {
|
169
163
|
return priceComparison;
|
170
164
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deserializeMarketData.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/phoenix/helpers/deserializeMarketData.ts"],"names":[],"mappings":";;;;;;AACA,kDAAuB;
|
1
|
+
{"version":3,"file":"deserializeMarketData.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/phoenix/helpers/deserializeMarketData.ts"],"names":[],"mappings":";;;;;;AACA,kDAAuB;AACvB,6CAA4C;AAC5C,0CAOyB;AACzB,0DAGiC;AAEjC,mDAAgD;AAEhD,SAAS,cAAc,CACrB,IAAY,EACZ,eAAoC,EACpC,iBAAwC;IAExC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAC;IACxC,MAAM,SAAS,GAAG,4BAA4B,CAC5C,IAAI,EACJ,eAAe,EACf,iBAAiB,CAClB,CAAC;IAEF,MAAM,KAAK,GAAG,SAAS,CAAC,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AAG,sBAAe,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;IACtE,MAAM,MAAM,GAAG,iCAAkB,CAAC,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvE,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;IAEjE,OAAO,6BAA6B,CAClC,YAAY,EACZ,IAAI,mBAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAChC,sBAAe,CAChB,CAAC;AACJ,CAAC;AAtBD,wCAsBC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -70,10 +70,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
70
70
|
return [];
|
71
71
|
const tokenPrice = yield cache.getTokenPrice(constants_1.zexMint, networkId);
|
72
72
|
const asset = tokenPrice
|
73
|
-
? (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, networkId, tokenPrice)
|
73
|
+
? (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount, networkId, tokenPrice, undefined, { lockedUntil: 1719475200000 })
|
74
74
|
: {
|
75
75
|
type: 'generic',
|
76
76
|
data: {
|
77
|
+
address: constants_1.zexMint,
|
77
78
|
imageUri: 'https://statics.solscan.io/cdn/imgs/s60?ref=68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f7a6574616d61726b6574732f6272616e642f6d61737465722f6173736574732f7a6574612e706e67',
|
78
79
|
amount,
|
79
80
|
price: null,
|
@@ -81,7 +82,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
81
82
|
},
|
82
83
|
value: null,
|
83
84
|
networkId,
|
84
|
-
attributes: {},
|
85
|
+
attributes: { lockedUntil: 1719475200000 },
|
85
86
|
};
|
86
87
|
return [
|
87
88
|
{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuE;AACvE,mEAA+C;AAG/C,2CAA8D;AAE9D,qGAA6E;AAE7E,MAAM,KAAK,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;CAchB,CAAC;AAEF,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAO,EACvB,sBAAU,EACV,KAAK,EACL;QACE,SAAS,EAAE,KAAK;KACjB,EACD;QACE,MAAM,EAAE,4BAA4B;QACpC,QAAQ,EAAE,6BAA6B;QACvC,WAAW,EAAE,gCAAgC;KAC9C,CACF,CA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,aAAa,CAAC,mBAAO,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,KAAK,GAAmB,UAAU;QACtC,CAAC,CAAC,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,OAAO,EAAE,mBAAO;gBAChB,QAAQ,EACN,kMAAkM;gBACpM,MAAM;gBACN,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,KAAK;aACZ;YACD,KAAK,EAAE,IAAI;YACX,SAAS;YACT,UAAU,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;SAC3C,CAAC;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"arrayToMap.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/arrayToMap.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CACxB,KAAU,EACV,QAAiB,EACD,EAAE;IAClB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAW,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"arrayToMap.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/arrayToMap.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CACxB,KAAU,EACV,QAAiB,EACD,EAAE;IAClB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAW,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.toBN = void 0;
|
7
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
9
|
+
const toBN = (n) => {
|
10
|
+
if (typeof n === 'number') {
|
11
|
+
return new bn_js_1.default(n);
|
12
|
+
}
|
13
|
+
if (n instanceof bn_js_1.default) {
|
14
|
+
return n;
|
15
|
+
}
|
16
|
+
if (n instanceof bignumber_js_1.default) {
|
17
|
+
return new bn_js_1.default(n.toFixed(0)); // Convert BigNumber to a string without decimals
|
18
|
+
}
|
19
|
+
throw new Error('Unsupported type for conversion to BN');
|
20
|
+
};
|
21
|
+
exports.toBN = toBN;
|
22
|
+
//# sourceMappingURL=toBN.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"toBN.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/toBN.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AACvB,gEAAqC;AAE9B,MAAM,IAAI,GAAG,CAAC,CAA0B,EAAM,EAAE;IACrD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,YAAY,eAAE,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,YAAY,sBAAS,EAAE,CAAC;QAC3B,OAAO,IAAI,eAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iDAAiD;IAChF,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAXW,QAAA,IAAI,QAWf"}
|