@sonarwatch/portfolio-plugins 0.14.131 → 0.14.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +2136 -2128
  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/citrus/loansFetcher.js +34 -68
  6. package/src/plugins/citrus/loansFetcher.js.map +1 -1
  7. package/src/plugins/debridge/dlmmVaultsFetcher.js +1 -0
  8. package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
  9. package/src/plugins/jupiter/exchange/helpersPerps.d.ts +2 -0
  10. package/src/plugins/jupiter/exchange/helpersPerps.js +3 -1
  11. package/src/plugins/jupiter/exchange/helpersPerps.js.map +1 -1
  12. package/src/plugins/jupiter/exchange/perpetualFetcher.js +27 -1
  13. package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
  14. package/src/plugins/jupiter/exchange/structs.d.ts +35 -1
  15. package/src/plugins/jupiter/exchange/structs.js +36 -1
  16. package/src/plugins/jupiter/exchange/structs.js.map +1 -1
  17. package/src/plugins/jupiter/exchange/valueAverageFetcher.js +1 -1
  18. package/src/plugins/jupiter/exchange/valueAverageFetcher.js.map +1 -1
  19. package/src/plugins/jupiter/filters.d.ts +1 -0
  20. package/src/plugins/jupiter/filters.js +11 -1
  21. package/src/plugins/jupiter/filters.js.map +1 -1
  22. package/src/plugins/rain/banksFetcher.js +47 -0
  23. package/src/plugins/rain/banksFetcher.js.map +1 -0
  24. package/src/plugins/rain/collectionsJob.js +9 -7
  25. package/src/plugins/rain/collectionsJob.js.map +1 -1
  26. package/src/plugins/rain/constants.d.ts +7 -2
  27. package/src/plugins/rain/constants.js +11 -3
  28. package/src/plugins/rain/constants.js.map +1 -1
  29. package/src/plugins/rain/defiBorrowsFetcher.d.ts +3 -0
  30. package/src/plugins/rain/defiBorrowsFetcher.js +52 -0
  31. package/src/plugins/rain/defiBorrowsFetcher.js.map +1 -0
  32. package/src/plugins/rain/index.js +10 -3
  33. package/src/plugins/rain/index.js.map +1 -1
  34. package/src/plugins/rain/nftBorrowsFetcher.d.ts +3 -0
  35. package/src/plugins/rain/nftBorrowsFetcher.js +76 -0
  36. package/src/plugins/rain/nftBorrowsFetcher.js.map +1 -0
  37. package/src/plugins/rain/poolsFetcher.js +79 -42
  38. package/src/plugins/rain/poolsFetcher.js.map +1 -1
  39. package/src/plugins/rain/structs.d.ts +455 -0
  40. package/src/plugins/rain/structs.js +425 -0
  41. package/src/plugins/rain/structs.js.map +1 -0
  42. package/src/plugins/rain/types.d.ts +18 -144
  43. package/src/plugins/sharky/loansFetcher.js +38 -73
  44. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  45. package/src/plugins/sushiswap/helpers.js +24 -24
  46. package/src/plugins/uniswap-v2/helpers.js +22 -22
  47. package/src/plugins/zeta/airdropFetcher.js +14 -14
  48. package/src/utils/elementbuilder/AssetCollectibleBuilder.d.ts +10 -0
  49. package/src/utils/elementbuilder/AssetCollectibleBuilder.js +53 -0
  50. package/src/utils/elementbuilder/AssetCollectibleBuilder.js.map +1 -0
  51. package/src/utils/elementbuilder/ElementBorrowlendBuilder.d.ts +9 -1
  52. package/src/utils/elementbuilder/ElementBorrowlendBuilder.js +41 -3
  53. package/src/utils/elementbuilder/ElementBorrowlendBuilder.js.map +1 -1
  54. package/src/utils/elementbuilder/ElementRegistry.js +9 -1
  55. package/src/utils/elementbuilder/ElementRegistry.js.map +1 -1
  56. package/src/utils/elementbuilder/Params.d.ts +14 -0
  57. package/src/utils/sei/constants.js +8 -8
  58. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  59. package/src/utils/solana/das/heliusAssetToAssetCollectible.js +3 -2
  60. package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
  61. package/src/plugins/rain/filters.d.ts +0 -7
  62. package/src/plugins/rain/filters.js +0 -53
  63. package/src/plugins/rain/filters.js.map +0 -1
  64. package/src/plugins/rain/helpers.d.ts +0 -9
  65. package/src/plugins/rain/helpers.js +0 -66
  66. package/src/plugins/rain/helpers.js.map +0 -1
  67. package/src/plugins/rain/loansFetcher.js +0 -139
  68. package/src/plugins/rain/loansFetcher.js.map +0 -1
  69. package/src/plugins/rain/structs/loan.d.ts +0 -86
  70. package/src/plugins/rain/structs/loan.js +0 -86
  71. package/src/plugins/rain/structs/loan.js.map +0 -1
  72. package/src/plugins/rain/structs/pool.d.ts +0 -79
  73. package/src/plugins/rain/structs/pool.js +0 -76
  74. package/src/plugins/rain/structs/pool.js.map +0 -1
  75. /package/src/plugins/rain/{loansFetcher.d.ts → banksFetcher.d.ts} +0 -0
