@sonarwatch/portfolio-plugins 0.11.163 → 0.11.165

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/CHANGELOG.md +14 -6
  2. package/package.json +2 -2
  3. package/src/index.js +8 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +8 -4
  6. package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
  7. package/src/plugins/nosana/constants.d.ts +7 -0
  8. package/src/plugins/nosana/constants.js +17 -0
  9. package/src/plugins/nosana/constants.js.map +1 -0
  10. package/src/plugins/nosana/helpers.d.ts +2 -0
  11. package/src/plugins/nosana/helpers.js +14 -0
  12. package/src/plugins/nosana/helpers.js.map +1 -0
  13. package/src/plugins/nosana/index.d.ts +6 -0
  14. package/src/plugins/nosana/index.js +12 -0
  15. package/src/plugins/nosana/index.js.map +1 -0
  16. package/src/plugins/nosana/stakingFetcher.d.ts +3 -0
  17. package/src/plugins/nosana/stakingFetcher.js +56 -0
  18. package/src/plugins/nosana/stakingFetcher.js.map +1 -0
  19. package/src/plugins/nosana/structs.d.ts +15 -0
  20. package/src/plugins/nosana/structs.js +17 -0
  21. package/src/plugins/nosana/structs.js.map +1 -0
  22. package/src/plugins/rain/collectionsJob.d.ts +3 -0
  23. package/src/plugins/rain/collectionsJob.js +36 -0
  24. package/src/plugins/rain/collectionsJob.js.map +1 -0
  25. package/src/plugins/rain/constants.d.ts +7 -0
  26. package/src/plugins/rain/constants.js +17 -0
  27. package/src/plugins/rain/constants.js.map +1 -0
  28. package/src/plugins/rain/filters.d.ts +5 -0
  29. package/src/plugins/rain/filters.js +53 -0
  30. package/src/plugins/rain/filters.js.map +1 -0
  31. package/src/plugins/rain/helpers.d.ts +7 -0
  32. package/src/plugins/rain/helpers.js +64 -0
  33. package/src/plugins/rain/helpers.js.map +1 -0
  34. package/src/plugins/rain/index.d.ts +6 -0
  35. package/src/plugins/rain/index.js +13 -0
  36. package/src/plugins/rain/index.js.map +1 -0
  37. package/src/plugins/rain/loansFetcher.d.ts +3 -0
  38. package/src/plugins/rain/loansFetcher.js +105 -0
  39. package/src/plugins/rain/loansFetcher.js.map +1 -0
  40. package/src/plugins/rain/poolsFetcher.d.ts +3 -0
  41. package/src/plugins/rain/poolsFetcher.js +73 -0
  42. package/src/plugins/rain/poolsFetcher.js.map +1 -0
  43. package/src/plugins/rain/structs/loan.d.ts +84 -0
  44. package/src/plugins/rain/structs/loan.js +86 -0
  45. package/src/plugins/rain/structs/loan.js.map +1 -0
  46. package/src/plugins/rain/structs/pool.d.ts +77 -0
  47. package/src/plugins/rain/structs/pool.js +76 -0
  48. package/src/plugins/rain/structs/pool.js.map +1 -0
  49. package/src/plugins/rain/types.d.ts +154 -0
  50. package/src/plugins/rain/types.js +3 -0
  51. package/src/plugins/rain/types.js.map +1 -0
  52. package/src/plugins/raydium/constants.d.ts +3 -0
  53. package/src/plugins/raydium/constants.js +4 -1
  54. package/src/plugins/raydium/constants.js.map +1 -1
  55. package/src/plugins/raydium/filters.d.ts +1 -0
  56. package/src/plugins/raydium/filters.js +11 -1
  57. package/src/plugins/raydium/filters.js.map +1 -1
  58. package/src/plugins/raydium/helpers.d.ts +2 -0
  59. package/src/plugins/raydium/helpers.js +10 -1
  60. package/src/plugins/raydium/helpers.js.map +1 -1
  61. package/src/plugins/raydium/index.js +2 -1
  62. package/src/plugins/raydium/index.js.map +1 -1
  63. package/src/plugins/raydium/stakingFetcher.d.ts +3 -0
  64. package/src/plugins/raydium/stakingFetcher.js +50 -0
  65. package/src/plugins/raydium/stakingFetcher.js.map +1 -0
  66. package/src/plugins/raydium/structs/staking.d.ts +12 -0
  67. package/src/plugins/raydium/structs/staking.js +15 -0
  68. package/src/plugins/raydium/structs/staking.js.map +1 -0
