@sonarwatch/portfolio-plugins 0.12.126 → 0.12.128

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeMineIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/mergeMineIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;oBACZ,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,WAAW;6BACnB;4BACD;gCACE,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,WAAW;gCACjB,OAAO,EAAE,MAAM;gCACf,IAAI,EAAE,cAAc;6BACrB;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;iBACb;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;oBACZ,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,aAAa;6BACrB;4BACD;gCACE,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,WAAW;gCACjB,OAAO,EAAE,WAAW;gCACpB,IAAI,EAAE,MAAM;6BACb;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;iBACb;gBACD;oBACE,IAAI,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E,IAAI;YACV,IAAI,EAAE,0BAA0B;YAChC,GAAG,EAAE,qDAAqD;SAC3D;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,yBAAyB;YAC/B,GAAG,EAAE,6EAA6E;SACnF;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,sBAAsB;YAC5B,GAAG,EAAE,yCAAyC;SAC/C;KACF;CACF,CAAC"}
@@ -13,64 +13,52 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const web3_js_1 = require("@solana/web3.js");
17
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
17
  const constants_1 = require("./constants");
19
18
  const constants_2 = require("../thevault/constants");
20
19
  const constants_3 = require("../saber/constants");
21
20
  const clients_1 = require("../../utils/clients");
22
21
  const solana_1 = require("../../utils/solana");
23
- const helpers_1 = require("./helpers");
24
22
  const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
25
23
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
26
24
  const tokenPriceToAssetTokens_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetTokens"));
25
+ const filters_1 = require("./filters");
26
+ const calculatePositions_1 = require("./calculatePositions");
27
27
  const rewardersMemo = new MemoizedCache_1.MemoizedCache(constants_1.rewardersCacheKey, {
28
28
  prefix: constants_1.platformId,
29
29
  networkId: portfolio_core_1.NetworkId.solana,
30
30
  });
31
31
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
32
32
  const connection = (0, clients_1.getClientSolana)();
33
- const rewarders = yield rewardersMemo.getItem(cache);
34
- if (!rewarders)
33
+ const [mergeMinerAccounts, minerAccounts] = yield Promise.all([
34
+ (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mergeMineIdlItem, (0, filters_1.mergeMinerFilters)(owner)).then((accs) => accs.filter((acc) => acc !== null && acc.primaryBalance !== '0')),
35
+ (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mineIdlItem, (0, filters_1.minerFilters)(owner)).then((accs) => accs.filter((acc) => acc !== null && acc.balance !== '0')),
36
+ ]);
37
+ if (mergeMinerAccounts.length === 0 && minerAccounts.length === 0)
35
38
  return [];
36
- const quarryDatas = (0, helpers_1.getQuarryData)(rewarders, new web3_js_1.PublicKey(owner));
37
- const accounts = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, constants_1.mineIdlItem, quarryDatas.map((m) => m.ownerMiner)).then((accs) => accs.filter((acc) => acc !== null && acc.balance !== '0'));
38
- if (accounts.length === 0)
39
+ const replicaMinerAccounts = yield Promise.all(mergeMinerAccounts.map((mmAcount) => {
40
+ return (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mineIdlItem, (0, filters_1.minerFilters)(mmAcount.pubkey.toString()));
41
+ }));
42
+ const allRewarders = yield rewardersMemo.getItem(cache);
43
+ if (!allRewarders)
44
+ return [];
45
+ const positions = (0, calculatePositions_1.calculatePositions)(mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, owner);
46
+ if (positions.length === 0)
39
47
  return [];
40
48
  const mints = new Set();
