@sonarwatch/portfolio-plugins 0.14.18 → 0.14.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/CHANGELOG.md +1664 -1656
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/balancer/helpers/pools.js +21 -21
  5. package/src/plugins/drift-market-maker-vault/constants.d.ts +5 -1
  6. package/src/plugins/drift-market-maker-vault/constants.js +25 -4
  7. package/src/plugins/drift-market-maker-vault/constants.js.map +1 -1
  8. package/src/plugins/drift-market-maker-vault/depositsFetcher.js +1 -1
  9. package/src/plugins/drift-market-maker-vault/depositsFetcher.js.map +1 -1
  10. package/src/plugins/drift-market-maker-vault/index.js +6 -1
  11. package/src/plugins/drift-market-maker-vault/index.js.map +1 -1
  12. package/src/plugins/drift-market-maker-vault/vaultsJob.js +1 -1
  13. package/src/plugins/drift-market-maker-vault/vaultsJob.js.map +1 -1
  14. package/src/plugins/elixir/positionsFetcher.js +1 -1
  15. package/src/plugins/elixir/positionsFetcher.js.map +1 -1
  16. package/src/plugins/sushiswap/helpers.js +24 -24
  17. package/src/plugins/uniswap-v2/helpers.js +22 -22
  18. package/src/plugins/vaultka/constants.d.ts +2 -1
  19. package/src/plugins/vaultka/constants.js +36 -7
  20. package/src/plugins/vaultka/constants.js.map +1 -1
  21. package/src/plugins/vaultka/strategyFetcher.js +19 -9
  22. package/src/plugins/vaultka/strategyFetcher.js.map +1 -1
  23. package/src/plugins/vaultka/strategyJob.js +1 -2
  24. package/src/plugins/vaultka/strategyJob.js.map +1 -1
  25. package/src/plugins/vaultka/structs.d.ts +48 -3
  26. package/src/plugins/vaultka/structs.js +46 -3
  27. package/src/plugins/vaultka/structs.js.map +1 -1
  28. package/src/plugins/vaultka/types.d.ts +7 -0
  29. package/src/plugins/vaultka/types.js +3 -0
  30. package/src/plugins/vaultka/types.js.map +1 -0
  31. package/src/plugins/zeta/airdropFetcher.js +14 -14
  32. package/src/utils/sei/constants.js +8 -8
  33. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
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.18",
3
+ "version": "0.14.20",
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;
@@ -4,6 +4,10 @@ export declare const circuitPlatformId = "circuit";
4
4
  export declare const circuitPlatform: Platform;
5
5
  export declare const moosePlatformId = "moose";
6
6
  export declare const moosePlatform: Platform;
7
- export declare const vaultsPid: PublicKey;
7
+ export declare const neutralPlatformId = "neutral";
8
+ export declare const neutralPlatform: Platform;
9
+ export declare const gauntletPlatformId = "gauntlet";
10
+ export declare const gauntletPlatform: Platform;
11
+ export declare const vaultsPids: PublicKey[];
8
12
  export declare const prefixVaults = "circuitVaults";
9
13
  export declare const platformIdByVaultManager: Map<string, string>;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.platformIdByVaultManager = exports.prefixVaults = exports.vaultsPid = exports.moosePlatform = exports.moosePlatformId = exports.circuitPlatform = exports.circuitPlatformId = void 0;
3
+ exports.platformIdByVaultManager = exports.prefixVaults = exports.vaultsPids = exports.gauntletPlatform = exports.gauntletPlatformId = exports.neutralPlatform = exports.neutralPlatformId = exports.moosePlatform = exports.moosePlatformId = exports.circuitPlatform = exports.circuitPlatformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.circuitPlatformId = 'circuit';
6
6
  exports.circuitPlatform = {
7
7
  id: exports.circuitPlatformId,
8
8
  name: 'Circuit',
9
9
  image: 'https://sonar.watch/img/platforms/circuit.webp',
10
- // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
11
10
  website: 'https://app.circuit.trade/',
12
11
  twitter: 'https://twitter.com/CircuitTrading_',
13
12
  };
