@sonarwatch/portfolio-plugins 0.12.156 → 0.12.158
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1426 -1418
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/kamino/constants.d.ts +1 -0
- package/src/plugins/kamino/constants.js +2 -1
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +20 -5
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/kamino/marketsJob.js +7 -0
- package/src/plugins/kamino/marketsJob.js.map +1 -1
- package/src/plugins/meteora/dlmmPositionsFetcher.js +4 -5
- package/src/plugins/meteora/dlmmPositionsFetcher.js.map +1 -1
- package/src/plugins/raydium/getRaydiumCLMMPositions.js +66 -19
- package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
- package/src/plugins/raydium/helpers.d.ts +4 -0
- package/src/plugins/raydium/helpers.js +142 -1
- package/src/plugins/raydium/helpers.js.map +1 -1
- package/src/plugins/raydium/structs/clmms.d.ts +23 -2
- package/src/plugins/raydium/structs/clmms.js +21 -2
- package/src/plugins/raydium/structs/clmms.js.map +1 -1
- package/src/plugins/raydium/types.d.ts +125 -0
- package/src/plugins/raydium/types.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/tradeport/constants.d.ts +5 -0
- package/src/plugins/tradeport/constants.js +15 -0
- package/src/plugins/tradeport/constants.js.map +1 -0
- package/src/plugins/tradeport/helpers.d.ts +2 -0
- package/src/plugins/tradeport/helpers.js +24 -0
- package/src/plugins/tradeport/helpers.js.map +1 -0
- package/src/plugins/tradeport/index.d.ts +6 -0
- package/src/plugins/tradeport/index.js +13 -0
- package/src/plugins/tradeport/index.js.map +1 -0
- package/src/plugins/tradeport/locksJob.d.ts +3 -0
- package/src/plugins/tradeport/locksJob.js +32 -0
- package/src/plugins/tradeport/locksJob.js.map +1 -0
- package/src/plugins/tradeport/positionsFetcher.d.ts +3 -0
- package/src/plugins/tradeport/positionsFetcher.js +76 -0
- package/src/plugins/tradeport/positionsFetcher.js.map +1 -0
- package/src/plugins/tradeport/types.d.ts +28 -0
- package/src/plugins/tradeport/types.js +3 -0
- package/src/plugins/tradeport/types.js.map +1 -0
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/misc/toBN.d.ts +1 -1
- package/src/utils/misc/toBN.js +4 -1
- package/src/utils/misc/toBN.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getPendingAssetToken = exports.getFarmYield = exports.getStakePubKey = exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
|
6
|
+
exports.getRewardBalance = exports.getTickArrayAddress = exports.getPendingAssetToken = exports.getFarmYield = exports.getStakePubKey = exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
|
7
7
|
/* eslint-disable eqeqeq */
|
8
8
|
/* eslint-disable @typescript-eslint/naming-convention */
|
9
9
|
/* eslint-disable no-underscore-dangle */
|
@@ -15,6 +15,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
15
15
|
const web3_js_1 = require("@solana/web3.js");
|
16
16
|
const constants_1 = require("./constants");
|
17
17
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
18
|
+
const toBN_1 = require("../../utils/misc/toBN");
|
18
19
|
function isARaydiumPosition(nft) {
|
19
20
|
return nft.name === constants_1.positionsIdentifier;
|
20
21
|
}
|
@@ -119,6 +120,9 @@ function mulDivFloor(a, b, denominator) {
|
|
119
120
|
}
|
120
121
|
return a.mul(b).div(denominator);
|
121
122
|
}
|
123
|
+
function wrappingSubU128(n0, n1) {
|
124
|
+
return n0.add(Q128).sub(n1).mod(Q128);
|
125
|
+
}
|
122
126
|
function mulDivCeil(a, b, denominator) {
|
123
127
|
if (denominator.eq(ZERO)) {
|
124
128
|
throw new Error('division by 0');
|
@@ -201,4 +205,141 @@ function getPendingAssetToken(depositBalance, rewardDebt, perShare, rewardToken,
|
|
201
205
|
return (0, tokenPriceToAssetToken_1.default)(rewardToken.address, amount, portfolio_core_1.NetworkId.solana, rewardToken);
|
202
206
|
}
|
203
207
|
exports.getPendingAssetToken = getPendingAssetToken;
|
208
|
+
function getRewardGrowthInsideV2(tickCurrentIndex, tickLowerState, tickUpperState, rewardInfos) {
|
209
|
+
const rewardGrowthsInside = [];
|
210
|
+
for (let i = 0; i < rewardInfos.length; i++) {
|
211
|
+
let rewardGrowthsBelow = new bn_js_1.default(0);
|
212
|
+
if (tickLowerState.liquidityGross.eqn(0)) {
|
213
|
+
rewardGrowthsBelow = rewardInfos[i].rewardGrowthGlobalX64;
|
214
|
+
}
|
215
|
+
else if (tickCurrentIndex < tickLowerState.tick) {
|
216
|
+
rewardGrowthsBelow = rewardInfos[i].rewardGrowthGlobalX64.sub(tickLowerState.rewardGrowthsOutsideX64[i]);
|
217
|
+
}
|
218
|
+
else {
|
219
|
+
rewardGrowthsBelow = tickLowerState.rewardGrowthsOutsideX64[i];
|
220
|
+
}
|
221
|
+
let rewardGrowthsAbove = new bn_js_1.default(0);
|
222
|
+
if (tickUpperState.liquidityGross.eqn(0)) {
|
223
|
+
//
|
224
|
+
}
|
225
|
+
else if (tickCurrentIndex < tickUpperState.tick) {
|
226
|
+
rewardGrowthsAbove = tickUpperState.rewardGrowthsOutsideX64[i];
|
227
|
+
}
|
228
|
+
else {
|
229
|
+
rewardGrowthsAbove = rewardInfos[i].rewardGrowthGlobalX64.sub(tickUpperState.rewardGrowthsOutsideX64[i]);
|
230
|
+
}
|
231
|
+
rewardGrowthsInside.push(wrappingSubU128(wrappingSubU128(rewardInfos[i].rewardGrowthGlobalX64, rewardGrowthsBelow), rewardGrowthsAbove));
|
232
|
+
}
|
233
|
+
return rewardGrowthsInside;
|
234
|
+
}
|
235
|
+
const GetPositionRewardsV2 = (ammPool, positionState, tickLowerState, tickUpperState) => {
|
236
|
+
const rewards = [];
|
237
|
+
const rewardGrowthsInside = getRewardGrowthInsideV2(ammPool.tickCurrent, tickLowerState, tickUpperState, ammPool.rewardInfos);
|
238
|
+
for (let i = 0; i < rewardGrowthsInside.length; i++) {
|
239
|
+
const rewardGrowthInside = rewardGrowthsInside[i];
|
240
|
+
const currRewardInfo = positionState.rewardInfos[i];
|
241
|
+
const rewardGrowthDelta = wrappingSubU128(rewardGrowthInside, currRewardInfo.growthInsideLastX64);
|
242
|
+
const amountOwedDelta = mulDivFloor(rewardGrowthDelta, positionState.liquidity, Q64);
|
243
|
+
const rewardAmountOwed = currRewardInfo.rewardAmountOwed.add(amountOwedDelta);
|
244
|
+
rewards.push(rewardAmountOwed);
|
245
|
+
}
|
246
|
+
return rewards;
|
247
|
+
};
|
248
|
+
const getTickArrayAddress = (programId, poolId, tickNumber, tickSpacing) => getTickArrayAddressByTick(new web3_js_1.PublicKey(programId), new web3_js_1.PublicKey(poolId), tickNumber, tickSpacing);
|
249
|
+
exports.getTickArrayAddress = getTickArrayAddress;
|
250
|
+
const TICK_ARRAY_SIZE = 60;
|
251
|
+
function tickCount(tickSpacing) {
|
252
|
+
return TICK_ARRAY_SIZE * tickSpacing;
|
253
|
+
}
|
254
|
+
function getTickArrayBitIndex(tickIndex, tickSpacing) {
|
255
|
+
const ticksInArray = tickCount(tickSpacing);
|
256
|
+
let startIndex = tickIndex / ticksInArray;
|
257
|
+
if (tickIndex < 0 && tickIndex % ticksInArray != 0) {
|
258
|
+
startIndex = Math.ceil(startIndex) - 1;
|
259
|
+
}
|
260
|
+
else {
|
261
|
+
startIndex = Math.floor(startIndex);
|
262
|
+
}
|
263
|
+
return startIndex;
|
264
|
+
}
|
265
|
+
function getTickArrayStartIndexByTick(tickIndex, tickSpacing) {
|
266
|
+
return getTickArrayBitIndex(tickIndex, tickSpacing) * tickCount(tickSpacing);
|
267
|
+
}
|
268
|
+
const TICK_ARRAY_SEED = Buffer.from('tick_array', 'utf8');
|
269
|
+
function getPdaTickArrayAddress(programId, poolId, startIndex) {
|
270
|
+
return findProgramAddress([TICK_ARRAY_SEED, poolId.toBuffer(), i32ToBytes(startIndex)], programId);
|
271
|
+
}
|
272
|
+
function getTickArrayAddressByTick(programId, poolId, tickIndex, tickSpacing) {
|
273
|
+
const startIndex = getTickArrayStartIndexByTick(tickIndex, tickSpacing);
|
274
|
+
const { publicKey: tickArrayAddress } = getPdaTickArrayAddress(programId, poolId, startIndex);
|
275
|
+
return tickArrayAddress;
|
276
|
+
}
|
277
|
+
function i32ToBytes(num) {
|
278
|
+
const arr = new ArrayBuffer(4);
|
279
|
+
const view = new DataView(arr);
|
280
|
+
view.setInt32(0, num, false);
|
281
|
+
return new Uint8Array(arr);
|
282
|
+
}
|
283
|
+
function findProgramAddress(seeds, programId) {
|
284
|
+
const [publicKey, nonce] = web3_js_1.PublicKey.findProgramAddressSync(seeds, programId);
|
285
|
+
return { publicKey, nonce };
|
286
|
+
}
|
287
|
+
function getTickOffsetInArray(tickIndex, tickSpacing) {
|
288
|
+
if (tickIndex % tickSpacing != 0) {
|
289
|
+
throw new Error('tickIndex % tickSpacing not equal 0');
|
290
|
+
}
|
291
|
+
const startTickIndex = getTickArrayStartIndexByTick(tickIndex, tickSpacing);
|
292
|
+
const offsetInArray = Math.floor((tickIndex - startTickIndex) / tickSpacing);
|
293
|
+
if (offsetInArray < 0 || offsetInArray >= TICK_ARRAY_SIZE) {
|
294
|
+
throw new Error('tick offset in array overflow');
|
295
|
+
}
|
296
|
+
return offsetInArray;
|
297
|
+
}
|
298
|
+
const getRewardBalance = (personalPositionInfo, poolStateInfo, tickArrays) => {
|
299
|
+
const [tickArrayLower, tickArrayUpper] = tickArrays;
|
300
|
+
if (!tickArrayLower || !tickArrayUpper)
|
301
|
+
return [];
|
302
|
+
const tickLowerState = tickArrayLower &&
|
303
|
+
tickArrayLower.ticks[getTickOffsetInArray(personalPositionInfo.tickLowerIndex, poolStateInfo.tickSpacing)];
|
304
|
+
const tickUpperState = tickArrayUpper &&
|
305
|
+
tickArrayUpper.ticks[getTickOffsetInArray(personalPositionInfo.tickUpperIndex, poolStateInfo.tickSpacing)];
|
306
|
+
if (!tickLowerState || !tickUpperState)
|
307
|
+
return [];
|
308
|
+
return GetPositionRewardsV2({
|
309
|
+
tickCurrent: poolStateInfo.tickCurrent,
|
310
|
+
feeGrowthGlobalX64B: (0, toBN_1.toBN)(poolStateInfo.feeGrowthGlobal0X64),
|
311
|
+
rewardInfos: poolStateInfo.rewardInfos.map((ri) => ({
|
312
|
+
rewardGrowthGlobalX64: (0, toBN_1.toBN)(ri.rewardGrowthGlobalX64),
|
313
|
+
})),
|
314
|
+
}, {
|
315
|
+
liquidity: (0, toBN_1.toBN)(personalPositionInfo.liquidity),
|
316
|
+
rewardInfos: personalPositionInfo.rewardInfos.map((ri) => ({
|
317
|
+
growthInsideLastX64: (0, toBN_1.toBN)(ri.growthInsideLastX64),
|
318
|
+
rewardAmountOwed: (0, toBN_1.toBN)(ri.rewardAmountOwed),
|
319
|
+
})),
|
320
|
+
}, {
|
321
|
+
tick: tickLowerState.tick,
|
322
|
+
liquidityNet: (0, toBN_1.toBN)(tickLowerState.liquidityNet),
|
323
|
+
liquidityGross: (0, toBN_1.toBN)(tickLowerState.liquidityGross),
|
324
|
+
feeGrowthOutsideX64A: (0, toBN_1.toBN)(tickLowerState.feeGrowthOutsideX64A),
|
325
|
+
feeGrowthOutsideX64B: (0, toBN_1.toBN)(tickLowerState.feeGrowthOutsideX64B),
|
326
|
+
rewardGrowthsOutsideX64: [
|
327
|
+
(0, toBN_1.toBN)(tickLowerState.rewardGrowthsOutsideX640),
|
328
|
+
(0, toBN_1.toBN)(tickLowerState.rewardGrowthsOutsideX641),
|
329
|
+
(0, toBN_1.toBN)(tickLowerState.rewardGrowthsOutsideX642),
|
330
|
+
],
|
331
|
+
}, {
|
332
|
+
tick: tickUpperState.tick,
|
333
|
+
liquidityNet: (0, toBN_1.toBN)(tickUpperState.liquidityNet),
|
334
|
+
liquidityGross: (0, toBN_1.toBN)(tickUpperState.liquidityGross),
|
335
|
+
feeGrowthOutsideX64A: (0, toBN_1.toBN)(tickUpperState.feeGrowthOutsideX64A),
|
336
|
+
feeGrowthOutsideX64B: (0, toBN_1.toBN)(tickUpperState.feeGrowthOutsideX64B),
|
337
|
+
rewardGrowthsOutsideX64: [
|
338
|
+
(0, toBN_1.toBN)(tickUpperState.rewardGrowthsOutsideX640),
|
339
|
+
(0, toBN_1.toBN)(tickUpperState.rewardGrowthsOutsideX641),
|
340
|
+
(0, toBN_1.toBN)(tickUpperState.rewardGrowthsOutsideX642),
|
341
|
+
],
|
342
|
+
}).map((bn) => new bignumber_js_1.default(bn.toString(10)));
|
343
|
+
};
|
344
|
+
exports.getRewardBalance = getRewardBalance;
|
204
345
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA2B;AAC3B,yDAAyD;AACzD,yCAAyC;AACzC,sCAAsC;AACtC,+BAA+B;AAC/B,gEAAqC;AACrC,kDAAuB;AACvB,+DAOoC;AACpC,6CAA4C;AAC5C,2CAAqE;AACrE,qGAA6E;AAE7E,SAAgB,kBAAkB,CAAC,GAA8B;IAC/D,OAAO,GAAG,CAAC,IAAI,KAAK,+BAAmB,CAAC;AAC1C,CAAC;AAFD,gDAEC;AAED,MAAM,IAAI,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,C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,EAAE,EAAE,CAAC,IAAI,sBAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC;AApEW,QAAA,gBAAgB,oBAoE3B"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { BeetStruct } from '@metaplex-foundation/beet';
|
2
|
+
import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
|
3
3
|
import BigNumber from 'bignumber.js';
|
4
4
|
import { PublicKey } from '@solana/web3.js';
|
5
5
|
export type PositionRewardInfo = {
|
@@ -24,7 +24,7 @@ export type PersonalPositionState = {
|
|
24
24
|
};
|
25
25
|
export declare const personalPositionStateStruct: BeetStruct<PersonalPositionState, Partial<PersonalPositionState>>;
|
26
26
|
export type RewardInfo = {
|
27
|
-
rewardState:
|
27
|
+
rewardState: number;
|
28
28
|
openTime: BigNumber;
|
29
29
|
endTime: BigNumber;
|
30
30
|
lastUpdateTime: BigNumber;
|
@@ -78,3 +78,24 @@ export type PoolState = {
|
|
78
78
|
padding2: BigNumber[];
|
79
79
|
};
|
80
80
|
export declare const poolStateStruct: BeetStruct<PoolState, Partial<PoolState>>;
|
81
|
+
export type TickState = {
|
82
|
+
tick: number;
|
83
|
+
liquidityNet: BigNumber;
|
84
|
+
liquidityGross: BigNumber;
|
85
|
+
feeGrowthOutsideX64A: BigNumber;
|
86
|
+
feeGrowthOutsideX64B: BigNumber;
|
87
|
+
rewardGrowthsOutsideX640: BigNumber;
|
88
|
+
rewardGrowthsOutsideX641: BigNumber;
|
89
|
+
rewardGrowthsOutsideX642: BigNumber;
|
90
|
+
padding: number[];
|
91
|
+
};
|
92
|
+
export declare const tickStatetruct: BeetStruct<TickState, Partial<TickState>>;
|
93
|
+
export type TickArrayState = {
|
94
|
+
buffer: Buffer;
|
95
|
+
poolId: PublicKey;
|
96
|
+
startTickIndex: number;
|
97
|
+
ticks: TickState[];
|
98
|
+
initializedTickCount: number;
|
99
|
+
padding: number[];
|
100
|
+
};
|
101
|
+
export declare const tickArrayStatetruct: FixableBeetStruct<TickArrayState, Partial<TickArrayState>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.poolStateStruct = exports.rewardInfoStruct = exports.personalPositionStateStruct = exports.positionRewardInfoStruct = void 0;
|
3
|
+
exports.tickArrayStatetruct = exports.tickStatetruct = exports.poolStateStruct = exports.rewardInfoStruct = exports.personalPositionStateStruct = exports.positionRewardInfoStruct = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../../utils/solana");
|
@@ -24,7 +24,7 @@ exports.personalPositionStateStruct = new beet_1.BeetStruct([
|
|
24
24
|
['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 8)],
|
25
25
|
], (args) => args);
|
26
26
|
exports.rewardInfoStruct = new beet_1.BeetStruct([
|
27
|
-
['rewardState',
|
27
|
+
['rewardState', beet_1.u8],
|
28
28
|
['openTime', solana_1.u64],
|
29
29
|
['endTime', solana_1.u64],
|
30
30
|
['lastUpdateTime', solana_1.u64],
|
@@ -76,4 +76,23 @@ exports.poolStateStruct = new beet_1.BeetStruct([
|
|
76
76
|
['padding1', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 26)],
|
77
77
|
['padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 32)],
|
78
78
|
], (args) => args);
|
79
|
+
exports.tickStatetruct = new beet_1.BeetStruct([
|
80
|
+
['tick', beet_1.i32],
|
81
|
+
['liquidityNet', solana_1.i128],
|
82
|
+
['liquidityGross', solana_1.u128],
|
83
|
+
['feeGrowthOutsideX64A', solana_1.u128],
|
84
|
+
['feeGrowthOutsideX64B', solana_1.u128],
|
85
|
+
['rewardGrowthsOutsideX640', solana_1.u128],
|
86
|
+
['rewardGrowthsOutsideX641', solana_1.u128],
|
87
|
+
['rewardGrowthsOutsideX642', solana_1.u128],
|
88
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u32, 13)],
|
89
|
+
], (args) => args);
|
90
|
+
exports.tickArrayStatetruct = new beet_1.FixableBeetStruct([
|
91
|
+
['buffer', (0, solana_1.blob)(8)],
|
92
|
+
['poolId', beet_solana_1.publicKey],
|
93
|
+
['startTickIndex', beet_1.i32],
|
94
|
+
['ticks', (0, beet_1.uniformFixedSizeArray)(exports.tickStatetruct, 60)],
|
95
|
+
['initializedTickCount', beet_1.u8],
|
96
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 115)],
|
97
|
+
], (args) => args);
|
79
98
|
//# sourceMappingURL=clmms.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmms.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/clmms.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"clmms.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/clmms.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA8D;AAOjD,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,qBAAqB,EAAE,aAAI,CAAC;IAC7B,CAAC,kBAAkB,EAAE,YAAG,CAAC;CAC1B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;AAkBW,QAAA,2BAA2B,GACtC,IAAI,iBAAU,CACZ;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,UAAG,CAAC;I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Struct } from '@metaplex-foundation/beet';
|
3
3
|
import { TokenPrice, Yield } from '@sonarwatch/portfolio-core';
|
4
4
|
import BigNumber from 'bignumber.js';
|
5
|
+
import BN from 'bn.js';
|
6
|
+
import Decimal from 'decimal.js';
|
5
7
|
import { AmmInfoV4, AmmInfoV5 } from './structs/amms';
|
6
8
|
import { FarmAccount, FarmAccountV6, UserFarmAccountV3, UserFarmAccountV31, UserFarmAccountV4, UserFarmAccountV5 } from './structs/farms';
|
7
9
|
import { ParsedAccount } from '../../utils/solana';
|
@@ -53,3 +55,126 @@ export type FarmInfoV6 = {
|
|
53
55
|
rewardTokens: (TokenPrice | undefined)[];
|
54
56
|
yields?: Yield[];
|
55
57
|
};
|
58
|
+
export interface ClmmPoolRewardInfo {
|
59
|
+
rewardState: number;
|
60
|
+
openTime: BN;
|
61
|
+
endTime: BN;
|
62
|
+
lastUpdateTime: BN;
|
63
|
+
emissionsPerSecondX64: BN;
|
64
|
+
rewardTotalEmissioned: BN;
|
65
|
+
rewardClaimed: BN;
|
66
|
+
tokenMint: PublicKey;
|
67
|
+
tokenVault: PublicKey;
|
68
|
+
creator: PublicKey;
|
69
|
+
rewardGrowthGlobalX64: BN;
|
70
|
+
perSecond: Decimal;
|
71
|
+
remainingRewards: undefined | BN;
|
72
|
+
tokenProgramId: PublicKey;
|
73
|
+
}
|
74
|
+
export interface ClmmPoolInfo {
|
75
|
+
id: PublicKey;
|
76
|
+
mintA: {
|
77
|
+
programId: PublicKey;
|
78
|
+
mint: PublicKey;
|
79
|
+
vault: PublicKey;
|
80
|
+
decimals: number;
|
81
|
+
};
|
82
|
+
mintB: {
|
83
|
+
programId: PublicKey;
|
84
|
+
mint: PublicKey;
|
85
|
+
vault: PublicKey;
|
86
|
+
decimals: number;
|
87
|
+
};
|
88
|
+
ammConfig: ClmmConfigInfo;
|
89
|
+
observationId: PublicKey;
|
90
|
+
creator: PublicKey;
|
91
|
+
programId: PublicKey;
|
92
|
+
version: 6;
|
93
|
+
tickSpacing: number;
|
94
|
+
liquidity: BN;
|
95
|
+
sqrtPriceX64: BN;
|
96
|
+
currentPrice: Decimal;
|
97
|
+
tickCurrent: number;
|
98
|
+
feeGrowthGlobalX64A: BN;
|
99
|
+
feeGrowthGlobalX64B: BN;
|
100
|
+
protocolFeesTokenA: BN;
|
101
|
+
protocolFeesTokenB: BN;
|
102
|
+
swapInAmountTokenA: BN;
|
103
|
+
swapOutAmountTokenB: BN;
|
104
|
+
swapInAmountTokenB: BN;
|
105
|
+
swapOutAmountTokenA: BN;
|
106
|
+
tickArrayBitmap: BN[];
|
107
|
+
rewardInfos: ClmmPoolRewardInfo[];
|
108
|
+
day: {
|
109
|
+
volume: number;
|
110
|
+
volumeFee: number;
|
111
|
+
feeA: number;
|
112
|
+
feeB: number;
|
113
|
+
feeApr: number;
|
114
|
+
rewardApr: {
|
115
|
+
A: number;
|
116
|
+
B: number;
|
117
|
+
C: number;
|
118
|
+
};
|
119
|
+
apr: number;
|
120
|
+
priceMin: number;
|
121
|
+
priceMax: number;
|
122
|
+
};
|
123
|
+
week: {
|
124
|
+
volume: number;
|
125
|
+
volumeFee: number;
|
126
|
+
feeA: number;
|
127
|
+
feeB: number;
|
128
|
+
feeApr: number;
|
129
|
+
rewardApr: {
|
130
|
+
A: number;
|
131
|
+
B: number;
|
132
|
+
C: number;
|
133
|
+
};
|
134
|
+
apr: number;
|
135
|
+
priceMin: number;
|
136
|
+
priceMax: number;
|
137
|
+
};
|
138
|
+
month: {
|
139
|
+
volume: number;
|
140
|
+
volumeFee: number;
|
141
|
+
feeA: number;
|
142
|
+
feeB: number;
|
143
|
+
feeApr: number;
|
144
|
+
rewardApr: {
|
145
|
+
A: number;
|
146
|
+
B: number;
|
147
|
+
C: number;
|
148
|
+
};
|
149
|
+
apr: number;
|
150
|
+
priceMin: number;
|
151
|
+
priceMax: number;
|
152
|
+
};
|
153
|
+
tvl: number;
|
154
|
+
lookupTableAccount: PublicKey;
|
155
|
+
startTime: number;
|
156
|
+
exBitmapInfo: TickArrayBitmapExtensionType;
|
157
|
+
}
|
158
|
+
export interface ClmmConfigInfo {
|
159
|
+
id: PublicKey;
|
160
|
+
index: number;
|
161
|
+
protocolFeeRate: number;
|
162
|
+
tradeFeeRate: number;
|
163
|
+
tickSpacing: number;
|
164
|
+
fundFeeRate: number;
|
165
|
+
fundOwner: string;
|
166
|
+
description: string;
|
167
|
+
}
|
168
|
+
export interface TickArrayBitmapExtensionType {
|
169
|
+
poolId: PublicKey;
|
170
|
+
positiveTickArrayBitmap: BN[][];
|
171
|
+
negativeTickArrayBitmap: BN[][];
|
172
|
+
}
|
173
|
+
export type Tick = {
|
174
|
+
tick: number;
|
175
|
+
liquidityNet: BN;
|
176
|
+
liquidityGross: BN;
|
177
|
+
feeGrowthOutsideX64A: BN;
|
178
|
+
feeGrowthOutsideX64B: BN;
|
179
|
+
rewardGrowthsOutsideX64: BN[];
|
180
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/types.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/types.ts"],"names":[],"mappings":";;;AAiBA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,+EAAa,CAAA;IACb,2EAAW,CAAA;IACX,qEAAQ,CAAA;IACR,2FAAmB,CAAA;IACnB,+EAAa,CAAA;IACb,uEAAS,CAAA;IACT,6DAAI,CAAA;IACJ,mFAAe,CAAA;AACjB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B"}
|
@@ -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;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "tradeport";
|
3
|
+
export declare const platform: Platform;
|
4
|
+
export declare const locksCacheKey = "locks";
|
5
|
+
export declare const lockStore = "0x4b705de46a79b29276baf45009bc7d6f70cc0f1407f0c9e03cac5729c0c47946";
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.lockStore = exports.locksCacheKey = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'tradeport';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'Tradeport',
|
8
|
+
image: 'https://sonar.watch/img/platforms/tradeport.webp',
|
9
|
+
website: 'https://www.tradeport.xyz/',
|
10
|
+
twitter: 'https://x.com/tradeportxyz',
|
11
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.locksCacheKey = `locks`;
|
14
|
+
exports.lockStore = '0x4b705de46a79b29276baf45009bc7d6f70cc0f1407f0c9e03cac5729c0c47946';
|
15
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,4BAA4B;IACrC,qEAAqE;CACtE,CAAC;AACW,QAAA,aAAa,GAAG,OAAO,CAAC;AAExB,QAAA,SAAS,GACpB,oEAAoE,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getTypeLabel = exports.getStatusLabel = void 0;
|
4
|
+
const getStatusLabel = (status) => {
|
5
|
+
if (status === '0') {
|
6
|
+
return 'Not Taken';
|
7
|
+
}
|
8
|
+
if (status === '1') {
|
9
|
+
return 'Active';
|
10
|
+
}
|
11
|
+
return null;
|
12
|
+
};
|
13
|
+
exports.getStatusLabel = getStatusLabel;
|
14
|
+
const getTypeLabel = (type) => {
|
15
|
+
if (type === '0') {
|
16
|
+
return 'Short';
|
17
|
+
}
|
18
|
+
if (type === '1') {
|
19
|
+
return 'Long';
|
20
|
+
}
|
21
|
+
return null;
|
22
|
+
};
|
23
|
+
exports.getTypeLabel = getTypeLabel;
|
24
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/helpers.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/C,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IAC3C,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
@@ -0,0 +1,13 @@
|
|
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.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const positionsFetcher_1 = __importDefault(require("./positionsFetcher"));
|
9
|
+
const locksJob_1 = __importDefault(require("./locksJob"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [locksJob_1.default];
|
12
|
+
exports.fetchers = [positionsFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0EAAkD;AAClD,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,0BAAgB,CAAC,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
|
16
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
+
const client = (0, clients_1.getClientSui)();
|
18
|
+
const locks = yield (0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, constants_1.lockStore, {
|
19
|
+
showContent: true,
|
20
|
+
});
|
21
|
+
yield cache.setItem(constants_1.locksCacheKey, locks.map((l) => { var _a; return (_a = l.data) === null || _a === void 0 ? void 0 : _a.content; }).filter((l) => l !== null), {
|
22
|
+
prefix: constants_1.platformId,
|
23
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
24
|
+
});
|
25
|
+
});
|
26
|
+
const job = {
|
27
|
+
id: `${constants_1.platformId}-locks`,
|
28
|
+
executor,
|
29
|
+
label: 'realtime',
|
30
|
+
};
|
31
|
+
exports.default = job;
|
32
|
+
//# sourceMappingURL=locksJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"locksJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tradeport/locksJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAmE;AACnE,iDAAmD;AACnD,mFAAgF;AAEhF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,MAAM,IAAA,+CAAsB,EAAO,MAAM,EAAE,qBAAS,EAAE;QAClE,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CACjB,yBAAa,EACb,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,OAAO,CAAA,EAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAC3D;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,UAAU;CAClB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|