@sonarwatch/portfolio-plugins 0.14.42 → 0.14.44

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 (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/plugins/drift/perpHelpers/pyth.js +2 -2
  4. package/src/plugins/drift/perpHelpers/pyth.js.map +1 -1
  5. package/src/plugins/flash/index.js +5 -2
  6. package/src/plugins/flash/index.js.map +1 -1
  7. package/src/plugins/flash/perpetualFetcher.js +10 -4
  8. package/src/plugins/flash/perpetualFetcher.js.map +1 -1
  9. package/src/plugins/flash/structs.d.ts +9 -0
  10. package/src/plugins/flash/structs.js +9 -1
  11. package/src/plugins/flash/structs.js.map +1 -1
  12. package/src/plugins/jupiter/types.d.ts +1 -1
  13. package/src/plugins/pyth/pricingJob.js +142 -9
  14. package/src/plugins/pyth/pricingJob.js.map +1 -1
  15. package/src/plugins/symmetry/basketsJob.js +0 -15
  16. package/src/plugins/symmetry/basketsJob.js.map +1 -1
  17. package/src/plugins/symmetry/structs.d.ts +5 -2
  18. package/src/plugins/symmetry/structs.js +4 -1
  19. package/src/plugins/symmetry/structs.js.map +1 -1
  20. package/src/utils/solana/pyth/helpers.d.ts +0 -11
  21. package/src/utils/solana/pyth/helpers.js +7 -232
  22. package/src/utils/solana/pyth/helpers.js.map +1 -1
  23. package/src/utils/solana/pyth/helpersOld.d.ts +3 -0
  24. package/src/utils/solana/pyth/helpersOld.js +154 -0
  25. package/src/utils/solana/pyth/helpersOld.js.map +1 -0
  26. package/src/utils/solana/pyth/structs.d.ts +26 -95
  27. package/src/utils/solana/pyth/structs.js +27 -32
  28. package/src/utils/solana/pyth/structs.js.map +1 -1
  29. package/src/utils/solana/pyth/structsOld.d.ts +97 -0
  30. package/src/utils/solana/pyth/structsOld.js +35 -0
  31. package/src/utils/solana/pyth/structsOld.js.map +1 -0
@@ -0,0 +1,97 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ export declare enum PriceStatus {
3
+ Unknown = 0,
4
+ Trading = 1,
5
+ Halted = 2,
6
+ Auction = 3,
7
+ Ignored = 4
8
+ }
9
+ export declare enum CorpAction {
10
+ NoCorpAct = 0
11
+ }
12
+ export declare enum PriceType {
13
+ Unknown = 0,
14
+ Price = 1
15
+ }
16
+ export declare enum DeriveType {
17
+ Unknown = 0,
18
+ Volatility = 1
19
+ }
20
+ export declare enum AccountType {
21
+ Unknown = 0,
22
+ Mapping = 1,
23
+ Product = 2,
24
+ Price = 3,
25
+ Test = 4,
26
+ Permission = 5
27
+ }
28
+ export type Base = {
29
+ magic: number;
30
+ version: number;
31
+ type: AccountType;
32
+ size: number;
33
+ };
34
+ export type MappingData = Base & {
35
+ nextMappingAccount: PublicKey | null;
36
+ productAccountKeys: PublicKey[];
37
+ };
38
+ export type Product = {
39
+ [index: string]: string;
40
+ };
41
+ export type ProductData = Base & {
42
+ priceAccountKey: PublicKey | null;
43
+ product: Product;
44
+ };
45
+ export type Price = {
46
+ priceComponent: bigint;
47
+ price: number;
48
+ confidenceComponent: bigint;
49
+ confidence: number;
50
+ status: PriceStatus;
51
+ corporateAction: CorpAction;
52
+ publishSlot: number;
53
+ };
54
+ export type PriceComponent = {
55
+ publisher: PublicKey;
56
+ aggregate: Price;
57
+ latest: Price;
58
+ };
59
+ export type Ema = {
60
+ valueComponent: bigint;
61
+ value: number;
62
+ numerator: bigint;
63
+ denominator: bigint;
64
+ };
65
+ export type PriceData = Base & {
66
+ priceType: PriceType;
67
+ exponent: number;
68
+ numComponentPrices: number;
69
+ numQuoters: number;
70
+ lastSlot: bigint;
71
+ validSlot: bigint;
72
+ emaPrice: Ema;
73
+ emaConfidence: Ema;
74
+ timestamp: bigint;
75
+ minPublishers: number;
76
+ drv2: number;
77
+ drv3: number;
78
+ drv4: number;
79
+ productAccountKey: PublicKey;
80
+ nextPriceAccountKey: PublicKey | null;
81
+ previousSlot: bigint;
82
+ previousPriceComponent: bigint;
83
+ previousPrice: number;
84
+ previousConfidenceComponent: bigint;
85
+ previousConfidence: number;
86
+ previousTimestamp: bigint;
87
+ priceComponents: PriceComponent[];
88
+ aggregate: Price;
89
+ price: number | undefined;
90
+ confidence: number | undefined;
91
+ status: PriceStatus;
92
+ };
93
+ export type PermissionData = Base & {
94
+ masterAuthority: PublicKey;
95
+ dataCurationAuthority: PublicKey;
96
+ securityAuthority: PublicKey;
97
+ };
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountType = exports.DeriveType = exports.PriceType = exports.CorpAction = exports.PriceStatus = void 0;
4
+ var PriceStatus;
5
+ (function (PriceStatus) {
6
+ PriceStatus[PriceStatus["Unknown"] = 0] = "Unknown";
7
+ PriceStatus[PriceStatus["Trading"] = 1] = "Trading";
8
+ PriceStatus[PriceStatus["Halted"] = 2] = "Halted";
9
+ PriceStatus[PriceStatus["Auction"] = 3] = "Auction";
10
+ PriceStatus[PriceStatus["Ignored"] = 4] = "Ignored";
11
+ })(PriceStatus || (exports.PriceStatus = PriceStatus = {}));
12
+ var CorpAction;
13
+ (function (CorpAction) {
14
+ CorpAction[CorpAction["NoCorpAct"] = 0] = "NoCorpAct";
15
+ })(CorpAction || (exports.CorpAction = CorpAction = {}));
16
+ var PriceType;
17
+ (function (PriceType) {
18
+ PriceType[PriceType["Unknown"] = 0] = "Unknown";
19
+ PriceType[PriceType["Price"] = 1] = "Price";
20
+ })(PriceType || (exports.PriceType = PriceType = {}));
21
+ var DeriveType;
22
+ (function (DeriveType) {
23
+ DeriveType[DeriveType["Unknown"] = 0] = "Unknown";
24
+ DeriveType[DeriveType["Volatility"] = 1] = "Volatility";
25
+ })(DeriveType || (exports.DeriveType = DeriveType = {}));
26
+ var AccountType;
27
+ (function (AccountType) {
28
+ AccountType[AccountType["Unknown"] = 0] = "Unknown";
29
+ AccountType[AccountType["Mapping"] = 1] = "Mapping";
30
+ AccountType[AccountType["Product"] = 2] = "Product";
31
+ AccountType[AccountType["Price"] = 3] = "Price";
32
+ AccountType[AccountType["Test"] = 4] = "Test";
33
+ AccountType[AccountType["Permission"] = 5] = "Permission";
34
+ })(AccountType || (exports.AccountType = AccountType = {}));
35
+ //# sourceMappingURL=structsOld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structsOld.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/pyth/structsOld.ts"],"names":[],"mappings":";;;AAEA,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,mDAAO,CAAA;AACT,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAED,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,qDAAS,CAAA;AACX,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,+CAAO,CAAA;IACP,2CAAK,CAAA;AACP,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,uDAAU,CAAA;AACZ,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,+CAAK,CAAA;IACL,6CAAI,CAAA;IACJ,yDAAU,CAAA;AACZ,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}