@@ -16,14 +15,36 @@ exports.moosePlatform = {
16
15
  id: exports.moosePlatformId,
17
16
  name: 'Moose Market',
18
17
  image: 'https://sonar.watch/img/platforms/moose.webp',
19
- // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
20
18
  website: 'https://moose.market/',
21
19
  twitter: 'https://twitter.com/moose_market',
22
20
  };
23
- exports.vaultsPid = new web3_js_1.PublicKey('vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR');
21
+ exports.neutralPlatformId = 'neutral';
22
+ exports.neutralPlatform = {
23
+ id: exports.neutralPlatformId,
24
+ name: 'Neutral',
25
+ image: 'https://sonar.watch/img/platforms/neutral.webp',
26
+ website: 'https://www.app.neutral.trade/',
27
+ twitter: 'https://twitter.com/TradeNeutral',
28
+ };
29
+ exports.gauntletPlatformId = 'gauntlet';
30
+ exports.gauntletPlatform = {
31
+ id: exports.gauntletPlatformId,
32
+ name: 'Gauntlet',
33
+ image: 'https://sonar.watch/img/platforms/gauntlet.webp',
34
+ twitter: 'https://twitter.com/gauntlet_xyz',
35
+ };
36
+ exports.vaultsPids = [
37
+ new web3_js_1.PublicKey('vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR'), // from Drift
38
+ new web3_js_1.PublicKey('9Fcn3Fd4d5ocrb12xCUtEvezxcjFEAyHBPfrZDiPt9Qj'), // from Neutral
39
+ new web3_js_1.PublicKey('EuSLjg23BrtwYAk1t4TFe5ArYSXCVXLBqrHRBfWQiTeJ'), // from Neutral
40
+ new web3_js_1.PublicKey('BVddkVtFJLCihbVrtLo8e3iEd9NftuLunaznAxFFW8vf'), // from Neutral
41
+ ];
24
42
  exports.prefixVaults = 'circuitVaults';
25
43
  exports.platformIdByVaultManager = new Map([
26
44
  ['GT3RSBy5nS2ACpT3LCkycHWm9CVJCSuqErAgf4sE33Qu', exports.circuitPlatformId],
27
45
  ['En8nqJqCE9D2Bsqetw4p89VgZTh8QK8SfCAn5sSyL4PM', exports.moosePlatformId],
46
+ ['C77bxLHWjnAVeG9HdMxu1gunFnjRCcWUDZYfa7xbacHr', exports.neutralPlatformId],
47
+ ['neutBqYtHqPiu89Yfuk3X3cebgBtyppzSbxJ9tt1eSB', exports.neutralPlatformId],
48
+ ['G6L1NE8tLYYzvMHYHbkHZqPFvfEsiRAsHSvyNQ2hut3o', exports.gauntletPlatformId],
28
49
  ]);
29
50
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,yBAAiB;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,qEAAqE;IACrE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,8CAA8C;IACrD,qEAAqE;IACrE,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,eAAe,CAAC;AAE/B,QAAA,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,CAAC,8CAA8C,EAAE,yBAAiB,CAAC;IACnE,CAAC,8CAA8C,EAAE,uBAAe,CAAC;CAClE,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,yBAAiB;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,yBAAiB;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,0BAAkB;IACtB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,IAAI,mBAAS,CAAC,6CAA6C,CAAC,EAAE,aAAa;IAC3E,IAAI,mBAAS,CAAC,8CAA8C,CAAC,EAAE,eAAe;IAC9E,IAAI,mBAAS,CAAC,8CAA8C,CAAC,EAAE,eAAe;IAC9E,IAAI,mBAAS,CAAC,8CAA8C,CAAC,EAAE,eAAe;CAC/E,CAAC;AAEW,QAAA,YAAY,GAAG,eAAe,CAAC;AAE/B,QAAA,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,CAAC,8CAA8C,EAAE,yBAAiB,CAAC;IACnE,CAAC,8CAA8C,EAAE,uBAAe,CAAC;IACjE,CAAC,8CAA8C,EAAE,yBAAiB,CAAC;IACnE,CAAC,6CAA6C,EAAE,yBAAiB,CAAC;IAClE,CAAC,8CAA8C,EAAE,0BAAkB,CAAC;CACrE,CAAC,CAAC"}
@@ -23,7 +23,7 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
23
23
  const stakingFetcher_1 = require("../goosefx/stakingFetcher");
