@hawksightco/hawk-sdk 1.3.265 → 1.3.267
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/dist/addresses.d.ts +37 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +84 -0
- package/dist/anchor.d.ts +22 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +121 -0
- package/dist/classes/AltStorage.d.ts +29 -0
- package/dist/classes/AltStorage.d.ts.map +1 -0
- package/dist/classes/AltStorage.js +58 -0
- package/dist/classes/Atomicity.d.ts +34 -0
- package/dist/classes/Atomicity.d.ts.map +1 -0
- package/dist/classes/Atomicity.js +110 -0
- package/dist/classes/Client.d.ts +35 -0
- package/dist/classes/Client.d.ts.map +1 -0
- package/dist/classes/Client.js +66 -0
- package/dist/classes/CombineTransactions.d.ts +11 -0
- package/dist/classes/CombineTransactions.d.ts.map +1 -0
- package/dist/classes/CombineTransactions.js +58 -0
- package/dist/classes/CreateTxMetadata.d.ts +100 -0
- package/dist/classes/CreateTxMetadata.d.ts.map +1 -0
- package/dist/classes/CreateTxMetadata.js +415 -0
- package/dist/classes/General.d.ts +87 -0
- package/dist/classes/General.d.ts.map +1 -0
- package/dist/classes/General.js +176 -0
- package/dist/classes/GeneralUtility.d.ts +79 -0
- package/dist/classes/GeneralUtility.d.ts.map +1 -0
- package/dist/classes/GeneralUtility.js +121 -0
- package/dist/classes/HawkAPI.d.ts +122 -0
- package/dist/classes/HawkAPI.d.ts.map +1 -0
- package/dist/classes/HawkAPI.js +169 -0
- package/dist/classes/Health.d.ts +29 -0
- package/dist/classes/Health.d.ts.map +1 -0
- package/dist/classes/Health.js +48 -0
- package/dist/classes/JupiterAlts.d.ts +37 -0
- package/dist/classes/JupiterAlts.d.ts.map +1 -0
- package/dist/classes/JupiterAlts.js +114 -0
- package/dist/classes/JupiterSwap.d.ts +21 -0
- package/dist/classes/JupiterSwap.d.ts.map +1 -0
- package/dist/classes/JupiterSwap.js +40 -0
- package/dist/classes/Logging.d.ts +13 -0
- package/dist/classes/Logging.d.ts.map +1 -0
- package/dist/classes/Logging.js +50 -0
- package/dist/classes/MultiTransaction.d.ts +75 -0
- package/dist/classes/MultiTransaction.d.ts.map +1 -0
- package/dist/classes/MultiTransaction.js +296 -0
- package/dist/classes/RaydiumSDK.d.ts +67 -0
- package/dist/classes/RaydiumSDK.d.ts.map +1 -0
- package/dist/classes/RaydiumSDK.js +206 -0
- package/dist/classes/Search.d.ts +100 -0
- package/dist/classes/Search.d.ts.map +1 -0
- package/dist/classes/Search.js +216 -0
- package/dist/classes/SimpleIxGenerator.d.ts +57 -0
- package/dist/classes/SimpleIxGenerator.d.ts.map +1 -0
- package/dist/classes/SimpleIxGenerator.js +62 -0
- package/dist/classes/SimplePdaGenerator.d.ts +28 -0
- package/dist/classes/SimplePdaGenerator.d.ts.map +1 -0
- package/dist/classes/SimplePdaGenerator.js +33 -0
- package/dist/classes/Transaction.d.ts +229 -0
- package/dist/classes/Transaction.d.ts.map +1 -0
- package/dist/classes/Transaction.js +643 -0
- package/dist/classes/Transaction2.d.ts +107 -0
- package/dist/classes/Transaction2.d.ts.map +1 -0
- package/dist/classes/Transaction2.js +249 -0
- package/dist/classes/Transaction3.d.ts +165 -0
- package/dist/classes/Transaction3.d.ts.map +1 -0
- package/dist/classes/Transaction3.js +416 -0
- package/dist/classes/TransactionBatchExecute.d.ts +163 -0
- package/dist/classes/TransactionBatchExecute.d.ts.map +1 -0
- package/dist/classes/TransactionBatchExecute.js +466 -0
- package/dist/classes/TransactionBatchExecute2.d.ts +99 -0
- package/dist/classes/TransactionBatchExecute2.d.ts.map +1 -0
- package/dist/classes/TransactionBatchExecute2.js +357 -0
- package/dist/classes/Transactions.d.ts +586 -0
- package/dist/classes/Transactions.d.ts.map +1 -0
- package/dist/classes/Transactions.js +7667 -0
- package/dist/classes/TxGenerator.d.ts +350 -0
- package/dist/classes/TxGenerator.d.ts.map +1 -0
- package/dist/classes/TxGenerator.js +1957 -0
- package/dist/classes/TxGeneratorAutomations.d.ts +186 -0
- package/dist/classes/TxGeneratorAutomations.d.ts.map +1 -0
- package/dist/classes/TxGeneratorAutomations.js +897 -0
- package/dist/classes/Util.d.ts +87 -0
- package/dist/classes/Util.d.ts.map +1 -0
- package/dist/classes/Util.js +148 -0
- package/dist/classes/account-cache/AccountCache.d.ts +54 -0
- package/dist/classes/account-cache/AccountCache.d.ts.map +1 -0
- package/dist/classes/account-cache/AccountCache.js +143 -0
- package/dist/classes/account-cache/MintCache.d.ts +33 -0
- package/dist/classes/account-cache/MintCache.d.ts.map +1 -0
- package/dist/classes/account-cache/MintCache.js +47 -0
- package/dist/classes/account-cache/TokenCache.d.ts +33 -0
- package/dist/classes/account-cache/TokenCache.d.ts.map +1 -0
- package/dist/classes/account-cache/TokenCache.js +47 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +96 -0
- package/dist/functions.d.ts +514 -0
- package/dist/functions.d.ts.map +1 -0
- package/dist/functions.js +1636 -0
- package/dist/hawksight.d.ts +53 -0
- package/dist/hawksight.d.ts.map +1 -0
- package/dist/hawksight.js +328 -0
- package/dist/hsToMeteora.d.ts +31 -0
- package/dist/hsToMeteora.d.ts.map +1 -0
- package/dist/hsToMeteora.js +3175 -0
- package/dist/idl/iyf-extension-idl.d.ts +14583 -0
- package/dist/idl/iyf-extension-idl.d.ts.map +1 -0
- package/dist/idl/iyf-extension-idl.js +14578 -0
- package/dist/idl/iyf-extension-wrapper.d.ts +112 -0
- package/dist/idl/iyf-extension-wrapper.d.ts.map +1 -0
- package/dist/idl/iyf-extension-wrapper.js +2 -0
- package/dist/idl/iyf-main-idl.d.ts +12078 -0
- package/dist/idl/iyf-main-idl.d.ts.map +1 -0
- package/dist/idl/iyf-main-idl.js +12073 -0
- package/dist/idl/iyf-main-wrapper.d.ts +112 -0
- package/dist/idl/iyf-main-wrapper.d.ts.map +1 -0
- package/dist/idl/iyf-main-wrapper.js +2 -0
- package/dist/idl/jupiter-idl.d.ts +3063 -0
- package/dist/idl/jupiter-idl.d.ts.map +1 -0
- package/dist/idl/jupiter-idl.js +3061 -0
- package/dist/idl/meteora-idl.d.ts +7371 -0
- package/dist/idl/meteora-idl.d.ts.map +1 -0
- package/dist/idl/meteora-idl.js +7372 -0
- package/dist/idl/orca-idl.d.ts +3833 -0
- package/dist/idl/orca-idl.d.ts.map +1 -0
- package/dist/idl/orca-idl.js +3834 -0
- package/dist/idl/raydium-idl.d.ts +3054 -0
- package/dist/idl/raydium-idl.d.ts.map +1 -0
- package/dist/idl/raydium-idl.js +3055 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts +126 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/IyfExtensionIxGenerator.js +467 -0
- package/dist/ixGenerator/IyfMainIxGenerator.d.ts +330 -0
- package/dist/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/IyfMainIxGenerator.js +1239 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts +685 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/MeteoraDlmmIxGenerator.js +3008 -0
- package/dist/ixGenerator/OrcaIxGenerator.d.ts +119 -0
- package/dist/ixGenerator/OrcaIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/OrcaIxGenerator.js +438 -0
- package/dist/ixGenerator/RaydiumIxGenerator.d.ts +99 -0
- package/dist/ixGenerator/RaydiumIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/RaydiumIxGenerator.js +558 -0
- package/dist/ixGenerator/UtilIxGenerator.d.ts +20 -0
- package/dist/ixGenerator/UtilIxGenerator.d.ts.map +1 -0
- package/dist/ixGenerator/UtilIxGenerator.js +25 -0
- package/dist/meteora/index.d.ts +2 -0
- package/dist/meteora/index.d.ts.map +1 -0
- package/dist/meteora/index.js +17 -0
- package/dist/meteora/liquidityStrategy.d.ts +408 -0
- package/dist/meteora/liquidityStrategy.d.ts.map +1 -0
- package/dist/meteora/liquidityStrategy.js +1325 -0
- package/dist/meteora.d.ts +669 -0
- package/dist/meteora.d.ts.map +1 -0
- package/dist/meteora.js +1932 -0
- package/dist/orca.d.ts +57 -0
- package/dist/orca.d.ts.map +1 -0
- package/dist/orca.js +123 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.d.ts +29 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/HawksightPdaGenerator.js +75 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts +76 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/MeteoraPdaGenerator.js +166 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.d.ts +23 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/OrcaPdaGenerator.js +68 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts +49 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/RaydiumPdaGenerator.js +114 -0
- package/dist/pdaGenerator/UtilPdaGenerator.d.ts +8 -0
- package/dist/pdaGenerator/UtilPdaGenerator.d.ts.map +1 -0
- package/dist/pdaGenerator/UtilPdaGenerator.js +51 -0
- package/dist/types.d.ts +1104 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +95 -0
- package/package.json +6 -5
|
@@ -0,0 +1,685 @@
|
|
|
1
|
+
import * as web3 from '@solana/web3.js';
|
|
2
|
+
import { TokenType, StrategyType as OldStrategyType, MeteoraPositionSide, RemainingAccountsInfo, BinRange, ShrinkMode } from '../types';
|
|
3
|
+
import BN from 'bn.js';
|
|
4
|
+
import { SimpleIxGenerator } from '../classes/SimpleIxGenerator';
|
|
5
|
+
import { SimplePdaGenerator } from '../classes/SimplePdaGenerator';
|
|
6
|
+
type LimitOrderCloseV2Params = {
|
|
7
|
+
connection: web3.Connection;
|
|
8
|
+
userWallet: web3.PublicKey;
|
|
9
|
+
position: web3.PublicKey;
|
|
10
|
+
lbPair: web3.PublicKey;
|
|
11
|
+
tokenXMint: web3.PublicKey;
|
|
12
|
+
tokenYMint: web3.PublicKey;
|
|
13
|
+
reserveX: web3.PublicKey;
|
|
14
|
+
reserveY: web3.PublicKey;
|
|
15
|
+
tokenXProgram: web3.PublicKey;
|
|
16
|
+
tokenYProgram: web3.PublicKey;
|
|
17
|
+
useFuelAccount?: boolean;
|
|
18
|
+
param: Buffer;
|
|
19
|
+
minBinId: number;
|
|
20
|
+
maxBinId: number;
|
|
21
|
+
binArrays: web3.PublicKey[];
|
|
22
|
+
};
|
|
23
|
+
type MeteoraDlmmLimitCloseAutomationV2Params = {
|
|
24
|
+
connection: web3.Connection;
|
|
25
|
+
userWallet: web3.PublicKey;
|
|
26
|
+
position: web3.PublicKey;
|
|
27
|
+
lbPair: web3.PublicKey;
|
|
28
|
+
tokenXMint: web3.PublicKey;
|
|
29
|
+
tokenYMint: web3.PublicKey;
|
|
30
|
+
reserveX: web3.PublicKey;
|
|
31
|
+
reserveY: web3.PublicKey;
|
|
32
|
+
tokenXProgram: web3.PublicKey;
|
|
33
|
+
tokenYProgram: web3.PublicKey;
|
|
34
|
+
pdaTokenType?: TokenType;
|
|
35
|
+
useFuelAccount?: boolean;
|
|
36
|
+
param: Buffer;
|
|
37
|
+
minBinId: number;
|
|
38
|
+
maxBinId: number;
|
|
39
|
+
isHawkRefund: boolean;
|
|
40
|
+
binArrays: web3.PublicKey[];
|
|
41
|
+
};
|
|
42
|
+
type SyncWithMarketPriceParams = {
|
|
43
|
+
connection: web3.Connection;
|
|
44
|
+
lbPair: web3.PublicKey;
|
|
45
|
+
marketPrice: number;
|
|
46
|
+
owner: web3.PublicKey;
|
|
47
|
+
skipCanSyncCheck?: boolean;
|
|
48
|
+
};
|
|
49
|
+
type SyncWithMarketPriceResult = {
|
|
50
|
+
canSync: boolean;
|
|
51
|
+
instruction: web3.TransactionInstruction | null;
|
|
52
|
+
};
|
|
53
|
+
export declare enum StrategyType {
|
|
54
|
+
Spot = 0,
|
|
55
|
+
Curve = 1,
|
|
56
|
+
BidAsk = 2
|
|
57
|
+
}
|
|
58
|
+
export declare function mapOldStrategyTypeToNew(oldStrategyType: OldStrategyType): StrategyType;
|
|
59
|
+
type InitializePosition = {
|
|
60
|
+
connection: web3.Connection;
|
|
61
|
+
userWallet: web3.PublicKey;
|
|
62
|
+
lbPair: web3.PublicKey;
|
|
63
|
+
position: web3.PublicKey;
|
|
64
|
+
lowerBinId: number;
|
|
65
|
+
width: number;
|
|
66
|
+
};
|
|
67
|
+
type InitializePositionAutomation = {
|
|
68
|
+
userWallet: web3.PublicKey;
|
|
69
|
+
lbPair: web3.PublicKey;
|
|
70
|
+
position: web3.PublicKey;
|
|
71
|
+
lowerBinId: number;
|
|
72
|
+
upperBinId: number;
|
|
73
|
+
};
|
|
74
|
+
type InitializePositionRelativeAutomation = {
|
|
75
|
+
userWallet: web3.PublicKey;
|
|
76
|
+
lbPair: web3.PublicKey;
|
|
77
|
+
position: web3.PublicKey;
|
|
78
|
+
relativeLowerBinId: number;
|
|
79
|
+
width: number;
|
|
80
|
+
useFuelAccount?: boolean;
|
|
81
|
+
};
|
|
82
|
+
type OpenPositionAndDepositAutomation = {
|
|
83
|
+
userWallet: web3.PublicKey;
|
|
84
|
+
lbPair: web3.PublicKey;
|
|
85
|
+
position: web3.PublicKey;
|
|
86
|
+
relativeLowerBinId: number;
|
|
87
|
+
relativeUpperBinId: number;
|
|
88
|
+
strategyType: OldStrategyType;
|
|
89
|
+
checkRange: {
|
|
90
|
+
minBinId: number;
|
|
91
|
+
maxBinId: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
type RedepositAutomation2 = {
|
|
95
|
+
userWallet: web3.PublicKey;
|
|
96
|
+
lbPair: web3.PublicKey;
|
|
97
|
+
position: web3.PublicKey;
|
|
98
|
+
relativeLowerBinId: number;
|
|
99
|
+
relativeUpperBinId: number;
|
|
100
|
+
strategyType: OldStrategyType;
|
|
101
|
+
checkRange: {
|
|
102
|
+
minBinId: number;
|
|
103
|
+
maxBinId: number;
|
|
104
|
+
};
|
|
105
|
+
targetActiveBin: number | undefined;
|
|
106
|
+
};
|
|
107
|
+
type RelativeOpenAutomation = {
|
|
108
|
+
userWallet: web3.PublicKey;
|
|
109
|
+
lbPair: web3.PublicKey;
|
|
110
|
+
position: web3.PublicKey;
|
|
111
|
+
relativeLowerBinId: number;
|
|
112
|
+
relativeUpperBinId: number;
|
|
113
|
+
strategyType: OldStrategyType;
|
|
114
|
+
checkRange: {
|
|
115
|
+
minBinId: number;
|
|
116
|
+
maxBinId: number;
|
|
117
|
+
};
|
|
118
|
+
targetActiveBin: number | undefined;
|
|
119
|
+
userTokenXAmount?: BN;
|
|
120
|
+
userTokenYAmount?: BN;
|
|
121
|
+
useFuelAccount?: boolean;
|
|
122
|
+
pdaTokenType?: TokenType;
|
|
123
|
+
};
|
|
124
|
+
type DepositAutomation = {
|
|
125
|
+
userWallet: web3.PublicKey;
|
|
126
|
+
lbPair: web3.PublicKey;
|
|
127
|
+
position: web3.PublicKey;
|
|
128
|
+
tokenXMint: web3.PublicKey;
|
|
129
|
+
tokenYMint: web3.PublicKey;
|
|
130
|
+
binArrayBitmapExtension: web3.PublicKey;
|
|
131
|
+
binArrayLower: web3.PublicKey;
|
|
132
|
+
binArrayUpper: web3.PublicKey;
|
|
133
|
+
tokenXProgram: web3.PublicKey;
|
|
134
|
+
tokenYProgram: web3.PublicKey;
|
|
135
|
+
reserveX: web3.PublicKey;
|
|
136
|
+
reserveY: web3.PublicKey;
|
|
137
|
+
activeId: number;
|
|
138
|
+
maxActiveBinSlippage: number;
|
|
139
|
+
strategyParametersMinBinId: number;
|
|
140
|
+
strategyParametersMaxBinId: number;
|
|
141
|
+
strategyParametersStrategyType: number;
|
|
142
|
+
strategyParametersParameters: number[];
|
|
143
|
+
tokenType?: TokenType;
|
|
144
|
+
};
|
|
145
|
+
type DepositWithAmountAutomation = {
|
|
146
|
+
userWallet: web3.PublicKey;
|
|
147
|
+
lbPair: web3.PublicKey;
|
|
148
|
+
position: web3.PublicKey;
|
|
149
|
+
tokenXMint: web3.PublicKey;
|
|
150
|
+
tokenYMint: web3.PublicKey;
|
|
151
|
+
reserveX: web3.PublicKey;
|
|
152
|
+
reserveY: web3.PublicKey;
|
|
153
|
+
binArrayBitmapExtension: web3.PublicKey;
|
|
154
|
+
binArrayLower: web3.PublicKey;
|
|
155
|
+
binArrayUpper: web3.PublicKey;
|
|
156
|
+
tokenXProgram: web3.PublicKey;
|
|
157
|
+
tokenYProgram: web3.PublicKey;
|
|
158
|
+
activeId: number;
|
|
159
|
+
maxActiveBinSlippage: number;
|
|
160
|
+
strategyParametersMinBinId: number;
|
|
161
|
+
strategyParametersMaxBinId: number;
|
|
162
|
+
strategyParametersStrategyType: number;
|
|
163
|
+
strategyParametersParameters: number[];
|
|
164
|
+
userTokenXAmount: BN | null;
|
|
165
|
+
userTokenYAmount: BN | null;
|
|
166
|
+
tokenType?: TokenType;
|
|
167
|
+
};
|
|
168
|
+
type InitializeLbPair2Raw = {
|
|
169
|
+
connection: web3.Connection;
|
|
170
|
+
funder: web3.PublicKey;
|
|
171
|
+
tokenMintX: web3.PublicKey;
|
|
172
|
+
tokenMintY: web3.PublicKey;
|
|
173
|
+
tokenProgramX: web3.PublicKey;
|
|
174
|
+
tokenProgramY: web3.PublicKey;
|
|
175
|
+
presetParameter: web3.PublicKey;
|
|
176
|
+
activeId: number;
|
|
177
|
+
};
|
|
178
|
+
type MeteoraDlmmCreatePoolAndPositionParams = {
|
|
179
|
+
connection: web3.Connection;
|
|
180
|
+
userWallet: web3.PublicKey;
|
|
181
|
+
position: web3.PublicKey;
|
|
182
|
+
presetParameter: web3.PublicKey;
|
|
183
|
+
tokenMintX: web3.PublicKey;
|
|
184
|
+
tokenMintY: web3.PublicKey;
|
|
185
|
+
tokenProgramX: web3.PublicKey;
|
|
186
|
+
tokenProgramY: web3.PublicKey;
|
|
187
|
+
activeId: number;
|
|
188
|
+
lowerBinId: number;
|
|
189
|
+
upperBinId: number;
|
|
190
|
+
strategyType: number;
|
|
191
|
+
binStep: BN;
|
|
192
|
+
baseFactor: BN;
|
|
193
|
+
baseFeePowerFactor: BN;
|
|
194
|
+
};
|
|
195
|
+
type MeteoraDlmmInitializeBinArrayParams = {
|
|
196
|
+
connection: web3.Connection;
|
|
197
|
+
userWallet: web3.PublicKey;
|
|
198
|
+
lbPair: web3.PublicKey;
|
|
199
|
+
lowerBinId: number;
|
|
200
|
+
upperBinId: number;
|
|
201
|
+
};
|
|
202
|
+
type MeteoraDlmmClaimFee2Params = {
|
|
203
|
+
userWallet: web3.PublicKey;
|
|
204
|
+
lbPair: web3.PublicKey;
|
|
205
|
+
position: web3.PublicKey;
|
|
206
|
+
tokenMintX: web3.PublicKey;
|
|
207
|
+
tokenMintY: web3.PublicKey;
|
|
208
|
+
tokenProgramX: web3.PublicKey;
|
|
209
|
+
tokenProgramY: web3.PublicKey;
|
|
210
|
+
lowerBinId: number;
|
|
211
|
+
upperBinId: number;
|
|
212
|
+
};
|
|
213
|
+
type MeteoraDlmmClaimReward2Params = {
|
|
214
|
+
userWallet: web3.PublicKey;
|
|
215
|
+
lbPair: web3.PublicKey;
|
|
216
|
+
position: web3.PublicKey;
|
|
217
|
+
rewardIndex: number;
|
|
218
|
+
rewardMint: web3.PublicKey;
|
|
219
|
+
rewardVault: web3.PublicKey;
|
|
220
|
+
tokenProgram: web3.PublicKey;
|
|
221
|
+
lowerBinId: number;
|
|
222
|
+
upperBinId: number;
|
|
223
|
+
};
|
|
224
|
+
type IncreasePositionLengthParams = {
|
|
225
|
+
connection: web3.Connection;
|
|
226
|
+
userWallet: web3.PublicKey;
|
|
227
|
+
lbPair: web3.PublicKey;
|
|
228
|
+
position: web3.PublicKey;
|
|
229
|
+
lengthToAdd: number;
|
|
230
|
+
side: MeteoraPositionSide;
|
|
231
|
+
};
|
|
232
|
+
type IncreasePositionLengthAutomationParams = IncreasePositionLengthParams & {
|
|
233
|
+
useFuelAccount?: boolean;
|
|
234
|
+
};
|
|
235
|
+
type RebalanceLiquidityIxParams = {
|
|
236
|
+
connection: web3.Connection;
|
|
237
|
+
userWallet: web3.PublicKey;
|
|
238
|
+
position: web3.PublicKey;
|
|
239
|
+
lbPair: web3.PublicKey;
|
|
240
|
+
tokenXMint: web3.PublicKey;
|
|
241
|
+
tokenYMint: web3.PublicKey;
|
|
242
|
+
tokenXProgram: web3.PublicKey;
|
|
243
|
+
tokenYProgram: web3.PublicKey;
|
|
244
|
+
activeId: number;
|
|
245
|
+
pdaTokenType?: TokenType;
|
|
246
|
+
maxActiveBinSlippage: number;
|
|
247
|
+
shouldClaimFee: boolean;
|
|
248
|
+
shouldClaimReward: boolean;
|
|
249
|
+
minWithdrawXAmount: BN;
|
|
250
|
+
maxDepositXAmount: BN;
|
|
251
|
+
minWithdrawYAmount: BN;
|
|
252
|
+
maxDepositYAmount: BN;
|
|
253
|
+
removeLiquidityParams: {
|
|
254
|
+
minBinId?: number;
|
|
255
|
+
maxBinId?: number;
|
|
256
|
+
bps: number;
|
|
257
|
+
}[];
|
|
258
|
+
addLiquidityParams: {
|
|
259
|
+
minDeltaId: number;
|
|
260
|
+
maxDeltaId: number;
|
|
261
|
+
x0: BN;
|
|
262
|
+
y0: BN;
|
|
263
|
+
deltaX: BN;
|
|
264
|
+
deltaY: BN;
|
|
265
|
+
bitFlag: number;
|
|
266
|
+
favorXInActiveId: boolean;
|
|
267
|
+
}[];
|
|
268
|
+
shrinkMode?: ShrinkMode;
|
|
269
|
+
rewardInfos?: {
|
|
270
|
+
rewardIndex: number;
|
|
271
|
+
rewardVault: web3.PublicKey;
|
|
272
|
+
rewardMint: web3.PublicKey;
|
|
273
|
+
rewardTokenProgram: web3.PublicKey;
|
|
274
|
+
}[];
|
|
275
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
276
|
+
};
|
|
277
|
+
type RemoveLiquidityByRange2Params = {
|
|
278
|
+
connection: web3.Connection;
|
|
279
|
+
userWallet: web3.PublicKey;
|
|
280
|
+
lbPair: web3.PublicKey;
|
|
281
|
+
position: web3.PublicKey;
|
|
282
|
+
tokenXMint: web3.PublicKey;
|
|
283
|
+
tokenYMint: web3.PublicKey;
|
|
284
|
+
tokenXProgram: web3.PublicKey;
|
|
285
|
+
tokenYProgram: web3.PublicKey;
|
|
286
|
+
fromBinId: number;
|
|
287
|
+
toBinId: number;
|
|
288
|
+
bpsToRemove: number;
|
|
289
|
+
pdaTokenType?: TokenType;
|
|
290
|
+
/**
|
|
291
|
+
* Optional transfer hook accounts info for Token2022 tokens with transfer hooks.
|
|
292
|
+
* If not provided, defaults to empty slices (no transfer hooks).
|
|
293
|
+
*/
|
|
294
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
295
|
+
};
|
|
296
|
+
type ClosePosition2Params = {
|
|
297
|
+
connection: web3.Connection;
|
|
298
|
+
userWallet: web3.PublicKey;
|
|
299
|
+
position: web3.PublicKey;
|
|
300
|
+
};
|
|
301
|
+
type ClosePositionIfEmptyParams = {
|
|
302
|
+
connection: web3.Connection;
|
|
303
|
+
userWallet: web3.PublicKey;
|
|
304
|
+
position: web3.PublicKey;
|
|
305
|
+
};
|
|
306
|
+
type RemoveLiquidityByRange2AutomationParams = {
|
|
307
|
+
connection: web3.Connection;
|
|
308
|
+
userWallet: web3.PublicKey;
|
|
309
|
+
lbPair: web3.PublicKey;
|
|
310
|
+
position: web3.PublicKey;
|
|
311
|
+
tokenXMint: web3.PublicKey;
|
|
312
|
+
tokenYMint: web3.PublicKey;
|
|
313
|
+
tokenXProgram: web3.PublicKey;
|
|
314
|
+
tokenYProgram: web3.PublicKey;
|
|
315
|
+
fromBinId: number;
|
|
316
|
+
toBinId: number;
|
|
317
|
+
bpsToRemove: number;
|
|
318
|
+
pdaTokenType?: TokenType;
|
|
319
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
320
|
+
useFuelAccount?: boolean;
|
|
321
|
+
};
|
|
322
|
+
type ClaimFee2AutomationParams = {
|
|
323
|
+
userWallet: web3.PublicKey;
|
|
324
|
+
lbPair: web3.PublicKey;
|
|
325
|
+
position: web3.PublicKey;
|
|
326
|
+
tokenMintX: web3.PublicKey;
|
|
327
|
+
tokenMintY: web3.PublicKey;
|
|
328
|
+
tokenProgramX: web3.PublicKey;
|
|
329
|
+
tokenProgramY: web3.PublicKey;
|
|
330
|
+
lowerBinId: number;
|
|
331
|
+
upperBinId: number;
|
|
332
|
+
pdaTokenType?: TokenType;
|
|
333
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
334
|
+
};
|
|
335
|
+
type ClaimReward2AutomationParams = {
|
|
336
|
+
userWallet: web3.PublicKey;
|
|
337
|
+
lbPair: web3.PublicKey;
|
|
338
|
+
position: web3.PublicKey;
|
|
339
|
+
rewardIndex: number;
|
|
340
|
+
rewardMint: web3.PublicKey;
|
|
341
|
+
rewardVault: web3.PublicKey;
|
|
342
|
+
tokenProgram: web3.PublicKey;
|
|
343
|
+
lowerBinId: number;
|
|
344
|
+
upperBinId: number;
|
|
345
|
+
pdaTokenType?: TokenType;
|
|
346
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
347
|
+
};
|
|
348
|
+
type ClosePosition2AutomationParams = {
|
|
349
|
+
connection: web3.Connection;
|
|
350
|
+
userWallet: web3.PublicKey;
|
|
351
|
+
position: web3.PublicKey;
|
|
352
|
+
lbPair: web3.PublicKey;
|
|
353
|
+
useFuelAccount?: boolean;
|
|
354
|
+
};
|
|
355
|
+
type BaseClosePosition2AutomationParams = ClosePosition2AutomationParams & {
|
|
356
|
+
isHawkRefund?: boolean;
|
|
357
|
+
};
|
|
358
|
+
type BaseClosePosition2AutomationIxParams = {
|
|
359
|
+
userPda: web3.PublicKey;
|
|
360
|
+
hawksightAuthority: web3.PublicKey;
|
|
361
|
+
authority: web3.PublicKey;
|
|
362
|
+
position: web3.PublicKey;
|
|
363
|
+
lbPair: web3.PublicKey;
|
|
364
|
+
fuelAccount: web3.PublicKey;
|
|
365
|
+
isHawkRefund: boolean;
|
|
366
|
+
};
|
|
367
|
+
export declare function buildBaseClosePosition2AutomationIx({ userPda, hawksightAuthority, authority, position, lbPair, fuelAccount, isHawkRefund, }: BaseClosePosition2AutomationIxParams): web3.TransactionInstruction;
|
|
368
|
+
/**
|
|
369
|
+
* Parameters for the addLiquidityByStrategy2Automation instruction.
|
|
370
|
+
* This is the automation version of Meteora's addLiquidityByStrategy (deposit_2_automation).
|
|
371
|
+
*/
|
|
372
|
+
type AddLiquidityByStrategy2AutomationParams = {
|
|
373
|
+
userWallet: web3.PublicKey;
|
|
374
|
+
lbPair: web3.PublicKey;
|
|
375
|
+
position: web3.PublicKey;
|
|
376
|
+
tokenXMint: web3.PublicKey;
|
|
377
|
+
tokenYMint: web3.PublicKey;
|
|
378
|
+
tokenXProgram: web3.PublicKey;
|
|
379
|
+
tokenYProgram: web3.PublicKey;
|
|
380
|
+
reserveX?: web3.PublicKey;
|
|
381
|
+
reserveY?: web3.PublicKey;
|
|
382
|
+
binArrayBitmapExtension?: web3.PublicKey;
|
|
383
|
+
activeId: number;
|
|
384
|
+
maxActiveBinSlippage: number;
|
|
385
|
+
/** Strategy min bin ID (relative to active bin, can be negative) */
|
|
386
|
+
strategyParametersMinBinId: number;
|
|
387
|
+
/** Strategy max bin ID (relative to active bin, can be negative) */
|
|
388
|
+
strategyParametersMaxBinId: number;
|
|
389
|
+
/** Strategy type: 0 = Spot, 1 = Curve, 2 = BidAsk */
|
|
390
|
+
strategyParametersStrategyType: number;
|
|
391
|
+
/** Strategy parameters array [x0, y0, deltaX, deltaY] as u64 LE bytes with bitFlag */
|
|
392
|
+
strategyParametersParameters: number[];
|
|
393
|
+
/** Optional: specific amount of X tokens to deposit (null = use all available) */
|
|
394
|
+
userTokenXAmount?: BN | null;
|
|
395
|
+
/** Optional: specific amount of Y tokens to deposit (null = use all available) */
|
|
396
|
+
userTokenYAmount?: BN | null;
|
|
397
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
398
|
+
pdaTokenType?: TokenType;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* Parameters for the addLiquidityByStrategy2Automation instruction.
|
|
402
|
+
* This is the automation version of Meteora's addLiquidityByStrategy (deposit_2_automation).
|
|
403
|
+
*/
|
|
404
|
+
type AddLiquidity2AutomationParams = {
|
|
405
|
+
connection: web3.Connection;
|
|
406
|
+
userWallet: web3.PublicKey;
|
|
407
|
+
lbPair: web3.PublicKey;
|
|
408
|
+
position: web3.PublicKey;
|
|
409
|
+
tokenXMint: web3.PublicKey;
|
|
410
|
+
tokenYMint: web3.PublicKey;
|
|
411
|
+
tokenXProgram: web3.PublicKey;
|
|
412
|
+
tokenYProgram: web3.PublicKey;
|
|
413
|
+
layers: {
|
|
414
|
+
strategyTypeX: number;
|
|
415
|
+
strategyTypeY: number;
|
|
416
|
+
percentageX: number;
|
|
417
|
+
percentageY: number;
|
|
418
|
+
}[];
|
|
419
|
+
checkRange?: {
|
|
420
|
+
lowerRange: number;
|
|
421
|
+
upperRange: number;
|
|
422
|
+
};
|
|
423
|
+
userTokenXAmount?: BN;
|
|
424
|
+
userTokenYAmount?: BN;
|
|
425
|
+
chunkLowerOffset?: number;
|
|
426
|
+
chunkUpperOffset?: number;
|
|
427
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
428
|
+
pdaTokenType?: TokenType;
|
|
429
|
+
lowerBinId: number;
|
|
430
|
+
upperBinId: number;
|
|
431
|
+
};
|
|
432
|
+
type MeteoraDlmmDepositRelativeAutomationParams = {
|
|
433
|
+
connection: web3.Connection;
|
|
434
|
+
userWallet: web3.PublicKey;
|
|
435
|
+
lbPair: web3.PublicKey;
|
|
436
|
+
position: web3.PublicKey;
|
|
437
|
+
tokenXMint: web3.PublicKey;
|
|
438
|
+
tokenYMint: web3.PublicKey;
|
|
439
|
+
tokenXProgram: web3.PublicKey;
|
|
440
|
+
tokenYProgram: web3.PublicKey;
|
|
441
|
+
activeId: number;
|
|
442
|
+
relativeBinRange: BinRange;
|
|
443
|
+
strategyType: number;
|
|
444
|
+
optionalTokenXAmount?: BN;
|
|
445
|
+
optionalTokenYAmount?: BN;
|
|
446
|
+
checkRange?: BinRange;
|
|
447
|
+
remainingAccountsInfo?: RemainingAccountsInfo;
|
|
448
|
+
pdaTokenType?: TokenType;
|
|
449
|
+
positionIsSigner?: boolean;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Meteora related instructions executed via iyf extension or iyf main
|
|
453
|
+
*/
|
|
454
|
+
export declare class MeteoraDlmmIxGenerator {
|
|
455
|
+
private readonly ix;
|
|
456
|
+
private readonly pda;
|
|
457
|
+
constructor(ix: SimpleIxGenerator, pda: SimplePdaGenerator);
|
|
458
|
+
/**
|
|
459
|
+
* Initialize a Meteora DLMM position via IYF Main's meteora dynamic CPI.
|
|
460
|
+
*
|
|
461
|
+
* This is the raw Meteora initializePosition instruction invoked through IYF Main.
|
|
462
|
+
*
|
|
463
|
+
* @param connection - Solana connection
|
|
464
|
+
* @param params - Initialize position parameters (Meteora-aligned: lowerBinId, width)
|
|
465
|
+
* @returns TransactionInstruction for initializing the position
|
|
466
|
+
*/
|
|
467
|
+
initializePosition({ connection, userWallet, lbPair, position, lowerBinId, width, }: InitializePosition): Promise<web3.TransactionInstruction>;
|
|
468
|
+
initializePositionAutomation(connection: web3.Connection, { userWallet, lbPair, position, lowerBinId, upperBinId, }: InitializePositionAutomation): Promise<web3.TransactionInstruction>;
|
|
469
|
+
initializePositionRelativeAutomation(connection: web3.Connection, { userWallet, lbPair, position, relativeLowerBinId, width, useFuelAccount, }: InitializePositionRelativeAutomation): Promise<web3.TransactionInstruction>;
|
|
470
|
+
/**
|
|
471
|
+
* Add liquidity to an existing Meteora DLMM position using strategy parameters.
|
|
472
|
+
* This is the automation version that uses V2 execution (meteora_dlmm_deposit_2_automation).
|
|
473
|
+
*
|
|
474
|
+
* Key differences from depositAutomation:
|
|
475
|
+
* - Uses iyfExtensionExecuteV2 with Anchor-based instruction building
|
|
476
|
+
* - Supports remainingAccountsInfo for Token2022 transfer hooks
|
|
477
|
+
* - Authority is HS_AUTHORITY (automation wallet)
|
|
478
|
+
* - Does not require binArrayLower/binArrayUpper (bin arrays are auto-derived or created separately)
|
|
479
|
+
*
|
|
480
|
+
* @param connection - Solana connection
|
|
481
|
+
* @param params - AddLiquidityByStrategy2AutomationParams parameters
|
|
482
|
+
* @returns TransactionInstruction for adding liquidity
|
|
483
|
+
*/
|
|
484
|
+
meteoraDlmmDepositRelativeAutomation({ connection, userWallet, lbPair, position, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, activeId, relativeBinRange, strategyType, optionalTokenXAmount, optionalTokenYAmount, checkRange, remainingAccountsInfo, pdaTokenType, positionIsSigner, }: MeteoraDlmmDepositRelativeAutomationParams): Promise<web3.TransactionInstruction>;
|
|
485
|
+
redepositAutomation(connection: web3.Connection, { userWallet, lbPair, position, relativeLowerBinId, relativeUpperBinId, strategyType, checkRange, }: OpenPositionAndDepositAutomation): Promise<web3.TransactionInstruction>;
|
|
486
|
+
redepositAutomation2(connection: web3.Connection, { userWallet, lbPair, position, relativeLowerBinId, relativeUpperBinId, strategyType, checkRange, targetActiveBin, }: RedepositAutomation2): Promise<web3.TransactionInstruction>;
|
|
487
|
+
relativeOpenAutomation(connection: web3.Connection, { userWallet, lbPair, position, relativeLowerBinId, relativeUpperBinId, strategyType, checkRange, targetActiveBin, userTokenXAmount, userTokenYAmount, useFuelAccount, pdaTokenType, }: RelativeOpenAutomation): Promise<web3.TransactionInstruction>;
|
|
488
|
+
claimFee(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
489
|
+
claimFee2(connection: web3.Connection, { userWallet, lbPair, position, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, lowerBinId, upperBinId, }: MeteoraDlmmClaimFee2Params): Promise<web3.TransactionInstruction>;
|
|
490
|
+
claimReward(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
491
|
+
claimReward2(connection: web3.Connection, { userWallet, lbPair, position, rewardIndex, rewardMint, rewardVault, tokenProgram, lowerBinId, upperBinId, }: MeteoraDlmmClaimReward2Params): Promise<web3.TransactionInstruction>;
|
|
492
|
+
/**
|
|
493
|
+
* Claim fees from a Meteora DLMM position via IYF Extension for automation.
|
|
494
|
+
*
|
|
495
|
+
* This is the automation version that uses HS_AUTHORITY as the signer.
|
|
496
|
+
*
|
|
497
|
+
* @param connection - Solana connection
|
|
498
|
+
* @param params - ClaimFee2AutomationParams parameters
|
|
499
|
+
* @returns TransactionInstruction for the claim_fee2 automation operation
|
|
500
|
+
*/
|
|
501
|
+
claimFee2Automation(connection: web3.Connection, { userWallet, lbPair, position, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, lowerBinId, upperBinId, pdaTokenType, remainingAccountsInfo, }: ClaimFee2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
502
|
+
/**
|
|
503
|
+
* Claim rewards from a Meteora DLMM position via IYF Extension for automation.
|
|
504
|
+
*
|
|
505
|
+
* This is the automation version that uses HS_AUTHORITY as the signer.
|
|
506
|
+
*
|
|
507
|
+
* @param connection - Solana connection
|
|
508
|
+
* @param params - ClaimReward2AutomationParams parameters
|
|
509
|
+
* @returns TransactionInstruction for the claim_reward2 automation operation
|
|
510
|
+
*/
|
|
511
|
+
claimReward2Automation(connection: web3.Connection, { userWallet, lbPair, position, rewardIndex, rewardMint, rewardVault, tokenProgram, lowerBinId, upperBinId, pdaTokenType, remainingAccountsInfo, }: ClaimReward2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
512
|
+
depositAutomation(connection: web3.Connection, params: DepositAutomation): Promise<web3.TransactionInstruction>;
|
|
513
|
+
depositWithAmountAutomation(connection: web3.Connection, params: DepositWithAmountAutomation): Promise<web3.TransactionInstruction>;
|
|
514
|
+
/**
|
|
515
|
+
* Add liquidity to an existing Meteora DLMM position using strategy parameters.
|
|
516
|
+
* This is the automation version that uses V2 execution (meteora_dlmm_deposit_2_automation).
|
|
517
|
+
*
|
|
518
|
+
* Key differences from depositAutomation:
|
|
519
|
+
* - Uses iyfExtensionExecuteV2 with Anchor-based instruction building
|
|
520
|
+
* - Supports remainingAccountsInfo for Token2022 transfer hooks
|
|
521
|
+
* - Authority is HS_AUTHORITY (automation wallet)
|
|
522
|
+
* - Does not require binArrayLower/binArrayUpper (bin arrays are auto-derived or created separately)
|
|
523
|
+
*
|
|
524
|
+
* @param connection - Solana connection
|
|
525
|
+
* @param params - AddLiquidityByStrategy2AutomationParams parameters
|
|
526
|
+
* @returns TransactionInstruction for adding liquidity
|
|
527
|
+
*/
|
|
528
|
+
addLiquidityByStrategy2Automation(connection: web3.Connection, params: AddLiquidityByStrategy2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
529
|
+
oneSideDeposit(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
530
|
+
withdrawAutomation(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
531
|
+
closePositionAutomation(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
532
|
+
/**
|
|
533
|
+
* Close an empty Meteora DLMM position via IYF Extension for automation.
|
|
534
|
+
*
|
|
535
|
+
* This is the automation version that uses HS_AUTHORITY as the signer.
|
|
536
|
+
*
|
|
537
|
+
* @param params - ClosePositionIfEmptyAutomationParams parameters
|
|
538
|
+
* @returns TransactionInstruction for the close_position_if_empty automation operation
|
|
539
|
+
*/
|
|
540
|
+
closePosition2Automation({ connection, userWallet, position, lbPair, useFuelAccount, }: ClosePosition2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
541
|
+
baseClosePosition2Automation({ connection, userWallet, position, lbPair, useFuelAccount, isHawkRefund, }: BaseClosePosition2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
542
|
+
limitCloseAutomation(connection: web3.Connection, params: {}): Promise<web3.TransactionInstruction>;
|
|
543
|
+
/**
|
|
544
|
+
* Meteora IDL
|
|
545
|
+
*
|
|
546
|
+
* @param connection
|
|
547
|
+
* @returns
|
|
548
|
+
*/
|
|
549
|
+
private meteora;
|
|
550
|
+
/**
|
|
551
|
+
* Meteora IDL
|
|
552
|
+
*
|
|
553
|
+
* @param connection
|
|
554
|
+
* @returns
|
|
555
|
+
*/
|
|
556
|
+
private dlmm;
|
|
557
|
+
limitOrderCloseV2({ connection, userWallet, position, lbPair, tokenXMint, tokenYMint, reserveX, reserveY, tokenXProgram, tokenYProgram, useFuelAccount, param, minBinId, maxBinId, binArrays, }: LimitOrderCloseV2Params): Promise<web3.TransactionInstruction>;
|
|
558
|
+
meteoraDlmmLimitCloseAutomationV2({ connection, userWallet, position, lbPair, tokenXMint, tokenYMint, reserveX, reserveY, tokenXProgram, tokenYProgram, pdaTokenType, param, minBinId, maxBinId, isHawkRefund, useFuelAccount, binArrays, }: MeteoraDlmmLimitCloseAutomationV2Params): Promise<web3.TransactionInstruction>;
|
|
559
|
+
/**
|
|
560
|
+
* Generates raw meteora instruction that initializes a meteora pool
|
|
561
|
+
*
|
|
562
|
+
* @param param0
|
|
563
|
+
* @returns
|
|
564
|
+
*/
|
|
565
|
+
initializeLbPair2Raw({ connection, funder, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, presetParameter, activeId, }: InitializeLbPair2Raw): Promise<web3.TransactionInstruction>;
|
|
566
|
+
private isOverflowDefaultBinArrayBitmap;
|
|
567
|
+
private internalBitmapRange;
|
|
568
|
+
private binIdToBinArrayIndex;
|
|
569
|
+
meteoraDlmmCreatePoolAndPosition({ connection, userWallet, position, presetParameter, tokenMintX, tokenMintY, tokenProgramX, tokenProgramY, activeId, lowerBinId, upperBinId, strategyType, binStep, baseFactor, baseFeePowerFactor, }: MeteoraDlmmCreatePoolAndPositionParams): Promise<web3.TransactionInstruction>;
|
|
570
|
+
meteoraDlmmInitializeBinArray({ connection, userWallet, lbPair, lowerBinId, upperBinId, }: MeteoraDlmmInitializeBinArrayParams): Promise<web3.TransactionInstruction>;
|
|
571
|
+
/**
|
|
572
|
+
* Initialize bin arrays for Meteora DLMM pool, invoked through meteora dlmm program
|
|
573
|
+
* which means initialization is paid by the user.
|
|
574
|
+
*
|
|
575
|
+
* @param connection - Solana connection
|
|
576
|
+
* @param userWallet - User wallet public key
|
|
577
|
+
* @param lbPair - LB pair public key
|
|
578
|
+
* @param lowerBinId - Lower bin ID
|
|
579
|
+
* @param upperBinId - Upper bin ID
|
|
580
|
+
* @returns
|
|
581
|
+
*/
|
|
582
|
+
meteoraDlmmInitializeBinArrayDefault({ connection, userWallet, lbPair, lowerBinId, upperBinId, }: MeteoraDlmmInitializeBinArrayParams): Promise<web3.TransactionInstruction[]>;
|
|
583
|
+
syncWithMarketPrice({ connection, lbPair, marketPrice, owner, skipCanSyncCheck, }: SyncWithMarketPriceParams): Promise<SyncWithMarketPriceResult>;
|
|
584
|
+
/**
|
|
585
|
+
* Increase the length of a Meteora DLMM position via IYF Main's meteora dynamic CPI.
|
|
586
|
+
*
|
|
587
|
+
* This instruction can only extend for up to 10kb in size, thus this instruction needs to be called
|
|
588
|
+
* multiple times.
|
|
589
|
+
*
|
|
590
|
+
* This is the raw Meteora initializePosition instruction invoked through IYF Main.
|
|
591
|
+
*
|
|
592
|
+
* @param connection - Solana connection
|
|
593
|
+
* @param params - Increase position length parameters
|
|
594
|
+
* @returns TransactionInstruction for initializing the position
|
|
595
|
+
*/
|
|
596
|
+
increasePositionLength({ connection, userWallet, lbPair, position, lengthToAdd, side, }: IncreasePositionLengthParams): Promise<web3.TransactionInstruction>;
|
|
597
|
+
increasePositionLengthAutomation({ connection, userWallet, lbPair, position, lengthToAdd, side, useFuelAccount, }: IncreasePositionLengthAutomationParams): Promise<web3.TransactionInstruction>;
|
|
598
|
+
/**
|
|
599
|
+
* Create a Meteora DLMM rebalance_liquidity instruction via IYF Main's meteora dynamic CPI.
|
|
600
|
+
*
|
|
601
|
+
* The rebalance_liquidity instruction allows for complex liquidity management including:
|
|
602
|
+
* - Removing liquidity from specific bin ranges
|
|
603
|
+
* - Adding liquidity to new bin ranges
|
|
604
|
+
* - Claiming fees and rewards
|
|
605
|
+
* - All in a single atomic transaction
|
|
606
|
+
*
|
|
607
|
+
* @param params - RebalanceLiquidityIxParams containing all necessary accounts and parameters
|
|
608
|
+
* @returns TransactionInstruction for the rebalance_liquidity operation
|
|
609
|
+
*/
|
|
610
|
+
rebalanceLiquidity({ connection, userWallet, position, lbPair, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, activeId, pdaTokenType, maxActiveBinSlippage, shouldClaimFee, shouldClaimReward, minWithdrawXAmount, maxDepositXAmount, minWithdrawYAmount, maxDepositYAmount, removeLiquidityParams, addLiquidityParams, shrinkMode, }: RebalanceLiquidityIxParams): Promise<web3.TransactionInstruction>;
|
|
611
|
+
/**
|
|
612
|
+
* Serialize RebalanceLiquidityParams to match Rust struct layout
|
|
613
|
+
*/
|
|
614
|
+
private serializeRebalanceLiquidityParams;
|
|
615
|
+
/**
|
|
616
|
+
* Serialize RemainingAccountsInfo to match Rust struct layout
|
|
617
|
+
*
|
|
618
|
+
* The format is a Borsh Vec of AccountsTypeSlice:
|
|
619
|
+
* - [slices_count: u32] - number of slices
|
|
620
|
+
* - For each slice: [accountsType: u8 (or u8+u8 for TransferHookMultiReward)][length: u8]
|
|
621
|
+
*
|
|
622
|
+
* This is passed directly to Anchor methods which wrap it in another Vec<u8>.
|
|
623
|
+
*/
|
|
624
|
+
private serializeRemainingAccountsInfo;
|
|
625
|
+
/**
|
|
626
|
+
* Remove liquidity from a bin range in a Meteora DLMM position via IYF Main's meteora dynamic CPI.
|
|
627
|
+
*
|
|
628
|
+
* This instruction withdraws liquidity from the specified bin range.
|
|
629
|
+
* The bin arrays for the range are automatically derived and included as remaining accounts.
|
|
630
|
+
*
|
|
631
|
+
* @param params - RemoveLiquidityByRange2 parameters
|
|
632
|
+
* @returns TransactionInstruction for the remove_liquidity_by_range2 operation
|
|
633
|
+
*/
|
|
634
|
+
removeLiquidityByRange2({ connection, userWallet, lbPair, position, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, fromBinId, toBinId, bpsToRemove, pdaTokenType, remainingAccountsInfo: remainingAccountsInfoParam, }: RemoveLiquidityByRange2Params): Promise<web3.TransactionInstruction>;
|
|
635
|
+
/**
|
|
636
|
+
* Close an empty Meteora DLMM position via IYF Main's meteora dynamic CPI.
|
|
637
|
+
*
|
|
638
|
+
* This instruction closes a position and returns the rent to the user.
|
|
639
|
+
* The position must be empty (no liquidity) for this to succeed.
|
|
640
|
+
*
|
|
641
|
+
* @param params - ClosePosition2 parameters
|
|
642
|
+
* @returns TransactionInstruction for the close_position2 operation
|
|
643
|
+
*/
|
|
644
|
+
closePosition2({ connection, userWallet, position, }: ClosePosition2Params): Promise<web3.TransactionInstruction>;
|
|
645
|
+
/**
|
|
646
|
+
* Close a Meteora DLMM position only if it is empty via IYF Main's meteora dynamic CPI.
|
|
647
|
+
*
|
|
648
|
+
* This instruction is similar to closePosition2 but will fail silently if the position
|
|
649
|
+
* still has liquidity. This is useful for safely attempting to close a position without
|
|
650
|
+
* knowing its current state.
|
|
651
|
+
*
|
|
652
|
+
* @param params - ClosePositionIfEmpty parameters
|
|
653
|
+
* @returns TransactionInstruction for the close_position_if_empty operation
|
|
654
|
+
*/
|
|
655
|
+
closePositionIfEmpty({ connection, userWallet, position, }: ClosePositionIfEmptyParams): Promise<web3.TransactionInstruction>;
|
|
656
|
+
/**
|
|
657
|
+
* Rebalance liquidity in a Meteora DLMM position via IYF Extension for automation.
|
|
658
|
+
*
|
|
659
|
+
* This is the automation version that uses HS_AUTHORITY as the signer.
|
|
660
|
+
* Wraps via iyfExtensionExecuteV2 instead of meteoraDynamicCpi.
|
|
661
|
+
*
|
|
662
|
+
* @param params - RebalanceLiquidityIxParams containing all necessary accounts and parameters
|
|
663
|
+
* @returns TransactionInstruction for the rebalance_liquidity automation operation
|
|
664
|
+
*/
|
|
665
|
+
rebalanceLiquidityAutomation({ connection, userWallet, position, lbPair, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, activeId, pdaTokenType, maxActiveBinSlippage, shouldClaimFee, shouldClaimReward, minWithdrawXAmount, maxDepositXAmount, minWithdrawYAmount, maxDepositYAmount, removeLiquidityParams, addLiquidityParams, shrinkMode, rewardInfos, remainingAccountsInfo, }: RebalanceLiquidityIxParams): Promise<web3.TransactionInstruction>;
|
|
666
|
+
/**
|
|
667
|
+
* Remove liquidity from a bin range in a Meteora DLMM position via IYF Extension for automation.
|
|
668
|
+
*
|
|
669
|
+
* This is the automation version that uses HS_AUTHORITY as the signer.
|
|
670
|
+
* Supports larger bin ranges (not limited to 70-bin chunks).
|
|
671
|
+
*
|
|
672
|
+
* @param params - RemoveLiquidityByRange2AutomationParams parameters
|
|
673
|
+
* @returns TransactionInstruction for the remove_liquidity_by_range2 automation operation
|
|
674
|
+
*/
|
|
675
|
+
removeLiquidityByRange2Automation({ connection, userWallet, lbPair, position, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, fromBinId, toBinId, bpsToRemove, pdaTokenType, remainingAccountsInfo, }: RemoveLiquidityByRange2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
676
|
+
addLiquidity2Automation({ connection, userWallet, lbPair, position, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, layers, checkRange, userTokenXAmount, userTokenYAmount, chunkLowerOffset, chunkUpperOffset, remainingAccountsInfo, pdaTokenType, lowerBinId, upperBinId, }: AddLiquidity2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
677
|
+
/**
|
|
678
|
+
* FE-callable mirror of addLiquidity2Automation.
|
|
679
|
+
* Same hybrid-layer add-liquidity flow, but signed by the user's wallet
|
|
680
|
+
* instead of HS_AUTHORITY (sighash: meteora_dlmm_add_liquidity_2).
|
|
681
|
+
*/
|
|
682
|
+
addLiquidity2({ connection, userWallet, lbPair, position, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, layers, checkRange, userTokenXAmount, userTokenYAmount, chunkLowerOffset, chunkUpperOffset, remainingAccountsInfo, pdaTokenType, lowerBinId, upperBinId, }: AddLiquidity2AutomationParams): Promise<web3.TransactionInstruction>;
|
|
683
|
+
}
|
|
684
|
+
export {};
|
|
685
|
+
//# sourceMappingURL=MeteoraDlmmIxGenerator.d.ts.map
|