@jup-ag/lend 0.1.10 → 0.2.0-beta.2

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.
@@ -81,6 +81,97 @@ declare function loadRelevantTicksHasDebtArraysLiquidate(vaultId: number, topTic
81
81
  }[];
82
82
  }[]>;
83
83
  declare function loadRelevantBranchesForLiquidate(vaultId: number, vaultState: any, program: Program<Vaults>, market: "main" | "ethena"): Promise<any[]>;
84
+ declare function getOracleSources({ connection, signer, oracle, }: {
85
+ connection: Connection;
86
+ signer?: PublicKey;
87
+ oracle: PublicKey;
88
+ }): Promise<{
89
+ source: PublicKey;
90
+ invert: boolean;
91
+ multiplier: BN__default;
92
+ divisor: BN__default;
93
+ sourceType: ({
94
+ pyth?: undefined;
95
+ msolPool?: undefined;
96
+ redstone?: undefined;
97
+ chainlink?: undefined;
98
+ singlePool?: undefined;
99
+ jupLend?: undefined;
100
+ chainlinkDataStreams?: undefined;
101
+ } & {
102
+ stakePool: Record<string, never>;
103
+ }) | ({
104
+ stakePool?: undefined;
105
+ msolPool?: undefined;
106
+ redstone?: undefined;
107
+ chainlink?: undefined;
108
+ singlePool?: undefined;
109
+ jupLend?: undefined;
110
+ chainlinkDataStreams?: undefined;
111
+ } & {
112
+ pyth: Record<string, never>;
113
+ }) | ({
114
+ stakePool?: undefined;
115
+ pyth?: undefined;
116
+ redstone?: undefined;
117
+ chainlink?: undefined;
118
+ singlePool?: undefined;
119
+ jupLend?: undefined;
120
+ chainlinkDataStreams?: undefined;
121
+ } & {
122
+ msolPool: Record<string, never>;
123
+ }) | ({
124
+ stakePool?: undefined;
125
+ pyth?: undefined;
126
+ msolPool?: undefined;
127
+ chainlink?: undefined;
128
+ singlePool?: undefined;
129
+ jupLend?: undefined;
130
+ chainlinkDataStreams?: undefined;
131
+ } & {
132
+ redstone: Record<string, never>;
133
+ }) | ({
134
+ stakePool?: undefined;
135
+ pyth?: undefined;
136
+ msolPool?: undefined;
137
+ redstone?: undefined;
138
+ singlePool?: undefined;
139
+ jupLend?: undefined;
140
+ chainlinkDataStreams?: undefined;
141
+ } & {
142
+ chainlink: Record<string, never>;
143
+ }) | ({
144
+ stakePool?: undefined;
145
+ pyth?: undefined;
146
+ msolPool?: undefined;
147
+ redstone?: undefined;
148
+ chainlink?: undefined;
149
+ jupLend?: undefined;
150
+ chainlinkDataStreams?: undefined;
151
+ } & {
152
+ singlePool: Record<string, never>;
153
+ }) | ({
154
+ stakePool?: undefined;
155
+ pyth?: undefined;
156
+ msolPool?: undefined;
157
+ redstone?: undefined;
158
+ chainlink?: undefined;
159
+ singlePool?: undefined;
160
+ chainlinkDataStreams?: undefined;
161
+ } & {
162
+ jupLend: Record<string, never>;
163
+ }) | ({
164
+ stakePool?: undefined;
165
+ pyth?: undefined;
166
+ msolPool?: undefined;
167
+ redstone?: undefined;
168
+ chainlink?: undefined;
169
+ singlePool?: undefined;
170
+ jupLend?: undefined;
171
+ } & {
172
+ chainlinkDataStreams: Record<string, never>;
173
+ });
174
+ }[]>;
84
175
  declare function readOraclePrice({ connection, signer, oracle, }: {
85
176
  connection: Connection;
86
177
  signer?: PublicKey;
@@ -94,7 +185,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
94
185
  multiplier: BN__default;
95
186
  divisor: BN__default;
96
187
  sourceType: ({
97
- stakePool?: undefined;
188
+ pyth?: undefined;
98
189
  msolPool?: undefined;
99
190
  redstone?: undefined;
100
191
  chainlink?: undefined;
@@ -102,9 +193,9 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
102
193
  jupLend?: undefined;
103
194
  chainlinkDataStreams?: undefined;
104
195
  } & {
105
- pyth: Record<string, never>;
196
+ stakePool: Record<string, never>;
106
197
  }) | ({
107
- pyth?: undefined;
198
+ stakePool?: undefined;
108
199
  msolPool?: undefined;
109
200
  redstone?: undefined;
110
201
  chainlink?: undefined;
@@ -112,10 +203,10 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
112
203
  jupLend?: undefined;
113
204
  chainlinkDataStreams?: undefined;
114
205
  } & {
115
- stakePool: Record<string, never>;
206
+ pyth: Record<string, never>;
116
207
  }) | ({
117
- pyth?: undefined;
118
208
  stakePool?: undefined;
209
+ pyth?: undefined;
119
210
  redstone?: undefined;
120
211
  chainlink?: undefined;
121
212
  singlePool?: undefined;
@@ -124,8 +215,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
124
215
  } & {
125
216
  msolPool: Record<string, never>;
126
217
  }) | ({
127
- pyth?: undefined;
128
218
  stakePool?: undefined;
219
+ pyth?: undefined;
129
220
  msolPool?: undefined;
130
221
  chainlink?: undefined;
131
222
  singlePool?: undefined;
@@ -134,8 +225,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
134
225
  } & {
135
226
  redstone: Record<string, never>;
136
227
  }) | ({
137
- pyth?: undefined;
138
228
  stakePool?: undefined;
229
+ pyth?: undefined;
139
230
  msolPool?: undefined;
140
231
  redstone?: undefined;
141
232
  singlePool?: undefined;
@@ -144,8 +235,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
144
235
  } & {
145
236
  chainlink: Record<string, never>;
146
237
  }) | ({
147
- pyth?: undefined;
148
238
  stakePool?: undefined;
239
+ pyth?: undefined;
149
240
  msolPool?: undefined;
150
241
  redstone?: undefined;
151
242
  chainlink?: undefined;
@@ -154,8 +245,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
154
245
  } & {
155
246
  singlePool: Record<string, never>;
156
247
  }) | ({
157
- pyth?: undefined;
158
248
  stakePool?: undefined;
249
+ pyth?: undefined;
159
250
  msolPool?: undefined;
160
251
  redstone?: undefined;
161
252
  chainlink?: undefined;
@@ -164,8 +255,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
164
255
  } & {
165
256
  jupLend: Record<string, never>;
166
257
  }) | ({
167
- pyth?: undefined;
168
258
  stakePool?: undefined;
259
+ pyth?: undefined;
169
260
  msolPool?: undefined;
170
261
  redstone?: undefined;
171
262
  chainlink?: undefined;
@@ -224,4 +315,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
224
315
  }[];
225
316
  }[]>;
226
317
 
227
- export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getLiquidityProgramId, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
318
+ export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getLiquidityProgramId, getOracleSources, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
@@ -81,6 +81,97 @@ declare function loadRelevantTicksHasDebtArraysLiquidate(vaultId: number, topTic
81
81
  }[];
82
82
  }[]>;
83
83
  declare function loadRelevantBranchesForLiquidate(vaultId: number, vaultState: any, program: Program<Vaults>, market: "main" | "ethena"): Promise<any[]>;
84
+ declare function getOracleSources({ connection, signer, oracle, }: {
85
+ connection: Connection;
86
+ signer?: PublicKey;
87
+ oracle: PublicKey;
88
+ }): Promise<{
89
+ source: PublicKey;
90
+ invert: boolean;
91
+ multiplier: BN__default;
92
+ divisor: BN__default;
93
+ sourceType: ({
94
+ pyth?: undefined;
95
+ msolPool?: undefined;
96
+ redstone?: undefined;
97
+ chainlink?: undefined;
98
+ singlePool?: undefined;
99
+ jupLend?: undefined;
100
+ chainlinkDataStreams?: undefined;
101
+ } & {
102
+ stakePool: Record<string, never>;
103
+ }) | ({
104
+ stakePool?: undefined;
105
+ msolPool?: undefined;
106
+ redstone?: undefined;
107
+ chainlink?: undefined;
108
+ singlePool?: undefined;
109
+ jupLend?: undefined;
110
+ chainlinkDataStreams?: undefined;
111
+ } & {
112
+ pyth: Record<string, never>;
113
+ }) | ({
114
+ stakePool?: undefined;
115
+ pyth?: undefined;
116
+ redstone?: undefined;
117
+ chainlink?: undefined;
118
+ singlePool?: undefined;
119
+ jupLend?: undefined;
120
+ chainlinkDataStreams?: undefined;
121
+ } & {
122
+ msolPool: Record<string, never>;
123
+ }) | ({
124
+ stakePool?: undefined;
125
+ pyth?: undefined;
126
+ msolPool?: undefined;
127
+ chainlink?: undefined;
128
+ singlePool?: undefined;
129
+ jupLend?: undefined;
130
+ chainlinkDataStreams?: undefined;
131
+ } & {
132
+ redstone: Record<string, never>;
133
+ }) | ({
134
+ stakePool?: undefined;
135
+ pyth?: undefined;
136
+ msolPool?: undefined;
137
+ redstone?: undefined;
138
+ singlePool?: undefined;
139
+ jupLend?: undefined;
140
+ chainlinkDataStreams?: undefined;
141
+ } & {
142
+ chainlink: Record<string, never>;
143
+ }) | ({
144
+ stakePool?: undefined;
145
+ pyth?: undefined;
146
+ msolPool?: undefined;
147
+ redstone?: undefined;
148
+ chainlink?: undefined;
149
+ jupLend?: undefined;
150
+ chainlinkDataStreams?: undefined;
151
+ } & {
152
+ singlePool: Record<string, never>;
153
+ }) | ({
154
+ stakePool?: undefined;
155
+ pyth?: undefined;
156
+ msolPool?: undefined;
157
+ redstone?: undefined;
158
+ chainlink?: undefined;
159
+ singlePool?: undefined;
160
+ chainlinkDataStreams?: undefined;
161
+ } & {
162
+ jupLend: Record<string, never>;
163
+ }) | ({
164
+ stakePool?: undefined;
165
+ pyth?: undefined;
166
+ msolPool?: undefined;
167
+ redstone?: undefined;
168
+ chainlink?: undefined;
169
+ singlePool?: undefined;
170
+ jupLend?: undefined;
171
+ } & {
172
+ chainlinkDataStreams: Record<string, never>;
173
+ });
174
+ }[]>;
84
175
  declare function readOraclePrice({ connection, signer, oracle, }: {
85
176
  connection: Connection;
86
177
  signer?: PublicKey;
@@ -94,7 +185,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
94
185
  multiplier: BN__default;
95
186
  divisor: BN__default;
96
187
  sourceType: ({
97
- stakePool?: undefined;
188
+ pyth?: undefined;
98
189
  msolPool?: undefined;
99
190
  redstone?: undefined;
100
191
  chainlink?: undefined;
@@ -102,9 +193,9 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
102
193
  jupLend?: undefined;
103
194
  chainlinkDataStreams?: undefined;
104
195
  } & {
105
- pyth: Record<string, never>;
196
+ stakePool: Record<string, never>;
106
197
  }) | ({
107
- pyth?: undefined;
198
+ stakePool?: undefined;
108
199
  msolPool?: undefined;
109
200
  redstone?: undefined;
110
201
  chainlink?: undefined;
@@ -112,10 +203,10 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
112
203
  jupLend?: undefined;
113
204
  chainlinkDataStreams?: undefined;
114
205
  } & {
115
- stakePool: Record<string, never>;
206
+ pyth: Record<string, never>;
116
207
  }) | ({
117
- pyth?: undefined;
118
208
  stakePool?: undefined;
209
+ pyth?: undefined;
119
210
  redstone?: undefined;
120
211
  chainlink?: undefined;
121
212
  singlePool?: undefined;
@@ -124,8 +215,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
124
215
  } & {
125
216
  msolPool: Record<string, never>;
126
217
  }) | ({
127
- pyth?: undefined;
128
218
  stakePool?: undefined;
219
+ pyth?: undefined;
129
220
  msolPool?: undefined;
130
221
  chainlink?: undefined;
131
222
  singlePool?: undefined;
@@ -134,8 +225,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
134
225
  } & {
135
226
  redstone: Record<string, never>;
136
227
  }) | ({
137
- pyth?: undefined;
138
228
  stakePool?: undefined;
229
+ pyth?: undefined;
139
230
  msolPool?: undefined;
140
231
  redstone?: undefined;
141
232
  singlePool?: undefined;
@@ -144,8 +235,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
144
235
  } & {
145
236
  chainlink: Record<string, never>;
146
237
  }) | ({
147
- pyth?: undefined;
148
238
  stakePool?: undefined;
239
+ pyth?: undefined;
149
240
  msolPool?: undefined;
150
241
  redstone?: undefined;
151
242
  chainlink?: undefined;
@@ -154,8 +245,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
154
245
  } & {
155
246
  singlePool: Record<string, never>;
156
247
  }) | ({
157
- pyth?: undefined;
158
248
  stakePool?: undefined;
249
+ pyth?: undefined;
159
250
  msolPool?: undefined;
160
251
  redstone?: undefined;
161
252
  chainlink?: undefined;
@@ -164,8 +255,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
164
255
  } & {
165
256
  jupLend: Record<string, never>;
166
257
  }) | ({
167
- pyth?: undefined;
168
258
  stakePool?: undefined;
259
+ pyth?: undefined;
169
260
  msolPool?: undefined;
170
261
  redstone?: undefined;
171
262
  chainlink?: undefined;
@@ -224,4 +315,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
224
315
  }[];
225
316
  }[]>;
226
317
 
227
- export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getLiquidityProgramId, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
318
+ export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getLiquidityProgramId, getOracleSources, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
@@ -1,11 +1,13 @@
1
- import { g as getVaultsProgram, a as getLiquidateIx } from '../shared/lend.B03stRz0.mjs';
2
- export { I as INIT_TICK, M as MAX_REPAY_AMOUNT, b as MAX_TICK, c as MAX_WITHDRAW_AMOUNT, d as MIN_I128, e as MIN_TICK, T as TICKS_PER_TICK_HAS_DEBT, f as TICK_HAS_DEBT_ARRAY_SIZE, h as TICK_HAS_DEBT_CHILDREN_SIZE, i as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, j as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, k as findNextTickWithDebt, l as getAccountOwner, m as getCurrentPosition, n as getCurrentPositionState, o as getFinalPosition, p as getFirstTickForIndex, q as getInitPositionContext, r as getInitPositionIx, s as getLiquidateContext, t as getLiquidityProgramId, u as getOperateContext, v as getOperateIx, w as getRatioAtTick, x as getTickAtRatio, y as getTickIndices, z as loadRelevantBranches, A as loadRelevantBranchesForLiquidate, B as loadRelevantTicksHasDebtArrays, C as loadRelevantTicksHasDebtArraysLiquidate, D as readOraclePrice, E as readTickHasDebtArray } from '../shared/lend.B03stRz0.mjs';
1
+ import { g as getLiquidateIx } from '../shared/lend.siYu8A-9.mjs';
2
+ export { a as getInitPositionContext, b as getInitPositionIx, c as getLiquidateContext, d as getOperateContext, e as getOperateIx } from '../shared/lend.siYu8A-9.mjs';
3
+ import { g as getVaultsProgram } from '../shared/lend.DcHJFKzT.mjs';
4
+ export { I as INIT_TICK, M as MAX_REPAY_AMOUNT, a as MAX_TICK, b as MAX_WITHDRAW_AMOUNT, c as MIN_I128, d as MIN_TICK, T as TICKS_PER_TICK_HAS_DEBT, e as TICK_HAS_DEBT_ARRAY_SIZE, f as TICK_HAS_DEBT_CHILDREN_SIZE, h as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, i as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, j as findNextTickWithDebt, k as getAccountOwner, l as getCurrentPosition, m as getCurrentPositionState, n as getFinalPosition, o as getFirstTickForIndex, p as getLiquidityProgramId, q as getOracleSources, r as getRatioAtTick, s as getTickAtRatio, t as getTickIndices, u as loadRelevantBranches, v as loadRelevantBranchesForLiquidate, w as loadRelevantTicksHasDebtArrays, x as loadRelevantTicksHasDebtArraysLiquidate, y as readOraclePrice, z as readTickHasDebtArray } from '../shared/lend.DcHJFKzT.mjs';
3
5
  import { PublicKey, TransactionMessage, ComputeBudgetProgram, VersionedTransaction } from '@solana/web3.js';
4
6
  import BN from 'bn.js';
5
- import { g as getVaultAdmin } from '../shared/lend.ByiEG4eI.mjs';
7
+ import { g as getVaultAdmin } from '../shared/lend.a53XYkl5.mjs';
6
8
  import '@coral-xyz/anchor';
7
9
  import '@solana/spl-token';
8
- import '../shared/lend.BhQGaP3o.mjs';
10
+ import '../shared/lend.C3XdrR6R.mjs';
9
11
 
10
12
  const simulateLiquidate = async (params) => {
11
13
  const { connection, signer } = params;