@sonarwatch/portfolio-plugins 0.14.151 → 0.14.153
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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/plugins/allbridge/constants.d.ts +0 -6
- package/src/plugins/allbridge/constants.js +1 -9
- package/src/plugins/allbridge/constants.js.map +1 -1
- package/src/plugins/allbridge/helpers.d.ts +1 -1
- package/src/plugins/allbridge/helpers.js +1 -3
- package/src/plugins/allbridge/helpers.js.map +1 -1
- package/src/plugins/allbridge/positionsFetcher.js +2 -1
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
- package/src/plugins/allbridge/structs.d.ts +13 -0
- package/src/plugins/allbridge/structs.js +14 -0
- package/src/plugins/allbridge/structs.js.map +1 -0
- package/src/plugins/allbridge/types.d.ts +0 -6
- package/src/plugins/bonfida/constants.js +1 -1
- package/src/plugins/bonfida/constants.js.map +1 -1
- package/src/plugins/divvy/constants.d.ts +0 -2
- package/src/plugins/divvy/constants.js +1 -7
- package/src/plugins/divvy/constants.js.map +1 -1
- package/src/plugins/divvy/houseJob.js +6 -3
- package/src/plugins/divvy/houseJob.js.map +1 -1
- package/src/plugins/divvy/housePoolFetcher.js +9 -11
- package/src/plugins/divvy/housePoolFetcher.js.map +1 -1
- package/src/plugins/divvy/stakingFetcher.js +7 -12
- package/src/plugins/divvy/stakingFetcher.js.map +1 -1
- package/src/plugins/divvy/structs.d.ts +57 -0
- package/src/plugins/divvy/structs.js +57 -0
- package/src/plugins/divvy/structs.js.map +1 -0
- package/src/plugins/drift/spotMarketsJob.js +0 -1
- package/src/plugins/drift/spotMarketsJob.js.map +1 -1
- package/src/plugins/elemental/constants.d.ts +4 -2
- package/src/plugins/elemental/constants.js +3 -7
- package/src/plugins/elemental/constants.js.map +1 -1
- package/src/plugins/elemental/filters.d.ts +0 -1
- package/src/plugins/elemental/filters.js +1 -6
- package/src/plugins/elemental/filters.js.map +1 -1
- package/src/plugins/elemental/helpers.js +2 -2
- package/src/plugins/elemental/helpers.js.map +1 -1
- package/src/plugins/elemental/poolsJob.js +4 -4
- package/src/plugins/elemental/poolsJob.js.map +1 -1
- package/src/plugins/ensofi/constants.d.ts +4 -2
- package/src/plugins/ensofi/constants.js +3 -7
- package/src/plugins/ensofi/constants.js.map +1 -1
- package/src/plugins/ensofi/idl.d.ts +149 -6
- package/src/plugins/ensofi/idl.js +1074 -61
- package/src/plugins/ensofi/idl.js.map +1 -1
- package/src/plugins/ensofi/index.js +2 -1
- package/src/plugins/ensofi/index.js.map +1 -1
- package/src/plugins/ensofi/solanaLoansFetcher.js +23 -37
- package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -1
- package/src/plugins/ensofi/solanaLoansJob.d.ts +3 -0
- package/src/plugins/ensofi/solanaLoansJob.js +63 -0
- package/src/plugins/ensofi/solanaLoansJob.js.map +1 -0
- package/src/plugins/ensofi/structs.d.ts +58 -0
- package/src/plugins/ensofi/structs.js +60 -0
- package/src/plugins/ensofi/structs.js.map +1 -0
- package/src/plugins/jupiter/governance/constants.js +3 -3
- package/src/plugins/jupiter/governance/constants.js.map +1 -1
- package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
- package/src/plugins/jupiter/launchpad/constants.js +8 -7
- package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +2 -1
- package/src/plugins/jupiter/pricingJob.js.map +1 -1
- package/src/plugins/kamino/reservesJob.js +35 -0
- package/src/plugins/kamino/reservesJob.js.map +1 -1
- package/src/plugins/loopscale/constants.d.ts +2 -3
- package/src/plugins/loopscale/constants.js +3 -4
- package/src/plugins/loopscale/constants.js.map +1 -1
- package/src/plugins/loopscale/helpers.d.ts +6 -33
- package/src/plugins/loopscale/helpers.js +39 -142
- package/src/plugins/loopscale/helpers.js.map +1 -1
- package/src/plugins/loopscale/index.js +10 -3
- package/src/plugins/loopscale/index.js.map +1 -1
- package/src/plugins/loopscale/lendFetcher.js +57 -0
- package/src/plugins/loopscale/lendFetcher.js.map +1 -0
- package/src/plugins/loopscale/lendVaultsFetcher.d.ts +6 -0
- package/src/plugins/loopscale/lendVaultsFetcher.js +68 -0
- package/src/plugins/loopscale/lendVaultsFetcher.js.map +1 -0
- package/src/plugins/loopscale/loansFetcher.d.ts +3 -0
- package/src/plugins/loopscale/loansFetcher.js +79 -0
- package/src/plugins/loopscale/loansFetcher.js.map +1 -0
- package/src/plugins/loopscale/structs.d.ts +116 -86
- package/src/plugins/loopscale/structs.js +101 -79
- package/src/plugins/loopscale/structs.js.map +1 -1
- package/src/plugins/loopscale/types.d.ts +6 -0
- package/src/plugins/loopscale/types.js.map +1 -0
- package/src/plugins/loopscale/vaultsJob.d.ts +3 -0
- package/src/plugins/loopscale/vaultsJob.js +121 -0
- package/src/plugins/loopscale/vaultsJob.js.map +1 -0
- package/src/plugins/lulo/depositsFetcher.js +9 -29
- package/src/plugins/lulo/depositsFetcher.js.map +1 -1
- package/src/plugins/marginfi/banksJob.js +6 -2
- package/src/plugins/marginfi/banksJob.js.map +1 -1
- package/src/plugins/marginfi/constants.d.ts +5 -3
- package/src/plugins/marginfi/constants.js +8 -7
- package/src/plugins/marginfi/constants.js.map +1 -1
- package/src/plugins/marginfi/depositsFetcher.js +50 -27
- package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
- package/src/plugins/marginfi/getMarginFiAccounts.d.ts +6 -0
- package/src/plugins/marginfi/getMarginFiAccounts.js +44 -0
- package/src/plugins/marginfi/getMarginFiAccounts.js.map +1 -0
- package/src/plugins/marginfi/helpers.d.ts +0 -5
- package/src/plugins/marginfi/helpers.js +1 -81
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/marginfi/structs/MarginfiAccount.d.ts +5 -0
- package/src/plugins/marginfi/structs/MarginfiAccount.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js +7 -7
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/types.d.ts +2 -0
- package/src/plugins/picasso/constants.d.ts +0 -2
- package/src/plugins/picasso/constants.js +1 -7
- package/src/plugins/picasso/constants.js.map +1 -1
- package/src/plugins/picasso/helpers.js +7 -4
- package/src/plugins/picasso/helpers.js.map +1 -1
- package/src/plugins/picasso/structs.d.ts +39 -0
- package/src/plugins/picasso/structs.js +37 -0
- package/src/plugins/picasso/structs.js.map +1 -0
- package/src/plugins/picasso/unstakingNftsJob.js +2 -1
- package/src/plugins/picasso/unstakingNftsJob.js.map +1 -1
- package/src/plugins/picasso/unstakingPositionsFetcher.js +4 -4
- package/src/plugins/picasso/unstakingPositionsFetcher.js.map +1 -1
- package/src/plugins/raydium/ammV2ApiJob.js +24 -0
- package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
- package/src/plugins/raydium/constants.d.ts +1 -0
- package/src/plugins/raydium/constants.js +2 -1
- package/src/plugins/raydium/constants.js.map +1 -1
- package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
- package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
- package/src/plugins/raydium/types.d.ts +14 -4
- package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
- package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
- package/src/plugins/sharky/collectionsJob.js +8 -9
- package/src/plugins/sharky/collectionsJob.js.map +1 -1
- package/src/plugins/sharky/constants.d.ts +0 -2
- package/src/plugins/sharky/constants.js +1 -7
- package/src/plugins/sharky/constants.js.map +1 -1
- package/src/plugins/sharky/loansFetcher.js +25 -19
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/plugins/sharky/structs.d.ts +96 -0
- package/src/plugins/sharky/structs.js +103 -0
- package/src/plugins/sharky/structs.js.map +1 -0
- package/src/plugins/sharky/types.d.ts +0 -15
- package/src/plugins/sharky/types.js +0 -8
- package/src/plugins/sharky/types.js.map +1 -1
- package/src/plugins/stabble/constants.d.ts +0 -3
- package/src/plugins/stabble/constants.js +1 -13
- package/src/plugins/stabble/constants.js.map +1 -1
- package/src/plugins/stabble/poolsJob.js +14 -9
- package/src/plugins/stabble/poolsJob.js.map +1 -1
- package/src/plugins/stabble/structs.d.ts +43 -0
- package/src/plugins/stabble/structs.js +42 -0
- package/src/plugins/stabble/structs.js.map +1 -0
- package/src/plugins/suilend/helpers.js +2 -0
- package/src/plugins/suilend/helpers.js.map +1 -1
- package/src/utils/misc/getLendingMarketAprs.d.ts +3 -1
- package/src/utils/misc/getLendingMarketAprs.js +24 -1
- package/src/utils/misc/getLendingMarketAprs.js.map +1 -1
- package/src/utils/solana/beets/ParsedGpa.d.ts +1 -0
- package/src/utils/solana/beets/ParsedGpa.js +9 -0
- package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
- package/src/plugins/divvy/types.d.ts +0 -28
- package/src/plugins/divvy/types.js.map +0 -1
- package/src/plugins/loopscale/filters.d.ts +0 -9
- package/src/plugins/loopscale/filters.js +0 -62
- package/src/plugins/loopscale/filters.js.map +0 -1
- package/src/plugins/loopscale/positionsFetcher.js +0 -119
- package/src/plugins/loopscale/positionsFetcher.js.map +0 -1
- package/src/plugins/marginfi/filters.d.ts +0 -5
- package/src/plugins/marginfi/filters.js +0 -45
- package/src/plugins/marginfi/filters.js.map +0 -1
- package/src/plugins/picasso/types.d.ts +0 -17
- package/src/plugins/picasso/types.js +0 -3
- package/src/plugins/picasso/types.js.map +0 -1
- package/src/plugins/sharky/filters.d.ts +0 -8
- package/src/plugins/sharky/filters.js +0 -43
- package/src/plugins/sharky/filters.js.map +0 -1
- package/src/plugins/stabble/filters.d.ts +0 -5
- package/src/plugins/stabble/filters.js +0 -20
- package/src/plugins/stabble/filters.js.map +0 -1
- package/src/plugins/stabble/types.d.ts +0 -40
- package/src/plugins/stabble/types.js +0 -3
- package/src/plugins/stabble/types.js.map +0 -1
- /package/src/plugins/loopscale/{positionsFetcher.d.ts → lendFetcher.d.ts} +0 -0
- /package/src/plugins/{divvy → loopscale}/types.js +0 -0
@@ -0,0 +1,103 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.programVersionStruct = exports.escrowPdaStruct = exports.loanStruct = exports.nftListStruct = exports.orderBookStruct = 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
|
+
const apyStruct = (0, beet_1.dataEnum)([
|
8
|
+
[
|
9
|
+
'Fixed',
|
10
|
+
new beet_1.FixableBeetArgsStruct([['apy', beet_1.u32]], 'APYRecord["Fixed"]'),
|
11
|
+
],
|
12
|
+
]);
|
13
|
+
const loanTermsStruct = (0, beet_1.dataEnum)([
|
14
|
+
[
|
15
|
+
'Time',
|
16
|
+
new beet_1.FixableBeetArgsStruct([
|
17
|
+
['start', solana_1.i64],
|
18
|
+
['duration', solana_1.u64],
|
19
|
+
['total_owed_lamports', solana_1.u64],
|
20
|
+
], 'LoanTermsRecord["Time"]'),
|
21
|
+
],
|
22
|
+
]);
|
23
|
+
const orderBookTypeStruct = (0, beet_1.dataEnum)([
|
24
|
+
[
|
25
|
+
'Collection',
|
26
|
+
new beet_1.FixableBeetArgsStruct([['collectionKey', beet_solana_1.publicKey]], 'OrderBookTypeRecord["Collection"]'),
|
27
|
+
],
|
28
|
+
[
|
29
|
+
'NFTList',
|
30
|
+
new beet_1.FixableBeetArgsStruct([['collectionKey', beet_solana_1.publicKey]], 'OrderBookTypeRecord["NFTList"]'),
|
31
|
+
],
|
32
|
+
]);
|
33
|
+
const loanTermsSpecStruct = (0, beet_1.dataEnum)([
|
34
|
+
[
|
35
|
+
'Time',
|
36
|
+
new beet_1.FixableBeetArgsStruct([['duration', solana_1.u64]], 'LoanTermsSpecRecord["Time"]'),
|
37
|
+
],
|
38
|
+
]);
|
39
|
+
const bookLoanTermsStruct = (0, beet_1.dataEnum)([
|
40
|
+
[
|
41
|
+
'Fixed',
|
42
|
+
new beet_1.FixableBeetArgsStruct([['terms', loanTermsSpecStruct]], 'BookLoanTermsRecord["Fixed"]'),
|
43
|
+
],
|
44
|
+
[
|
45
|
+
'LenderChooses',
|
46
|
+
new beet_1.FixableBeetArgsStruct([], 'BookLoanTermsRecord["LenderChooses"]'),
|
47
|
+
],
|
48
|
+
]);
|
49
|
+
exports.orderBookStruct = new beet_1.FixableBeetStruct([
|
50
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
51
|
+
['version', beet_1.u8],
|
52
|
+
['orderBookType', orderBookTypeStruct],
|
53
|
+
['apy', apyStruct],
|
54
|
+
['loanTerms', bookLoanTermsStruct],
|
55
|
+
['feePermillicentage', beet_1.u16],
|
56
|
+
['feeAuthority', beet_solana_1.publicKey],
|
57
|
+
], (args) => args);
|
58
|
+
exports.nftListStruct = new beet_1.FixableBeetStruct([
|
59
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
60
|
+
['version', beet_1.u8],
|
61
|
+
['collectionName', (0, beet_1.array)(beet_1.u8)],
|
62
|
+
], (args) => args);
|
63
|
+
const loanStateStruct = (0, beet_1.dataEnum)([
|
64
|
+
[
|
65
|
+
'Offer',
|
66
|
+
new beet_1.FixableBeetArgsStruct([
|
67
|
+
['lenderWallet', beet_solana_1.publicKey],
|
68
|
+
['termsSpec', loanTermsSpecStruct],
|
69
|
+
['offerTime', solana_1.i64],
|
70
|
+
], 'OrderBookTypeRecord["Offer"]'),
|
71
|
+
],
|
72
|
+
[
|
73
|
+
'Taken',
|
74
|
+
new beet_1.FixableBeetArgsStruct([
|
75
|
+
['nftCollateralMint', beet_solana_1.publicKey],
|
76
|
+
['lenderNoteMint', beet_solana_1.publicKey],
|
77
|
+
['borrowerNoteMint', beet_solana_1.publicKey],
|
78
|
+
['apy', apyStruct],
|
79
|
+
['terms', loanTermsStruct],
|
80
|
+
['isCollateralFrozen', beet_1.u8],
|
81
|
+
], 'OrderBookTypeRecord["Taken"]'),
|
82
|
+
],
|
83
|
+
]);
|
84
|
+
exports.loanStruct = new beet_1.FixableBeetStruct([
|
85
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
86
|
+
['version', beet_1.u8],
|
87
|
+
['principalLamports', solana_1.u64],
|
88
|
+
['orderBook', beet_solana_1.publicKey],
|
89
|
+
['valueTokenMint', beet_solana_1.publicKey],
|
90
|
+
['escrowBumpSeed', beet_1.u8],
|
91
|
+
['loanState', loanStateStruct],
|
92
|
+
], (args) => args);
|
93
|
+
exports.escrowPdaStruct = new beet_1.FixableBeetStruct([
|
94
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
95
|
+
['bump', beet_1.u8],
|
96
|
+
], (args) => args);
|
97
|
+
exports.programVersionStruct = new beet_1.FixableBeetStruct([
|
98
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
99
|
+
['version', beet_1.u8],
|
100
|
+
['bump', beet_1.u8],
|
101
|
+
['updated', solana_1.i64],
|
102
|
+
], (args) => args);
|
103
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/structs.ts"],"names":[],"mappings":";;;AAEA,oDAWmC;AACnC,kEAA6D;AAC7D,+CAA8C;AAS9C,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAY;IACpC;QACE,OAAO;QACP,IAAI,4BAAqB,CACvB,CAAC,CAAC,KAAK,EAAE,UAAG,CAAC,CAAC,EACd,oBAAoB,CACrB;KACF;CACF,CAAqB,CAAC;AAWvB,MAAM,eAAe,GAAG,IAAA,eAAQ,EAAkB;IAChD;QACE,MAAM;QACN,IAAI,4BAAqB,CACvB;YACE,CAAC,OAAO,EAAE,YAAG,CAAC;YACd,CAAC,UAAU,EAAE,YAAG,CAAC;YACjB,CAAC,qBA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G,IAAI,wBAAiB,CAClD;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC;AAUW,QAAA,oBAAoB,GAAG,IAAI,wBAAiB,CACvD;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,SAAS,EAAE,YAAG,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { FixableBeetStruct } from '@metaplex-foundation/beet';
|
3
1
|
export type Loan = {
|
4
2
|
version: number;
|
5
3
|
principalLamports: string;
|
@@ -45,22 +43,9 @@ export type LoanTermsSpec = {
|
|
45
43
|
duration: string;
|
46
44
|
};
|
47
45
|
};
|
48
|
-
export type OrderBook = {
|
49
|
-
orderBookType: {
|
50
|
-
nftList: {
|
51
|
-
listAccount: string;
|
52
|
-
};
|
53
|
-
};
|
54
|
-
};
|
55
46
|
export type Collection = {
|
56
47
|
orderBook: string;
|
57
48
|
name: string;
|
58
49
|
floor: number;
|
59
50
|
tensor_id: string;
|
60
51
|
};
|
61
|
-
export type NftList = {
|
62
|
-
buffer: Buffer;
|
63
|
-
version: number;
|
64
|
-
collectionName: number[];
|
65
|
-
};
|
66
|
-
export declare const nftListStruct: FixableBeetStruct<NftList, Partial<NftList>>;
|
@@ -1,11 +1,3 @@
|
|
1
1
|
"use strict";
|
2
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
3
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/types.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/types.ts"],"names":[],"mappings":""}
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
-
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
3
2
|
export declare const platformId = "stabble";
|
4
3
|
export declare const platform: Platform;
|
5
4
|
export declare const stableProgramId = "swapNyd8XiQwJ6ianp9snpu4brUqFxadzvHebnAXjJZ";
|
6
|
-
export declare const stableIdlItem: IdlItem;
|
7
5
|
export declare const weightedProgramId = "swapFpHZwjELNnjvThjajtiVmkz3yPQEHjLtka2fwHW";
|
8
|
-
export declare const weightedIdlItem: IdlItem;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const stableIdl_1 = require("./stableIdl");
|
5
|
-
const weightedIdl_1 = require("./weightedIdl");
|
3
|
+
exports.weightedProgramId = exports.stableProgramId = exports.platform = exports.platformId = void 0;
|
6
4
|
exports.platformId = 'stabble';
|
7
5
|
exports.platform = {
|
8
6
|
id: exports.platformId,
|
@@ -19,15 +17,5 @@ exports.platform = {
|
|
19
17
|
description: "Solana's first frictionless liquidity and trading layer",
|
20
18
|
};
|
21
19
|
exports.stableProgramId = 'swapNyd8XiQwJ6ianp9snpu4brUqFxadzvHebnAXjJZ';
|
22
|
-
exports.stableIdlItem = {
|
23
|
-
programId: exports.stableProgramId,
|
24
|
-
idl: stableIdl_1.StableIdl,
|
25
|
-
idlType: 'anchor',
|
26
|
-
};
|
27
20
|
exports.weightedProgramId = 'swapFpHZwjELNnjvThjajtiVmkz3yPQEHjLtka2fwHW';
|
28
|
-
exports.weightedIdlItem = {
|
29
|
-
programId: exports.weightedProgramId,
|
30
|
-
idl: weightedIdl_1.WeightedIdl,
|
31
|
-
idlType: 'anchor',
|
32
|
-
};
|
33
21
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EACH,6EAA6E;IAC/E,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,gCAAgC;IAC1C,aAAa,EAAE,2BAA2B;IAC1C,OAAO,EAAE,uCAAuC;IAChD,MAAM,EAAE,+BAA+B;IACvC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EAAE,yDAAyD;CACvE,CAAC;AAEW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAEhE,QAAA,iBAAiB,GAAG,6CAA6C,CAAC"}
|
@@ -14,26 +14,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const web3_js_1 = require("@solana/web3.js");
|
17
18
|
const constants_1 = require("./constants");
|
18
19
|
const clients_1 = require("../../utils/clients");
|
19
|
-
const solana_1 = require("../../utils/solana");
|
20
|
-
const filters_1 = require("./filters");
|
21
20
|
const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
|
22
21
|
const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
|
22
|
+
const structs_1 = require("./structs");
|
23
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
23
24
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
25
|
const connection = (0, clients_1.getClientSolana)();
|
25
26
|
const dasUrl = (0, getSolanaDasEndpoint_1.default)();
|
26
27
|
const pools = (yield Promise.all([
|
27
|
-
|
28
|
-
|
28
|
+
ParsedGpa_1.ParsedGpa.build(connection, structs_1.stablePoolStruct, new web3_js_1.PublicKey(constants_1.stableProgramId))
|
29
|
+
.addFilter('vault', new web3_js_1.PublicKey('stab1io8dHvK26KoHmTwwHyYmHRbUWbyEJx6CdrGabC'))
|
30
|
+
.run(),
|
31
|
+
ParsedGpa_1.ParsedGpa.build(connection, structs_1.weightedPoolStruct, new web3_js_1.PublicKey(constants_1.weightedProgramId))
|
32
|
+
.addFilter('vault', new web3_js_1.PublicKey('w8edo9a9TDw52c1rBmVbP6dNakaAuFiPjDd52ZJwwVi'))
|
33
|
+
.run(),
|
29
34
|
])).flat();
|
30
35
|
const mints = new Set();
|
31
36
|
const lpMints = new Set();
|
32
37
|
pools.forEach((pool) => {
|
33
38
|
pool.tokens.forEach((token) => {
|
34
|
-
mints.add(token.mint);
|
39
|
+
mints.add(token.mint.toString());
|
35
40
|
});
|
36
|
-
lpMints.add(pool.mint);
|
41
|
+
lpMints.add(pool.mint.toString());
|
37
42
|
});
|
38
43
|
const [tokenPrices, heliusAssets] = yield Promise.all([
|
39
44
|
cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
|
@@ -41,13 +46,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
46
|
]);
|
42
47
|
const sources = [];
|
43
48
|
pools.forEach((pool) => {
|
44
|
-
const heliusAsset = heliusAssets.get(pool.mint);
|
49
|
+
const heliusAsset = heliusAssets.get(pool.mint.toString());
|
45
50
|
if (!(heliusAsset === null || heliusAsset === void 0 ? void 0 : heliusAsset.token_info))
|
46
51
|
return;
|
47
52
|
const supply = new bignumber_js_1.default(heliusAsset.token_info.supply).dividedBy(Math.pow(10, Number(heliusAsset.token_info.decimals)));
|
48
53
|
const underlyings = [];
|
49
54
|
for (const token of pool.tokens) {
|
50
|
-
const tokenPrice = tokenPrices.get(token.mint);
|
55
|
+
const tokenPrice = tokenPrices.get(token.mint.toString());
|
51
56
|
if (!tokenPrice)
|
52
57
|
return;
|
53
58
|
const tokenAmount = token.scalingUp
|
@@ -65,7 +70,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
70
|
});
|
66
71
|
}
|
67
72
|
sources.push({
|
68
|
-
address: pool.mint,
|
73
|
+
address: pool.mint.toString(),
|
69
74
|
decimals: heliusAsset.token_info.decimals,
|
70
75
|
id: constants_1.platformId,
|
71
76
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA6E;AAC7E,iDAAsD;AACtD,8EAAgF;AAChF,oGAA4E;AAC5E,uCAAiE;AACjE,kEAA+D;AAE/D,MAAM,QAAQ,GAAgB,CAAO,K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,EAAE,WAAW,CAAC,QAAQ,EAAE;gBACnC,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC7B,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,QAAQ;YACzC,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,WAAW,CAAC,MAAM,CACvB,CAAC,GAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,WAAW,GAAG,GAAG,EACjD,CAAC,CACF;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,WAAW;YACX,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;SAChE,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,QAAQ;IACzB,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,43 @@
|
|
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 BigNumber from 'bignumber.js';
|
5
|
+
import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
|
6
|
+
export type PoolToken = {
|
7
|
+
mint: PublicKey;
|
8
|
+
decimals: number;
|
9
|
+
scalingUp: boolean;
|
10
|
+
scalingFactor: BigNumber;
|
11
|
+
balance: BigNumber;
|
12
|
+
weight: BigNumber;
|
13
|
+
};
|
14
|
+
export declare const poolTokenStruct: BeetStruct<PoolToken, Partial<PoolToken>>;
|
15
|
+
export type WeightedPool = {
|
16
|
+
accountDiscriminator: number[];
|
17
|
+
owner: PublicKey;
|
18
|
+
vault: PublicKey;
|
19
|
+
mint: PublicKey;
|
20
|
+
authorityBump: number;
|
21
|
+
isActive: boolean;
|
22
|
+
invariant: BigNumber;
|
23
|
+
swapFee: BigNumber;
|
24
|
+
tokens: PoolToken[];
|
25
|
+
pendingOwner?: PublicKey;
|
26
|
+
};
|
27
|
+
export declare const weightedPoolStruct: FixableBeetStruct<WeightedPool, Partial<WeightedPool>>;
|
28
|
+
export type StablePool = {
|
29
|
+
accountDiscriminator: number[];
|
30
|
+
owner: PublicKey;
|
31
|
+
vault: PublicKey;
|
32
|
+
mint: PublicKey;
|
33
|
+
authorityBump: number;
|
34
|
+
isActive: boolean;
|
35
|
+
ampInitialFactor: number;
|
36
|
+
ampTargetFactor: number;
|
37
|
+
rampStartTs: BigNumber;
|
38
|
+
rampStopTs: BigNumber;
|
39
|
+
swapFee: BigNumber;
|
40
|
+
tokens: PoolToken[];
|
41
|
+
pendingOwner?: PublicKey;
|
42
|
+
};
|
43
|
+
export declare const stablePoolStruct: FixableBeetStruct<StablePool, Partial<StablePool>>;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stablePoolStruct = exports.weightedPoolStruct = exports.poolTokenStruct = void 0;
|
4
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
5
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
exports.poolTokenStruct = new beet_1.BeetStruct([
|
8
|
+
['mint', beet_solana_1.publicKey],
|
9
|
+
['decimals', beet_1.u8],
|
10
|
+
['scalingUp', beet_1.bool],
|
11
|
+
['scalingFactor', solana_1.u64],
|
12
|
+
['balance', solana_1.u64],
|
13
|
+
['weight', solana_1.u64],
|
14
|
+
], (args) => args);
|
15
|
+
exports.weightedPoolStruct = new beet_1.FixableBeetStruct([
|
16
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
17
|
+
['owner', beet_solana_1.publicKey],
|
18
|
+
['vault', beet_solana_1.publicKey],
|
19
|
+
['mint', beet_solana_1.publicKey],
|
20
|
+
['authorityBump', beet_1.u8],
|
21
|
+
['isActive', beet_1.bool],
|
22
|
+
['invariant', solana_1.u64],
|
23
|
+
['swapFee', solana_1.u64],
|
24
|
+
['tokens', (0, beet_1.array)(exports.poolTokenStruct)],
|
25
|
+
['pendingOwner', beet_solana_1.publicKey],
|
26
|
+
], (args) => args);
|
27
|
+
exports.stablePoolStruct = new beet_1.FixableBeetStruct([
|
28
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
29
|
+
['owner', beet_solana_1.publicKey],
|
30
|
+
['vault', beet_solana_1.publicKey],
|
31
|
+
['mint', beet_solana_1.publicKey],
|
32
|
+
['authorityBump', beet_1.u8],
|
33
|
+
['isActive', beet_1.bool],
|
34
|
+
['ampInitialFactor', beet_1.u16],
|
35
|
+
['ampTargetFactor', beet_1.u16],
|
36
|
+
['rampStartTs', solana_1.i64],
|
37
|
+
['rampStopTs', solana_1.i64],
|
38
|
+
['swapFee', solana_1.u64],
|
39
|
+
['tokens', (0, beet_1.array)(exports.poolTokenStruct)],
|
40
|
+
['pendingOwner', beet_solana_1.publicKey],
|
41
|
+
], (args) => args);
|
42
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/structs.ts"],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C;IAClB,CAAC,kBAAkB,EAAE,UAAG,CAAC;IACzB,CAAC,iBAAiB,EAAE,UAAG,CAAC;IACxB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,QAAQ,EAAE,IAAA,YAAK,EAAC,uBAAe,CAAC,CAAC;IAClC,CAAC,cAAc,EAAE,uBAAS,CAAC;CAC5B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAkB,CAC7B,CAAC"}
|
@@ -38,6 +38,8 @@ function getRatesAsMap(borrowLendRates) {
|
|
38
38
|
return ratesByReserveId;
|
39
39
|
for (const borrowLendRate of borrowLendRates) {
|
40
40
|
const id = borrowLendRate.poolName;
|
41
|
+
if (!id)
|
42
|
+
continue;
|
41
43
|
ratesByReserveId.set(id, borrowLendRate);
|
42
44
|
}
|
43
45
|
return ratesByReserveId;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAIrC,SAAgB,mBAAmB,CACjC,cAA2C;IAE3C,MAAM,cAAc,GAAmB,IAAI,GAAG,EAAE,CAAC;IACjD,MAAM,sBAAsB,GAA2B,IAAI,GAAG,EAAE,CAAC;IACjE,IAAI,CAAC,cAAc;QAAE,OAAO,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IAErE,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;QACnC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,oBAAoB,GACxB,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,YAAY,CAAC;YAClE,KAAK,MAAM,UAAU,IAAI,oBAAoB,EAAE,CAAC;gBAC9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C;YACrC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACxD,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;YAC9C,OAAO,gBAAgB;iBACpB,SAAS,CAAC,cAAc,CAAC;iBACzB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;iBAChC,IAAI,CAAC,UAAU,CAAC;iBAChB,QAAQ,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAtCD,oCAsCC;AAED,SAAgB,aAAa,CAC3B,WAAsB,EACtB,SAAiB,EACjB,aAAsB;IAEtB,OAAO,IAAA,sBAAS,EAAC,SAAS,CAAC;SACxB,KAAK,CACJ,CAAC;QACC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;YAC/D,SAAA,EAAE,EAAI,CAAC,CAAA,CACZ;SACA,KAAK,CAAC,WAAW,CAAC;SAClB,QAAQ,EAAE,CAAC;AAChB,CAAC;AAbD,sCAaC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { BorrowLendRate } from '@sonarwatch/portfolio-core';
|
1
2
|
import BigNumber from 'bignumber.js';
|
2
3
|
/**
|
3
4
|
* Get both Lending and Borrowing APRs of a market
|
@@ -10,7 +11,8 @@ import BigNumber from 'bignumber.js';
|
|
10
11
|
*
|
11
12
|
* @returns {Aprs} BorrowApr and DepositApr of the market in raw value (i.e 0.02 = 2%)
|
12
13
|
*/
|
13
|
-
export
|
14
|
+
export declare function getLendingMarketAprs(borrowedAmount: BigNumber, availableAmount: BigNumber, interestRateAprs: number[], interestRateSteps: number[], spreadFeeBps: number): Aprs;
|
15
|
+
export declare function getLendingMarketBLRate(tokenAddress: string, netBorrowedAmount: BigNumber, netAvailableAmount: BigNumber, interestRateAprs: number[], interestRateSteps: number[], spreadFeeBps: number, platformId: string, poolName?: string): BorrowLendRate;
|
14
16
|
type Aprs = {
|
15
17
|
borrowApr: number;
|
16
18
|
depositApr: number;
|
@@ -3,6 +3,8 @@ 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.getLendingMarketBLRate = exports.getLendingMarketAprs = void 0;
|
7
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
6
8
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
7
9
|
/**
|
8
10
|
* Get both Lending and Borrowing APRs of a market
|
@@ -54,5 +56,26 @@ function getLendingMarketAprs(borrowedAmount, availableAmount, interestRateAprs,
|
|
54
56
|
depositApr,
|
55
57
|
};
|
56
58
|
}
|
57
|
-
exports.
|
59
|
+
exports.getLendingMarketAprs = getLendingMarketAprs;
|
60
|
+
function getLendingMarketBLRate(tokenAddress, netBorrowedAmount, netAvailableAmount, interestRateAprs, interestRateSteps, spreadFeeBps, platformId, poolName) {
|
61
|
+
const { borrowApr, depositApr } = getLendingMarketAprs(netBorrowedAmount, netAvailableAmount, interestRateAprs, interestRateSteps, spreadFeeBps);
|
62
|
+
const depositedAmount = netBorrowedAmount.plus(netAvailableAmount).toNumber();
|
63
|
+
return {
|
64
|
+
tokenAddress,
|
65
|
+
depositedAmount,
|
66
|
+
utilizationRatio: netBorrowedAmount.dividedBy(depositedAmount).toNumber(),
|
67
|
+
borrowYield: {
|
68
|
+
apy: (0, portfolio_core_1.aprToApy)(borrowApr),
|
69
|
+
apr: borrowApr,
|
70
|
+
},
|
71
|
+
borrowedAmount: 0,
|
72
|
+
depositYield: {
|
73
|
+
apy: (0, portfolio_core_1.aprToApy)(depositApr),
|
74
|
+
apr: depositApr,
|
75
|
+
},
|
76
|
+
platformId,
|
77
|
+
poolName,
|
78
|
+
};
|
79
|
+
}
|
80
|
+
exports.getLendingMarketBLRate = getLendingMarketBLRate;
|
58
81
|
//# sourceMappingURL=getLendingMarketAprs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLendingMarketAprs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLendingMarketAprs.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"getLendingMarketAprs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLendingMarketAprs.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAsE;AACtE,gEAAqC;AAErC;;;;;;;;;;GAUG;AACH,SAAgB,oBAAoB,CAClC,cAAyB,EACzB,eAA0B,EAC1B,gBAA0B,EAC1B,iBAA2B,EAC3B,YAAoB;IAEpB,IAAI,gBAAgB,CAAC,MAAM,KAAK,iBAAiB,CAAC,MAAM;QACtD,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAC1C,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CACrC,CAAC;IACF,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,cAAc,CAAC,MAAM,EAAE;QACzB,SAAS,GAAG,IAAA,sBAAS,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvE,IAAI,eAAe,CAAC,MAAM,EAAE;QAC1B,SAAS,GAAG,IAAA,sBAAS,EAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;aAC7D,SAAS,CAAC,GAAG,CAAC;aACd,QAAQ,EAAE,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClD,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAC/C,MAAM,QAAQ,GAAG,iBAAiB,CAAC,CA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,EAAE,GAAG,oBAAoB,CACpD,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,CACb,CAAC;IACF,MAAM,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC9E,OAAO;QACL,YAAY;QACZ,eAAe;QACf,gBAAgB,EAAE,iBAAiB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QACzE,WAAW,EAAE;YACX,GAAG,EAAE,IAAA,yBAAQ,EAAC,SAAS,CAAC;YACxB,GAAG,EAAE,SAAS;SACf;QACD,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE;YACZ,GAAG,EAAE,IAAA,yBAAQ,EAAC,UAAU,CAAC;YACzB,GAAG,EAAE,UAAU;SAChB;QACD,UAAU;QACV,QAAQ;KACT,CAAC;AACJ,CAAC;AAlCD,wDAkCC"}
|
@@ -11,6 +11,7 @@ export declare class ParsedGpa<T> {
|
|
11
11
|
static build<T>(connection: Connection, beets: GlobalBeetStruct<T>, programId: PublicKey): ParsedGpa<T>;
|
12
12
|
private constructor();
|
13
13
|
addInnerFilter(keys: string, val: T[keyof T] & NonNullable<unknown>): this;
|
14
|
+
addRawFilter(offset: number, bytes: string): this;
|
14
15
|
addFilter(key: keyof T & string, val: T[keyof T]): this;
|
15
16
|
addDataSizeFilter(size?: number): this;
|
16
17
|
run(): Promise<ParsedAccount<T>[]>;
|
@@ -25,6 +25,13 @@ class ParsedGpa {
|
|
25
25
|
this.gpaBuilder.addInnerFilter(keys, val);
|
26
26
|
return this;
|
27
27
|
}
|
28
|
+
addRawFilter(offset, bytes) {
|
29
|
+
if (this.gpaBuilder.config.filters == null) {
|
30
|
+
this.gpaBuilder.config.filters = [];
|
31
|
+
}
|
32
|
+
this.gpaBuilder.config.filters.push({ memcmp: { offset, bytes } });
|
33
|
+
return this;
|
34
|
+
}
|
28
35
|
addFilter(key, val) {
|
29
36
|
this.gpaBuilder.addFilter(key, val);
|
30
37
|
return this;
|
@@ -40,8 +47,10 @@ class ParsedGpa {
|
|
40
47
|
});
|
41
48
|
}
|
42
49
|
debug() {
|
50
|
+
/* eslint-disable no-console */
|
43
51
|
console.log(this.programId.toString());
|
44
52
|
console.log(this.gpaBuilder.config.filters);
|
53
|
+
/* eslint-enable no-console */
|
45
54
|
return this;
|
46
55
|
}
|
47
56
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParsedGpa.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/beets/ParsedGpa.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAA8D;AAK9D,MAAa,SAAS;IAGpB,MAAM,CAAC,KAAK,CACV,UAAsB,EACtB,KAA0B,EAC1B,SAAoB;QAEpB,OAAO,IAAI,SAAS,CAAI,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,YACqB,UAAsB,EAC/B,SAAoB,EACpB,KAA0B;QAFjB,eAAU,GAAV,UAAU,CAAY;QAC/B,cAAS,GAAT,SAAS,CAAW;QACpB,UAAK,GAAL,KAAK,CAAqB;QAEpC,IAAI,CAAC,UAAU,GAAG,wBAAU,CAAC,UAAU,CACrC,SAAS,EACT,KAA+C,CAChD,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,IAAY,EAAE,GAAsC;QACjE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,GAAqB,EAAE,GAAe;QAC9C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB,CAAC,IAAa;QAC7B,IAAI,CAAC,UAAU,CAAC,QAAQ,CACtB,CAAC,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC,KAAK,C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AK,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC9B,CAAA,CACzB,CAAC;QACJ,CAAC;KAAA;IAED,KAAK;QACH,+BAA+B;QAC/B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5C,8BAA8B;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlED,8BAkEC"}
|
@@ -1,28 +0,0 @@
|
|
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
|
-
export type House = {
|
5
|
-
pubkey: PublicKey;
|
6
|
-
houseMint: string;
|
7
|
-
currency: string;
|
8
|
-
currencyDecimals: number;
|
9
|
-
houseTokenSupply: string;
|
10
|
-
liquidity: string;
|
11
|
-
};
|
12
|
-
export type Position = {
|
13
|
-
house: string;
|
14
|
-
user: string;
|
15
|
-
amount: string;
|
16
|
-
status: {
|
17
|
-
deposit?: {};
|
18
|
-
withdraw?: {};
|
19
|
-
};
|
20
|
-
};
|
21
|
-
export type Miner = {
|
22
|
-
isBoosted: boolean;
|
23
|
-
rewarder: string;
|
24
|
-
authority: string;
|
25
|
-
amount: string;
|
26
|
-
rewards: string;
|
27
|
-
revshares: number;
|
28
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/types.ts"],"names":[],"mappings":""}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
-
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
-
import { GetProgramAccountsFilter } from '@solana/web3.js';
|
4
|
-
export declare const roleFilters: (owner: string) => GetProgramAccountsFilter[];
|
5
|
-
export declare const escrowFilters: (organization_identifier: string) => GetProgramAccountsFilter[];
|
6
|
-
export declare const orderFilters: (organization_identifier: string) => GetProgramAccountsFilter[];
|
7
|
-
export declare const loanVaultLentFilters: (borrower: string) => GetProgramAccountsFilter[];
|
8
|
-
export declare const loanVaultBorrowedFilters: (borrower: string) => GetProgramAccountsFilter[];
|
9
|
-
export declare const lockboxFilters: (nft: string) => GetProgramAccountsFilter[];
|
@@ -1,62 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.lockboxFilters = exports.loanVaultBorrowedFilters = exports.loanVaultLentFilters = exports.orderFilters = exports.escrowFilters = exports.roleFilters = void 0;
|
4
|
-
const roleFilters = (owner) => [
|
5
|
-
{
|
6
|
-
memcmp: {
|
7
|
-
offset: 8,
|
8
|
-
bytes: owner,
|
9
|
-
},
|
10
|
-
},
|
11
|
-
];
|
12
|
-
exports.roleFilters = roleFilters;
|
13
|
-
const escrowFilters = (organization_identifier) => [
|
14
|
-
{
|
15
|
-
memcmp: {
|
16
|
-
offset: 8,
|
17
|
-
bytes: organization_identifier,
|
18
|
-
},
|
19
|
-
},
|
20
|
-
{ dataSize: 208 },
|
21
|
-
];
|
22
|
-
exports.escrowFilters = escrowFilters;
|
23
|
-
const orderFilters = (organization_identifier) => [
|
24
|
-
{
|
25
|
-
memcmp: {
|
26
|
-
offset: 73,
|
27
|
-
bytes: organization_identifier,
|
28
|
-
},
|
29
|
-
},
|
30
|
-
{ dataSize: 355 },
|
31
|
-
];
|
32
|
-
exports.orderFilters = orderFilters;
|
33
|
-
const loanVaultLentFilters = (borrower) => [
|
34
|
-
{
|
35
|
-
memcmp: {
|
36
|
-
offset: 8 + 32,
|
37
|
-
bytes: borrower,
|
38
|
-
},
|
39
|
-
},
|
40
|
-
{ dataSize: 338 },
|
41
|
-
];
|
42
|
-
exports.loanVaultLentFilters = loanVaultLentFilters;
|
43
|
-
const loanVaultBorrowedFilters = (borrower) => [
|
44
|
-
{
|
45
|
-
memcmp: {
|
46
|
-
offset: 8 + 32 + 32,
|
47
|
-
bytes: borrower,
|
48
|
-
},
|
49
|
-
},
|
50
|
-
{ dataSize: 338 },
|
51
|
-
];
|
52
|
-
exports.loanVaultBorrowedFilters = loanVaultBorrowedFilters;
|
53
|
-
const lockboxFilters = (nft) => [
|
54
|
-
{
|
55
|
-
memcmp: {
|
56
|
-
offset: 52,
|
57
|
-
bytes: nft,
|
58
|
-
},
|
59
|
-
},
|
60
|
-
];
|
61
|
-
exports.lockboxFilters = lockboxFilters;
|
62
|
-
//# sourceMappingURL=filters.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAPW,QAAA,WAAW,eAOtB;AAEK,MAAM,aAAa,GAAG,CAC3B,uBAA+B,EACH,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,uBAAuB;SAC/B;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,MAAM,YAAY,GAAG,CAC1B,uBAA+B,EACH,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,uBAAuB;SAC/B;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,YAAY,gBAUvB;AAEK,MAAM,oBAAoB,GAAG,CAClC,QAAgB,EACY,EAAE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