@sonarwatch/portfolio-plugins 0.12.29 → 0.12.31
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1819 -1806
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/banx/calculateLoanRepayValue.d.ts +4 -0
- package/src/plugins/banx/calculateLoanRepayValue.js +37 -0
- package/src/plugins/banx/calculateLoanRepayValue.js.map +1 -0
- package/src/plugins/banx/collectionsJob.d.ts +3 -0
- package/src/plugins/banx/collectionsJob.js +40 -0
- package/src/plugins/banx/collectionsJob.js.map +1 -0
- package/src/plugins/banx/constants.d.ts +8 -0
- package/src/plugins/banx/constants.js +13 -1
- package/src/plugins/banx/constants.js.map +1 -1
- package/src/plugins/banx/filters.d.ts +2 -0
- package/src/plugins/banx/filters.js +26 -1
- package/src/plugins/banx/filters.js.map +1 -1
- package/src/plugins/banx/idl.d.ts +115 -0
- package/src/plugins/banx/idl.js +2256 -0
- package/src/plugins/banx/idl.js.map +1 -0
- package/src/plugins/banx/index.js +9 -2
- package/src/plugins/banx/index.js.map +1 -1
- package/src/plugins/banx/loansFetcher.d.ts +3 -0
- package/src/plugins/banx/loansFetcher.js +158 -0
- package/src/plugins/banx/loansFetcher.js.map +1 -0
- package/src/plugins/banx/offersFetcher.d.ts +3 -0
- package/src/plugins/banx/offersFetcher.js +99 -0
- package/src/plugins/banx/offersFetcher.js.map +1 -0
- package/src/plugins/banx/types.d.ts +200 -0
- package/src/plugins/citrus/collectionsJob.d.ts +3 -0
- package/src/plugins/citrus/collectionsJob.js +40 -0
- package/src/plugins/citrus/collectionsJob.js.map +1 -0
- package/src/plugins/citrus/constants.d.ts +12 -0
- package/src/plugins/citrus/constants.js +26 -0
- package/src/plugins/citrus/constants.js.map +1 -0
- package/src/plugins/citrus/filters.d.ts +2 -0
- package/src/plugins/citrus/filters.js +32 -0
- package/src/plugins/citrus/filters.js.map +1 -0
- package/src/plugins/citrus/idl.d.ts +73 -0
- package/src/plugins/citrus/idl.js +292 -0
- package/src/plugins/citrus/idl.js.map +1 -0
- package/src/plugins/citrus/index.d.ts +6 -0
- package/src/plugins/citrus/index.js +13 -0
- package/src/plugins/citrus/index.js.map +1 -0
- package/src/plugins/citrus/loansFetcher.d.ts +3 -0
- package/src/plugins/citrus/loansFetcher.js +150 -0
- package/src/plugins/citrus/loansFetcher.js.map +1 -0
- package/src/plugins/citrus/types.d.ts +54 -0
- package/src/plugins/citrus/types.js +3 -0
- package/src/plugins/citrus/types.js.map +1 -0
- package/src/plugins/raydium/clmmJob.js +4 -2
- package/src/plugins/raydium/clmmJob.js.map +1 -1
- package/src/plugins/sharky/collectionsJob.d.ts +3 -0
- package/src/plugins/sharky/collectionsJob.js +75 -0
- package/src/plugins/sharky/collectionsJob.js.map +1 -0
- package/src/plugins/sharky/constants.d.ts +12 -0
- package/src/plugins/sharky/constants.js +26 -0
- package/src/plugins/sharky/constants.js.map +1 -0
- package/src/plugins/sharky/filters.d.ts +6 -0
- package/src/plugins/sharky/filters.js +43 -0
- package/src/plugins/sharky/filters.js.map +1 -0
- package/src/plugins/sharky/idl.d.ts +135 -0
- package/src/plugins/sharky/idl.js +388 -0
- package/src/plugins/sharky/idl.js.map +1 -0
- package/src/plugins/sharky/index.d.ts +6 -0
- package/src/plugins/sharky/index.js +13 -0
- package/src/plugins/sharky/index.js.map +1 -0
- package/src/plugins/sharky/loansFetcher.d.ts +3 -0
- package/src/plugins/sharky/loansFetcher.js +141 -0
- package/src/plugins/sharky/loansFetcher.js.map +1 -0
- package/src/plugins/sharky/types.d.ts +66 -0
- package/src/plugins/sharky/types.js +11 -0
- package/src/plugins/sharky/types.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/das/getAssetBatchDas.d.ts +4 -0
- package/src/utils/solana/das/getAssetBatchDas.js +68 -0
- package/src/utils/solana/das/getAssetBatchDas.js.map +1 -0
- package/src/utils/solana/das/heliusAssetToAssetCollectible.d.ts +7 -1
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js +13 -9
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
- package/src/utils/solana/das/types.d.ts +5 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.d.ts +4 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +33 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.d.ts +4 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.js +37 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.js.map +1 -0
- package/src/utils/solana/getMultipleAccountsInfoSafe.d.ts +2 -2
- package/src/utils/solana/getMultipleAccountsInfoSafe.js +3 -3
- package/src/utils/solana/getMultipleAccountsInfoSafe.js.map +1 -1
- package/src/utils/solana/getParsedMultipleAccountsInfo.d.ts +2 -2
- package/src/utils/solana/getParsedMultipleAccountsInfo.js +2 -2
- package/src/utils/solana/getParsedMultipleAccountsInfo.js.map +1 -1
- package/src/utils/solana/index.d.ts +2 -0
- package/src/utils/solana/index.js +2 -0
- package/src/utils/solana/index.js.map +1 -1
@@ -0,0 +1,388 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SharkyIDL = void 0;
|
4
|
+
exports.SharkyIDL = {
|
5
|
+
version: '6.3.0',
|
6
|
+
name: 'sharky',
|
7
|
+
instructions: [],
|
8
|
+
accounts: [
|
9
|
+
{
|
10
|
+
name: 'orderBook',
|
11
|
+
type: {
|
12
|
+
kind: 'struct',
|
13
|
+
fields: [
|
14
|
+
{
|
15
|
+
name: 'version',
|
16
|
+
type: 'u8',
|
17
|
+
},
|
18
|
+
{
|
19
|
+
name: 'orderBookType',
|
20
|
+
type: {
|
21
|
+
defined: 'OrderBookType',
|
22
|
+
},
|
23
|
+
},
|
24
|
+
{
|
25
|
+
name: 'apy',
|
26
|
+
type: {
|
27
|
+
defined: 'APY',
|
28
|
+
},
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: 'loanTerms',
|
32
|
+
type: {
|
33
|
+
defined: 'BookLoanTerms',
|
34
|
+
},
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'feePermillicentage',
|
38
|
+
type: 'u16',
|
39
|
+
},
|
40
|
+
{
|
41
|
+
name: 'feeAuthority',
|
42
|
+
type: 'publicKey',
|
43
|
+
},
|
44
|
+
],
|
45
|
+
},
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: 'loan',
|
49
|
+
type: {
|
50
|
+
kind: 'struct',
|
51
|
+
fields: [
|
52
|
+
{
|
53
|
+
name: 'version',
|
54
|
+
type: 'u8',
|
55
|
+
},
|
56
|
+
{
|
57
|
+
name: 'principalLamports',
|
58
|
+
docs: ['amount in tokens, decimals included'],
|
59
|
+
type: 'u64',
|
60
|
+
},
|
61
|
+
{
|
62
|
+
name: 'orderBook',
|
63
|
+
type: 'publicKey',
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'valueTokenMint',
|
67
|
+
docs: ['Token mint for what the loan is in (spl address)'],
|
68
|
+
type: 'publicKey',
|
69
|
+
},
|
70
|
+
{
|
71
|
+
name: 'escrowBumpSeed',
|
72
|
+
type: 'u8',
|
73
|
+
},
|
74
|
+
{
|
75
|
+
name: 'loanState',
|
76
|
+
docs: ['stores start and duration'],
|
77
|
+
type: {
|
78
|
+
defined: 'LoanState',
|
79
|
+
},
|
80
|
+
},
|
81
|
+
],
|
82
|
+
},
|
83
|
+
},
|
84
|
+
{
|
85
|
+
name: 'nftList',
|
86
|
+
type: {
|
87
|
+
kind: 'struct',
|
88
|
+
fields: [
|
89
|
+
{
|
90
|
+
name: 'version',
|
91
|
+
type: 'u8',
|
92
|
+
},
|
93
|
+
{
|
94
|
+
name: 'collectionName',
|
95
|
+
type: 'string',
|
96
|
+
},
|
97
|
+
],
|
98
|
+
},
|
99
|
+
},
|
100
|
+
{
|
101
|
+
name: 'escrowPda',
|
102
|
+
type: {
|
103
|
+
kind: 'struct',
|
104
|
+
fields: [
|
105
|
+
{
|
106
|
+
name: 'bump',
|
107
|
+
type: 'u8',
|
108
|
+
},
|
109
|
+
],
|
110
|
+
},
|
111
|
+
},
|
112
|
+
{
|
113
|
+
name: 'programVersion',
|
114
|
+
type: {
|
115
|
+
kind: 'struct',
|
116
|
+
fields: [
|
117
|
+
{
|
118
|
+
name: 'version',
|
119
|
+
type: 'u8',
|
120
|
+
},
|
121
|
+
{
|
122
|
+
name: 'bump',
|
123
|
+
type: 'u8',
|
124
|
+
},
|
125
|
+
{
|
126
|
+
name: 'updated',
|
127
|
+
type: 'i64',
|
128
|
+
},
|
129
|
+
],
|
130
|
+
},
|
131
|
+
},
|
132
|
+
],
|
133
|
+
types: [
|
134
|
+
{
|
135
|
+
name: 'CnftArgs',
|
136
|
+
type: {
|
137
|
+
kind: 'struct',
|
138
|
+
fields: [
|
139
|
+
{
|
140
|
+
name: 'cnftRoot',
|
141
|
+
type: {
|
142
|
+
array: ['u8', 32],
|
143
|
+
},
|
144
|
+
},
|
145
|
+
{
|
146
|
+
name: 'cnftDataHash',
|
147
|
+
type: {
|
148
|
+
array: ['u8', 32],
|
149
|
+
},
|
150
|
+
},
|
151
|
+
{
|
152
|
+
name: 'cnftCreatorHash',
|
153
|
+
type: {
|
154
|
+
array: ['u8', 32],
|
155
|
+
},
|
156
|
+
},
|
157
|
+
{
|
158
|
+
name: 'cnftNonce',
|
159
|
+
type: 'u64',
|
160
|
+
},
|
161
|
+
{
|
162
|
+
name: 'cnftIndex',
|
163
|
+
type: 'u32',
|
164
|
+
},
|
165
|
+
],
|
166
|
+
},
|
167
|
+
},
|
168
|
+
{
|
169
|
+
name: 'UpdateIndex',
|
170
|
+
type: {
|
171
|
+
kind: 'struct',
|
172
|
+
fields: [
|
173
|
+
{
|
174
|
+
name: 'index',
|
175
|
+
type: 'u32',
|
176
|
+
},
|
177
|
+
{
|
178
|
+
name: 'mint',
|
179
|
+
type: 'publicKey',
|
180
|
+
},
|
181
|
+
],
|
182
|
+
},
|
183
|
+
},
|
184
|
+
{
|
185
|
+
name: 'LoanOffer',
|
186
|
+
type: {
|
187
|
+
kind: 'struct',
|
188
|
+
fields: [
|
189
|
+
{
|
190
|
+
name: 'lenderWallet',
|
191
|
+
type: 'publicKey',
|
192
|
+
},
|
193
|
+
{
|
194
|
+
name: 'termsSpec',
|
195
|
+
type: {
|
196
|
+
defined: 'LoanTermsSpec',
|
197
|
+
},
|
198
|
+
},
|
199
|
+
{
|
200
|
+
name: 'offerTime',
|
201
|
+
type: 'i64',
|
202
|
+
},
|
203
|
+
],
|
204
|
+
},
|
205
|
+
},
|
206
|
+
{
|
207
|
+
name: 'TakenLoan',
|
208
|
+
type: {
|
209
|
+
kind: 'struct',
|
210
|
+
fields: [
|
211
|
+
{
|
212
|
+
name: 'nftCollateralMint',
|
213
|
+
type: 'publicKey',
|
214
|
+
},
|
215
|
+
{
|
216
|
+
name: 'lenderNoteMint',
|
217
|
+
type: 'publicKey',
|
218
|
+
},
|
219
|
+
{
|
220
|
+
name: 'borrowerNoteMint',
|
221
|
+
type: 'publicKey',
|
222
|
+
},
|
223
|
+
{
|
224
|
+
name: 'apy',
|
225
|
+
docs: [
|
226
|
+
'Thousandths of a percent (allows to have 3 decimal points of precision)',
|
227
|
+
],
|
228
|
+
type: {
|
229
|
+
defined: 'APY',
|
230
|
+
},
|
231
|
+
},
|
232
|
+
{
|
233
|
+
name: 'terms',
|
234
|
+
type: {
|
235
|
+
defined: 'LoanTerms',
|
236
|
+
},
|
237
|
+
},
|
238
|
+
{
|
239
|
+
name: 'isCollateralFrozen',
|
240
|
+
type: 'u8',
|
241
|
+
},
|
242
|
+
],
|
243
|
+
},
|
244
|
+
},
|
245
|
+
{
|
246
|
+
name: 'APY',
|
247
|
+
docs: ['APY settings on an [`OrderBook`]'],
|
248
|
+
type: {
|
249
|
+
kind: 'enum',
|
250
|
+
variants: [
|
251
|
+
{
|
252
|
+
name: 'Fixed',
|
253
|
+
fields: [
|
254
|
+
{
|
255
|
+
name: 'apy',
|
256
|
+
docs: ['Thousandths of a percent'],
|
257
|
+
type: 'u32',
|
258
|
+
},
|
259
|
+
],
|
260
|
+
},
|
261
|
+
],
|
262
|
+
},
|
263
|
+
},
|
264
|
+
{
|
265
|
+
name: 'BookLoanTerms',
|
266
|
+
type: {
|
267
|
+
kind: 'enum',
|
268
|
+
variants: [
|
269
|
+
{
|
270
|
+
name: 'Fixed',
|
271
|
+
fields: [
|
272
|
+
{
|
273
|
+
name: 'terms',
|
274
|
+
type: {
|
275
|
+
defined: 'LoanTermsSpec',
|
276
|
+
},
|
277
|
+
},
|
278
|
+
],
|
279
|
+
},
|
280
|
+
{
|
281
|
+
name: 'LenderChooses',
|
282
|
+
},
|
283
|
+
],
|
284
|
+
},
|
285
|
+
},
|
286
|
+
{
|
287
|
+
name: 'LoanTermsSpec',
|
288
|
+
type: {
|
289
|
+
kind: 'enum',
|
290
|
+
variants: [
|
291
|
+
{
|
292
|
+
name: 'Time',
|
293
|
+
fields: [
|
294
|
+
{
|
295
|
+
name: 'duration',
|
296
|
+
type: 'u64',
|
297
|
+
},
|
298
|
+
],
|
299
|
+
},
|
300
|
+
],
|
301
|
+
},
|
302
|
+
},
|
303
|
+
{
|
304
|
+
name: 'OrderBookType',
|
305
|
+
type: {
|
306
|
+
kind: 'enum',
|
307
|
+
variants: [
|
308
|
+
{
|
309
|
+
name: 'Collection',
|
310
|
+
fields: [
|
311
|
+
{
|
312
|
+
name: 'collection_key',
|
313
|
+
type: 'publicKey',
|
314
|
+
},
|
315
|
+
],
|
316
|
+
},
|
317
|
+
{
|
318
|
+
name: 'NFTList',
|
319
|
+
fields: [
|
320
|
+
{
|
321
|
+
name: 'list_account',
|
322
|
+
type: 'publicKey',
|
323
|
+
},
|
324
|
+
],
|
325
|
+
},
|
326
|
+
],
|
327
|
+
},
|
328
|
+
},
|
329
|
+
{
|
330
|
+
name: 'LoanTerms',
|
331
|
+
type: {
|
332
|
+
kind: 'enum',
|
333
|
+
variants: [
|
334
|
+
{
|
335
|
+
name: 'Time',
|
336
|
+
fields: [
|
337
|
+
{
|
338
|
+
name: 'start',
|
339
|
+
docs: ['This is a [`UnixTimeStamp`]'],
|
340
|
+
type: 'i64',
|
341
|
+
},
|
342
|
+
{
|
343
|
+
name: 'duration',
|
344
|
+
type: 'u64',
|
345
|
+
},
|
346
|
+
{
|
347
|
+
name: 'total_owed_lamports',
|
348
|
+
type: 'u64',
|
349
|
+
},
|
350
|
+
],
|
351
|
+
},
|
352
|
+
],
|
353
|
+
},
|
354
|
+
},
|
355
|
+
{
|
356
|
+
name: 'LoanState',
|
357
|
+
type: {
|
358
|
+
kind: 'enum',
|
359
|
+
variants: [
|
360
|
+
{
|
361
|
+
name: 'Offer',
|
362
|
+
fields: [
|
363
|
+
{
|
364
|
+
name: 'offer',
|
365
|
+
type: {
|
366
|
+
defined: 'LoanOffer',
|
367
|
+
},
|
368
|
+
},
|
369
|
+
],
|
370
|
+
},
|
371
|
+
{
|
372
|
+
name: 'Taken',
|
373
|
+
fields: [
|
374
|
+
{
|
375
|
+
name: 'taken',
|
376
|
+
type: {
|
377
|
+
defined: 'TakenLoan',
|
378
|
+
},
|
379
|
+
},
|
380
|
+
],
|
381
|
+
},
|
382
|
+
],
|
383
|
+
},
|
384
|
+
},
|
385
|
+
],
|
386
|
+
errors: [],
|
387
|
+
};
|
388
|
+
//# sourceMappingURL=idl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"idl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/idl.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,EAAE;I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AAM,EAAE;4BACN;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,CAAC,6BAA6B,CAAC;gCACrC,IAAI,EAAE,KAAK;6BACZ;4BACD;gCACE,IAAI,EAAE,UAAU;gCAChB,IAAI,EAAE,KAAK;6BACZ;4BACD;gCACE,IAAI,EAAE,qBAAqB;gCAC3B,IAAI,EAAE,KAAK;6BACZ;yBACF;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,OAAO;wBACb,MAAM,EAAE;4BACN;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE;oCACJ,OAAO,EAAE,WAAW;iCACrB;6BACF;yBACF;qBACF;oBACD;wBACE,IAAI,EAAE,OAAO;wBACb,MAAM,EAAE;4BACN;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE;oCACJ,OAAO,EAAE,WAAW;iCACrB;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const collectionsJob_1 = __importDefault(require("./collectionsJob"));
|
9
|
+
const loansFetcher_1 = __importDefault(require("./loansFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [collectionsJob_1.default];
|
12
|
+
exports.fetchers = [loansFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,wBAAc,CAAC,CAAC;AAC/B,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
|
@@ -0,0 +1,141 @@
|
|
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 solana_1 = require("../../utils/solana");
|
20
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
21
|
+
const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
|
22
|
+
const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
|
23
|
+
const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
|
24
|
+
const filters_1 = require("./filters");
|
25
|
+
const collections = new Map();
|
26
|
+
let collectionLastUpdate = 0;
|
27
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
|
+
const dasUrl = (0, getSolanaDasEndpoint_1.default)();
|
29
|
+
const connection = (0, clients_1.getClientSolana)();
|
30
|
+
const [filterA, filterB, filterC] = (0, filters_1.getLoanFilters)(owner);
|
31
|
+
const accounts = (yield Promise.all([
|
32
|
+
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterA),
|
33
|
+
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterB),
|
34
|
+
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterC),
|
35
|
+
])).flat();
|
36
|
+
if (accounts.length === 0)
|
37
|
+
return [];
|
38
|
+
const [solTokenPrice, heliusAssets] = yield Promise.all([
|
39
|
+
cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana),
|
40
|
+
(0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, accounts
|
41
|
+
.map((acc) => { var _a; return (_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint; })
|
42
|
+
.filter((mint) => mint)),
|
43
|
+
]);
|
44
|
+
if (!solTokenPrice)
|
45
|
+
return [];
|
46
|
+
if (collectionLastUpdate + constants_1.collectionRefreshInterval < Date.now()) {
|
47
|
+
const collectionsArr = yield cache.getItem(constants_1.collectionsCacheKey, {
|
48
|
+
prefix: constants_1.cachePrefix,
|
49
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
50
|
+
});
|
51
|
+
if (collectionsArr) {
|
52
|
+
collectionsArr.forEach((cc) => {
|
53
|
+
collections.set(cc.orderBook, cc);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
collectionLastUpdate = Date.now();
|
57
|
+
}
|
58
|
+
const elements = [];
|
59
|
+
accounts.forEach((acc) => {
|
60
|
+
var _a;
|
61
|
+
const collection = collections.get(acc.orderBook);
|
62
|
+
if (!collection)
|
63
|
+
return;
|
64
|
+
const borrowedAssets = [];
|
65
|
+
const suppliedAssets = [];
|
66
|
+
let mintAsset = null;
|
67
|
+
if ((_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint) {
|
68
|
+
const heliusAsset = heliusAssets.get(acc.loanState.taken.taken.nftCollateralMint);
|
69
|
+
if (heliusAsset) {
|
70
|
+
const assetValue = new bignumber_js_1.default(collection.floor)
|
71
|
+
.multipliedBy(solTokenPrice.price)
|
72
|
+
.toNumber();
|
73
|
+
mintAsset = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(heliusAsset, {
|
74
|
+
tags: [portfolio_core_1.collectibleFreezedTag],
|
75
|
+
collection: {
|
76
|
+
name: collection.name,
|
77
|
+
floorPrice: assetValue,
|
78
|
+
},
|
79
|
+
});
|
80
|
+
}
|
81
|
+
}
|
82
|
+
const solAsset = (0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, new bignumber_js_1.default(acc.principalLamports)
|
83
|
+
.dividedBy(Math.pow(10, portfolio_core_1.solanaNativeDecimals))
|
84
|
+
.toNumber(), portfolio_core_1.NetworkId.solana, solTokenPrice);
|
85
|
+
let name;
|
86
|
+
if (acc.loanState.offer) {
|
87
|
+
// LENDER
|
88
|
+
suppliedAssets.push(solAsset);
|
89
|
+
name = `Lend Offer on ${collection.name}`;
|
90
|
+
}
|
91
|
+
else if (acc.loanState.taken) {
|
92
|
+
if (acc.loanState.taken.taken.lenderNoteMint === owner.toString()) {
|
93
|
+
// LENDER
|
94
|
+
suppliedAssets.push(solAsset);
|
95
|
+
if (mintAsset)
|
96
|
+
borrowedAssets.push(mintAsset);
|
97
|
+
name = `Active Loan on ${collection.name}`;
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
// BORROWER
|
101
|
+
if (mintAsset) {
|
102
|
+
suppliedAssets.push(mintAsset);
|
103
|
+
}
|
104
|
+
borrowedAssets.push(solAsset);
|
105
|
+
name = `Active Loan on ${collection.name}`;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
if (suppliedAssets.length === 0)
|
109
|
+
return;
|
110
|
+
const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, []);
|
111
|
+
elements.push({
|
112
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
113
|
+
label: 'Lending',
|
114
|
+
platformId: constants_1.platformId,
|
115
|
+
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
116
|
+
value: suppliedValue,
|
117
|
+
name,
|
118
|
+
data: {
|
119
|
+
borrowedAssets,
|
120
|
+
borrowedValue,
|
121
|
+
borrowedYields: [],
|
122
|
+
suppliedAssets,
|
123
|
+
suppliedValue,
|
124
|
+
suppliedYields: [],
|
125
|
+
collateralRatio: null,
|
126
|
+
rewardAssets: [],
|
127
|
+
rewardValue,
|
128
|
+
healthRatio,
|
129
|
+
value: suppliedValue,
|
130
|
+
},
|
131
|
+
});
|
132
|
+
});
|
133
|
+
return elements;
|
134
|
+
});
|
135
|
+
const fetcher = {
|
136
|
+
id: `${constants_1.platformId}-loans`,
|
137
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
138
|
+
executor,
|
139
|
+
};
|
140
|
+
exports.default = fetcher;
|
141
|
+
//# sourceMappingURL=loansFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAkE;AAElE,qGAA6E;AAC7E,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AACrG,uCAA2C;AAE3C,MAAM,WAAW,GAA4B,IAA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E,WAAW,EAAE,GAC9D,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;QAC9D,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,KAAK,EAAE,aAAa;YACpB,IAAI;YACJ,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,EAAE;gBAClB,cAAc;gBACd,aAAa;gBACb,cAAc,EAAE,EAAE;gBAClB,eAAe,EAAE,IAAI;gBACrB,YAAY,EAAE,EAAE;gBAChB,WAAW;gBACX,WAAW;gBACX,KAAK,EAAE,aAAa;aACrB;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { FixableBeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
export type Loan = {
|
4
|
+
version: number;
|
5
|
+
principalLamports: string;
|
6
|
+
orderBook: string;
|
7
|
+
valueTokenMint: string;
|
8
|
+
escrowBumSeed: number;
|
9
|
+
loanState: {
|
10
|
+
offer?: LoanOffer;
|
11
|
+
taken?: TakenLoan;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
export type LoanOffer = {
|
15
|
+
offer: {
|
16
|
+
lenderWallet: string;
|
17
|
+
termsSpec: LoanTermsSpec;
|
18
|
+
offerTime: number;
|
19
|
+
};
|
20
|
+
};
|
21
|
+
export type TakenLoan = {
|
22
|
+
taken: {
|
23
|
+
nftCollateralMint: string;
|
24
|
+
lenderNoteMint: string;
|
25
|
+
borrowerNoteMint: string;
|
26
|
+
apy: APY;
|
27
|
+
terms: LoanTerms;
|
28
|
+
isCollateralFrozen: number;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
export type APY = {
|
32
|
+
fixed: {
|
33
|
+
apy: number;
|
34
|
+
};
|
35
|
+
};
|
36
|
+
export type LoanTerms = {
|
37
|
+
time: {
|
38
|
+
start: number;
|
39
|
+
duration: string;
|
40
|
+
totalOwedLamports: string;
|
41
|
+
};
|
42
|
+
};
|
43
|
+
export type LoanTermsSpec = {
|
44
|
+
time: {
|
45
|
+
duration: string;
|
46
|
+
};
|
47
|
+
};
|
48
|
+
export type OrderBook = {
|
49
|
+
orderBookType: {
|
50
|
+
nftList: {
|
51
|
+
listAccount: string;
|
52
|
+
};
|
53
|
+
};
|
54
|
+
};
|
55
|
+
export type Collection = {
|
56
|
+
orderBook: string;
|
57
|
+
name: string;
|
58
|
+
floor: number;
|
59
|
+
tensor_id: string;
|
60
|
+
};
|
61
|
+
export type NftList = {
|
62
|
+
buffer: Buffer;
|
63
|
+
version: number;
|
64
|
+
collectionName: number[];
|
65
|
+
};
|
66
|
+
export declare const nftListStruct: FixableBeetStruct<NftList, Partial<NftList>>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.nftListStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const solana_1 = require("../../utils/solana");
|
6
|
+
exports.nftListStruct = new beet_1.FixableBeetStruct([
|
7
|
+
['buffer', (0, solana_1.blob)(8)],
|
8
|
+
['version', beet_1.u8],
|
9
|
+
['collectionName', (0, beet_1.array)(beet_1.u8)],
|
10
|
+
], (args) => args);
|
11
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/types.ts"],"names":[],"mappings":";;;AAAA,oDAAyE;AACzE,+CAA0C;AA0E7B,QAAA,aAAa,GAAG,IAAI,wBAAiB,CAChD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,gBAAgB,EAAE,IAAA,YAAK,EAAC,SAAE,CAAC,CAAC;CAC9B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC"}
|