@sonarwatch/portfolio-plugins 0.14.144 → 0.14.151
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 +28 -0
- package/package.json +1 -1
- package/src/plugins/bskt/constants.d.ts +1 -0
- package/src/plugins/bskt/constants.js +2 -1
- package/src/plugins/bskt/constants.js.map +1 -1
- package/src/plugins/bskt/index.js +5 -1
- package/src/plugins/bskt/index.js.map +1 -1
- package/src/plugins/bskt/stakingFetcher.d.ts +3 -0
- package/src/plugins/bskt/stakingFetcher.js +58 -0
- package/src/plugins/bskt/stakingFetcher.js.map +1 -0
- package/src/plugins/bskt/structs.d.ts +12 -0
- package/src/plugins/bskt/structs.js +12 -1
- package/src/plugins/bskt/structs.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/types.d.ts +6 -2
- package/src/plugins/orca/whirlpoolsStatsJob.js +7 -3
- package/src/plugins/orca/whirlpoolsStatsJob.js.map +1 -1
- package/src/plugins/ratex/getPool.d.ts +1 -2
- package/src/plugins/ratex/getPool.js +4 -3
- package/src/plugins/ratex/getPool.js.map +1 -1
- package/src/plugins/ratex/helpers.d.ts +7 -4
- package/src/plugins/ratex/helpers.js +11 -31
- package/src/plugins/ratex/helpers.js.map +1 -1
- package/src/plugins/ratex/marketsJob.js +4 -9
- package/src/plugins/ratex/marketsJob.js.map +1 -1
- package/src/plugins/ratex/positionsFetcher.js +2 -2
- package/src/plugins/ratex/positionsFetcher.js.map +1 -1
- package/src/plugins/ratex/structs.d.ts +211 -0
- package/src/plugins/ratex/structs.js +203 -0
- package/src/plugins/ratex/structs.js.map +1 -0
- package/src/plugins/ratex/types.d.ts +5 -76
- package/src/plugins/zeta/constants.d.ts +0 -2
- package/src/plugins/zeta/constants.js +1 -7
- package/src/plugins/zeta/constants.js.map +1 -1
- package/src/plugins/zeta/stakingFetcher.js +6 -3
- package/src/plugins/zeta/stakingFetcher.js.map +1 -1
- package/src/plugins/zeta/structs.d.ts +24 -1
- package/src/plugins/zeta/structs.js +30 -1
- package/src/plugins/zeta/structs.js.map +1 -1
- package/src/plugins/zeta/types.d.ts +0 -26
- package/src/plugins/zeta/types.js +0 -7
- package/src/plugins/zeta/types.js.map +1 -1
- package/src/plugins/ratex/idl.json +0 -8806
@@ -0,0 +1,211 @@
|
|
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 State = {
|
7
|
+
accountDiscriminator: number[];
|
8
|
+
admin: PublicKey;
|
9
|
+
signer: PublicKey;
|
10
|
+
numberOfAuthorities: BigNumber;
|
11
|
+
numberOfSubAccounts: BigNumber;
|
12
|
+
collateralRatioInitial: BigNumber;
|
13
|
+
collateralRatioMaintenance: BigNumber;
|
14
|
+
collateralRatioInitialPreExpiry: BigNumber;
|
15
|
+
numberOfYieldMarkets: number;
|
16
|
+
numberOfMarginMarkets: number;
|
17
|
+
signerNonce: number;
|
18
|
+
twapDuration: number;
|
19
|
+
marginIndexStart: number;
|
20
|
+
marketIndexStart: number;
|
21
|
+
keepers: PublicKey[];
|
22
|
+
keeperFeePerTx: BigNumber[];
|
23
|
+
keeperFee: BigNumber[];
|
24
|
+
};
|
25
|
+
export declare const stateStruct: FixableBeetStruct<State, Partial<State>>;
|
26
|
+
export type MarginMarket = {
|
27
|
+
accountDiscriminator: number[];
|
28
|
+
pubkey: PublicKey;
|
29
|
+
mint: PublicKey;
|
30
|
+
};
|
31
|
+
export declare const marginMarketStruct: FixableBeetStruct<MarginMarket, Partial<MarginMarket>>;
|
32
|
+
export type AmmpoolRewardInfo = {
|
33
|
+
mint: PublicKey;
|
34
|
+
vault: PublicKey;
|
35
|
+
authority: PublicKey;
|
36
|
+
emissionsPerSecondX64: BigNumber;
|
37
|
+
growthGlobalX64: BigNumber;
|
38
|
+
};
|
39
|
+
export declare const ammPoolRewardInfoStruct: BeetStruct<AmmpoolRewardInfo, Partial<AmmpoolRewardInfo>>;
|
40
|
+
export type Ammpool = {
|
41
|
+
ammpoolsConfig: PublicKey;
|
42
|
+
liquidity: BigNumber;
|
43
|
+
sqrtPrice: BigNumber;
|
44
|
+
protocolFeeOwedA: BigNumber;
|
45
|
+
protocolFeeOwedB: BigNumber;
|
46
|
+
tokenMintBase: PublicKey;
|
47
|
+
tokenVaultBase: PublicKey;
|
48
|
+
feeGrowthGlobalA: BigNumber;
|
49
|
+
tokenMintQuote: PublicKey;
|
50
|
+
tokenVaultQuote: PublicKey;
|
51
|
+
feeGrowthGlobalB: BigNumber;
|
52
|
+
rewardLastUpdatedTimestamp: BigNumber;
|
53
|
+
rewardInfos: AmmpoolRewardInfo[];
|
54
|
+
oracle: PublicKey;
|
55
|
+
tickCurrentIndex: number;
|
56
|
+
observationIndex: number;
|
57
|
+
observationUpdateDuration: number;
|
58
|
+
tickSpacing: number;
|
59
|
+
tickSpacingSeed: number[];
|
60
|
+
feeRate: number;
|
61
|
+
protocolFeeRate: number;
|
62
|
+
};
|
63
|
+
export declare const ammpoolStruct: BeetStruct<Ammpool, Partial<Ammpool>>;
|
64
|
+
export declare enum MarginType {
|
65
|
+
NonYieldBearing = 0,
|
66
|
+
YieldBearing = 1
|
67
|
+
}
|
68
|
+
export type YieldMarket = {
|
69
|
+
accountDiscriminator: number[];
|
70
|
+
pubkey: PublicKey;
|
71
|
+
oracle: PublicKey;
|
72
|
+
name: number[];
|
73
|
+
quoteAssetVault: PublicKey;
|
74
|
+
baseAssetVault: PublicKey;
|
75
|
+
pool: Ammpool;
|
76
|
+
startTs: BigNumber;
|
77
|
+
expireTs: BigNumber;
|
78
|
+
orderStepSize: BigNumber;
|
79
|
+
minOrderSize: BigNumber;
|
80
|
+
minLpAmount: BigNumber;
|
81
|
+
minLiquidationSize: BigNumber;
|
82
|
+
marketIndex: number;
|
83
|
+
marginIndex: number;
|
84
|
+
lpMarginIndex: number;
|
85
|
+
marginType: MarginType;
|
86
|
+
lpMarginType: MarginType;
|
87
|
+
marginDecimals: number;
|
88
|
+
lpMarginDecimals: number;
|
89
|
+
};
|
90
|
+
export declare const yieldMarketStruct: FixableBeetStruct<YieldMarket, Partial<YieldMarket>>;
|
91
|
+
export type Oracle = {
|
92
|
+
accountDiscriminator: number[];
|
93
|
+
admin: PublicKey;
|
94
|
+
name: number[];
|
95
|
+
lastRate: BigNumber;
|
96
|
+
rate: BigNumber;
|
97
|
+
marketRate: BigNumber;
|
98
|
+
ts: BigNumber;
|
99
|
+
decimals: number;
|
100
|
+
padding: number[];
|
101
|
+
epochStartTimestamp: BigNumber;
|
102
|
+
lastEpochStartTimestamp: BigNumber;
|
103
|
+
padding1: number[];
|
104
|
+
};
|
105
|
+
export declare const oracleStruct: FixableBeetStruct<Oracle, Partial<Oracle>>;
|
106
|
+
export type YieldPosition = {
|
107
|
+
baseAssetAmount: BigNumber;
|
108
|
+
quoteAssetAmount: BigNumber;
|
109
|
+
lastRate: BigNumber;
|
110
|
+
marketIndex: number;
|
111
|
+
padding1: number[];
|
112
|
+
padding2: number[];
|
113
|
+
};
|
114
|
+
export declare const yieldPositionStruct: BeetStruct<YieldPosition, Partial<YieldPosition>>;
|
115
|
+
export declare enum OrderStatus {
|
116
|
+
Init = 0,
|
117
|
+
Open = 1,
|
118
|
+
Filled = 2,
|
119
|
+
Canceled = 3
|
120
|
+
}
|
121
|
+
export declare enum OrderType {
|
122
|
+
Market = 0,
|
123
|
+
Limit = 1
|
124
|
+
}
|
125
|
+
export type Order = {
|
126
|
+
slot: BigNumber;
|
127
|
+
priceLimit: BigNumber;
|
128
|
+
baseAssetAmount: BigNumber;
|
129
|
+
baseAssetAmountFilled: BigNumber;
|
130
|
+
quoteAssetAmountFilled: BigNumber;
|
131
|
+
expireTs: BigNumber;
|
132
|
+
orderIndex: number;
|
133
|
+
orderId: number;
|
134
|
+
isolatedMarginAmount: BigNumber;
|
135
|
+
marketIndex: number;
|
136
|
+
status: OrderStatus;
|
137
|
+
orderType: OrderType;
|
138
|
+
isClose: boolean;
|
139
|
+
padding1: number[];
|
140
|
+
padding2: number[];
|
141
|
+
};
|
142
|
+
export declare const orderStruct: BeetStruct<Order, Partial<Order>>;
|
143
|
+
export type MarginPosition = {
|
144
|
+
balance: BigNumber;
|
145
|
+
marketIndex: number;
|
146
|
+
decimals: number;
|
147
|
+
padding2: number[];
|
148
|
+
};
|
149
|
+
export declare const marginPositionStruct: BeetStruct<MarginPosition, Partial<MarginPosition>>;
|
150
|
+
export type User = {
|
151
|
+
accountDiscriminator: number[];
|
152
|
+
authority: PublicKey;
|
153
|
+
marginPositions: MarginPosition[];
|
154
|
+
orders: Order[];
|
155
|
+
yieldPositions: YieldPosition[];
|
156
|
+
lastActiveSlot: BigNumber;
|
157
|
+
lastOrderId: number;
|
158
|
+
subAccountId: number;
|
159
|
+
idle: boolean;
|
160
|
+
padding2: boolean;
|
161
|
+
isIsolated: boolean;
|
162
|
+
isExpiryOn: boolean;
|
163
|
+
padding1: number[];
|
164
|
+
};
|
165
|
+
export declare const userStruct: FixableBeetStruct<User, Partial<User>>;
|
166
|
+
export type UserStats = {
|
167
|
+
accountDiscriminator: number[];
|
168
|
+
authority: PublicKey;
|
169
|
+
referrer: PublicKey;
|
170
|
+
numberOfSubAccounts: number;
|
171
|
+
numberOfSubAccountsCreated: number;
|
172
|
+
padding: number[];
|
173
|
+
};
|
174
|
+
export declare const userStatsStruct: BeetStruct<UserStats, Partial<UserStats>>;
|
175
|
+
export type PositionRewardInfo = {
|
176
|
+
growthInsideCheckpoint: BigNumber;
|
177
|
+
amountOwed: BigNumber;
|
178
|
+
};
|
179
|
+
export declare const positionrewardinfoStruct: BeetStruct<PositionRewardInfo, Partial<PositionRewardInfo>>;
|
180
|
+
export type AmmPosition = {
|
181
|
+
ammpool: PublicKey;
|
182
|
+
liquidity: BigNumber;
|
183
|
+
tickLowerIndex: number;
|
184
|
+
tickUpperIndex: number;
|
185
|
+
lowerRate: BigNumber;
|
186
|
+
upperRate: BigNumber;
|
187
|
+
feeGrowthCheckpointA: BigNumber;
|
188
|
+
feeOwedA: BigNumber;
|
189
|
+
feeGrowthCheckpointB: BigNumber;
|
190
|
+
feeOwedB: BigNumber;
|
191
|
+
rewardInfos: PositionRewardInfo[];
|
192
|
+
};
|
193
|
+
export declare const positionStruct: BeetStruct<AmmPosition, Partial<AmmPosition>>;
|
194
|
+
export declare enum LpStatus {
|
195
|
+
Active = 0,
|
196
|
+
Updating = 1
|
197
|
+
}
|
198
|
+
export type LP = {
|
199
|
+
accountDiscriminator: number[];
|
200
|
+
authority: PublicKey;
|
201
|
+
ammPosition: AmmPosition;
|
202
|
+
reserveQuoteAmount: BigNumber;
|
203
|
+
reserveBaseAmount: BigNumber;
|
204
|
+
lastActiveSlot: BigNumber;
|
205
|
+
subAccountId: BigNumber;
|
206
|
+
idle: boolean;
|
207
|
+
state: LpStatus;
|
208
|
+
padding1: number[];
|
209
|
+
padding2: number[];
|
210
|
+
};
|
211
|
+
export declare const lpStruct: BeetStruct<LP, Partial<LP>>;
|
@@ -0,0 +1,203 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.lpStruct = exports.LpStatus = exports.positionStruct = exports.positionrewardinfoStruct = exports.userStatsStruct = exports.userStruct = exports.marginPositionStruct = exports.orderStruct = exports.OrderType = exports.OrderStatus = exports.yieldPositionStruct = exports.oracleStruct = exports.yieldMarketStruct = exports.MarginType = exports.ammpoolStruct = exports.ammPoolRewardInfoStruct = exports.marginMarketStruct = exports.stateStruct = 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
|
+
exports.stateStruct = new beet_1.FixableBeetStruct([
|
8
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
9
|
+
['admin', beet_solana_1.publicKey],
|
10
|
+
['signer', beet_solana_1.publicKey],
|
11
|
+
['numberOfAuthorities', solana_1.u64],
|
12
|
+
['numberOfSubAccounts', solana_1.u64],
|
13
|
+
['collateralRatioInitial', solana_1.i64],
|
14
|
+
['collateralRatioMaintenance', solana_1.i64],
|
15
|
+
['collateralRatioInitialPreExpiry', solana_1.i64],
|
16
|
+
['numberOfYieldMarkets', beet_1.u32],
|
17
|
+
['numberOfMarginMarkets', beet_1.u32],
|
18
|
+
['signerNonce', beet_1.u8],
|
19
|
+
['twapDuration', beet_1.u32],
|
20
|
+
['marginIndexStart', beet_1.u32],
|
21
|
+
['marketIndexStart', beet_1.u32],
|
22
|
+
['keepers', (0, beet_1.uniformFixedSizeArray)(beet_solana_1.publicKey, 20)],
|
23
|
+
['keeperFeePerTx', solana_1.u64],
|
24
|
+
['keeperFee', solana_1.u64],
|
25
|
+
], (args) => args);
|
26
|
+
exports.marginMarketStruct = new beet_1.FixableBeetStruct([
|
27
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
28
|
+
['pubkey', beet_solana_1.publicKey],
|
29
|
+
['mint', beet_solana_1.publicKey],
|
30
|
+
], (args) => args);
|
31
|
+
exports.ammPoolRewardInfoStruct = new beet_1.BeetStruct([
|
32
|
+
['mint', beet_solana_1.publicKey],
|
33
|
+
['vault', beet_solana_1.publicKey],
|
34
|
+
['authority', beet_solana_1.publicKey],
|
35
|
+
['emissionsPerSecondX64', solana_1.u128],
|
36
|
+
['growthGlobalX64', solana_1.u128],
|
37
|
+
], (args) => args);
|
38
|
+
exports.ammpoolStruct = new beet_1.BeetStruct([
|
39
|
+
['ammpoolsConfig', beet_solana_1.publicKey],
|
40
|
+
['liquidity', solana_1.u128],
|
41
|
+
['sqrtPrice', solana_1.u128],
|
42
|
+
['protocolFeeOwedA', solana_1.u64],
|
43
|
+
['protocolFeeOwedB', solana_1.u64],
|
44
|
+
['tokenMintBase', beet_solana_1.publicKey],
|
45
|
+
['tokenVaultBase', beet_solana_1.publicKey],
|
46
|
+
['feeGrowthGlobalA', solana_1.u128],
|
47
|
+
['tokenMintQuote', beet_solana_1.publicKey],
|
48
|
+
['tokenVaultQuote', beet_solana_1.publicKey],
|
49
|
+
['feeGrowthGlobalB', solana_1.u128],
|
50
|
+
['rewardLastUpdatedTimestamp', solana_1.u64],
|
51
|
+
['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.ammPoolRewardInfoStruct, 3)],
|
52
|
+
['oracle', beet_solana_1.publicKey],
|
53
|
+
['tickCurrentIndex', beet_1.i32],
|
54
|
+
['observationIndex', beet_1.u16],
|
55
|
+
['observationUpdateDuration', beet_1.u16],
|
56
|
+
['tickSpacing', beet_1.u16],
|
57
|
+
['tickSpacingSeed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 2)],
|
58
|
+
['feeRate', beet_1.u16],
|
59
|
+
['protocolFeeRate', beet_1.u16],
|
60
|
+
], (args) => args);
|
61
|
+
var MarginType;
|
62
|
+
(function (MarginType) {
|
63
|
+
MarginType[MarginType["NonYieldBearing"] = 0] = "NonYieldBearing";
|
64
|
+
MarginType[MarginType["YieldBearing"] = 1] = "YieldBearing";
|
65
|
+
})(MarginType || (exports.MarginType = MarginType = {}));
|
66
|
+
exports.yieldMarketStruct = new beet_1.FixableBeetStruct([
|
67
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
68
|
+
['pubkey', beet_solana_1.publicKey],
|
69
|
+
['oracle', beet_solana_1.publicKey],
|
70
|
+
['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
71
|
+
['quoteAssetVault', beet_solana_1.publicKey],
|
72
|
+
['baseAssetVault', beet_solana_1.publicKey],
|
73
|
+
['pool', exports.ammpoolStruct],
|
74
|
+
['startTs', solana_1.i64],
|
75
|
+
['expireTs', solana_1.i64],
|
76
|
+
['orderStepSize', solana_1.u64],
|
77
|
+
['minOrderSize', solana_1.u64],
|
78
|
+
['minLpAmount', solana_1.u64],
|
79
|
+
['minLiquidationSize', solana_1.u64],
|
80
|
+
['marketIndex', beet_1.u32],
|
81
|
+
['marginIndex', beet_1.u32],
|
82
|
+
['lpMarginIndex', beet_1.u32],
|
83
|
+
['marginType', beet_1.u8],
|
84
|
+
['lpMarginType', beet_1.u8],
|
85
|
+
['marginDecimals', beet_1.u8],
|
86
|
+
['lpMarginDecimals', beet_1.u8],
|
87
|
+
], (args) => args);
|
88
|
+
exports.oracleStruct = new beet_1.FixableBeetStruct([
|
89
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
90
|
+
['admin', beet_solana_1.publicKey],
|
91
|
+
['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
92
|
+
['lastRate', solana_1.u64],
|
93
|
+
['rate', solana_1.u64],
|
94
|
+
['marketRate', solana_1.u64],
|
95
|
+
['ts', solana_1.i64],
|
96
|
+
['decimals', beet_1.u32],
|
97
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
|
98
|
+
['epochStartTimestamp', solana_1.i64],
|
99
|
+
['lastEpochStartTimestamp', solana_1.i64],
|
100
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
101
|
+
], (args) => args);
|
102
|
+
exports.yieldPositionStruct = new beet_1.BeetStruct([
|
103
|
+
['baseAssetAmount', solana_1.i64],
|
104
|
+
['quoteAssetAmount', solana_1.i64],
|
105
|
+
['lastRate', solana_1.u64],
|
106
|
+
['marketIndex', beet_1.u32],
|
107
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
|
108
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
109
|
+
], (args) => args);
|
110
|
+
var OrderStatus;
|
111
|
+
(function (OrderStatus) {
|
112
|
+
OrderStatus[OrderStatus["Init"] = 0] = "Init";
|
113
|
+
OrderStatus[OrderStatus["Open"] = 1] = "Open";
|
114
|
+
OrderStatus[OrderStatus["Filled"] = 2] = "Filled";
|
115
|
+
OrderStatus[OrderStatus["Canceled"] = 3] = "Canceled";
|
116
|
+
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
117
|
+
var OrderType;
|
118
|
+
(function (OrderType) {
|
119
|
+
OrderType[OrderType["Market"] = 0] = "Market";
|
120
|
+
OrderType[OrderType["Limit"] = 1] = "Limit";
|
121
|
+
})(OrderType || (exports.OrderType = OrderType = {}));
|
122
|
+
exports.orderStruct = new beet_1.BeetStruct([
|
123
|
+
['slot', solana_1.u64],
|
124
|
+
['priceLimit', solana_1.u128],
|
125
|
+
['baseAssetAmount', solana_1.i64],
|
126
|
+
['baseAssetAmountFilled', solana_1.i64],
|
127
|
+
['quoteAssetAmountFilled', solana_1.i64],
|
128
|
+
['expireTs', solana_1.i64],
|
129
|
+
['orderIndex', beet_1.u32],
|
130
|
+
['orderId', beet_1.u32],
|
131
|
+
['isolatedMarginAmount', solana_1.u64],
|
132
|
+
['marketIndex', beet_1.u32],
|
133
|
+
['status', beet_1.u8],
|
134
|
+
['orderType', beet_1.u8],
|
135
|
+
['isClose', beet_1.bool],
|
136
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 1)],
|
137
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
138
|
+
], (args) => args);
|
139
|
+
exports.marginPositionStruct = new beet_1.BeetStruct([
|
140
|
+
['balance', solana_1.i64],
|
141
|
+
['marketIndex', beet_1.u32],
|
142
|
+
['decimals', beet_1.u32],
|
143
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
144
|
+
], (args) => args);
|
145
|
+
exports.userStruct = new beet_1.FixableBeetStruct([
|
146
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
147
|
+
['authority', beet_solana_1.publicKey],
|
148
|
+
['marginPositions', (0, beet_1.uniformFixedSizeArray)(exports.marginPositionStruct, 2)],
|
149
|
+
['orders', (0, beet_1.uniformFixedSizeArray)(exports.orderStruct, 32)],
|
150
|
+
['yieldPositions', (0, beet_1.uniformFixedSizeArray)(exports.yieldPositionStruct, 8)],
|
151
|
+
['lastActiveSlot', solana_1.u64],
|
152
|
+
['lastOrderId', beet_1.u32],
|
153
|
+
['subAccountId', beet_1.u16],
|
154
|
+
['idle', beet_1.bool],
|
155
|
+
['padding2', beet_1.bool],
|
156
|
+
['isIsolated', beet_1.bool],
|
157
|
+
['isExpiryOn', beet_1.bool],
|
158
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
|
159
|
+
], (args) => args);
|
160
|
+
exports.userStatsStruct = new beet_1.BeetStruct([
|
161
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
162
|
+
['authority', beet_solana_1.publicKey],
|
163
|
+
['referrer', beet_solana_1.publicKey],
|
164
|
+
['numberOfSubAccounts', beet_1.u16],
|
165
|
+
['numberOfSubAccountsCreated', beet_1.u16],
|
166
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 52)],
|
167
|
+
], (args) => args);
|
168
|
+
exports.positionrewardinfoStruct = new beet_1.BeetStruct([
|
169
|
+
['growthInsideCheckpoint', solana_1.u128],
|
170
|
+
['amountOwed', solana_1.u64],
|
171
|
+
], (args) => args);
|
172
|
+
exports.positionStruct = new beet_1.BeetStruct([
|
173
|
+
['ammpool', beet_solana_1.publicKey],
|
174
|
+
['liquidity', solana_1.u128],
|
175
|
+
['tickLowerIndex', beet_1.i32],
|
176
|
+
['tickUpperIndex', beet_1.i32],
|
177
|
+
['lowerRate', solana_1.u64],
|
178
|
+
['upperRate', solana_1.u64],
|
179
|
+
['feeGrowthCheckpointA', solana_1.u128],
|
180
|
+
['feeOwedA', solana_1.u64],
|
181
|
+
['feeGrowthCheckpointB', solana_1.u128],
|
182
|
+
['feeOwedB', solana_1.u64],
|
183
|
+
['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.positionrewardinfoStruct, 3)],
|
184
|
+
], (args) => args);
|
185
|
+
var LpStatus;
|
186
|
+
(function (LpStatus) {
|
187
|
+
LpStatus[LpStatus["Active"] = 0] = "Active";
|
188
|
+
LpStatus[LpStatus["Updating"] = 1] = "Updating";
|
189
|
+
})(LpStatus || (exports.LpStatus = LpStatus = {}));
|
190
|
+
exports.lpStruct = new beet_1.BeetStruct([
|
191
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
192
|
+
['authority', beet_solana_1.publicKey],
|
193
|
+
['ammPosition', exports.positionStruct],
|
194
|
+
['reserveQuoteAmount', solana_1.i64],
|
195
|
+
['reserveBaseAmount', solana_1.i64],
|
196
|
+
['lastActiveSlot', solana_1.u64],
|
197
|
+
['subAccountId', beet_1.u16],
|
198
|
+
['idle', beet_1.bool],
|
199
|
+
['state', beet_1.u8],
|
200
|
+
['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
|
201
|
+
['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 72)],
|
202
|
+
], (args) => args);
|
203
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/structs.ts"],"names":[],"mappings":";;;AAEA,oDASmC;AACnC,kEAA6D;AAC7D,+CAAoD;AAsBvC,QAAA,WAAW,GAAG,IAAI,wBAAiB,CAC9C;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,E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AAI,CAAC;IAC9B,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,gCAAwB,EAAE,CAAC,CAAC,CAAC;CACpE,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC;AAEF,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,2CAAU,CAAA;IACV,+CAAY,CAAA;AACd,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAgBY,QAAA,QAAQ,GAAG,IAAI,iBAAU,CACpC;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,aAAa,EAAE,sBAAc,CAAC;IAC/B,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,cAAc,EAAE,UAAG,CAAC;IACrB,CAAC,MAAM,EAAE,WAAI,CAAC;IACd,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAU,CACrB,CAAC"}
|
@@ -1,83 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
};
|
4
|
-
export type MarginMarket = {
|
5
|
-
pubkey: string;
|
6
|
-
mint: string;
|
7
|
-
};
|
1
|
+
import BigNumber from 'bignumber.js';
|
2
|
+
import { YieldMarket } from './structs';
|
8
3
|
export type Program = {
|
9
4
|
programId: string;
|
10
5
|
mint: string;
|
11
6
|
};
|
12
|
-
export type UserStats = {
|
13
|
-
numberOfSubAccountsCreated: number;
|
14
|
-
};
|
15
|
-
export type User = {
|
16
|
-
marginPositions: MarginPosition[];
|
17
|
-
};
|
18
|
-
export type MarginPosition = {
|
19
|
-
balance: number;
|
20
|
-
marketIndex: number;
|
21
|
-
decimals: number;
|
22
|
-
};
|
23
|
-
export type LP = {
|
24
|
-
ammPosition: AmmPosition;
|
25
|
-
reserveQuoteAmount: number;
|
26
|
-
reserveBaseAmount: number;
|
27
|
-
};
|
28
|
-
export type AmmPosition = {
|
29
|
-
ammpool: string;
|
30
|
-
liquidity: number;
|
31
|
-
tickLowerIndex: number;
|
32
|
-
tickUpperIndex: number;
|
33
|
-
lowerRate: number;
|
34
|
-
upperRate: number;
|
35
|
-
feeGrowthCheckpointA: number;
|
36
|
-
feeOwedA: number;
|
37
|
-
feeGrowthCheckpointB: number;
|
38
|
-
feeOwedB: number;
|
39
|
-
};
|
40
|
-
export type YieldMarket = {
|
41
|
-
pubkey: string;
|
42
|
-
oracle: string;
|
43
|
-
pool: Ammpool;
|
44
|
-
lpMarginIndex: number;
|
45
|
-
lpMarginDecimals: number;
|
46
|
-
};
|
47
|
-
export type AmmpoolRewardInfo = {
|
48
|
-
mint: string;
|
49
|
-
vault: string;
|
50
|
-
authority: string;
|
51
|
-
emissionsPerSecondX64: number;
|
52
|
-
growthGlobalX64: number;
|
53
|
-
};
|
54
|
-
export type Ammpool = {
|
55
|
-
ammpoolsConfig: string;
|
56
|
-
liquidity: number;
|
57
|
-
sqrtPrice: number;
|
58
|
-
protocolFeeOwedA: number;
|
59
|
-
protocolFeeOwedB: number;
|
60
|
-
tokenMintBase: string;
|
61
|
-
tokenVaultBase: string;
|
62
|
-
feeGrowthGlobalA: number;
|
63
|
-
tokenMintQuote: string;
|
64
|
-
tokenVaultQuote: string;
|
65
|
-
feeGrowthGlobalB: number;
|
66
|
-
rewardLastUpdatedTimestamp: number;
|
67
|
-
rewardInfos: AmmpoolRewardInfo[];
|
68
|
-
oracle: string;
|
69
|
-
tickCurrentIndex: number;
|
70
|
-
observationIndex: number;
|
71
|
-
observationUpdateDuration: number;
|
72
|
-
tickSpacing: number;
|
73
|
-
tickSpacingSeed: number[];
|
74
|
-
feeRate: number;
|
75
|
-
protocolFeeRate: number;
|
76
|
-
};
|
77
|
-
export type Oracle = {
|
78
|
-
rate: number;
|
79
|
-
};
|
80
|
-
export type YieldMarketWithOracle = YieldMarket & Oracle;
|
81
7
|
export type PtToken = {
|
82
8
|
pt_mint: string;
|
83
9
|
pt_price: number;
|
@@ -85,3 +11,6 @@ export type PtToken = {
|
|
85
11
|
pt_yield: number;
|
86
12
|
security_id: string;
|
87
13
|
};
|
14
|
+
export type YieldMarketWithOracle = YieldMarket & {
|
15
|
+
rate: BigNumber;
|
16
|
+
};
|
@@ -2,7 +2,6 @@
|
|
2
2
|
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
3
|
import { PublicKey } from '@solana/web3.js';
|
4
4
|
import { Platform } from '@sonarwatch/portfolio-core';
|
5
|
-
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
6
5
|
import { AirdropStatics } from '../../AirdropFetcher';
|
7
6
|
export declare const zexMint = "ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo";
|
8
7
|
export declare const platformId = "zeta";
|
@@ -14,4 +13,3 @@ export declare const zexDecimals = 6;
|
|
14
13
|
export declare const distributorPid = "4JSALTb4QbipG7NNLryAFJg4y8X5C1ELErSncsVMA3gZ";
|
15
14
|
export declare const distributors: string[];
|
16
15
|
export declare const stakingPid: PublicKey;
|
17
|
-
export declare const zetaIdlItem: IdlItem;
|
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.stakingPid = exports.distributors = exports.distributorPid = exports.zexDecimals = exports.airdropStatics = exports.graphqlApi = exports.programId = exports.platform = exports.platformId = exports.zexMint = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
const idls_1 = require("./idls");
|
6
5
|
exports.zexMint = 'ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo';
|
7
6
|
exports.platformId = 'zeta';
|
8
7
|
exports.platform = {
|
@@ -70,9 +69,4 @@ exports.distributors = [
|
|
70
69
|
'6o1ZexNBJnQCDXiWtJgDPkE4u5WndgUb1wKDjofRuWme',
|
71
70
|
];
|
72
71
|
exports.stakingPid = new web3_js_1.PublicKey('4DUapvWZDDCkfWJpdwvX2QjwAE9Yq4wU8792RMMv7Csg');
|
73
|
-
exports.zetaIdlItem = {
|
74
|
-
programId: exports.stakingPid.toString(),
|
75
|
-
idl: idls_1.idls,
|
76
|
-
idlType: 'anchor',
|
77
|
-
};
|
78
72
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EACH,0EAA0E;IAC5E,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,aAAa,EAAE,4BAA4B;IAC3C,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,QAAQ,EAAE,8BAA8B;IACxC,OAAO,EAAE,+BAA+B;IACxC,MAAM,EAAE,gCAAgC;IACxC,WAAW,EAAE,6DAA6D;CAC3E,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,UAAU,GAAG,sCAAsC,CAAC;AAEpD,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,6BAA6B;IACxC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,MAAM;IACnB,EAAE,EAAE,cAAc;IAClB,KAAK,EACH,0EAA0E;IAC5E,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEW,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAChE,QAAA,YAAY,GAAG;IAC1B,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CAC/C,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC"}
|
@@ -19,6 +19,7 @@ const clients_1 = require("../../utils/clients");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
20
20
|
const solana_1 = require("../../utils/solana");
|
21
21
|
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
22
|
+
const structs_1 = require("./structs");
|
22
23
|
const networkId = portfolio_core_1.NetworkId.solana;
|
23
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
25
|
const client = (0, clients_1.getClientSolana)();
|
@@ -27,10 +28,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
27
28
|
const accounts = [];
|
28
29
|
do {
|
29
30
|
const stakeAccountsAddresses = (0, helpers_1.getStakeAccountsAddresses)(owner, index, index + step);
|
30
|
-
const stakeAccounts = yield (0, solana_1.
|
31
|
+
const stakeAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.stakeAccountStruct, stakeAccountsAddresses);
|
31
32
|
index += step;
|
32
33
|
accounts.push(...stakeAccounts);
|
33
34
|
} while (!accounts.some((acc) => !acc));
|
35
|
+
if (!accounts.length)
|
36
|
+
return [];
|
34
37
|
const registry = new ElementRegistry_1.ElementRegistry(networkId, constants_1.platformId);
|
35
38
|
const stakingElement = registry.addElementMultiple({
|
36
39
|
label: 'Staked',
|
@@ -42,8 +45,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
45
|
const name = (0, solana_1.u8ArrayToString)(account.name);
|
43
46
|
const amount = new bignumber_js_1.default(account.amountStillStaked).toNumber();
|
44
47
|
const attributes = {
|
45
|
-
lockedUntil: account.stakeState.
|
46
|
-
? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.
|
48
|
+
lockedUntil: account.stakeState.__kind === 'Vesting'
|
49
|
+
? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.stakeStartEpoch)
|
47
50
|
: -1,
|
48
51
|
tags: [name],
|
49
52
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAGoC;AACpC,gEAAqC;AAGrC,
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"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CAAC;QAE3C,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC;QAEnE,MAAM,UAAU,GAA6B;YAC3C,WAAW,EACT,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,SAAS;gBACrC,CAAC,CAAC,IAAA,sBAAY,EACV,OAAO,CAAC,mBAAmB,EAC3B,OAAO,CAAC,UAAU,CAAC,eAAe,CACnC;gBACH,CAAC,CAAC,CAAC,CAAC;YACR,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC;QAEF,cAAc,CAAC,QAAQ,CAAC;YACtB,OAAO,EAAE,mBAAO;YAChB,MAAM;YACN,UAAU;YACV,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
3
3
|
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
4
|
-
import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
|
4
|
+
import { BeetStruct, FixableBeetStruct, DataEnumKeyAsKind } from '@metaplex-foundation/beet';
|
5
5
|
import { PublicKey } from '@solana/web3.js';
|
6
6
|
import BigNumber from 'bignumber.js';
|
7
7
|
export declare enum MarginAccountType {
|
@@ -57,3 +57,26 @@ export type ClaimStatus = {
|
|
57
57
|
claimedAmount: BigNumber;
|
58
58
|
};
|
59
59
|
export declare const claimStatusStruct: BeetStruct<ClaimStatus, Partial<ClaimStatus>>;
|
60
|
+
type StakeStateRecord = {
|
61
|
+
Uninitialized: NonNullable<unknown>;
|
62
|
+
Vesting: {
|
63
|
+
stakeStartEpoch: number;
|
64
|
+
lastClaimTs: BigNumber;
|
65
|
+
};
|
66
|
+
Locked: NonNullable<unknown>;
|
67
|
+
};
|
68
|
+
type StakeState = DataEnumKeyAsKind<StakeStateRecord>;
|
69
|
+
export type StakeAccount = {
|
70
|
+
accountDiscriminator: number[];
|
71
|
+
name: number[];
|
72
|
+
vaultNonce: number;
|
73
|
+
bitInUse: number;
|
74
|
+
stakeState: StakeState;
|
75
|
+
initialStakeAmount: BigNumber;
|
76
|
+
amountStillStaked: BigNumber;
|
77
|
+
amountClaimed: BigNumber;
|
78
|
+
stakeDurationEpochs: number;
|
79
|
+
authority: PublicKey;
|
80
|
+
};
|
81
|
+
export declare const stakeAccountStruct: FixableBeetStruct<StakeAccount, Partial<StakeAccount>>;
|
82
|
+
export {};
|