41
- accounts.forEach((account) => {
42
- const quarryData = quarryDatas.find((q) => q.ownerMiner === (account === null || account === void 0 ? void 0 : account.pubkey));
43
- if (!quarryData)
44
- return;
45
- const rewarder = rewarders.find((r) => r.rewarder === quarryData.rewarder.toString());
46
- if (!rewarder)
47
- return;
48
- mints.add(rewarder.rewardsTokenInfo.address);
49
- const quarry = rewarder.quarries.find((q) => (account === null || account === void 0 ? void 0 : account.quarry) === q.quarry);
50
- if (!quarry)
51
- return;
52
- mints.add(quarry.stakedToken.mint);
49
+ positions.forEach((position) => {
50
+ mints.add(position.stakedTokenInfo.address);
51
+ position.rewardsToken.forEach((rewardToken) => mints.add(rewardToken.toString()));
53
52
  });
54
53
  const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.solana);
55
54
  const elements = [];
56
- accounts.forEach((account) => {
57
- var _a;
58
- if (!account)
59
- return;
60
- const quarryData = quarryDatas.find((q) => q.ownerMiner === (account === null || account === void 0 ? void 0 : account.pubkey));
61
- if (!quarryData)
62
- return;
63
- const rewarder = rewarders.find((r) => r.rewarder === quarryData.rewarder.toString());
64
- if (!rewarder)
65
- return;
66
- const quarry = rewarder.quarries.find((q) => (account === null || account === void 0 ? void 0 : account.quarry) === q.quarry);
67
- if (!quarry)
68
- return;
55
+ positions.forEach((position) => {
56
+ const { rewardsToken, rewardsBalance, primaryRewarder, stakedBalance, stakedTokenInfo, } = position;
69
57
  const assets = [];
70
58
  const rewardAssets = [];
71
- const stakedTokenPrice = tokenPrices.get(quarry.stakedToken.mint);
59
+ const stakedTokenPrice = tokenPrices.get(stakedTokenInfo.address);
72
60
  if (stakedTokenPrice)
73
- assets.push(...(0, tokenPriceToAssetTokens_1.default)(stakedTokenPrice.address, new bignumber_js_1.default(account.balance)
61
+ assets.push(...(0, tokenPriceToAssetTokens_1.default)(stakedTokenPrice.address, new bignumber_js_1.default(stakedBalance)
74
62
  .dividedBy(Math.pow(10, stakedTokenPrice.decimals))
75
63
  .toNumber(), portfolio_core_1.NetworkId.solana, stakedTokenPrice));
76
64
  else {
@@ -79,28 +67,36 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
79
67
  type: 'token',
80
68
  value: null,
81
69
  attributes: {},
82
- name: quarry.primaryTokenInfo.symbol,
70
+ name: stakedTokenInfo.symbol,
83
71
  data: {
84
- amount: new bignumber_js_1.default(account.balance)
85
- .dividedBy(Math.pow(10, quarry.primaryTokenInfo.decimals))
72
+ amount: new bignumber_js_1.default(stakedBalance)
73
+ .dividedBy(Math.pow(10, stakedTokenInfo.decimals))
86
74
  .toNumber(),
87
- address: quarry.stakedToken.mint,
75
+ address: stakedTokenInfo.address,
88
76
  price: null,
89
77
  },
90
- imageUri: quarry.primaryTokenInfo.logoURI,
78
+ imageUri: stakedTokenInfo.logoURI,
91
79
  });
92
80
  }
93
- const rewardTokenPrice = tokenPrices.get(rewarder.rewardsTokenInfo.address);
94
- if (account.rewardsEarned !== '0' && rewardTokenPrice) {
95
- rewardAssets.push((0, tokenPriceToAssetToken_1.default)(rewardTokenPrice.address, new bignumber_js_1.default(account.rewardsEarned)
96
- .dividedBy(Math.pow(10, rewardTokenPrice.decimals))
97
- .toNumber(), portfolio_core_1.NetworkId.solana, rewardTokenPrice));
98
- }
81
+ rewardsToken.forEach((rewardToken, i) => {
82
+ var _a;
83
+ if (rewardsBalance[i] === '0')
84
+ return;
85
+ const rewardTokenPrice = tokenPrices.get(rewardToken);
86
+ if (rewardTokenPrice) {
87
+ rewardAssets.push((0, tokenPriceToAssetToken_1.default)(rewardTokenPrice.elementName === constants_1.IOUTokensElementName &&
88
+ ((_a = rewardTokenPrice.underlyings) === null || _a === void 0 ? void 0 : _a.length) === 1
89
+ ? rewardTokenPrice.underlyings[0].address
90
+ : rewardTokenPrice.address, new bignumber_js_1.default(rewardsBalance[i])
91
+ .dividedBy(Math.pow(10, rewardTokenPrice.decimals))
92
+ .toNumber(), portfolio_core_1.NetworkId.solana, rewardTokenPrice));
93
+ }
94
+ });
99
95
  const assetsValue = (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value));
100
96
  const rewardAssetsValue = (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value));
101
97
  const value = assetsValue;
102
98
  let elementPlatformId;
103
- switch (rewarder.slug) {
99
+ switch (primaryRewarder.slug) {
104
100
  case 'vault':
105
101
  elementPlatformId = constants_2.platformId;
106
102
  break;
@@ -116,7 +112,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
116
112
  platformId: elementPlatformId,
117
113
  type: portfolio_core_1.PortfolioElementType.liquidity,
118
114
  value,
119
- name: elementPlatformId === constants_1.platformId ? (_a = rewarder.info) === null || _a === void 0 ? void 0 : _a.name : constants_1.platform.name,
115
+ name: elementPlatformId === constants_1.platformId ? primaryRewarder.name : constants_1.platform.name,
120
116
  data: {
121
117
  liquidities: [
122
118
  {
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAErC,2CAKqB;AACrB,qDAAyE;AACzE,kDAAmE;AAEnE,iDAAsD;AACtD,+CAAuE;AACvE,uCAA0C;AAE1C,kEAA+D;AAC/D,qGAA6E;AAC7E,uGAA+E;AAE/E,MAAM,aAAa,GAAG,IAAI,6BAAa,CAAa,6BAAiB,EAAE;IACrE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE1B,MAAM,WAAW,GAAG,IAAA,uBAAa,EAAC,SAAS,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAEnE,MAAM,QAAQ,GAAG,MAAM,IAAA,0CAAiC,EACtD,UAAU,EACV,uBAAW,EACX,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CACrC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC;IAE5E,IAAI,QAAQ,CAAC,M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AK,OAAO;gBACV,iBAAiB,GAAG,sBAAe,CAAC;gBACpC,MAAM;YACR;gBACE,iBAAiB,GAAG,sBAAU,CAAC;QACnC,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,iBAAiB;YAC7B,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,KAAK;YACL,IAAI,EACF,iBAAiB,KAAK,sBAAU,CAAC,CAAC,CAAC,MAAA,QAAQ,CAAC,IAAI,0CAAE,IAAI,CAAC,CAAC,CAAC,oBAAQ,CAAC,IAAI;YACxE,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX;wBACE,MAAM;wBACN,WAAW;wBACX,YAAY;wBACZ,iBAAiB;wBACjB,KAAK;wBACL,MAAM,EAAE,EAAE;qBACX;iBACF;aACF;SACF,CAAC,CAAC;IACL,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,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,2CAOqB;AACrB,qDAAyE;AACzE,kDAAmE;AAEnE,iDAAsD;AACtD,+CAG4B;AAE5B,kEAA+D;AAC/D,qGAA6E;AAC7E,uGAA+E;AAC/E,uCAA4D;AAC5D,6DAA0D;AAE1D,MAAM,aAAa,GAAG,IAAI,6BAAa,CAAa,6BAAiB,EAAE;IACrE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,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Ae,OAAO,CAAC"}
@@ -0,0 +1,59 @@
1
+ export declare const redeemerIdl: {
2
+ version: string;
3
+ name: string;
4
+ instructions: {
5
+ name: string;
6
+ accounts: ({
7
+ name: string;
8
+ isMut: boolean;
9
+ isSigner: boolean;
10
+ pda: {
11
+ seeds: ({
12
+ kind: string;
13
+ type: string;
14
+ value: string;
15
+ account?: undefined;
16
+ path?: undefined;
17
+ } | {
18
+ kind: string;
19
+ type: string;
20
+ account: string;
21
+ path: string;
22
+ value?: undefined;
23
+ })[];
24
+ };
25
+ } | {
26
+ name: string;
27
+ isMut: boolean;
28
+ isSigner: boolean;
29
+ pda?: undefined;
30
+ })[];
31
+ args: {
32
+ name: string;
33
+ type: string;
34
+ }[];
35
+ }[];
36
+ accounts: {
37
+ name: string;
38
+ type: {
39
+ kind: string;
40
+ fields: {
41
+ name: string;
42
+ type: string;
43
+ }[];
44
+ };
45
+ }[];
46
+ events: {
47
+ name: string;
48
+ fields: {
49
+ name: string;
50
+ type: string;
51
+ index: boolean;
52
+ }[];
53
+ }[];
54
+ errors: {
55
+ code: number;
56
+ name: string;
57
+ msg: string;
58
+ }[];
59
+ };
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.redeemerIdl = void 0;
4
+ exports.redeemerIdl = {
5
+ version: '5.0.2',
6
+ name: 'quarry_redeemer',
7
+ instructions: [
8
+ {
9
+ name: 'createRedeemer',
10
+ accounts: [
11
+ {
12
+ name: 'redeemer',
13
+ isMut: !0,
14
+ isSigner: !1,
15
+ pda: {
16
+ seeds: [
17
+ {
18
+ kind: 'const',
19
+ type: 'string',
20
+ value: 'Redeemer',
21
+ },
22
+ {
23
+ kind: 'account',
24
+ type: 'publicKey',
25
+ account: 'Mint',
26
+ path: 'iou_mint',
27
+ },
28
+ {
29
+ kind: 'account',
30
+ type: 'publicKey',
31
+ account: 'Mint',
32
+ path: 'redemption_mint',
33
+ },
34
+ ],
35
+ },
36
+ },
37
+ {
38
+ name: 'iouMint',
39
+ isMut: !1,
40
+ isSigner: !1,
41
+ },
42
+ {
43
+ name: 'redemptionMint',
44
+ isMut: !1,
45
+ isSigner: !1,
46
+ },
47
+ {
48
+ name: 'payer',
49
+ isMut: !0,
50
+ isSigner: !0,
51
+ },
52
+ {
53
+ name: 'systemProgram',
54
+ isMut: !1,
55
+ isSigner: !1,
56
+ },
57
+ ],
58
+ args: [
59
+ {
60
+ name: 'bump',
61
+ type: 'u8',
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ name: 'redeemTokens',
67
+ accounts: [
68
+ {
69
+ name: 'redeemer',
70
+ isMut: !0,
71
+ isSigner: !1,
72
+ },
73
+ {
74
+ name: 'sourceAuthority',
75
+ isMut: !1,
76
+ isSigner: !0,
77
+ },
78
+ {
79
+ name: 'iouMint',
80
+ isMut: !0,
81
+ isSigner: !1,
82
+ },
83
+ {
84
+ name: 'iouSource',
85
+ isMut: !0,
86
+ isSigner: !1,
87
+ },
88
+ {
89
+ name: 'redemptionVault',
90
+ isMut: !0,
91
+ isSigner: !1,
92
+ },
93
+ {
94
+ name: 'redemptionDestination',
95
+ isMut: !0,
96
+ isSigner: !1,
97
+ },
98
+ {
99
+ name: 'tokenProgram',
100
+ isMut: !1,
101
+ isSigner: !1,
102
+ },
103
+ ],
104
+ args: [
105
+ {
106
+ name: 'amount',
107
+ type: 'u64',
108
+ },
109
+ ],
110
+ },
111
+ {
112
+ name: 'redeemAllTokens',
113
+ accounts: [
114
+ {
115
+ name: 'redeemer',
116
+ isMut: !0,
117
+ isSigner: !1,
118
+ },
119
+ {
120
+ name: 'sourceAuthority',
121
+ isMut: !1,
122
+ isSigner: !0,
123
+ },
124
+ {
125
+ name: 'iouMint',
126
+ isMut: !0,
127
+ isSigner: !1,
128
+ },
129
+ {
130
+ name: 'iouSource',
131
+ isMut: !0,
132
+ isSigner: !1,
133
+ },
134
+ {
135
+ name: 'redemptionVault',
136
+ isMut: !0,
137
+ isSigner: !1,
138
+ },
139
+ {
140
+ name: 'redemptionDestination',
141
+ isMut: !0,
142
+ isSigner: !1,
143
+ },
144
+ {
145
+ name: 'tokenProgram',
146
+ isMut: !1,
147
+ isSigner: !1,
148
+ },
149
+ ],
150
+ args: [],
151
+ },
152
+ ],
153
+ accounts: [
154
+ {
155
+ name: 'Redeemer',
156
+ type: {
157
+ kind: 'struct',
158
+ fields: [
159
+ {
160
+ name: 'iouMint',
161
+ type: 'publicKey',
162
+ },
163
+ {
164
+ name: 'redemptionMint',
165
+ type: 'publicKey',
166
+ },
167
+ {
168
+ name: 'bump',
169
+ type: 'u8',
170
+ },
171
+ {
172
+ name: 'totalTokensRedeemed',
173
+ type: 'u64',
174
+ },
175
+ ],
176
+ },
177
+ },
178
+ ],
179
+ events: [
180
+ {
181
+ name: 'RedeemTokensEvent',
182
+ fields: [
183
+ {
184
+ name: 'user',
185
+ type: 'publicKey',
186
+ index: !1,
187
+ },
188
+ {
189
+ name: 'iouMint',
190
+ type: 'publicKey',
191
+ index: !1,
192
+ },
193
+ {
194
+ name: 'redemptionMint',
195
+ type: 'publicKey',
196
+ index: !1,
197
+ },
198
+ {
199
+ name: 'amount',
200
+ type: 'u64',
201
+ index: !1,
202
+ },
203
+ {
204
+ name: 'timestamp',
205
+ type: 'i64',
206
+ index: !1,
207
+ },
208
+ ],
209
+ },
210
+ ],
211
+ errors: [
212
+ {
213
+ code: 6e3,
214
+ name: 'Unauthorized',
215
+ msg: 'Unauthorized.',
216
+ },
217
+ ],
218
+ };
219
+ //# sourceMappingURL=redeemerIdl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redeemerIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemerIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR;oBAC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AAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;iBACb;aACF;YACD,IAAI,EAAE,EAAE;SACT;KACF;IACD,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,WAAW;qBAClB;oBACD;wBACE,IAAI,EAAE,gBAAgB;wBACtB,IAAI,EAAE,WAAW;qBAClB;oBACD;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI;qBACX;oBACD;wBACE,IAAI,EAAE,qBAAqB;wBAC3B,IAAI,EAAE,KAAK;qBACZ;iBACF;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,eAAe;SACrB;KACF;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,56 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const clients_1 = require("../../utils/clients");
15
+ const solana_1 = require("../../utils/solana");
16
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const connection = (0, clients_1.getClientSolana)();
18
+ const accounts = yield (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.redeemerIdlItem);
19
+ if (accounts.length === 0)
20
+ return;
21
+ const sources = [];
22
+ const tokenPrices = yield cache.getTokenPricesAsMap(accounts.map((acc) => acc.redemptionMint), portfolio_core_1.NetworkId.solana);
23
+ accounts.forEach((acc) => {
24
+ const redemptionTokenPrice = tokenPrices.get(acc.redemptionMint);
25
+ if (!redemptionTokenPrice)
26
+ return;
27
+ sources.push({
28
+ address: acc.iouMint,
29
+ decimals: redemptionTokenPrice.decimals,
30
+ id: constants_1.platformId,
31
+ networkId: portfolio_core_1.NetworkId.solana,
32
+ platformId: constants_1.platformId,
33
+ price: redemptionTokenPrice.price,
34
+ timestamp: Date.now(),
35
+ weight: 1,
36
+ elementName: constants_1.IOUTokensElementName,
37
+ underlyings: [
38
+ {
39
+ address: acc.redemptionMint,
40
+ decimals: redemptionTokenPrice.decimals,
41
+ amountPerLp: 1,
42
+ networkId: portfolio_core_1.NetworkId.solana,
43
+ price: redemptionTokenPrice.price,
44
+ },
45
+ ],
46
+ });
47
+ });
48
+ yield cache.setTokenPriceSources(sources);
49
+ });
50
+ const job = {
51
+ id: `${constants_1.platformId}-redeemers`,
52
+ executor,
53
+ label: 'normal',
54
+ };
55
+ exports.default = job;
56
+ //# sourceMappingURL=redeemersJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redeemersJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemersJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAgF;AAEhF,iDAAsD;AACtD,+CAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAA4B,EACjD,UAAU,EACV,2BAAe,CAChB,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,EACzC,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,MAAM,oBAAoB,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAElC,OAAO,CAAC,IAAI,CAAC;YACX,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;YACvC,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,oBAAoB,CAAC,KAAK;YACjC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,gCAAoB;YACjC,WAAW,EAAE;gBACX;oBACE,OAAO,EAAE,GAAG,CAAC,cAAc;oBAC3B,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;oBACvC,WAAW,EAAE,CAAC;oBACd,SAAS,EAAE,0BAAS,CAAC,MAAM;oBAC3B,KAAK,EAAE,oBAAoB,CAAC,KAAK;iBAClC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -20,6 +20,9 @@ export type Quarry = {
20
20
  replicaMint: string;
21
21
  slug: string;
22
22
  stakedToken: TokenInfo;
23
+ replicaQuarries: {
24
+ quarry: string;
25
+ }[];
23
26
  };
24
27
  export type RewardersApiRes = {
25
28
  [rewarder: string]: Omit<Rewarder, 'rewarder'>;
@@ -53,3 +56,39 @@ export type Miner = {
53
56
  balance: string;
54
57
  index: string;
55
58
  };
59
+ export type MergeMiner = {
60
+ pool: string;
61
+ owner: string;
62
+ bump: number;
63
+ index: string;
64
+ primaryBalance: string;
65
+ replicaBalance: string;
66
+ };
67
+ export type QuarryPDA = {
68
+ primaryQuarry: PublicKey;
69
+ mm: PublicKey;
70
+ rewarder: PublicKey;
71
+ replicas: {
72
+ rewardsMint: PublicKey;
73
+ replicaMMMiner: PublicKey;
74
+ rewarder: PublicKey;
75
+ replicaQuarry: PublicKey;
76
+ }[];
77
+ ownerMiner: PublicKey;
78
+ mmMiner: PublicKey;
79
+ rewardsToken: PublicKey;
80
+ };
81
+ export type Redeemer = {
82
+ iouMint: string;
83
+ redemptionMint: string;
84
+ };
85
+ export type Position = {
86
+ primaryRewarder: {
87
+ slug: string;
88
+ name?: string;
89
+ };
90
+ rewardsToken: string[];
91
+ rewardsBalance: string[];
92
+ stakedTokenInfo: DetailedTokenInfo;
93
+ stakedBalance: string;
94
+ };