24
24
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
25
  const client = (0, clients_1.getClientSolana)();
26
- const depositAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultDepositorStruct, constants_2.vaultsPid, (0, filters_1.vaultDepositorFilter)(owner));
26
+ const depositAccounts = (yield Promise.all(constants_2.vaultsPids.map((vaultsPid) => (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultDepositorStruct, vaultsPid, (0, filters_1.vaultDepositorFilter)(owner))))).flat();
27
27
  if (depositAccounts.length === 0)
28
28
  return [];
29
29
  const vaultsInfo = yield cache.getItems(depositAccounts.map((deposit) => deposit.vault.toString()), { prefix: constants_2.prefixVaults, networkId: portfolio_core_1.NetworkId.solana });
@@ -1 +1 @@
1
- {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AAGpC,kDAAmE;AACnE,2CAAsD;AACtD,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAiD;AACjD,uCAAiD;AACjD,qGAA6E;AAC7E,8DAAsD;AAGtD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAwB,EACpD,MAAM,EACN,8BAAoB,EACpB,qBAAS,EACT,IAAA,8BAAoB,EAAC,KAAK,CAAC,CAC5B,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,QAAQ,CACrC,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAC1D,EAAE,MAAM,EAAE,wBAAY,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,CACtD,CAAC;IACF,MAAM,SAAS,GAA2B,IAAI,GAAG,EAAE,CAAC;IACpD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,SAAS;YAAE,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,cAAc,CAC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;iBACrC,SAAS,CAAC,SAAA,EAAE,EAAI,QAAQ,CAAA,CAAC;iBACzB,QAAQ,EAAE,EACb,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,KACD,UAAU,EAAE;oBACV,WAAW,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE;yBAC/C,KAAK,CAAC,IAAI,CAAC;yBACX,IAAI,CAAC,0BAAS,CAAC;yBACf,QAAQ,EAAE;iBACd,IACD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,CACT,IAAA,gCAAsB,EACpB,IAAI,EACJ,UAAU,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EAC/C,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAElC,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU;YACV,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,IAAI;YACJ,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1D,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAe,qBAAqB;IAC3C,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -7,7 +7,12 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
9
9
  const vaultsJob_1 = __importDefault(require("./vaultsJob"));
10
- exports.platforms = [constants_1.circuitPlatform, constants_1.moosePlatform];
10
+ exports.platforms = [
11
+ constants_1.circuitPlatform,
12
+ constants_1.moosePlatform,
13
+ constants_1.neutralPlatform,
14
+ constants_1.gauntletPlatform,
15
+ ];
11
16
  exports.jobs = [vaultsJob_1.default];
12
17
  exports.fetchers = [depositsFetcher_1.default];
13
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6D;AAC7D,wEAAgD;AAChD,4DAAoC;AAEvB,QAAA,SAAS,GAAe,CAAC,2BAAe,EAAE,yBAAa,CAAC,CAAC;AACzD,QAAA,IAAI,GAAU,CAAC,mBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAKqB;AACrB,wEAAgD;AAChD,4DAAoC;AAEvB,QAAA,SAAS,GAAe;IACnC,2BAAe;IACf,yBAAa;IACb,2BAAe;IACf,4BAAgB;CACjB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,mBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
@@ -19,7 +19,7 @@ const structs_1 = require("./structs");
19
19
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
20
20
  const client = (0, clients_1.getClientSolana)();
21
21
  const [vaults, spotMarkets] = yield Promise.all([
22
- (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultStruct, constants_2.vaultsPid, filters_1.vaultFilter),
22
+ (yield Promise.all(constants_2.vaultsPids.map((vaultsPid) => (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultStruct, vaultsPid, filters_1.vaultFilter)))).flat(),
23
23
  cache.getItem(constants_1.keySpotMarkets, {
24
24
  prefix: constants_1.platformId,
25
25
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA+E;AAC/E,kDAI4B;AAC5B,2CAAgF;AAChF,uCAAwC;AACxC,uCAAwC;AAIxC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,IAAA,iCAAwB,EAAC,MAAM,EAAE,qBAAW,EAAE,qBAAS,EAAE,qBAAW,CAAC;QACrE,KAAK,CAAC,OAAO,CAAuB,0BAAc,EAAE;YAClD,MAAM,EAAE,sBAAe;YACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAA,wBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CACjC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,KAAK,CAAC,eAAe,CACjD,CAAC;QACF,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,eAAe,GAAG,oCAAwB,CAAC,GAAG,CAClD,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CACzB,CAAC;QACF,IAAI,CAAC,eAAe;YAAE,SAAS;QAE/B,WAAW,CAAC,IAAI,CAAC;YACf,GAAG,EAAE,MAAM;YACX,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrE,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,QAAQ,CAAY,WAAW,EAAE;QAC3C,MAAM,EAAE,wBAAY;QACpB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA+E;AAC/E,kDAAgE;AAChE,2CAIqB;AACrB,uCAAwC;AACxC,uCAAwC;AAIxC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,CACE,MAAM,OAAO,CAAC,GAAG,CACf,sBAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC3B,IAAA,iCAAwB,EAAC,MAAM,EAAE,qBAAW,EAAE,SAAS,EAAE,qB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,EAAE,GAAG,sBAAU,sBAAsB;IACvC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -108,7 +108,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
108
108
  ? Number(a.pending) / Math.pow(10, tokenPrice.decimals)
109
109
  : undefined;
110
110
  if (pendingAmount) {
111
- assets.push((0, tokenPriceToAssetToken_1.default)(a.coinType, pendingAmount, portfolio_core_1.NetworkId.sui, tokenPrice, undefined, {}));
111
+ assets.push((0, tokenPriceToAssetToken_1.default)(a.coinType, pendingAmount, portfolio_core_1.NetworkId.sui, tokenPrice, undefined, { isClaimable: true }));
112
112
  yields.push({
113
113
  apr: 0,
114
114
  apy: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elixir/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAWoC;AAGpC,2CAMqB;AAErB,iDAAmD;AACnD,iFAA8E;AAE9E,qGAA6E;AAC7E,uCAGmB;AAEnB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClD,KAAK,CAAC,OAAO,CAA0B,qBAAS,EAAE;YAChD,MAAM,EAAE,wBAAY;YACpB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC;QACF,KAAK,CAAC,OAAO,CAAa,wBAAY,EAAE;YACtC,MAAM,EAAE,wBAAY;YACpB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE3C,MAAM,YAAY,GAAG,MAAM,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O,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elixir/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAWoC;AAGpC,2CAMqB;AAErB,iDAAmD;AACnD,iFAA8E;AAE9E,qGAA6E;AAC7E,uCAGmB;AAEnB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClD,KAAK,CAAC,OAAO,CAA0B,qBAAS,EAAE;YAChD,MAAM,EAAE,wBAAY;YACpB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC;QACF,KAAK,CAAC,OAAO,CAAa,wBAAY,EAAE;YACtC,MAAM,EAAE,wBAAY;YACpB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE3C,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CACpC,YAAY,CAAC,GAAG,CAAC,CAAO,CAAC,EAAE,EAAE;;QAC3B,IAAI,CAAC,CAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,OAAO,CAAA;YAAE,OAAO,IAAI,CAAC;QAElC,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,GACpD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAA,6CAAqB,EAAgB,MAAM,EAAE;gBAC3C,QAAQ,EAAE,MAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,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AAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,MAAM,KAAK,GAAG,WAAW,CAAC;QAE1B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,WAAW,GAAyB;gBACxC;oBACE,KAAK;oBACL,MAAM;oBACN,WAAW;oBACX,YAAY,EAAE,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,MAAM;oBACN,IAAI,EAAE,MAAA,kBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,KAAK,CAAC,0CAAE,SAAS;iBAC3D;aACF,CAAC;YAEF,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,EAAE,WAAW,EAAE;gBACrB,KAAK,EAAE,eAAe;gBACtB,SAAS,EAAE,0BAAS,CAAC,GAAG;gBACxB,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aAC3D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -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;
@@ -1,8 +1,9 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
2
  import { PublicKey } from '@solana/web3.js';
3
+ import { StrategyInfo } from './types';
3
4
  export declare const platformId = "vaultka";
4
5
  export declare const platform: Platform;
5
6
  export declare const lendingsCacheKey = "lendings";
6
7
  export declare const lendingProgramIds: PublicKey[];
7
8
  export declare const strategiesCacheKey = "strategies";
8
- export declare const strategies: string[];
9
+ export declare const strategies: StrategyInfo[];
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.strategies = exports.strategiesCacheKey = exports.lendingProgramIds = exports.lendingsCacheKey = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
+ const structs_1 = require("./structs");
5
6
  exports.platformId = 'vaultka';
6
7
  exports.platform = {
7
8
  id: exports.platformId,
@@ -20,12 +21,40 @@ exports.lendingProgramIds = [
20
21
  ];
21
22
  exports.strategiesCacheKey = `strategies`;
22
23
  exports.strategies = [
23
- '6UBsNdYq3MEao1m9NXQD1VEmXvptUXhfMwdHANGAo4bs',
24
- 'B3FS1X2PZPBrtBZiyAN9oqABnu3o5YWwdY5ioqoVh64P',
25
- 'SkFLfp7eSRsan13dEUZSVzMBj3vdyZnhaasFKQTzuiE',
26
- '6VwarrrqWVWAmZtNdgGafeyoXD3SsspKxuxkZVarZqTA',
27
- '9p5Sc5SvR8QpJCQV3U4q6zVUTupr4Tr9Jmf48sbcSjtX',
28
- 'FRyGij76xTvAg1nPPTaXHfa3QxUfZuKARuAyAaMyoLPo',
29
- 'A7PDwCJ3qcdVoZLqq7wHAwMq9yEKZU2vFx7Y9qbZ1dKJ',
24
+ {
25
+ pubkey: '6UBsNdYq3MEao1m9NXQD1VEmXvptUXhfMwdHANGAo4bs',
26
+ strategyStruct: structs_1.strategyStruct,
27
+ positionInfoStruct: structs_1.positionInfoStruct,
28
+ },
29
+ {
30
+ pubkey: 'B3FS1X2PZPBrtBZiyAN9oqABnu3o5YWwdY5ioqoVh64P',
31
+ strategyStruct: structs_1.strategyStruct,
32
+ positionInfoStruct: structs_1.positionInfoStruct,
33
+ },
34
+ {
35
+ pubkey: 'SkFLfp7eSRsan13dEUZSVzMBj3vdyZnhaasFKQTzuiE',
36
+ strategyStruct: structs_1.strategyStruct,
37
+ positionInfoStruct: structs_1.positionInfoStruct,
38
+ },
39
+ {
40
+ pubkey: '6VwarrrqWVWAmZtNdgGafeyoXD3SsspKxuxkZVarZqTA',
41
+ strategyStruct: structs_1.strategyStruct,
42
+ positionInfoStruct: structs_1.positionInfoStruct,
43
+ },
44
+ {
45
+ pubkey: '9p5Sc5SvR8QpJCQV3U4q6zVUTupr4Tr9Jmf48sbcSjtX',
46
+ strategyStruct: structs_1.lstStrategyStruct,
47
+ positionInfoStruct: structs_1.lstPositionInfoStruct,
48
+ },
49
+ {
50
+ pubkey: 'FRyGij76xTvAg1nPPTaXHfa3QxUfZuKARuAyAaMyoLPo',
51
+ strategyStruct: structs_1.lstStrategyStruct,
52
+ positionInfoStruct: structs_1.lstPositionInfoStruct,
53
+ },
54
+ {
55
+ pubkey: 'A7PDwCJ3qcdVoZLqq7wHAwMq9yEKZU2vFx7Y9qbZ1dKJ',
56
+ strategyStruct: structs_1.lstStrategyStruct,
57
+ positionInfoStruct: structs_1.lstPositionInfoStruct,
58
+ },
30
59
  ];
31
60
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,6BAA6B;IACtC,OAAO,EAAE,+BAA+B;IACxC,WAAW,EAAE,SAAS,EAAE,sCAAsC;CAC/D,CAAC;AAEW,QAAA,gBAAgB,GAAG,UAAU,CAAC;AAE9B,QAAA,iBAAiB,GAAG;IAC/B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;IAC7D,IAAI,mBAAS,CAAC,8CAA8C,CAAC;IAC7D,IAAI,mBAAS,CAAC,6CAA6C,CAAC;IAC5D,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC;AAEW,QAAA,kBAAkB,GAAG,YAAY,CAAC;AAElC,QAAA,UAAU,GAAG;IACxB,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CAC/C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,uCAKmB;AAEN,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,6BAA6B;IACtC,OAAO,EAAE,+BAA+B;IACxC,WAAW,EAAE,SAAS,EAAE,sCAAsC;CAC/D,CAAC;AAEW,QAAA,gBAAgB,GAAG,UAAU,CAAC;AAE9B,QAAA,iBAAiB,GAAG;IAC/B,IAAI,mBAAS,CAAC,8CAA8C,CAAC;IAC7D,IAAI,mBAAS,CAAC,8CAA8C,CAAC;IAC7D,IAAI,mBAAS,CAAC,6CAA6C,CAAC;IAC5D,IAAI,mBAAS,CAAC,8CAA8C,CAAC;CAC9D,CAAC;AAEW,QAAA,kBAAkB,GAAG,YAAY,CAAC;AAElC,QAAA,UAAU,GAAmB;IACxC;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAd,wBAAc;QACd,kBAAkB,EAAlB,4BAAkB;KACnB;IACD;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAd,wBAAc;QACd,kBAAkB,EAAlB,4BAAkB;KACnB;IACD;QACE,MAAM,EAAE,6CAA6C;QACrD,cAAc,EAAd,wBAAc;QACd,kBAAkB,EAAlB,4BAAkB;KACnB;IACD;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAd,wBAAc;QACd,kBAAkB,EAAlB,4BAAkB;KACnB;IACD;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAE,2BAAiB;QACjC,kBAAkB,EAAE,+BAAqB;KAC1C;IACD;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAE,2BAAiB;QACjC,kBAAkB,EAAE,+BAAqB;KAC1C;IACD;QACE,MAAM,EAAE,8CAA8C;QACtD,cAAc,EAAE,2BAAiB;QACjC,kBAAkB,EAAE,+BAAqB;KAC1C;CACF,CAAC"}
@@ -15,10 +15,9 @@ const constants_1 = require("./constants");
15
15
  const clients_1 = require("../../utils/clients");
16
16
  const solana_1 = require("../../utils/solana");
17
17
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
18
- const structs_1 = require("./structs");
19
18
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
20
19
  const connection = (0, clients_1.getClientSolana)();
21
- const positionInfos = yield Promise.all(constants_1.strategies.map((strategy) => (0, solana_1.getParsedProgramAccounts)(connection, structs_1.positionInfoStruct, new web3_js_1.PublicKey(strategy), [
20
+ const positionInfos = yield Promise.all(constants_1.strategies.map((strategy) => (0, solana_1.getParsedProgramAccounts)(connection, strategy.positionInfoStruct, new web3_js_1.PublicKey(strategy.pubkey), [
22
21
  {
23
22
  memcmp: {
24
23
  offset: 24,
@@ -36,24 +35,35 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
36
35
  return [];
37
36
  const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
38
37
  positionInfos.forEach((positionInfo, i) => {
39
- if (positionInfo[i] &&
40
- !positionInfo[i].liquidated &&
41
- !positionInfo[i].closed) {
38
+ if (positionInfo[0] &&
39
+ !positionInfo[0].liquidated &&
40
+ !positionInfo[0].closed) {
41
+ const strategy = strategiesInfo[i];
42
42
  const element = elementRegistry.addElementBorrowlend({
43
43
  label: 'Leverage',
44
44
  });
45
+ let borrowMint;
46
+ if (isLstStrategy(strategy)) {
47
+ borrowMint = strategy.collateral_mint;
48
+ }
49
+ else {
50
+ borrowMint = strategy.borrow_mint;
51
+ }
45
52
  element.addSuppliedAsset({
46
- address: strategiesInfo[i].token_mint,
47
- amount: positionInfo[i].position_amount,
53
+ address: strategy.collateral_mint,
54
+ amount: positionInfo[0].position_amount,
48
55
  });
49
56
  element.addBorrowedAsset({
50
- address: strategiesInfo[i].collateral_mint,
51
- amount: positionInfo[i].leverage_amount,
57
+ address: borrowMint,
58
+ amount: positionInfo[0].leverage_amount,
52
59
  });
53
60
  }
54
61
  });
55
62
  return elementRegistry.getElements(cache);
56
63
  });
64
+ function isLstStrategy(strategy) {
65
+ return !('borrow_mint' in strategy);
66
+ }
57
67
  const fetcher = {
58
68
  id: `${constants_1.platformId}-strategy`,
59
69
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"strategyFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAyE;AAEzE,iDAAsD;AACtD,+CAA8D;AAC9D,gFAA6E;AAC7E,uCAAuE;AAEvE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,GAAG,CACrC,sBAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC1B,IAAA,iCAAwB,EACtB,UAAU,EACV,4BAAkB,EAClB,IAAI,mBAAS,CA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IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"strategyFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAyE;AAEzE,iDAAsD;AACtD,+CAA8D;AAC9D,gFAA6E;AAQ7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,GAAG,CACrC,sBAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC1B,IAAA,iCAAwB,EACtB,UAAU,EACV,QAAQ,CAAC,kBAAkB,EAC3B,IAAI,mBAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC9B;QACE;YACE,MAAM,EAAE;gBACN,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,KAAK;aACb;SACF;KACF,CACF,CACF,CACF,CAAC;IAEF,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QACxE,OAAO,EAAE,CAAC;IAEZ,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,OAAO,CACxC,8BAAkB,EAClB;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CACF,CAAC;IAEF,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;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IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -12,12 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
13
  const web3_js_1 = require("@solana/web3.js");
14
14
  const constants_1 = require("./constants");
15
- const structs_1 = require("./structs");
16
15
  const clients_1 = require("../../utils/clients");
17
16
  const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
18
17
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
19
18
  const connection = (0, clients_1.getClientSolana)();
20
- const strategys = yield Promise.all(constants_1.strategies.map((strategy) => (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.strategyStruct, web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('STRATEGY')], new web3_js_1.PublicKey(strategy))[0])));
19
+ const strategys = yield Promise.all(constants_1.strategies.map((strategy) => (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, strategy.strategyStruct, web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('STRATEGY')], new web3_js_1.PublicKey(strategy.pubkey))[0])));
21
20
  yield cache.setItem(constants_1.strategiesCacheKey, strategys, {
22
21
  prefix: constants_1.platformId,
23
22
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"strategyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAyE;AACzE,uCAA2C;AAC3C,iDAAsD;AACtD,kFAA+E;AAE/E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,sBAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC1B,IAAA,2CAAoB,EAClB,UAAU,EACV,wBAAc,EACd,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EACzB,IAAI,mBAAS,CAAC,QAAQ,CAAC,CACxB,CAAC,CAAC,CAAC,CACL,CACF,CACF,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CAAC,8BAAkB,EAAE,SAAS,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"strategyJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/strategyJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAyE;AACzE,iDAAsD;AACtD,kFAA+E;AAE/E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,sBAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC1B,IAAA,2CAAoB,EAClB,UAAU,EACV,QAAQ,CAAC,cAAc,EACvB,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EACzB,IAAI,mBAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/B,CAAC,CAAC,CAAC,CACL,CACF,CACF,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CAAC,8BAAkB,EAAE,SAAS,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -25,7 +25,7 @@ export type PositionInfo = {
25
25
  amount: BigNumber;
26
26
  pos_id: BigNumber;
27
27
  user: PublicKey;
28
- leverage: number;
28
+ leverageNum: number;
29
29
  closed: boolean;
30
30
  liquidated: boolean;
31
31
  leverage_amount: BigNumber;
@@ -52,8 +52,53 @@ export type Strategy = {
52
52
  mfee_percent: BigNumber;
53
53
  usdt_usd_feed: number[];
54
54
  jlp_sol_feed: number[];
55
- token_mint: PublicKey;
56
- keeper_fees: BigNumber;
57
55
  collateral_mint: PublicKey;
56
+ keeper_fees: BigNumber;
57
+ borrow_mint: PublicKey;
58
58
  };
59
59
  export declare const strategyStruct: BeetStruct<Strategy, Partial<Strategy>>;
60
+ export type LstPositionInfo = {
61
+ buffer: Buffer;
62
+ amount: BigNumber;
63
+ pos_id: BigNumber;
64
+ user: PublicKey;
65
+ leverage: BigNumber;
66
+ closed: boolean;
67
+ liquidated: boolean;
68
+ leverage_amount: BigNumber;
69
+ is_in_deposit_request: boolean;
70
+ is_in_withdraw_request: boolean;
71
+ position_amount: BigNumber;
72
+ to_be_liquidated: boolean;
73
+ deposit_keeper_fee_paid: BigNumber;
74
+ withdraw_keeper_fee_paid: BigNumber;
75
+ open_timestamp: BigNumber;
76
+ close_timestamp: BigNumber;
77
+ sol_price_open: BigNumber;
78
+ sol_price_close: BigNumber;
79
+ close_received_sol_amount: BigNumber;
80
+ expected_amount_out_lst: BigNumber;
81
+ expected_amount_out_sol: BigNumber;
82
+ };
83
+ export declare const lstPositionInfoStruct: BeetStruct<LstPositionInfo, Partial<LstPositionInfo>>;
84
+ export type LstStrategy = {
85
+ buffer: Buffer;
86
+ keeper: PublicKey;
87
+ keeper_ata: PublicKey;
88
+ next_position_id: BigNumber;
89
+ dtv_limit: BigNumber;
90
+ leverage_limit: BigNumber;
91
+ fixed_fee_split: BigNumber;
92
+ mfee_percent: BigNumber;
93
+ sol_usd_feed: number[];
94
+ lst_feed: number[];
95
+ collateral_mint: PublicKey;
96
+ keeper_fees: BigNumber;
97
+ lst_price: BigNumber;
98
+ is_manual_price_update: boolean;
99
+ slippage_control: BigNumber;
100
+ lst_price_control_slippage: BigNumber;
101
+ admin: PublicKey;
102
+ maturity_time: BigNumber;
103
+ };
104
+ export declare const lstStrategyStruct: BeetStruct<LstStrategy, Partial<LstStrategy>>;