@sonarwatch/portfolio-plugins 0.14.131 → 0.14.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @sonarwatch/portfolio-plugins
2
-
3
- This library is @sonarwatch/portfolio-plugins
1
+ # @sonarwatch/portfolio-plugins
2
+
3
+ This library is @sonarwatch/portfolio-plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.14.131",
3
+ "version": "0.14.132",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
36
36
  const graphql_request_1 = __importStar(require("graphql-request"));
37
37
  function getBalancerPoolsV2(url) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- const query = (0, graphql_request_1.gql) `
40
- query pools {
41
- pools(
42
- first: 1000
43
- orderBy: totalLiquidity
44
- orderDirection: desc
45
- where: { totalLiquidity_gt: "500" }
46
- ) {
47
- id
48
- address
49
- symbol
50
- totalLiquidity
51
- totalShares
52
- tokens {
53
- balance
54
- decimals
55
- symbol
56
- address
57
- }
58
- }
59
- }
39
+ const query = (0, graphql_request_1.gql) `
40
+ query pools {
41
+ pools(
42
+ first: 1000
43
+ orderBy: totalLiquidity
44
+ orderDirection: desc
45
+ where: { totalLiquidity_gt: "500" }
46
+ ) {
47
+ id
48
+ address
49
+ symbol
50
+ totalLiquidity
51
+ totalShares
52
+ tokens {
53
+ balance
54
+ decimals
55
+ symbol
56
+ address
57
+ }
58
+ }
59
+ }
60
60
  `;
61
61
  const res = yield (0, graphql_request_1.default)(url, query);
62
62
  const pools = res.pools;
@@ -1,7 +1,9 @@
1
1
  import BN from 'bn.js';
2
+ import BigNumber from 'bignumber.js';
2
3
  import { CustodyInfo } from '../types';
3
4
  import { Position } from './structs';
4
5
  export declare const USD_POWER: BN;
6
+ export declare const USD_POWER_BIGN: BigNumber;
5
7
  export type CustodyBn = Omit<CustodyInfo, 'pricing' | 'decreasePositionBps' | 'fundingRateState' | 'jumpRateState' | 'assets'> & {
6
8
  decreasePositionBps: BN;
7
9
  pricing: {
@@ -3,10 +3,12 @@ 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.getLiquidationPrice = exports.getFeeAmount = exports.positionToBn = exports.custodyToBN = exports.USD_POWER = void 0;
6
+ exports.getLiquidationPrice = exports.getFeeAmount = exports.positionToBn = exports.custodyToBN = exports.USD_POWER_BIGN = exports.USD_POWER = void 0;
7
7
  const bn_js_1 = __importDefault(require("bn.js"));
8
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
9
  const structs_1 = require("./structs");
9
10
  exports.USD_POWER = new bn_js_1.default(1000000);
11
+ exports.USD_POWER_BIGN = new bignumber_js_1.default(1000000);
10
12
  const BPS_POWER = new bn_js_1.default(10000);
11
13
  const DBPS_POWER = new bn_js_1.default(100000);
12
14
  const RATE_POWER = new bn_js_1.default(1000000000);
@@ -1 +1 @@
1
- {"version":3,"file":"helpersPerps.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/helpersPerps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AAEvB,uCAA2C;AAE9B,QAAA,SAAS,GAAG,IAAI,eAAE,CAAC,OAAS,CAAC,CAAC;AAC3C,MAAM,SAAS,GAAG,IAAI,eAAE,CAAC,KAAM,CAAC,CAAC;AACjC,MAAM,UAAU,GAAG,IAAI,eAAE,CAAC,MAAO,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,IAAI,eAAE,CAAC,UAAa,CAAC,CAAC;AACzC,MAAM,eAAe,GAAG,EAAE,GAAG,GAAG,CAAC;AAEjC,IAAK,mBAGJ;AAHD,WAAK,m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Y,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;IACnD,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE7D,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAI,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC1C,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B"}
@@ -24,12 +24,13 @@ const structs_1 = require("./structs");
24
24
  const helpersPerps_1 = require("./helpersPerps");
25
25
  const usdFactor = new bignumber_js_1.default(Math.pow(10, 6));
26
26
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
27
+ var _a, _b;
27
28
  const client = (0, clients_1.getClientSolana)();
28
29
  const positionAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.positionStruct, constants_1.perpsProgramId, (0, filters_1.perpetualsPositionsFilter)(owner));
29
30
  if (positionAccounts.length === 0 ||
30
31
  positionAccounts.every((perp) => perp.sizeUsd.isLessThanOrEqualTo(0)))
31
32
  return [];
32
- const [custodiesAccounts, perpPoolsArr] = yield Promise.all([
33
+ const [custodiesAccounts, perpPoolsArr, prAccounts] = yield Promise.all([
33
34
  cache.getItem(constants_1.custodiesKey, {
34
35
  prefix: constants_1.platformId,
35
36
  networkId: portfolio_core_1.NetworkId.solana,
@@ -38,9 +39,29 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
38
39
  prefix: constants_1.platformId,
39
40
  networkId: portfolio_core_1.NetworkId.solana,
40
41
  }),
42
+ (0, solana_1.getParsedProgramAccounts)(client, structs_1.positionRequestStruct, constants_1.perpsProgramId, (0, filters_1.positionRequestFilters)(owner)),
41
43
  ]);
42
44
  if (!custodiesAccounts || !perpPoolsArr)
43
45
  return [];
46
+ const prAccountsObj = {};
47
+ prAccounts.forEach((a) => {
48
+ const position = a.position.toString();
49
+ if (a.executed || !a.triggerPrice)
50
+ return;
51
+ if (!prAccountsObj[position])
52
+ prAccountsObj[position] = {
53
+ tp: null,
54
+ sl: null,
55
+ };
56
+ if (a.triggerAboveThreshold)
57
+ prAccountsObj[position].tp = a.triggerPrice
58
+ .dividedBy(helpersPerps_1.USD_POWER_BIGN)
59
+ .toNumber();
60
+ else
61
+ prAccountsObj[position].sl = a.triggerPrice
62
+ .dividedBy(helpersPerps_1.USD_POWER_BIGN)
63
+ .toNumber();
64
+ });
44
65
  const perpPools = new Map();
45
66
  perpPoolsArr.forEach((a) => {
46
67
  perpPools.set(a.pubkey.toString(), a);
@@ -100,6 +121,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
100
121
  const rawPnlValue = priceVar.times(collateralValue).times(leverage);
101
122
  const netPnlValue = rawPnlValue.minus(fees);
102
123
  const value = collateralValue.plus(netPnlValue);
124
+ const positionPubkey = position.pubkey.toString();
125
+ const tp = ((_a = prAccountsObj[positionPubkey]) === null || _a === void 0 ? void 0 : _a.tp) || undefined;
126
+ const sl = ((_b = prAccountsObj[positionPubkey]) === null || _b === void 0 ? void 0 : _b.sl) || undefined;
103
127
  levPositions.push({
104
128
  address: custody.mint,
105
129
  side: isLong ? portfolio_core_1.LeverageSide.long : portfolio_core_1.LeverageSide.short,
@@ -112,6 +136,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
112
136
  value: value.toNumber(),
113
137
  markPrice: currentPrice,
114
138
  entryPrice: entryPrice.toNumber(),
139
+ tp,
140
+ sl,
115
141
  });
116
142
  }
117
143
  if (levPositions.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AACrC,6CAA4C;AAC5C,iCAA2B;AAG3B,oDAAyD;AACzD,kDAAgF;AAChF,wCAAuD;AAEvD,2CAKqB;AACrB,uCAAiD;AACjD,iDAMwB;AAExB,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,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1D,KAAK,CAAC,OAAO,CAAgB,wBAAY,EAAE;YACzC,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC;QACF,KAAK,CAAC,OAAO,CAAqC,wBAAY,EAAE;YAC9D,MA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,KAAK;aACN;YACD,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,0BAAS,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"}
1
+ {"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AACrC,6CAA4C;AAC5C,iCAA2B;AAG3B,oDAAyD;AACzD,kDAAgF;AAChF,wCAA+E;AAE/E,2CAKqB;AACrB,uCAAwE;AACxE,iDAOwB;AAExB,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,CAAC,iBAAiB,EAAE,YAAY,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACtE,KAAK,CAAC,OAAO,CAAgB,wBAAY,EAAE;Y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jB,SAAS,EAAE,0BAAS,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"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
3
3
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
4
- import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
4
+ import { BeetStruct, COption, FixableBeetStruct } from '@metaplex-foundation/beet';
5
5
  import BigNumber from 'bignumber.js';
6
6
  import { PublicKey } from '@solana/web3.js';
7
7
  export type LimitOrder = {
@@ -120,6 +120,40 @@ export type VestingEscrow = {
120
120
  padding: BigNumber[];
121
121
  };
122
122
  export declare const vestingEscrowStruct: BeetStruct<VestingEscrow, Partial<VestingEscrow>>;
123
+ export declare enum RequestChange {
124
+ None = 0,
125
+ Increase = 1,
126
+ Decrease = 2
127
+ }
128
+ export declare enum RequestType {
129
+ Market = 0,
130
+ Trigger = 1
131
+ }
132
+ export type PositionRequest = {
133
+ buffer: Buffer;
134
+ owner: PublicKey;
135
+ pool: PublicKey;
136
+ custody: PublicKey;
137
+ position: PublicKey;
138
+ mint: PublicKey;
139
+ openTime: BigNumber;
140
+ updateTime: BigNumber;
141
+ sizeUsdDelta: BigNumber;
142
+ collateralDelta: BigNumber;
143
+ requestChange: RequestChange;
144
+ requestType: RequestType;
145
+ side: Side;
146
+ priceSlippage: COption<BigNumber>;
147
+ jupiterMinimumOut: COption<BigNumber>;
148
+ preSwapAmount: COption<BigNumber>;
149
+ triggerPrice: COption<BigNumber>;
150
+ triggerAboveThreshold: COption<boolean>;
151
+ entirePosition: COption<boolean>;
152
+ executed: boolean;
153
+ counter: BigNumber;
154
+ bump: number;
155
+ };
156
+ export declare const positionRequestStruct: FixableBeetStruct<PositionRequest, Partial<PositionRequest>>;
123
157
  export type Limit = {
124
158
  maxAumUsd: BigNumber;
125
159
  maxIndividualLpToken: BigNumber;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.positionStruct = exports.Side = exports.custodyStruct = exports.jumpRateStateStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.vestingEscrowStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = void 0;
3
+ exports.positionStruct = exports.Side = exports.custodyStruct = exports.jumpRateStateStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.positionRequestStruct = exports.RequestType = exports.RequestChange = exports.vestingEscrowStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = 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");
@@ -115,6 +115,41 @@ exports.vestingEscrowStruct = new beet_1.BeetStruct([
115
115
  ['padding1', solana_1.u64],
116
116
  ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 5)],
117
117
  ], (args) => args);
118
+ var RequestChange;
119
+ (function (RequestChange) {
120
+ RequestChange[RequestChange["None"] = 0] = "None";
121
+ RequestChange[RequestChange["Increase"] = 1] = "Increase";
122
+ RequestChange[RequestChange["Decrease"] = 2] = "Decrease";
123
+ })(RequestChange || (exports.RequestChange = RequestChange = {}));
124
+ var RequestType;
125
+ (function (RequestType) {
126
+ RequestType[RequestType["Market"] = 0] = "Market";
127
+ RequestType[RequestType["Trigger"] = 1] = "Trigger";
128
+ })(RequestType || (exports.RequestType = RequestType = {}));
129
+ exports.positionRequestStruct = new beet_1.FixableBeetStruct([
130
+ ['buffer', (0, solana_1.blob)(8)],
131
+ ['owner', beet_solana_1.publicKey],
132
+ ['pool', beet_solana_1.publicKey],
133
+ ['custody', beet_solana_1.publicKey],
134
+ ['position', beet_solana_1.publicKey],
135
+ ['mint', beet_solana_1.publicKey],
136
+ ['openTime', solana_1.i64],
137
+ ['updateTime', solana_1.i64],
138
+ ['sizeUsdDelta', solana_1.u64],
139
+ ['collateralDelta', solana_1.u64],
140
+ ['requestChange', beet_1.u8],
141
+ ['requestType', beet_1.u8],
142
+ ['side', beet_1.u8],
143
+ ['priceSlippage', (0, beet_1.coption)(solana_1.u64)],
144
+ ['jupiterMinimumOut', (0, beet_1.coption)(solana_1.u64)],
145
+ ['preSwapAmount', (0, beet_1.coption)(solana_1.u64)],
146
+ ['triggerPrice', (0, beet_1.coption)(solana_1.u64)],
147
+ ['triggerAboveThreshold', (0, beet_1.coption)(beet_1.bool)],
148
+ ['entirePosition', (0, beet_1.coption)(beet_1.bool)],
149
+ ['executed', beet_1.bool],
150
+ ['counter', solana_1.u64],
151
+ ['bump', beet_1.u8],
152
+ ], (args) => args);
118
153
  exports.limitStruct = new beet_1.BeetStruct([
119
154
  ['maxAumUsd', solana_1.u128],
120
155
  ['maxIndividualLpToken', solana_1.u128],
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,O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C;AAEF,IAAY,IAIX;AAJD,WAAY,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
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAUmC;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,CAA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AAI;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"}
@@ -2,5 +2,6 @@
2
2
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
3
  import { GetProgramAccountsFilter } from '@solana/web3.js';
4
4
  export declare const perpetualsPositionsFilter: (owner: string) => GetProgramAccountsFilter[];
5
+ export declare const positionRequestFilters: (owner: string) => GetProgramAccountsFilter[];
5
6
  export declare const escrowFilter: (owner: string) => GetProgramAccountsFilter[];
6
7
  export declare const partialUnstakeFilter: (escrow: string) => GetProgramAccountsFilter[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.partialUnstakeFilter = exports.escrowFilter = exports.perpetualsPositionsFilter = void 0;
3
+ exports.partialUnstakeFilter = exports.escrowFilter = exports.positionRequestFilters = exports.perpetualsPositionsFilter = void 0;
4
4
  const perpetualsPositionsFilter = (owner) => [
5
5
  {
6
6
  memcmp: {
@@ -11,6 +11,16 @@ const perpetualsPositionsFilter = (owner) => [
11
11
  { dataSize: 216 },
12
12
  ];
13
13
  exports.perpetualsPositionsFilter = perpetualsPositionsFilter;
14
+ const positionRequestFilters = (owner) => [
15
+ {
16
+ memcmp: {
17
+ offset: 8,
18
+ bytes: owner,
19
+ },
20
+ },
21
+ { dataSize: 312 },
22
+ ];
23
+ exports.positionRequestFilters = positionRequestFilters;
14
24
  const escrowFilter = (owner) => [
15
25
  {
16
26
  memcmp: {
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,CACvC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,yBAAyB,6BAUpC;AAEK,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,YAAY,gBAQvB;AAEK,MAAM,oBAAoB,GAAG,CAClC,MAAc,EACc,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,MAAM;SACd;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,oBAAoB,wBAU/B"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,CACvC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,yBAAyB,6BAUpC;AAEK,MAAM,sBAAsB,GAAG,CACpC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,sBAAsB,0BAUjC;AAEK,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,YAAY,gBAQvB;AAEK,MAAM,oBAAoB,GAAG,CAClC,MAAc,EACc,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,MAAM;SACd;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,oBAAoB,wBAU/B"}
@@ -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;
@@ -40,20 +40,20 @@ const clients_1 = require("../../utils/clients");
40
40
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
41
41
  const helpers_1 = require("./helpers");
42
42
  const AirdropFetcher_1 = require("../../AirdropFetcher");
43
- const query = (0, graphql_request_1.gql) `
44
- query GetAirdropFinalFrontend($authority: String!) {
45
- getAirdropFinalFrontend(authority: $authority) {
46
- authority
47
- community_allocation
48
- eligibility
49
- main_allocation
50
- og_allocation
51
- s1_allocation
52
- s2_allocation
53
- total_allocation
54
- __typename
55
- }
56
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ query GetAirdropFinalFrontend($authority: String!) {
45
+ getAirdropFinalFrontend(authority: $authority) {
46
+ authority
47
+ community_allocation
48
+ eligibility
49
+ main_allocation
50
+ og_allocation
51
+ s1_allocation
52
+ s2_allocation
53
+ total_allocation
54
+ __typename
55
+ }
56
+ }
57
57
  `;
58
58
  const networkId = portfolio_core_1.NetworkId.solana;
59
59
  const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;