@sonarwatch/portfolio-plugins 0.12.27 → 0.12.29
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1810 -1802
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bluefin/positionFetcher.js +5 -5
- package/src/plugins/bluefin/positionFetcher.js.map +1 -1
- package/src/plugins/bonfida/airdropFetcher.d.ts +3 -0
- package/src/plugins/bonfida/airdropFetcher.js +59 -0
- package/src/plugins/bonfida/airdropFetcher.js.map +1 -0
- package/src/plugins/bonfida/constants.d.ts +4 -0
- package/src/plugins/bonfida/constants.js +5 -1
- package/src/plugins/bonfida/constants.js.map +1 -1
- package/src/plugins/bonfida/filters.d.ts +2 -0
- package/src/plugins/bonfida/filters.js +15 -0
- package/src/plugins/bonfida/filters.js.map +1 -0
- package/src/plugins/bonfida/index.js +2 -1
- package/src/plugins/bonfida/index.js.map +1 -1
- package/src/plugins/bonfida/types.d.ts +6 -0
- package/src/plugins/bonfida/types.js +3 -0
- package/src/plugins/bonfida/types.js.map +1 -0
- package/src/plugins/flash/perpetualFetcher.js +8 -13
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flash/poolJob.js +1 -1
- package/src/plugins/flash/poolJob.js.map +1 -1
- package/src/plugins/flash/structs.d.ts +2 -2
- package/src/plugins/flash/structs.js +2 -2
- package/src/plugins/flash/structs.js.map +1 -1
- package/src/plugins/futarchy/constants.js +3 -0
- package/src/plugins/futarchy/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.js +2 -1
- package/src/plugins/jupiter/exchange/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/custodiesJob.js +11 -4
- package/src/plugins/jupiter/exchange/custodiesJob.js.map +1 -1
- package/src/plugins/jupiter/exchange/filters.js +1 -6
- package/src/plugins/jupiter/exchange/filters.js.map +1 -1
- package/src/plugins/jupiter/exchange/perpetualFetcher.js +54 -45
- package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/structs.d.ts +1 -0
- package/src/plugins/jupiter/exchange/structs.js +1 -0
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/types.d.ts +27 -2
- package/src/plugins/jupiter/types.js.map +1 -1
- package/src/plugins/kamino/constants.js +4 -0
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/meteora/dlmmPositionsFetcher.js +8 -9
- package/src/plugins/meteora/dlmmPositionsFetcher.js.map +1 -1
- package/src/plugins/parcl/marginFetcher.js +4 -2
- package/src/plugins/parcl/marginFetcher.js.map +1 -1
- package/src/plugins/pyth/stakingFetcher.js +4 -2
- package/src/plugins/pyth/stakingFetcher.js.map +1 -1
- package/src/plugins/raydium/clmmJob.js +114 -15
- package/src/plugins/raydium/clmmJob.js.map +1 -1
- package/src/plugins/raydium/cpmmJob.js +79 -65
- package/src/plugins/raydium/cpmmJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/whalesmarket/constants.d.ts +3 -0
- package/src/plugins/whalesmarket/constants.js +4 -1
- package/src/plugins/whalesmarket/constants.js.map +1 -1
- package/src/plugins/whalesmarket/depositFetcher.js +119 -26
- package/src/plugins/whalesmarket/depositFetcher.js.map +1 -1
- package/src/plugins/whalesmarket/filters.d.ts +20 -0
- package/src/plugins/whalesmarket/filters.js +25 -1
- package/src/plugins/whalesmarket/filters.js.map +1 -1
- package/src/plugins/whalesmarket/index.js +2 -1
- package/src/plugins/whalesmarket/index.js.map +1 -1
- package/src/plugins/whalesmarket/structs.d.ts +29 -0
- package/src/plugins/whalesmarket/structs.js +31 -1
- package/src/plugins/whalesmarket/structs.js.map +1 -1
- package/src/plugins/whalesmarket/tokensJob.d.ts +3 -0
- package/src/plugins/whalesmarket/tokensJob.js +47 -0
- package/src/plugins/whalesmarket/tokensJob.js.map +1 -0
- package/src/plugins/whalesmarket/types.d.ts +111 -0
- package/src/plugins/whalesmarket/types.js +48 -0
- package/src/plugins/whalesmarket/types.js.map +1 -0
- package/src/utils/misc/constants.d.ts +1 -0
- package/src/utils/misc/constants.js +2 -1
- package/src/utils/misc/constants.js.map +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +2 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/pyth/helpers.d.ts +2 -2
- package/src/utils/solana/pyth/helpers.js +13 -7
- package/src/utils/solana/pyth/helpers.js.map +1 -1
@@ -18,7 +18,6 @@ const web3_js_1 = require("@solana/web3.js");
|
|
18
18
|
const clients_1 = require("../../../utils/clients");
|
19
19
|
const solana_1 = require("../../../utils/solana");
|
20
20
|
const filters_1 = require("../filters");
|
21
|
-
const getMultipleAccountsInfoSafe_1 = require("../../../utils/solana/getMultipleAccountsInfoSafe");
|
22
21
|
const helpers_1 = require("../../../utils/solana/pyth/helpers");
|
23
22
|
const constants_1 = require("../../tokens/constants");
|
24
23
|
const constants_2 = require("./constants");
|
@@ -26,9 +25,9 @@ const structs_1 = require("./structs");
|
|
26
25
|
const usdFactor = new bignumber_js_1.default(Math.pow(10, 6));
|
27
26
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
27
|
const client = (0, clients_1.getClientSolana)();
|
29
|
-
const
|
30
|
-
if (
|
31
|
-
|
28
|
+
const positionAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.positionStruct, constants_2.perpsProgramId, (0, filters_1.perpetualsPositionsFilter)(owner));
|
29
|
+
if (positionAccounts.length === 0 ||
|
30
|
+
positionAccounts.every((perp) => perp.sizeUsd.isLessThanOrEqualTo(0)))
|
32
31
|
return [];
|
33
32
|
const custodiesAccounts = yield cache.getItem(constants_2.custodiesKey, {
|
34
33
|
prefix: constants_2.platformId,
|
@@ -36,20 +35,29 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
36
35
|
});
|
37
36
|
if (!custodiesAccounts)
|
38
37
|
return [];
|
38
|
+
const perpPoolsArr = yield cache.getItem(constants_2.perpPoolsKey, {
|
39
|
+
prefix: constants_2.platformId,
|
40
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
41
|
+
});
|
42
|
+
if (!perpPoolsArr)
|
43
|
+
return [];
|
44
|
+
const perpPools = new Map();
|
45
|
+
perpPoolsArr.forEach((a) => {
|
46
|
+
perpPools.set(a.pubkey.toString(), a);
|
47
|
+
});
|
39
48
|
const oraclesPubkeys = [];
|
40
49
|
const custodyById = new Map();
|
41
|
-
custodiesAccounts.forEach((
|
42
|
-
oraclesPubkeys.push(new web3_js_1.PublicKey(
|
43
|
-
custodyById.set(
|
50
|
+
custodiesAccounts.forEach((a) => {
|
51
|
+
oraclesPubkeys.push(new web3_js_1.PublicKey(a.oracle.oracleAccount));
|
52
|
+
custodyById.set(a.pubkey, a);
|
44
53
|
});
|
45
|
-
const
|
46
|
-
const pythPricesByAccount = (0, helpers_1.getPythPricesDatasMap)(oraclesPubkeys, oracleAccounts);
|
54
|
+
const pythPricesByAccount = yield (0, helpers_1.getPythPricesAsMap)(client, oraclesPubkeys);
|
47
55
|
const tokensDetailsById = new Map();
|
48
56
|
const tokensDetails = yield cache.getItems(custodiesAccounts.map((acc) => acc.mint), { prefix: constants_1.tokenListsDetailsPrefix, networkId: portfolio_core_1.NetworkId.solana });
|
49
57
|
tokensDetails.forEach((tD) => tD ? tokensDetailsById.set(tD.address, tD) : undefined);
|
50
58
|
const positions = [];
|
51
|
-
for (const position of
|
52
|
-
const { collateralUsd, sizeUsd, price, side } = position;
|
59
|
+
for (const position of positionAccounts) {
|
60
|
+
const { collateralUsd, sizeUsd, price, side, cumulativeInterestSnapshot, lockedAmount, } = position;
|
53
61
|
if (sizeUsd.isLessThanOrEqualTo(0))
|
54
62
|
continue;
|
55
63
|
if (side === structs_1.Side.None)
|
@@ -59,46 +67,45 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
59
67
|
const collateralCustody = custodyById.get(position.collateralCustody.toString());
|
60
68
|
if (!custody || !collateralCustody)
|
61
69
|
continue;
|
62
|
-
const
|
63
|
-
|
64
|
-
const collateralCustodyPriceData = pythPricesByAccount.get(collateralCustody.oracle.oracleAccount);
|
65
|
-
if (!custodyPriceData ||
|
66
|
-
!custodyPriceData.price ||
|
67
|
-
!collateralCustodyPriceData ||
|
68
|
-
!collateralCustodyPriceData.price)
|
70
|
+
const perpPool = perpPools.get(custody.pool);
|
71
|
+
if (!perpPool)
|
69
72
|
continue;
|
70
|
-
const
|
73
|
+
const entryPrice = price.dividedBy(usdFactor);
|
74
|
+
const currentPrice = pythPricesByAccount.get(custody.oracle.oracleAccount);
|
75
|
+
if (!currentPrice)
|
76
|
+
continue;
|
77
|
+
const size = lockedAmount.div(Math.pow(10, custody.decimals));
|
78
|
+
const sizeValue = sizeUsd.dividedBy(usdFactor);
|
71
79
|
const leverage = sizeUsd.dividedBy(collateralUsd);
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
const
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
// .dividedBy(10 ** 15)
|
85
|
-
// .absoluteValue();
|
86
|
-
// const openAndCloseFees = sizeUsd.times(0.001).times(2).dividedBy(usdFactor);
|
87
|
-
// const fees = borrowFee.plus(openAndCloseFees).negated().toNumber();
|
80
|
+
const collateralValue = collateralUsd.dividedBy(usdFactor);
|
81
|
+
const { increasePositionBps, decreasePositionBps } = perpPool.fees;
|
82
|
+
const increaseFees = new bignumber_js_1.default(increasePositionBps).div(10000);
|
83
|
+
const decreaseFees = new bignumber_js_1.default(decreasePositionBps).div(10000);
|
84
|
+
const openFees = entryPrice.times(size).times(increaseFees);
|
85
|
+
const closeFees = sizeValue.times(decreaseFees);
|
86
|
+
const openAndCloseFees = openFees.plus(closeFees);
|
87
|
+
const borrowFee = sizeUsd
|
88
|
+
.times(new bignumber_js_1.default(collateralCustody.fundingRateState.cumulativeInterestRate).minus(cumulativeInterestSnapshot))
|
89
|
+
.dividedBy(Math.pow(10, 15))
|
90
|
+
.absoluteValue();
|
91
|
+
const fees = borrowFee.plus(openAndCloseFees).toNumber();
|
88
92
|
const priceDelta = isLong
|
89
|
-
? currentPrice.minus(
|
90
|
-
:
|
91
|
-
const priceVar = priceDelta.dividedBy(
|
92
|
-
const
|
93
|
-
|
93
|
+
? new bignumber_js_1.default(currentPrice).minus(entryPrice)
|
94
|
+
: entryPrice.minus(currentPrice);
|
95
|
+
const priceVar = priceDelta.dividedBy(entryPrice);
|
96
|
+
const rawPnlValue = priceVar.times(collateralValue).times(leverage);
|
97
|
+
const netPnlValue = rawPnlValue.minus(fees);
|
98
|
+
const value = collateralValue.plus(netPnlValue);
|
94
99
|
positions.push({
|
95
|
-
collateralValue: collateralUsd.dividedBy(usdFactor).toNumber(),
|
96
|
-
liquidationPrice: null,
|
97
|
-
sizeValue: sizeUsd.toNumber(),
|
98
|
-
value: collateralUsd.dividedBy(usdFactor).plus(pnl).toNumber(),
|
99
|
-
side: isLong ? portfolio_core_1.LeverageSide.long : portfolio_core_1.LeverageSide.short,
|
100
100
|
address: custody.mint,
|
101
|
+
side: isLong ? portfolio_core_1.LeverageSide.long : portfolio_core_1.LeverageSide.short,
|
101
102
|
leverage: leverage.toNumber(),
|
103
|
+
liquidationPrice: null,
|
104
|
+
collateralValue: collateralValue.toNumber(),
|
105
|
+
size: size.toNumber(),
|
106
|
+
sizeValue: sizeValue.toNumber(),
|
107
|
+
pnlValue: rawPnlValue.toNumber(),
|
108
|
+
value: value.toNumber(),
|
102
109
|
});
|
103
110
|
}
|
104
111
|
if (positions.length === 0)
|
@@ -109,8 +116,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
109
116
|
type: portfolio_core_1.PortfolioElementType.leverage,
|
110
117
|
data: {
|
111
118
|
positions,
|
119
|
+
positionsValue: value,
|
112
120
|
value,
|
113
121
|
collateralAssets: [],
|
122
|
+
collateralValue: 0,
|
114
123
|
},
|
115
124
|
label: 'Leverage',
|
116
125
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,oDAAyD;AACzD,
|
1
|
+
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,oDAAyD;AACzD,kDAAgF;AAChF,wCAAuD;AAEvD,gEAAwE;AACxE,sDAAiE;AACjE,2CAKqB;AACrB,uCAAiD;AAEjD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;AACzC,MAAM,QAAQ,GAAoB,CAChC,KAAa,EACb,KAAY,EACyB,EAAE;IACvC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,gBAAgB,GAAG,MAAM,IAAA,iCAAwB,EACrD,MAAM,EACN,wBAAc,EACd,0BAAc,EACd,IAAA,mCAAyB,EAAC,KAAK,CAAC,CACjC,CAAC;IACF,IACE,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAC7B,gBAAgB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;QAErE,OAAO,EAAE,CAAC;IAEZ,MAAM,iBAAiB,GAAG,MAAM,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S,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK;SACN;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -19,6 +19,7 @@ exports.limitOrderStruct = new beet_1.BeetStruct([
|
|
19
19
|
['reserve', beet_solana_1.publicKey],
|
20
20
|
['uid', solana_1.u64],
|
21
21
|
['expiredAt', solana_1.i64],
|
22
|
+
['base', beet_solana_1.publicKey],
|
22
23
|
['referral', beet_solana_1.publicKey],
|
23
24
|
], (args) => args);
|
24
25
|
exports.dcaStruct = new beet_1.BeetStruct([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAA6D;
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,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IAAI;IACd,+BAAI,CAAA;IACJ,+BAAI,CAAA;IACJ,iCAAK,CAAA;AACP,CAAC,EAJW,IAAI,oBAAJ,IAAI,QAIf;AAoBY,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
export type CustodyInfo =
|
2
|
+
export type CustodyInfo = ParsedCustody & {
|
3
3
|
pubkey: string;
|
4
4
|
};
|
5
|
-
type
|
5
|
+
type ParsedCustody = {
|
6
6
|
buffer: Buffer;
|
7
7
|
pool: string;
|
8
8
|
mint: string;
|
@@ -18,6 +18,31 @@ type Custody = {
|
|
18
18
|
bump: number;
|
19
19
|
tokenAccountBump: number;
|
20
20
|
};
|
21
|
+
export type PerpetualPoolInfo = ParsedPerpetualPool & {
|
22
|
+
pubkey: string;
|
23
|
+
};
|
24
|
+
type ParsedPerpetualPool = {
|
25
|
+
buffer: Buffer;
|
26
|
+
name: number;
|
27
|
+
custodies: string[];
|
28
|
+
aumUsd: string;
|
29
|
+
fees: ParsedFees;
|
30
|
+
maxRequestExecutionSec: string;
|
31
|
+
bump: number;
|
32
|
+
lpTokenBump: number;
|
33
|
+
inceptionTime: string;
|
34
|
+
};
|
35
|
+
type ParsedFees = {
|
36
|
+
increasePositionBps: string;
|
37
|
+
decreasePositionBps: string;
|
38
|
+
addRemoveLiquidityBps: string;
|
39
|
+
swapBps: string;
|
40
|
+
taxBps: string;
|
41
|
+
stableSwapBps: string;
|
42
|
+
stableSwapTaxBps: string;
|
43
|
+
liquidationRewardBps: string;
|
44
|
+
protocolShareBps: string;
|
45
|
+
};
|
21
46
|
declare enum OracleType {
|
22
47
|
None = 0,
|
23
48
|
Test = 1,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/types.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/types.ts"],"names":[],"mappings":";;AAgDA,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,2CAAI,CAAA;IACJ,2CAAI,CAAA;IACJ,2CAAI,CAAA;AACN,CAAC,EAJI,UAAU,KAAV,UAAU,QAId"}
|
@@ -47,6 +47,10 @@ exports.lendingConfigs = new Map([
|
|
47
47
|
'he1iusmfkpAdwvxLNGV8Y1iSbj4rUy6yMhEA3fotn9A',
|
48
48
|
'So11111111111111111111111111111111111111112',
|
49
49
|
],
|
50
|
+
[
|
51
|
+
'vSoLxydx6akxyMD9XEcPvGYNGq6Nn66oqVb3UkGkei7',
|
52
|
+
'So11111111111111111111111111111111111111112',
|
53
|
+
],
|
50
54
|
],
|
51
55
|
leveragePairs: [
|
52
56
|
[
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],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A6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;aACF;SACF;KACF;IACD,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxE,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;CAC9E,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,WAAW,GAAG,UAAU,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,uBAAuB;CACrC,CAAC;AAEW,QAAA,QAAQ,GAAG,6CAA6C,CAAC;AACzD,QAAA,YAAY,GAAG,CAAC,CAAC;AACjB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAC3B,iDAAiD,CAAC;AAEvC,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAEhE,QAAA,kBAAkB,GAAG,6CAA6C,CAAC;AACnE,QAAA,gBAAgB,GAAG,GAAG,kBAAU,aAAa,CAAC;AAE9C,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAE5D,QAAA,cAAc,GAAqC,IAAI,GAAG,CAAC;IACtE;QACE,8CAA8C;QAC9C;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE;gBACb;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,8CAA8C;oBAC9C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;aACF;YACD,aAAa,EAAE;gBACb;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;aACF;SACF;KACF;IACD,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxE,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;CAC9E,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,WAAW,GAAG,UAAU,CAAC"}
|
@@ -27,8 +27,10 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
27
27
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
28
|
const client = (0, clients_1.getClientSolana)();
|
29
29
|
const userPubKey = new web3_js_1.PublicKey(owner);
|
30
|
-
const positionsV1 = yield
|
31
|
-
|
30
|
+
const [positionsV1, positionsV2] = yield Promise.all([
|
31
|
+
(0, solana_1.getParsedProgramAccounts)(client, struct_1.dlmmPositionV1Struct, constants_1.dlmmProgramId, (0, filters_1.dlmmPositionAccountFilter)(userPubKey.toString())),
|
32
|
+
(0, solana_1.getParsedProgramAccounts)(client, struct_1.dlmmPositionV2Struct, constants_1.dlmmProgramId, (0, filters_1.dlmmPositionV2AccountFilter)(userPubKey.toString())),
|
33
|
+
]);
|
32
34
|
const positions = [...positionsV1, ...positionsV2];
|
33
35
|
if (positions.length === 0)
|
34
36
|
return [];
|
@@ -67,16 +69,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
67
69
|
lbPairById.set(lbPairKeys[i - binArrayKeys.length].toBase58(), lbPairAcc);
|
68
70
|
}
|
69
71
|
}
|
70
|
-
const tokenPrices = yield cache.getTokenPrices(Array.from(mints), portfolio_core_1.NetworkId.solana);
|
71
|
-
const tokenPriceById = new Map();
|
72
|
-
for (const tokenPrice of tokenPrices) {
|
73
|
-
if (tokenPrice)
|
74
|
-
tokenPriceById.set(tokenPrice.address, tokenPrice);
|
75
|
-
}
|
76
72
|
const reservePublicKeys = Array.from(lbPairById.values())
|
77
73
|
.map(({ reserveX, reserveY }) => [reserveX, reserveY])
|
78
74
|
.flat();
|
79
|
-
const reserveAccountsInfo = yield
|
75
|
+
const [tokenPriceById, reserveAccountsInfo] = yield Promise.all([
|
76
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
77
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, reservePublicKeys),
|
78
|
+
]);
|
80
79
|
const lbPairReserveMap = new Map();
|
81
80
|
lbPairKeys.forEach((lbPair, idx) => {
|
82
81
|
const index = idx * 2;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dlmmPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meteora/dlmmPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
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;IACnD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;QACvD,MAAM,kB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AAC,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"}
|
@@ -21,10 +21,12 @@ const filters_1 = require("./filters");
|
|
21
21
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
23
|
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const accounts = yield
|
24
|
+
const [accounts, usdcTokenPrice] = yield Promise.all([
|
25
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.marginAccountStruct, constants_1.programId, (0, filters_1.marginAccountFilter)(owner)),
|
26
|
+
cache.getTokenPrice(constants_1.usdcMint, portfolio_core_1.NetworkId.solana),
|
27
|
+
]);
|
25
28
|
if (accounts.length === 0)
|
26
29
|
return [];
|
27
|
-
const usdcTokenPrice = yield cache.getTokenPrice(constants_1.usdcMint, portfolio_core_1.NetworkId.solana);
|
28
30
|
const assets = [];
|
29
31
|
for (const account of accounts) {
|
30
32
|
if (account.margin.isZero())
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/parcl/marginFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAEpC,2CAA4E;AAE5E,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAgD;AAChD,uCAAgD;AAChD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,
|
1
|
+
{"version":3,"file":"marginFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/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AAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -23,7 +23,10 @@ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo"
|
|
23
23
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
24
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
25
|
const client = (0, clients_1.getClientSolana)();
|
26
|
-
const stakingAccounts = yield
|
26
|
+
const [stakingAccounts, tokenPrice] = yield Promise.all([
|
27
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.positionDataStruct, constants_1.stakingProgramId, (0, filters_1.positionsDataFilter)(owner)),
|
28
|
+
cache.getTokenPrice(constants_1.pythMint, portfolio_core_1.NetworkId.solana),
|
29
|
+
]);
|
27
30
|
if (stakingAccounts.length !== 1)
|
28
31
|
return [];
|
29
32
|
const tokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('custody'), stakingAccounts[0].pubkey.toBuffer()], constants_1.stakingProgramId)[0];
|
@@ -31,7 +34,6 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
31
34
|
const amount = tokenAccountInfo === null || tokenAccountInfo === void 0 ? void 0 : tokenAccountInfo.amount;
|
32
35
|
if (!amount || amount.isZero())
|
33
36
|
return [];
|
34
|
-
const tokenPrice = yield cache.getTokenPrice(constants_1.pythMint, portfolio_core_1.NetworkId.solana);
|
35
37
|
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.pythMint, amount.dividedBy(Math.pow(10, 6)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice);
|
36
38
|
return [
|
37
39
|
{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,6CAA4C;AAG5C,2CAAqE;AACrE,iDAAsD;AACtD,+CAG4B;AAC5B,uCAA+C;AAC/C,uCAAgD;AAChD,kFAA+E;AAC/E,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAwB,
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,6CAA4C;AAG5C,2CAAqE;AACrE,iDAAsD;AACtD,+CAG4B;AAC5B,uCAA+C;AAC/C,uCAAgD;AAChD,kFAA+E;AAC/E,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACtD,IAAA,iCAAwB,EACtB,MAAM,EACN,4BAAkB,EAClB,4BAAgB,EAChB,IAAA,6BAAmB,EAAC,KAAK,CAAC,CAC3B;QACD,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC;KAChD,CAAC,CAAC;IAEH,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,YAAY,GAAG,mBAAS,CAAC,sBAAsB,CACnD,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAC9D,4BAAgB,CACjB,CAAC,CAAC,CAAC,CAAC;IAEL,MAAM,gBAAgB,GAAG,MAAM,IAAA,2CAAoB,EACjD,MAAM,EACN,2BAAkB,EAClB,YAAY,CACb,CAAC;IAEF,MAAM,MAAM,GAAG,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAC;IACxC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE1C,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC,QAAQ,EAAE,EACpC,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -13,30 +13,129 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
-
const
|
16
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
17
17
|
const constants_1 = require("./constants");
|
18
18
|
const solana_1 = require("../../utils/solana");
|
19
19
|
const clients_1 = require("../../utils/clients");
|
20
|
-
const tokenPricesFromSqrt_1 =
|
20
|
+
const tokenPricesFromSqrt_1 = require("../../utils/clmm/tokenPricesFromSqrt");
|
21
21
|
const clmms_1 = require("./structs/clmms");
|
22
22
|
const filters_1 = require("./filters");
|
23
|
+
const getLpUnderlyingTokenSource_1 = require("../../utils/misc/getLpUnderlyingTokenSource");
|
24
|
+
const constants_2 = require("../../utils/misc/constants");
|
23
25
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
26
|
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const
|
27
|
+
const allPoolsPubkeys = yield client.getProgramAccounts(constants_1.raydiumProgram, {
|
28
|
+
filters: filters_1.clmmPoolsStateFilter,
|
29
|
+
dataSlice: { offset: 0, length: 0 },
|
30
|
+
});
|
31
|
+
const acceptedPairs = getLpUnderlyingTokenSource_1.defaultAcceptedPairs.get(portfolio_core_1.NetworkId.solana);
|
32
|
+
if (!acceptedPairs)
|
33
|
+
return;
|
34
|
+
const step = 100;
|
35
|
+
const tokenPriceSources = [];
|
26
36
|
const promises = [];
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
const
|
32
|
-
const
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
let clmmPoolsInfo;
|
38
|
+
let tokenAccounts;
|
39
|
+
let tokenPriceById;
|
40
|
+
for (let offset = 0; offset < allPoolsPubkeys.length; offset += step) {
|
41
|
+
const tokenAccountsPkeys = [];
|
42
|
+
const mints = new Set();
|
43
|
+
clmmPoolsInfo = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, clmms_1.poolStateStruct, allPoolsPubkeys.slice(offset, offset + step).map((res) => res.pubkey));
|
44
|
+
clmmPoolsInfo.forEach((pI) => {
|
45
|
+
if (!pI)
|
46
|
+
return;
|
47
|
+
mints.add(pI.tokenMint0.toString());
|
48
|
+
mints.add(pI.tokenMint1.toString());
|
49
|
+
tokenAccountsPkeys.push(pI.tokenVault0, pI.tokenVault1);
|
50
|
+
});
|
51
|
+
[tokenAccounts, tokenPriceById] = yield Promise.all([
|
52
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountsPkeys),
|
53
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
54
|
+
]);
|
55
|
+
const tokenAccountsMap = new Map();
|
56
|
+
tokenAccounts.forEach((tA) => {
|
57
|
+
if (!tA)
|
58
|
+
return;
|
59
|
+
tokenAccountsMap.set(tA.pubkey.toString(), tA);
|
60
|
+
});
|
61
|
+
let mintA;
|
62
|
+
let mintB;
|
63
|
+
let unknownPrice;
|
64
|
+
let decimalA;
|
65
|
+
let decimalB;
|
66
|
+
let poolState;
|
67
|
+
let refLiquidity;
|
68
|
+
let priceAToB;
|
69
|
+
let refTokenPrice;
|
70
|
+
let refTokenAccount;
|
71
|
+
for (let id = 0; id < clmmPoolsInfo.length; id++) {
|
72
|
+
poolState = clmmPoolsInfo[id];
|
73
|
+
if (!poolState || poolState.liquidity.isZero())
|
74
|
+
continue;
|
75
|
+
mintA = poolState.tokenMint0.toString();
|
76
|
+
mintB = poolState.tokenMint1.toString();
|
77
|
+
decimalA = poolState.mintDecimals0;
|
78
|
+
decimalB = poolState.mintDecimals1;
|
79
|
+
let refMint;
|
80
|
+
let unkMint;
|
81
|
+
let refTokenVault;
|
82
|
+
let aToB;
|
83
|
+
let refDecimal;
|
84
|
+
let unkDecimal;
|
85
|
+
if (acceptedPairs.includes(mintA)) {
|
86
|
+
refMint = mintA;
|
87
|
+
unkMint = mintB;
|
88
|
+
refTokenVault = poolState.tokenVault0.toString();
|
89
|
+
aToB = true;
|
90
|
+
refDecimal = decimalA;
|
91
|
+
unkDecimal = decimalB;
|
92
|
+
}
|
93
|
+
else if (acceptedPairs.includes(mintB)) {
|
94
|
+
refMint = mintB;
|
95
|
+
unkMint = mintA;
|
96
|
+
refTokenVault = poolState.tokenVault1.toString();
|
97
|
+
aToB = false;
|
98
|
+
refDecimal = decimalB;
|
99
|
+
unkDecimal = decimalA;
|
100
|
+
}
|
101
|
+
else {
|
102
|
+
continue;
|
103
|
+
}
|
104
|
+
refTokenPrice = tokenPriceById.get(refMint);
|
105
|
+
if (!refTokenPrice)
|
106
|
+
continue;
|
107
|
+
refTokenAccount = tokenAccountsMap.get(refTokenVault);
|
108
|
+
if (!refTokenAccount)
|
109
|
+
continue;
|
110
|
+
refLiquidity = refTokenAccount.amount
|
111
|
+
.times(refTokenPrice.price)
|
112
|
+
.dividedBy(Math.pow(10, refDecimal));
|
113
|
+
if (refLiquidity.isLessThan(constants_2.minimumReserveValue))
|
114
|
+
continue;
|
115
|
+
priceAToB = (0, tokenPricesFromSqrt_1.sqrtPriceX64ToPrice)(poolState.sqrtPriceX64, decimalA, decimalB);
|
116
|
+
unknownPrice = aToB
|
117
|
+
? new decimal_js_1.default(refTokenPrice.price).dividedBy(priceAToB).toNumber()
|
118
|
+
: new decimal_js_1.default(refTokenPrice.price).times(priceAToB).toNumber();
|
119
|
+
tokenPriceSources.push({
|
120
|
+
address: unkMint,
|
121
|
+
decimals: unkDecimal,
|
122
|
+
id: constants_1.platformId,
|
123
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
124
|
+
platformId: constants_1.platformId,
|
125
|
+
price: unknownPrice,
|
126
|
+
timestamp: Date.now(),
|
127
|
+
weight: 1,
|
128
|
+
});
|
129
|
+
promises.push(cache.setItem(poolState.pubkey.toString(), poolState, {
|
130
|
+
prefix: constants_1.poolStatesPrefix,
|
131
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
132
|
+
}));
|
133
|
+
}
|
134
|
+
yield Promise.all([
|
135
|
+
...promises,
|
136
|
+
cache.setTokenPriceSources(tokenPriceSources),
|
137
|
+
]);
|
38
138
|
}
|
39
|
-
yield Promise.all(promises);
|
40
139
|
});
|
41
140
|
const job = {
|
42
141
|
id: `${constants_1.platformId}-clmm`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AAEzE,4DAAiC;AACjC,2CAA2E;AAC3E,+CAK4B;AAC5B,iDAAsD;AAGtD,8EAA2E;AAC3E,2CAA6D;AAC7D,uCAAiD;AACjD,4FAAmF;AACnF,0DAAiE;AAEjE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,0BAAc,EAAE;QACtE,OAAO,EAAE,8BAAoB;QAC7B,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KACpC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,iDAAoB,CAAC,GAAG,CAAC,0BAAS,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,CAAC,aAAa;QAAE,OAAO;IAE3B,MAAM,IAAI,GAAG,GAAG,CAAC;IACjB,MAAM,iBAAiB,GAAuB,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,IAAI,aAAkD,CAAC;IACvD,IAAI,aAAa,CAAC;IAClB,IAAI,cAAc,CAAC;IACnB,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,CAAC;QACrE,MAAM,kB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