@@ -0,0 +1,154 @@
1
+ import { PoolStatus } from './structs/pool';
2
+ export type PoolResponse = {
3
+ pubkey: string;
4
+ pool: Pool;
5
+ };
6
+ export type CollectionResponse = {
7
+ collections: Collection[];
8
+ };
9
+ export type Pool = {
10
+ owner: string;
11
+ currency: string;
12
+ oraclePoolUsd: string;
13
+ oracleSolUsd: string;
14
+ status: PoolStatus;
15
+ isCompounded: boolean;
16
+ isShared: boolean;
17
+ totalAmount: string;
18
+ borrowedAmount: string;
19
+ availableAmount: string;
20
+ usableAmount: string;
21
+ loanCurve: Curve;
22
+ mortgageCurve: Curve;
23
+ isMortgageEnabled: boolean;
24
+ nftLocked: string;
25
+ totalLiquidations: string;
26
+ totalLoans: string;
27
+ totalMortgages: string;
28
+ totalInterest: string;
29
+ depositedAt: string;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ collectionsUpdatedAt: string;
33
+ lastLoanAt: string;
34
+ lastMortgageAt: string;
35
+ conditions: PoolCondition;
36
+ liquidation: PoolLiquidation;
37
+ whitelist: string;
38
+ padding: string[];
39
+ collections: PoolCollection[];
40
+ };
41
+ export type PoolCollection = {
42
+ collection: string;
43
+ collectionLtv: number;
44
+ exposure: number;
45
+ amountUsed: string;
46
+ };
47
+ export type PoolLiquidation = {
48
+ loanLiquidation: number;
49
+ mortgageLiquidation: number;
50
+ isAutoSellEnabled: boolean;
51
+ percentageMaxLoss: number;
52
+ };
53
+ export type PoolCondition = {
54
+ isEnabled: boolean;
55
+ minAge: string;
56
+ minLoan: string;
57
+ minVolume: number;
58
+ liquidationThreshold: number;
59
+ padding1: number;
60
+ padding2: number;
61
+ padding3: number;
62
+ };
63
+ export type Curve = {
64
+ baseInterest: number;
65
+ interestRate: number;
66
+ curveRate: number;
67
+ curveRateDay: number;
68
+ maxDuration: string;
69
+ maxAmount: string;
70
+ };
71
+ export type Collection = {
72
+ collectionId: number;
73
+ pubkey: string;
74
+ slug: string;
75
+ name: string;
76
+ thumbnail: string;
77
+ banner: string;
78
+ nftLocked: string;
79
+ supply: string;
80
+ floorPrice: string;
81
+ isLocked: boolean;
82
+ offChainData: {
83
+ collectionNameMe: string;
84
+ collectionNameTensor: string;
85
+ collectionName: string;
86
+ image: string;
87
+ collectionSolanart: string;
88
+ isMortgageEnabled: boolean;
89
+ isPnft: boolean;
90
+ isClaimable: boolean;
91
+ collectionHyperspace: string;
92
+ sharkyApy: number;
93
+ _id: string;
94
+ };
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ deletedAt: string;
98
+ version: number;
99
+ };
100
+ export type LoansResponse = {
101
+ user: string;
102
+ platform: string;
103
+ limit: number;
104
+ offset: number;
105
+ isAdmin: number;
106
+ totalCount: number;
107
+ ongoingCount: number;
108
+ loans: Loan[];
109
+ };
110
+ export type Loan = {
111
+ pubkey: string;
112
+ kind: string;
113
+ status: string;
114
+ borrower: string;
115
+ lender: string;
116
+ pool: string;
117
+ mint: string;
118
+ currency: string;
119
+ isCustom: boolean;
120
+ isFrozen: boolean;
121
+ isCompressedLoan: boolean;
122
+ isDefi: boolean;
123
+ collateralAmount: string;
124
+ collateralDecimals: number;
125
+ price: string;
126
+ interest: string;
127
+ amount: string;
128
+ duration: string;
129
+ collectionId: number;
130
+ liquidation: number;
131
+ marketplace: string;
132
+ sale: Sale;
133
+ listing: Listing;
134
+ createdAt: Date;
135
+ expiredAt: Date;
136
+ repaidAt: Date;
137
+ soldAt: Date;
138
+ liquidatedAt: Date;
139
+ updatedAt: Date;
140
+ deletedAt: null;
141
+ version: number;
142
+ amountUsd: string;
143
+ };
144
+ export type Listing = {
145
+ isListed: boolean;
146
+ price: string;
147
+ _id: string;
148
+ };
149
+ export type Sale = {
150
+ isForSale: boolean;
151
+ salePrice: string;
152
+ currency: string;
153
+ _id: string;
154
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/types.ts"],"names":[],"mappings":""}
@@ -2,8 +2,11 @@ import { PublicKey } from '@solana/web3.js';
2
2
  import { Platform } from '@sonarwatch/portfolio-core';
3
3
  export declare const platformId = "raydium";
4
4
  export declare const raydiumPlatform: Platform;
5
+ export declare const AMM_PROGRAM_ID_V3: PublicKey;
5
6
  export declare const AMM_PROGRAM_ID_V4: PublicKey;
6
7
  export declare const AMM_PROGRAM_ID_V5: PublicKey;
7
8
  export declare const raydiumProgram: PublicKey;
8
9
  export declare const poolStatesPrefix = "raydium-poolSates";
9
10
  export declare const positionsIdentifier = "Raydium Concentrated Liquidity";
11
+ export declare const rayMint = "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R";
12
+ export declare const rayDecimals = 6;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.positionsIdentifier = exports.poolStatesPrefix = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.raydiumPlatform = exports.platformId = void 0;
3
+ exports.rayDecimals = exports.rayMint = exports.positionsIdentifier = exports.poolStatesPrefix = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.raydiumPlatform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'raydium';
6
6
  exports.raydiumPlatform = {
@@ -10,9 +10,12 @@ exports.raydiumPlatform = {
10
10
  defiLlamaId: 'raydium',
11
11
  website: 'https://raydium.io/',
12
12
  };
13
+ exports.AMM_PROGRAM_ID_V3 = new web3_js_1.PublicKey('EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q');
13
14
  exports.AMM_PROGRAM_ID_V4 = new web3_js_1.PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8');
14
15
  exports.AMM_PROGRAM_ID_V5 = new web3_js_1.PublicKey('5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h');
15
16
  exports.raydiumProgram = new web3_js_1.PublicKey('CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK');
16
17
  exports.poolStatesPrefix = `${exports.platformId}-poolSates`;
17
18
  exports.positionsIdentifier = 'Raydium Concentrated Liquidity';
19
+ exports.rayMint = '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R';
20
+ exports.rayDecimals = 6;
18
21
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE7C,QAAA,mBAAmB,GAAG,gCAAgC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,gBAAgB,GAAG,GAAG,kBAAU,YAAY,CAAC;AAE7C,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,WAAW,GAAG,CAAC,CAAC"}
@@ -2,3 +2,4 @@ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
2
  export declare const ammV4Filter: GetProgramAccountsFilter[];
3
3
  export declare const ammV5Filter: GetProgramAccountsFilter[];
4
4
  export declare const poolsStateFilter: GetProgramAccountsFilter[];
5
+ export declare const stakingFilters: (owner: string) => GetProgramAccountsFilter[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.poolsStateFilter = exports.ammV5Filter = exports.ammV4Filter = void 0;
3
+ exports.stakingFilters = exports.poolsStateFilter = exports.ammV5Filter = exports.ammV4Filter = void 0;
4
4
  const amms_1 = require("./structs/amms");
5
5
  exports.ammV4Filter = [
6
6
  { dataSize: amms_1.ammInfoV4Struct.byteSize },
@@ -11,4 +11,14 @@ exports.ammV5Filter = [
11
11
  exports.poolsStateFilter = [
12
12
  { dataSize: 1544 },
13
13
  ];
14
+ const stakingFilters = (owner) => [
15
+ {
16
+ memcmp: {
17
+ offset: 40,
18
+ bytes: owner,
19
+ },
20
+ },
21
+ { dataSize: 232 },
22
+ ];
23
+ exports.stakingFilters = stakingFilters;
14
24
  //# sourceMappingURL=filters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/filters.ts"],"names":[],"mappings":";;;AACA,yCAAkE;AAErD,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,gBAAgB,GAA+B;IAC1D,EAAE,QAAQ,EAAE,IAAI,EAAE;CACnB,CAAC"}
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/filters.ts"],"names":[],"mappings":";;;AACA,yCAAkE;AAErD,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,sBAAe,CAAC,QAAQ,EAAE;CACvC,CAAC;AAEW,QAAA,gBAAgB,GAA+B;IAC1D,EAAE,QAAQ,EAAE,IAAI,EAAE;CACnB,CAAC;AAEK,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,cAAc,kBAQzB"}
@@ -1,9 +1,11 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import BN from 'bn.js';
3
3
  import { PortfolioAssetCollectible } from '@sonarwatch/portfolio-core';
4
+ import { PublicKey } from '@solana/web3.js';
4
5
  export declare function isARaydiumPosition(nft: PortfolioAssetCollectible): boolean;
5
6
  export declare function raydiumTickToPriceX64(tick: number): BN;
6
7
  export declare function getRaydiumTokenAmountsFromLiquidity(sqrtPriceCurrentX64: BigNumber, sqrtPriceX64A: BigNumber, sqrtPriceX64B: BigNumber, liquidity: BigNumber, roundUp: boolean): {
7
8
  tokenAmountA: BigNumber;
8
9
  tokenAmountB: BigNumber;
9
10
  };
11
+ export declare function getStakePubKey(owner: string): PublicKey;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
6
+ exports.getStakePubKey = exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
7
7
  /* eslint-disable eqeqeq */
8
8
  /* eslint-disable @typescript-eslint/naming-convention */
9
9
  /* eslint-disable no-underscore-dangle */
@@ -11,6 +11,7 @@ exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = ex
11
11
  /* eslint-disable no-bitwise */
12
12
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
13
13
  const bn_js_1 = __importDefault(require("bn.js"));
14
+ const web3_js_1 = require("@solana/web3.js");
14
15
  const constants_1 = require("./constants");
15
16
  function isARaydiumPosition(nft) {
16
17
  return nft.data.name === constants_1.positionsIdentifier;
@@ -168,4 +169,12 @@ function getRaydiumTokenAmountsFromLiquidity(sqrtPriceCurrentX64, sqrtPriceX64A,
168
169
  };
169
170
  }
170
171
  exports.getRaydiumTokenAmountsFromLiquidity = getRaydiumTokenAmountsFromLiquidity;
172
+ function getStakePubKey(owner) {
173
+ return web3_js_1.PublicKey.findProgramAddressSync([
174
+ new web3_js_1.PublicKey('4EwbZo8BZXP5313z5A2H11MRBP15M5n6YxfmkjXESKAW').toBuffer(),
175
+ new web3_js_1.PublicKey(owner).toBuffer(),
176
+ Buffer.from('staker_info_v2_associated_seed', 'utf-8'),
177
+ ], constants_1.AMM_PROGRAM_ID_V3)[0];
178
+ }
179
+ exports.getStakePubKey = getStakePubKey;
171
180
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["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C5B,OAAO,CACR,CAAC,QAAQ,EAAE,CACb,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,sBAAS,CAC3B,4BAA4B,CAC1B,IAAI,eAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,EAChC,IAAI,eAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,EACtC,IAAI,eAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAC5B,OAAO,CACR,CAAC,QAAQ,EAAE,CACb,CAAC;QACF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO;QACL,YAAY,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;QAC9B,YAAY,EAAE,IAAI,sBAAS,CACzB,4BAA4B,CAC1B,IAAI,eAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,EAChC,IAAI,eAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,EAChC,IAAI,eAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAC5B,OAAO,CACR,CAAC,QAAQ,EAAE,CACb;KACF,CAAC;AACJ,CAAC;AAtDD,kFAsDC;AAED,SAAgB,cAAc,CAAC,KAAa;IAC1C,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,IAAI,mBAAS,CAAC,8CAA8C,CAAC,CAAC,QAAQ,EAAE;QACxE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,OAAO,CAAC;KACvD,EACD,6BAAiB,CAClB,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,wCASC"}
@@ -7,7 +7,8 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const lpTokensJob_1 = __importDefault(require("./lpTokensJob"));
8
8
  const clmmJob_1 = __importDefault(require("./clmmJob"));
9
9
  const constants_1 = require("./constants");
10
+ const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
10
11
  exports.platforms = [constants_1.raydiumPlatform];
11
12
  exports.jobs = [lpTokensJob_1.default, clmmJob_1.default];
12
- exports.fetchers = [];
13
+ exports.fetchers = [stakingFetcher_1.default];
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,wDAAgC;AAChC,2CAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,2BAAe,CAAC,CAAC;AAC1C,QAAA,IAAI,GAAU,CAAC,qBAAW,EAAE,iBAAO,CAAC,CAAC;AACrC,QAAA,QAAQ,GAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/index.ts"],"names":[],"mappings":";;;;;;AAGA,gEAAwC;AACxC,wDAAgC;AAChC,2CAA8C;AAC9C,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,2BAAe,CAAC,CAAC;AAC1C,QAAA,IAAI,GAAU,CAAC,qBAAW,EAAE,iBAAO,CAAC,CAAC;AACrC,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const clients_1 = require("../../utils/clients");
19
+ const staking_1 = require("./structs/staking");
20
+ const helpers_1 = require("./helpers");
21
+ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
22
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
23
+ const rayFactor = new bignumber_js_1.default(Math.pow(10, constants_1.rayDecimals));
24
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const client = (0, clients_1.getClientSolana)();
26
+ const stakeAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, staking_1.stakeStruct, (0, helpers_1.getStakePubKey)(owner));
27
+ if (!stakeAccount || stakeAccount.depositBalance.isZero())
28
+ return [];
29
+ const tokenPrice = yield cache.getTokenPrice(constants_1.rayMint, portfolio_core_1.NetworkId.solana);
30
+ const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.rayMint, stakeAccount.depositBalance.dividedBy(rayFactor).toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice);
31
+ return [
32
+ {
33
+ networkId: portfolio_core_1.NetworkId.solana,
34
+ platformId: constants_1.platformId,
35
+ type: portfolio_core_1.PortfolioElementType.multiple,
36
+ label: 'Staked',
37
+ value: asset.value,
38
+ data: {
39
+ assets: [asset],
40
+ },
41
+ },
42
+ ];
43
+ });
44
+ const fetcher = {
45
+ id: `${constants_1.platformId}-staking`,
46
+ networkId: portfolio_core_1.NetworkId.solana,
47
+ executor,
48
+ };
49
+ exports.default = fetcher;
50
+ //# sourceMappingURL=stakingFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,gEAAqC;AAGrC,2CAA+D;AAC/D,iDAAsD;AACtD,+CAAgD;AAChD,uCAA2C;AAC3C,kFAA+E;AAC/E,qGAA6E;AAE7E,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;AAEnD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,YAAY,GAAG,MAAM,IAAA,2CAAoB,EAC7C,MAAM,EACN,qBAAW,EACX,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;IAEF,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,cAAc,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAErE,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,mBAAO,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,mBAAO,EACP,YAAY,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAC3D,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;IAEF,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;SACF;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"}
@@ -0,0 +1,12 @@
1
+ import { BeetStruct } from '@metaplex-foundation/beet';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import BigNumber from 'bignumber.js';
4
+ export type Stake = {
5
+ state: BigNumber;
6
+ poolId: PublicKey;
7
+ stakerOwner: PublicKey;
8
+ depositBalance: BigNumber;
9
+ rewardDebt: BigNumber;
10
+ rewardDebtB: BigNumber;
11
+ };
12
+ export declare const stakeStruct: BeetStruct<Stake, Partial<Stake>>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stakeStruct = 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.stakeStruct = new beet_1.BeetStruct([
8
+ ['state', solana_1.u64],
9
+ ['poolId', beet_solana_1.publicKey],
10
+ ['stakerOwner', beet_solana_1.publicKey],
11
+ ['depositBalance', solana_1.u64],
12
+ ['rewardDebt', solana_1.u64],
13
+ ['rewardDebtB', solana_1.u64],
14
+ ], (args) => args);
15
+ //# sourceMappingURL=staking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/staking.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AACvD,kEAA6D;AAG7D,kDAA4C;AAW/B,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,aAAa,EAAE,YAAG,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}