@sonarwatch/portfolio-plugins 0.14.1 → 0.14.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/CHANGELOG.md +1595 -1574
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +4 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/debridge/airdropFetcher.js +6 -0
  8. package/src/plugins/debridge/airdropFetcher.js.map +1 -1
  9. package/src/plugins/debridge/constants.d.ts +3 -1
  10. package/src/plugins/debridge/constants.js +4 -2
  11. package/src/plugins/debridge/constants.js.map +1 -1
  12. package/src/plugins/debridge/dlmmVaultsFetcher.d.ts +3 -0
  13. package/src/plugins/debridge/dlmmVaultsFetcher.js +158 -0
  14. package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -0
  15. package/src/plugins/debridge/dlmmVaultsJob.d.ts +3 -0
  16. package/src/plugins/debridge/dlmmVaultsJob.js +42 -0
  17. package/src/plugins/debridge/dlmmVaultsJob.js.map +1 -0
  18. package/src/plugins/debridge/index.js +7 -2
  19. package/src/plugins/debridge/index.js.map +1 -1
  20. package/src/plugins/deepbook/airdropFetcher.js +36 -14
  21. package/src/plugins/deepbook/airdropFetcher.js.map +1 -1
  22. package/src/plugins/jupiter/exchange/custodiesJob.js +2 -2
  23. package/src/plugins/jupiter/exchange/custodiesJob.js.map +1 -1
  24. package/src/plugins/jupiter/exchange/filters.d.ts +1 -0
  25. package/src/plugins/jupiter/exchange/filters.js +10 -1
  26. package/src/plugins/jupiter/exchange/filters.js.map +1 -1
  27. package/src/plugins/jupiter/launchpad/constants.js +1 -1
  28. package/src/plugins/kamino/{s2AirdropFetcher.js → s2AirdropFetcher.old.js} +1 -1
  29. package/src/plugins/kamino/s2AirdropFetcher.old.js.map +1 -0
  30. package/src/plugins/native-stake/solana/constants.js +0 -1
  31. package/src/plugins/native-stake/solana/constants.js.map +1 -1
  32. package/src/plugins/native-stake/solana/solanaFetcher.js +11 -7
  33. package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
  34. package/src/plugins/nxfinance/positionsFetcher.js +1 -1
  35. package/src/plugins/nxfinance/positionsFetcher.js.map +1 -1
  36. package/src/plugins/scallop/cnyAirdropFetcher.js +1 -1
  37. package/src/plugins/scallop/cnyAirdropFetcher.js.map +1 -1
  38. package/src/plugins/scallop/constants.d.ts +9 -16
  39. package/src/plugins/scallop/constants.js +28 -44
  40. package/src/plugins/scallop/constants.js.map +1 -1
  41. package/src/plugins/scallop/index.js +7 -1
  42. package/src/plugins/scallop/index.js.map +1 -1
  43. package/src/plugins/scallop/lendingsFetcher.js +149 -79
  44. package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
  45. package/src/plugins/scallop/marketJob.js.map +1 -1
  46. package/src/plugins/scallop/obligationsFetcher.js +2 -2
  47. package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
  48. package/src/plugins/scallop/poolsJob.js +14 -5
  49. package/src/plugins/scallop/poolsJob.js.map +1 -1
  50. package/src/plugins/scallop/sCoinJob.js +2 -1
  51. package/src/plugins/scallop/sCoinJob.js.map +1 -1
  52. package/src/plugins/scallop/types/address.d.ts +1 -0
  53. package/src/plugins/scallop/types/basic.d.ts +4 -0
  54. package/src/plugins/scallop/types/coin.d.ts +18 -8
  55. package/src/plugins/scallop/types/coin.js +50 -2
  56. package/src/plugins/scallop/types/coin.js.map +1 -1
  57. package/src/plugins/scallop/types/data.d.ts +7 -5
  58. package/src/plugins/scallop/types/index.d.ts +2 -0
  59. package/src/plugins/scallop/types/index.js +2 -0
  60. package/src/plugins/scallop/types/index.js.map +1 -1
  61. package/src/plugins/scallop/types/spool.d.ts +10 -0
  62. package/src/plugins/scallop/types/spool.js +3 -0
  63. package/src/plugins/scallop/types/spool.js.map +1 -0
  64. package/src/plugins/scallop/types/sui.d.ts +2 -0
  65. package/src/plugins/scallop/types/sui.js +3 -0
  66. package/src/plugins/scallop/types/sui.js.map +1 -0
  67. package/src/plugins/scallop/types/vesca.d.ts +9 -12
  68. package/src/plugins/scallop/veScaFetcher.js +1 -1
  69. package/src/plugins/scallop/veScaFetcher.js.map +1 -1
  70. package/src/plugins/sushiswap/helpers.js +24 -24
  71. package/src/plugins/uniswap-v2/helpers.js +22 -22
  72. package/src/plugins/vaultka/constants.d.ts +8 -0
  73. package/src/plugins/vaultka/constants.js +31 -0
  74. package/src/plugins/vaultka/constants.js.map +1 -0
  75. package/src/plugins/vaultka/index.d.ts +6 -0
  76. package/src/plugins/vaultka/index.js +15 -0
  77. package/src/plugins/vaultka/index.js.map +1 -0
  78. package/src/plugins/vaultka/lendingFetcher.d.ts +3 -0
  79. package/src/plugins/vaultka/lendingFetcher.js +58 -0
  80. package/src/plugins/vaultka/lendingFetcher.js.map +1 -0
  81. package/src/plugins/vaultka/lendingJob.d.ts +3 -0
  82. package/src/plugins/vaultka/lendingJob.js +32 -0
  83. package/src/plugins/vaultka/lendingJob.js.map +1 -0
  84. package/src/plugins/vaultka/strategyFetcher.d.ts +3 -0
  85. package/src/plugins/vaultka/strategyFetcher.js +63 -0
  86. package/src/plugins/vaultka/strategyFetcher.js.map +1 -0
  87. package/src/plugins/vaultka/strategyJob.d.ts +3 -0
  88. package/src/plugins/vaultka/strategyJob.js +32 -0
  89. package/src/plugins/vaultka/strategyJob.js.map +1 -0
  90. package/src/plugins/vaultka/structs.d.ts +59 -0
  91. package/src/plugins/vaultka/structs.js +58 -0
  92. package/src/plugins/vaultka/structs.js.map +1 -0
  93. package/src/plugins/zeta/airdropFetcher.js +14 -14
  94. package/src/utils/sei/constants.js +8 -8
  95. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  96. package/src/utils/sui/types.d.ts +4 -0
  97. package/src/plugins/kamino/s2AirdropFetcher.js.map +0 -1
  98. /package/src/plugins/kamino/{s2AirdropFetcher.d.ts → s2AirdropFetcher.old.d.ts} +0 -0