@@ -0,0 +1,455 @@
1
+ /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
+ /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import { FixableBeetStruct, BeetStruct } from '@metaplex-foundation/beet';
5
+ import BigNumber from 'bignumber.js';
6
+ export declare const poolLiquidationStruct: BeetStruct<PoolLiquidation, Partial<PoolLiquidation>>;
7
+ export declare const poolLimitStruct: FixableBeetStruct<PoolLimit, Partial<PoolLimit>>;
8
+ export declare const poolCurrencyStruct: BeetStruct<PoolCurrency, Partial<PoolCurrency>>;
9
+ export declare const delegatorStruct: BeetStruct<Delegator, Partial<Delegator>>;
10
+ export declare const poolConditionStruct: FixableBeetStruct<PoolCondition, Partial<PoolCondition>>;
11
+ export declare const personalBankStruct: FixableBeetStruct<PersonalBank, Partial<PersonalBank>>;
12
+ export declare enum BankType {
13
+ Personal = 0,
14
+ Shared = 1
15
+ }
16
+ export declare enum CurveConfig {
17
+ Apr = 0
18
+ }
19
+ export declare enum CurveType {
20
+ Apr = 0
21
+ }
22
+ export declare enum DelegatorType {
23
+ Empty = 0,
24
+ Marginfi = 1
25
+ }
26
+ export declare enum LoanKind {
27
+ Classic = 0,
28
+ MarginSwap = 1,
29
+ Request = 2
30
+ }
31
+ export declare enum LoanKindConfig {
32
+ Classic = 0,
33
+ MarginSwap = 1
34
+ }
35
+ export declare enum LoanStatus {
36
+ Ongoing = 0,
37
+ Repaid = 1,
38
+ Liquidated = 2,
39
+ Sold = 3
40
+ }
41
+ export declare enum OracleConfig {
42
+ None = 0,
43
+ Pyth = 1,
44
+ Switchboard = 2,
45
+ SwitchboardOnDemand = 3
46
+ }
47
+ export declare enum OracleType {
48
+ Empty = 0,
49
+ Pyth = 1,
50
+ Switchboard = 2,
51
+ SwitchboardOnDemand = 3
52
+ }
53
+ export declare enum PoolStatus {
54
+ Enabled = 0,
55
+ Disabled = 1
56
+ }
57
+ export declare enum QuoteStep {
58
+ Open = 0,
59
+ Start = 1,
60
+ End = 2,
61
+ Close = 3
62
+ }
63
+ export declare enum QuoteType {
64
+ None = 0,
65
+ MarginSwap = 1,
66
+ InstantSell = 2,
67
+ Liquidate = 3
68
+ }
69
+ export declare enum SetConfig {
70
+ UpdateMinDuration = 0,
71
+ UpdateMaxDuration = 1,
72
+ UpdateMaxAmountUsd = 2,
73
+ UpdateMinAmountUsd = 3
74
+ }
75
+ export declare enum SetCurrencyConfig {
76
+ UpdateIsLocked = 0,
77
+ UpdateOracle = 1
78
+ }
79
+ export declare enum SetPoolConfig {
80
+ EnablePool = 0,
81
+ DisablePool = 1,
82
+ EnableAutoSell = 2,
83
+ DisableAutoSell = 3,
84
+ UpdateCurve = 4,
85
+ UpdateCurrencies = 5,
86
+ UpdateConditions = 6,
87
+ UpdateLimits = 7
88
+ }
89
+ export type Bank = {
90
+ accountDiscriminator: number[];
91
+ owner: PublicKey;
92
+ mint: PublicKey;
93
+ vault: PublicKey;
94
+ authority: PublicKey;
95
+ bankType: BankType;
96
+ bankTypeDetail: PersonalBank;
97
+ totalLiquidity: BigNumber;
98
+ availableLiquidity: BigNumber;
99
+ delegatedLiquidity: BigNumber;
100
+ cooldownLiquidity: BigNumber;
101
+ cooldownPeriod: BigNumber;
102
+ delegators: Delegator[];
103
+ createdAt: BigNumber;
104
+ depositedAt: BigNumber;
105
+ withdrawnAt: BigNumber;
106
+ borrowedAt: BigNumber;
107
+ repaidAt: BigNumber;
108
+ frozenUntil: BigNumber;
109
+ reserved: number[];
110
+ };
111
+ export declare const bankStruct: FixableBeetStruct<Bank, Partial<Bank>>;
112
+ export type Config = {
113
+ accountDiscriminator: number[];
114
+ minDuration: number;
115
+ maxDuration: number;
116
+ maxAmountUsd: number;
117
+ minAmountUsd: number;
118
+ admins: PublicKey[];
119
+ managers: PublicKey[];
120
+ reserved: number[];
121
+ };
122
+ export declare const configStruct: FixableBeetStruct<Config, Partial<Config>>;
123
+ export type Currency = {
124
+ accountDiscriminator: number[];
125
+ currencyId: number;
126
+ padding1: number[];
127
+ mint: PublicKey;
128
+ tokenProgram: PublicKey;
129
+ isLocked: number;
130
+ decimals: number;
131
+ padding2: number[];
132
+ oracles: OracleType[];
133
+ padding3: number[];
134
+ currentLoan: BigNumber;
135
+ createdAt: BigNumber;
136
+ updatedAt: BigNumber;
137
+ reserved: number[];
138
+ };
139
+ export declare const currencyStruct: FixableBeetStruct<Currency, Partial<Currency>>;
140
+ export type DefiLoan = {
141
+ accountDiscriminator: number[];
142
+ kind: LoanKind;
143
+ kindDetail: number[];
144
+ status: LoanStatus;
145
+ isCustom: number;
146
+ padding1: number[];
147
+ borrower: PublicKey;
148
+ bank: PublicKey;
149
+ pool: PublicKey;
150
+ collateral: PublicKey;
151
+ principal: PublicKey;
152
+ referrer: PublicKey;
153
+ interest: BigNumber;
154
+ borrowedAmount: BigNumber;
155
+ collateralAmount: BigNumber;
156
+ duration: number;
157
+ currency: number;
158
+ liquidation: number;
159
+ padding2: number[];
160
+ createdAt: BigNumber;
161
+ expiredAt: BigNumber;
162
+ repaidAt: BigNumber;
163
+ liquidatedAt: BigNumber;
164
+ soldAmount: BigNumber;
165
+ reserved: BigNumber[];
166
+ };
167
+ export declare const defiLoanStruct: FixableBeetStruct<DefiLoan, Partial<DefiLoan>>;
168
+ export type Pool = {
169
+ accountDiscriminator: number[];
170
+ owner: PublicKey;
171
+ seed: number[];
172
+ status: PoolStatus;
173
+ bump: number;
174
+ padding1: number[];
175
+ currentLoan: BigNumber;
176
+ curve: CurveType;
177
+ conditions: PoolCondition;
178
+ liquidation: PoolLiquidation;
179
+ limits: PoolLimit;
180
+ totalLiquidations: BigNumber;
181
+ totalLoans: BigNumber;
182
+ totalInterest: BigNumber;
183
+ createdAt: BigNumber;
184
+ updatedAt: BigNumber;
185
+ currenciesUpdatedAt: BigNumber;
186
+ lastLoanAt: BigNumber;
187
+ reserved: BigNumber[];
188
+ currencies: PoolCurrency[];
189
+ };
190
+ export declare const poolStruct: FixableBeetStruct<Pool, Partial<Pool>>;
191
+ export type Quote = {
192
+ accountDiscriminator: number[];
193
+ quoteType: QuoteType;
194
+ quoteStep: QuoteStep;
195
+ padding1: number[];
196
+ quote: PublicKey;
197
+ payer: PublicKey;
198
+ borrower: PublicKey;
199
+ loan: PublicKey;
200
+ inVault: PublicKey;
201
+ outVault: PublicKey;
202
+ borrowedAmount: BigNumber;
203
+ inAmountJup: BigNumber;
204
+ minSwappedAmount: BigNumber;
205
+ tempValue: BigNumber;
206
+ dataLength: BigNumber;
207
+ jupVec: number[];
208
+ slot: BigNumber;
209
+ createdAt: BigNumber;
210
+ bump: number;
211
+ padding2: number[];
212
+ };
213
+ export declare const quoteStruct: FixableBeetStruct<Quote, Partial<Quote>>;
214
+ export type Request = {
215
+ accountDiscriminator: number[];
216
+ payer: PublicKey;
217
+ borrower: PublicKey;
218
+ request: PublicKey;
219
+ collateral: PublicKey;
220
+ principal: PublicKey;
221
+ requestVault: PublicKey;
222
+ collateralAmount: BigNumber;
223
+ principalAmount: BigNumber;
224
+ interest: BigNumber;
225
+ duration: number;
226
+ padding1: number;
227
+ padding2: number;
228
+ bump: number;
229
+ createdAt: BigNumber;
230
+ reserved: number[];
231
+ };
232
+ export declare const requestStruct: FixableBeetStruct<Request, Partial<Request>>;
233
+ export type UserStats = {
234
+ accountDiscriminator: number[];
235
+ owner: PublicKey;
236
+ totalLoan: BigNumber;
237
+ totalLiquidation: BigNumber;
238
+ currentLoan: BigNumber;
239
+ totalVolume: BigNumber;
240
+ points: BigNumber;
241
+ creditScore: BigNumber;
242
+ referrer: PublicKey;
243
+ createdAt: BigNumber;
244
+ bump: number;
245
+ padding1: number[];
246
+ reserved: number[];
247
+ };
248
+ export declare const userStatsStruct: FixableBeetStruct<UserStats, Partial<UserStats>>;
249
+ export type Vault = {
250
+ accountDiscriminator: number[];
251
+ mint: PublicKey;
252
+ tokenAccount: PublicKey;
253
+ tokenProgram: PublicKey;
254
+ oracles: OracleType[];
255
+ padding1: number[];
256
+ ixGate: BigNumber;
257
+ vaultBump: number;
258
+ tokenAccountBump: number;
259
+ decimals: number;
260
+ padding2: number[];
261
+ deposited: BigNumber;
262
+ maxDeposit: BigNumber;
263
+ withdrawalWindow: BigNumber;
264
+ withdrawalWindowLimit: BigNumber;
265
+ withdrawalWindowStart: BigNumber;
266
+ withdrawalWindowAccumulator: BigNumber;
267
+ createdAt: BigNumber;
268
+ updatedAt: BigNumber;
269
+ depositedAt: BigNumber;
270
+ withdrawnAt: BigNumber;
271
+ reserved: number[];
272
+ };
273
+ export declare const vaultStruct: FixableBeetStruct<Vault, Partial<Vault>>;
274
+ export type ClassicLoan = {
275
+ reserved: number[];
276
+ };
277
+ export declare const classicLoanStruct: FixableBeetStruct<ClassicLoan, Partial<ClassicLoan>>;
278
+ export type ConditionConfig = {
279
+ minAge: BigNumber;
280
+ minLoan: BigNumber;
281
+ minVolume: BigNumber;
282
+ liquidationThreshold: number;
283
+ isEnabled: number;
284
+ whitelist: PublicKey;
285
+ };
286
+ export declare const conditionConfigStruct: BeetStruct<ConditionConfig, Partial<ConditionConfig>>;
287
+ export type CurrencyConfig = {
288
+ currency: number;
289
+ currencyLtv: number;
290
+ exposure: number;
291
+ };
292
+ export declare const currencyConfigStruct: BeetStruct<CurrencyConfig, Partial<CurrencyConfig>>;
293
+ export type CurrencyConfigFake = {
294
+ currency: number;
295
+ currencyLtv: number;
296
+ exposure: number;
297
+ borrowedAmount: BigNumber;
298
+ };
299
+ export declare const currencyConfigFakeStruct: BeetStruct<CurrencyConfigFake, Partial<CurrencyConfigFake>>;
300
+ export type CurrencyDeletedEvent = {
301
+ currency: PublicKey;
302
+ };
303
+ export declare const currencyDeletedEventStruct: BeetStruct<CurrencyDeletedEvent, Partial<CurrencyDeletedEvent>>;
304
+ export type CurveApr = {
305
+ apr: number;
306
+ padding2: number[];
307
+ padding1: BigNumber[];
308
+ };
309
+ export declare const curveAprStruct: FixableBeetStruct<CurveApr, Partial<CurveApr>>;
310
+ export type CurveAprConfig = {
311
+ apr: number;
312
+ };
313
+ export declare const curveAprConfigStruct: BeetStruct<CurveAprConfig, Partial<CurveAprConfig>>;
314
+ export type Delegator = {
315
+ delegatorType: DelegatorType;
316
+ delegatedAmount: BigNumber;
317
+ };
318
+ export type EmptyDelegator = {
319
+ reserved: number[];
320
+ reserved1: number[];
321
+ reserved2: number[];
322
+ reserved3: number[];
323
+ };
324
+ export declare const emptyDelegatorStruct: FixableBeetStruct<EmptyDelegator, Partial<EmptyDelegator>>;
325
+ export type EmptyOracle = {
326
+ reserved: number[];
327
+ reserved1: number[];
328
+ reserved2: number[];
329
+ reserved3: number[];
330
+ };
331
+ export declare const emptyOracleStruct: FixableBeetStruct<EmptyOracle, Partial<EmptyOracle>>;
332
+ export type LimitConfig = {
333
+ minDuration: number;
334
+ maxDuration: number;
335
+ maxAmountUsd: number;
336
+ minAmountUsd: number;
337
+ };
338
+ export declare const limitConfigStruct: BeetStruct<LimitConfig, Partial<LimitConfig>>;
339
+ export type MarginSwapLoan = {
340
+ downPayment: BigNumber;
341
+ reserved: number[];
342
+ reserved1: number[];
343
+ };
344
+ export declare const marginSwapLoanStruct: FixableBeetStruct<MarginSwapLoan, Partial<MarginSwapLoan>>;
345
+ export type MarginfiDelegator = {
346
+ marginfiBank: PublicKey;
347
+ reserved1: number[];
348
+ reserved2: number[];
349
+ reserved3: number[];
350
+ };
351
+ export declare const marginfiDelegatorStruct: FixableBeetStruct<MarginfiDelegator, Partial<MarginfiDelegator>>;
352
+ export type PersonalBank = {
353
+ reserved: number[];
354
+ reserved1: number[];
355
+ reserved2: number[];
356
+ };
357
+ export type PoolCondition = {
358
+ minAge: BigNumber;
359
+ minLoan: BigNumber;
360
+ minVolume: BigNumber;
361
+ unused: BigNumber;
362
+ liquidationThreshold: number;
363
+ isEnabled: number;
364
+ padding1: number[];
365
+ whitelist: PublicKey;
366
+ reserved: BigNumber[];
367
+ };
368
+ export type PoolCurrency = {
369
+ currency: number;
370
+ currencyLtv: number;
371
+ exposure: number;
372
+ borrowedAmount: BigNumber;
373
+ };
374
+ export type PoolDeletedEvent = {
375
+ pool: PublicKey;
376
+ };
377
+ export declare const poolDeletedEventStruct: BeetStruct<PoolDeletedEvent, Partial<PoolDeletedEvent>>;
378
+ export type PoolLimit = {
379
+ minDuration: number;
380
+ maxDuration: number;
381
+ maxAmountUsd: number;
382
+ minAmountUsd: number;
383
+ reserved: BigNumber[];
384
+ };
385
+ export type PoolLiquidation = {
386
+ loanLiquidation: number;
387
+ mortgageLiquidation: number;
388
+ isAutoSellEnabled: number;
389
+ padding1: number;
390
+ padding2: number;
391
+ };
392
+ export type PythV2Oracle = {
393
+ feedId: number[];
394
+ reserved: number[];
395
+ reserved1: number[];
396
+ reserved2: number[];
397
+ };
398
+ export declare const pythV2OracleStruct: FixableBeetStruct<PythV2Oracle, Partial<PythV2Oracle>>;
399
+ export type RequestDeletedEvent = {
400
+ request: PublicKey;
401
+ };
402
+ export declare const requestDeletedEventStruct: BeetStruct<RequestDeletedEvent, Partial<RequestDeletedEvent>>;
403
+ export type RequestLoan = {
404
+ reserved: number[];
405
+ };
406
+ export declare const requestLoanStruct: FixableBeetStruct<RequestLoan, Partial<RequestLoan>>;
407
+ export type SharedBank = {
408
+ lpMint: PublicKey;
409
+ lpRate: BigNumber;
410
+ lpSupply: BigNumber;
411
+ padding1: number[];
412
+ lpDecimals: number;
413
+ padding2: number[];
414
+ };
415
+ export declare const sharedBankStruct: FixableBeetStruct<SharedBank, Partial<SharedBank>>;
416
+ export type SwitchboardOnDemandOracle = {
417
+ account: PublicKey;
418
+ reserved: number[];
419
+ reserved1: number[];
420
+ reserved2: number[];
421
+ };
422
+ export declare const switchboardOnDemandOracleStruct: FixableBeetStruct<SwitchboardOnDemandOracle, Partial<SwitchboardOnDemandOracle>>;
423
+ export type SwitchboardOracle = {
424
+ account: PublicKey;
425
+ reserved: number[];
426
+ reserved1: number[];
427
+ reserved2: number[];
428
+ };
429
+ export declare const switchboardOracleStruct: FixableBeetStruct<SwitchboardOracle, Partial<SwitchboardOracle>>;
430
+ export type NftLoan = {
431
+ accountDiscriminator: number[];
432
+ kind: LoanKind;
433
+ kindDetail: number[];
434
+ status: LoanStatus;
435
+ isCustom: number;
436
+ padding1: number[];
437
+ borrower: PublicKey;
438
+ bank: PublicKey;
439
+ pool: PublicKey;
440
+ collateral: PublicKey;
441
+ principal: PublicKey;
442
+ referrer: PublicKey;
443
+ interest: BigNumber;
444
+ borrowedAmount: BigNumber;
445
+ duration: number;
446
+ collection: number;
447
+ liquidation: number;
448
+ padding2: number[];
449
+ createdAt: BigNumber;
450
+ expiredAt: BigNumber;
451
+ repaidAt: BigNumber;
452
+ liquidatedAt: BigNumber;
453
+ reserved: BigNumber[];
454
+ };
455
+ export declare const nftLoanStruct: FixableBeetStruct<NftLoan, Partial<NftLoan>>;