@@ -0,0 +1,59 @@
1
+ /// <reference types="node" />
2
+ import { BeetStruct } from '@metaplex-foundation/beet';
3
+ import BigNumber from 'bignumber.js';
4
+ import { PublicKey } from '@solana/web3.js';
5
+ export type UserInfo = {
6
+ buffer: Buffer;
7
+ shares: BigNumber;
8
+ };
9
+ export declare const userInfoStruct: BeetStruct<UserInfo, Partial<UserInfo>>;
10
+ export type Lending = {
11
+ buffer: Buffer;
12
+ vault_balance: BigNumber;
13
+ borrowed_amount: BigNumber;
14
+ owner: PublicKey;
15
+ total_shares: BigNumber;
16
+ max_utilization_rate: BigNumber;
17
+ water_fee_receiver: PublicKey;
18
+ withdraw_fee: BigNumber;
19
+ withdraw_fee_receiver_ata: PublicKey;
20
+ mint: PublicKey;
21
+ };
22
+ export declare const lendingStruct: BeetStruct<Lending, Partial<Lending>>;
23
+ export type PositionInfo = {
24
+ buffer: Buffer;
25
+ amount: BigNumber;
26
+ pos_id: BigNumber;
27
+ user: PublicKey;
28
+ leverage: number;
29
+ closed: boolean;
30
+ liquidated: boolean;
31
+ leverage_amount: BigNumber;
32
+ is_in_deposit_request: boolean;
33
+ is_in_withdraw_request: boolean;
34
+ position_amount: BigNumber;
35
+ to_be_liquidated: boolean;
36
+ open_timestamp: BigNumber;
37
+ close_timestamp: BigNumber;
38
+ expected_amount_out_token: BigNumber;
39
+ expected_amount_out_collateral: BigNumber;
40
+ increase_position_collateral_pendings: BigNumber;
41
+ requests_slippage: number;
42
+ };
43
+ export declare const positionInfoStruct: BeetStruct<PositionInfo, Partial<PositionInfo>>;
44
+ export type Strategy = {
45
+ buffer: Buffer;
46
+ keeper: PublicKey;
47
+ keeper_ata: PublicKey;
48
+ next_position_id: BigNumber;
49
+ dtv_limit: BigNumber;
50
+ leverage_limit: BigNumber;
51
+ fixed_fee_split: BigNumber;
52
+ mfee_percent: BigNumber;
53
+ usdt_usd_feed: number[];
54
+ jlp_sol_feed: number[];
55
+ token_mint: PublicKey;
56
+ keeper_fees: BigNumber;
57
+ collateral_mint: PublicKey;
58
+ };
59
+ export declare const strategyStruct: BeetStruct<Strategy, Partial<Strategy>>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.strategyStruct = exports.positionInfoStruct = exports.lendingStruct = exports.userInfoStruct = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ exports.userInfoStruct = new beet_1.BeetStruct([
8
+ ['buffer', (0, solana_1.blob)(8)],
9
+ ['shares', solana_1.u128],
10
+ ], (args) => args);
11
+ exports.lendingStruct = new beet_1.BeetStruct([
12
+ ['buffer', (0, solana_1.blob)(8)],
13
+ ['vault_balance', solana_1.u128],
14
+ ['borrowed_amount', solana_1.u128],
15
+ ['owner', beet_solana_1.publicKey],
16
+ ['total_shares', solana_1.u128],
17
+ ['max_utilization_rate', solana_1.u64],
18
+ ['water_fee_receiver', beet_solana_1.publicKey],
19
+ ['withdraw_fee', solana_1.u64],
20
+ ['withdraw_fee_receiver_ata', beet_solana_1.publicKey],
21
+ ['mint', beet_solana_1.publicKey],
22
+ ], (args) => args);
23
+ exports.positionInfoStruct = new beet_1.BeetStruct([
24
+ ['buffer', (0, solana_1.blob)(8)],
25
+ ['amount', solana_1.u64],
26
+ ['pos_id', solana_1.u64],
27
+ ['user', beet_solana_1.publicKey],
28
+ ['leverage', beet_1.u8],
29
+ ['closed', beet_1.bool],
30
+ ['liquidated', beet_1.bool],
31
+ ['leverage_amount', solana_1.u64],
32
+ ['is_in_deposit_request', beet_1.bool],
33
+ ['is_in_withdraw_request', beet_1.bool],
34
+ ['position_amount', solana_1.u64],
35
+ ['to_be_liquidated', beet_1.bool],
36
+ ['open_timestamp', solana_1.i64],
37
+ ['close_timestamp', solana_1.i64],
38
+ ['expected_amount_out_token', solana_1.u64],
39
+ ['expected_amount_out_collateral', solana_1.u64],
40
+ ['increase_position_collateral_pendings', solana_1.u64],
41
+ ['requests_slippage', beet_1.u8],
42
+ ], (args) => args);
43
+ exports.strategyStruct = new beet_1.BeetStruct([
44
+ ['buffer', (0, solana_1.blob)(8)],
45
+ ['keeper', beet_solana_1.publicKey],
46
+ ['keeper_ata', beet_solana_1.publicKey],
47
+ ['next_position_id', solana_1.u64],
48
+ ['dtv_limit', solana_1.u64],
49
+ ['leverage_limit', solana_1.u64],
50
+ ['fixed_fee_split', solana_1.u64],
51
+ ['mfee_percent', solana_1.u64],
52
+ ['usdt_usd_feed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
53
+ ['jlp_sol_feed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
54
+ ['token_mint', beet_solana_1.publicKey],
55
+ ['keeper_fees', solana_1.u64],
56
+ ['collateral_mint', beet_solana_1.publicKey],
57
+ ], (args) => args);
58
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/vaultka/structs.ts"],"names":[],"mappings":";;;AAAA,oDAKmC;AAGnC,kEAA6D;AAC7D,+CAA0D;AAO7C,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,aAAI,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC;AAeW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,iBAAiB,EAAE,aAAI,CAAC;IACzB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,cAAc,EAAE,aAAI,CAAC;IACtB,CAAC,sBAAsB,EAAE,YAAG,CAAC;IAC7B,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,2B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C;IACvB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,eAAe,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC,cAAc,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,iBAAiB,EAAE,uBAAS,CAAC;CAC/B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __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;
@@ -26,6 +26,10 @@ export type AirdropWrapperNFT = {
26
26
  balance: string;
27
27
  id: ID;
28
28
  };
29
+ export type DeepAirdropNFT = {
30
+ amount: string;
31
+ id: ID;
32
+ };
29
33
  export type StructTag = {
30
34
  address: string;
31
35
  module: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"s2AirdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/s2AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,yDAK8B;AAC9B,2CAAmE;AAGnE,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC/D,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,kDAAkD,KAAK,6BAA6B,EACpF,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAC;IAEF,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CACrC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CACpC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IAEvB,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,4BAAgB;QACzB,KAAK,EAAE;YACL;gBACE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;gBACxB,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,oBAAQ;aAClB;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,cAAc,GAAmB;IACrC,EAAE,EAAE,4BAAgB,CAAC,EAAE;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AASO,wCAAc;AAPvB,MAAM,OAAO,GAAG,IAAA,wCAAuB,EACrC,cAAc,EACd,oBAAQ,CAAC,EAAE,EACX,GAAG,oBAAQ,CAAC,EAAE,aAAa,EAC3B,4BAAgB,CAAC,QAAQ,CAC1B,CAAC;AAEuB,0BAAO"}