@crypticdot/defituna-api 1.10.0 → 1.10.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.
- package/dist/index.d.mts +1658 -1213
- package/dist/index.d.ts +1658 -1213
- package/dist/index.js +738 -634
- package/dist/index.mjs +727 -623
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,6 +48,8 @@ var import_snakecase_keys = __toESM(require("snakecase-keys"));
|
|
|
48
48
|
// src/client/schemas.ts
|
|
49
49
|
var schemas_exports = {};
|
|
50
50
|
__export(schemas_exports, {
|
|
51
|
+
AmountWithUsdSchema: () => AmountWithUsdSchema,
|
|
52
|
+
AmountWithoutUsdSchema: () => AmountWithoutUsdSchema,
|
|
51
53
|
CloseSpotPositionQuote: () => CloseSpotPositionQuote,
|
|
52
54
|
DecreaseSpotPositionQuote: () => DecreaseSpotPositionQuote,
|
|
53
55
|
FeesStatsGroup: () => FeesStatsGroup,
|
|
@@ -113,6 +115,7 @@ __export(schemas_exports, {
|
|
|
113
115
|
SwapQuoteByOutput: () => SwapQuoteByOutput,
|
|
114
116
|
Tick: () => Tick,
|
|
115
117
|
TokenOraclePrice: () => TokenOraclePrice,
|
|
118
|
+
TokensPnlSchema: () => TokensPnlSchema,
|
|
116
119
|
TradableAmount: () => TradableAmount,
|
|
117
120
|
TradeHistoryAction: () => TradeHistoryAction,
|
|
118
121
|
TradeHistoryActionSchema: () => TradeHistoryActionSchema,
|
|
@@ -120,7 +123,6 @@ __export(schemas_exports, {
|
|
|
120
123
|
TradeHistoryEntryNotification: () => TradeHistoryEntryNotification,
|
|
121
124
|
TradeHistoryUIDirection: () => TradeHistoryUIDirection,
|
|
122
125
|
TradeHistoryUIDirectionSchema: () => TradeHistoryUIDirectionSchema,
|
|
123
|
-
TunaLpPosition: () => TunaLpPosition,
|
|
124
126
|
TunaLpPositionAction: () => TunaLpPositionAction,
|
|
125
127
|
TunaLpPositionActionClose: () => TunaLpPositionActionClose,
|
|
126
128
|
TunaLpPositionActionCollectAndCompoundFees: () => TunaLpPositionActionCollectAndCompoundFees,
|
|
@@ -131,71 +133,61 @@ __export(schemas_exports, {
|
|
|
131
133
|
TunaLpPositionActionOpen: () => TunaLpPositionActionOpen,
|
|
132
134
|
TunaLpPositionActionParametersUpdate: () => TunaLpPositionActionParametersUpdate,
|
|
133
135
|
TunaLpPositionActionRepayDebt: () => TunaLpPositionActionRepayDebt,
|
|
136
|
+
TunaLpPositionAutoCompounding: () => TunaLpPositionAutoCompounding,
|
|
137
|
+
TunaLpPositionAutoCompoundingSchema: () => TunaLpPositionAutoCompoundingSchema,
|
|
138
|
+
TunaLpPositionDtoSchema: () => TunaLpPositionDtoSchema,
|
|
139
|
+
TunaLpPositionFlagsSchema: () => TunaLpPositionFlagsSchema,
|
|
140
|
+
TunaLpPositionHistorical: () => TunaLpPositionHistorical,
|
|
134
141
|
TunaLpPositionParameters: () => TunaLpPositionParameters,
|
|
135
142
|
TunaLpPositionTokenPrices: () => TunaLpPositionTokenPrices,
|
|
136
143
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
137
144
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
138
|
-
|
|
145
|
+
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
139
146
|
TunaPositionNotification: () => TunaPositionNotification,
|
|
147
|
+
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
148
|
+
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
149
|
+
TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
|
|
140
150
|
TunaPositionState: () => TunaPositionState,
|
|
141
151
|
TunaPositionStateSchema: () => TunaPositionStateSchema,
|
|
152
|
+
TunaPositionTokenPnlSchema: () => TunaPositionTokenPnlSchema,
|
|
142
153
|
TunaSpotPosition: () => TunaSpotPosition,
|
|
143
154
|
TunaSpotPositionNotification: () => TunaSpotPositionNotification,
|
|
144
155
|
TunaSpotPositionState: () => TunaSpotPositionState,
|
|
145
156
|
TunaSpotPositionStateSchema: () => TunaSpotPositionStateSchema,
|
|
146
157
|
UpdateStreamSubscriptionResult: () => UpdateStreamSubscriptionResult,
|
|
158
|
+
UsdPnlSchema: () => UsdPnlSchema,
|
|
147
159
|
Vault: () => Vault,
|
|
148
160
|
VaultHistoricalStats: () => VaultHistoricalStats,
|
|
149
161
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
150
162
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
151
163
|
});
|
|
164
|
+
var import_zod8 = require("zod");
|
|
165
|
+
|
|
166
|
+
// src/client/schemas/basic.ts
|
|
152
167
|
var import_zod = require("zod");
|
|
153
|
-
var
|
|
154
|
-
amount: import_zod.z.coerce.bigint()
|
|
155
|
-
});
|
|
156
|
-
var amountWithUsd = import_zod.z.object({
|
|
168
|
+
var AmountWithUsdSchema = import_zod.z.object({
|
|
157
169
|
amount: import_zod.z.coerce.bigint(),
|
|
158
170
|
usd: import_zod.z.number()
|
|
159
171
|
});
|
|
160
|
-
var
|
|
172
|
+
var AmountWithoutUsdSchema = import_zod.z.object({
|
|
173
|
+
amount: import_zod.z.coerce.bigint()
|
|
174
|
+
});
|
|
175
|
+
var TokensPnlSchema = import_zod.z.object({
|
|
161
176
|
amount: import_zod.z.coerce.bigint(),
|
|
162
|
-
|
|
177
|
+
rate: import_zod.z.number()
|
|
163
178
|
});
|
|
164
|
-
var
|
|
179
|
+
var UsdPnlSchema = import_zod.z.object({
|
|
165
180
|
amount: import_zod.z.number(),
|
|
166
|
-
|
|
181
|
+
rate: import_zod.z.number()
|
|
167
182
|
});
|
|
168
|
-
var NotificationEntity = {
|
|
169
|
-
POOL_SWAP: "pool_swap",
|
|
170
|
-
POOL_PRICE: "pool_price",
|
|
171
|
-
ORDER_BOOK: "order_book",
|
|
172
|
-
TUNA_POSITION: "tuna_position",
|
|
173
|
-
TUNA_SPOT_POSITION: "tuna_spot_position",
|
|
174
|
-
LENDING_POSITION: "lending_position",
|
|
175
|
-
STAKING_POSITION: "staking_position",
|
|
176
|
-
FUSION_LIMIT_ORDER: "fusion_limit_order",
|
|
177
|
-
TRADE_HISTORY_ENTRY: "trade_history_entry",
|
|
178
|
-
ORDER_HISTORY_ENTRY: "order_history_entry",
|
|
179
|
-
STATE_SNAPSHOT: "state_snapshot"
|
|
180
|
-
};
|
|
181
|
-
var NotificationAction = {
|
|
182
|
-
CREATE: "create",
|
|
183
|
-
UPDATE: "update"
|
|
184
|
-
};
|
|
185
183
|
var PoolProvider = {
|
|
186
184
|
ORCA: "orca",
|
|
187
185
|
FUSION: "fusion"
|
|
188
186
|
};
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
CLOSED: "closed"
|
|
194
|
-
};
|
|
195
|
-
var TunaSpotPositionState = {
|
|
196
|
-
OPEN: "open",
|
|
197
|
-
CLOSED: "closed"
|
|
198
|
-
};
|
|
187
|
+
var PoolProviderSchema = import_zod.z.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
|
|
188
|
+
|
|
189
|
+
// src/client/schemas/limit_orders.ts
|
|
190
|
+
var import_zod2 = require("zod");
|
|
199
191
|
var LimitOrderState = {
|
|
200
192
|
OPEN: "open",
|
|
201
193
|
PARTIALLY_FILLED: "partially_filled",
|
|
@@ -203,65 +195,50 @@ var LimitOrderState = {
|
|
|
203
195
|
COMPLETE: "complete",
|
|
204
196
|
CANCELLED: "cancelled"
|
|
205
197
|
};
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
UNSTAKE: "unstake",
|
|
247
|
-
WITHDRAW: "withdraw",
|
|
248
|
-
CLAIM_REWARDS: "claim_rewards",
|
|
249
|
-
COMPOUND_REWARDS: "compound_rewards"
|
|
250
|
-
};
|
|
251
|
-
var PoolSubscriptionTopic = {
|
|
252
|
-
ORDER_BOOK: "order_book",
|
|
253
|
-
POOL_PRICES: "pool_prices",
|
|
254
|
-
POOL_SWAPS: "pool_swaps"
|
|
255
|
-
};
|
|
256
|
-
var WalletSubscriptionTopic = {
|
|
257
|
-
TUNA_POSITIONS: "tuna_positions",
|
|
258
|
-
TUNA_SPOT_POSITIONS: "tuna_spot_positions",
|
|
259
|
-
LENDING_POSITIONS: "lending_positions",
|
|
260
|
-
FUSION_LIMIT_ORDERS: "fusion_limit_orders",
|
|
261
|
-
STAKING_POSITION: "staking_position",
|
|
262
|
-
TRADE_HISTORY: "trade_history",
|
|
263
|
-
ORDER_HISTORY: "order_history"
|
|
198
|
+
var LimitOrderStateSchema = import_zod2.z.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
|
|
199
|
+
var LimitOrder = import_zod2.z.object({
|
|
200
|
+
address: import_zod2.z.string(),
|
|
201
|
+
mint: import_zod2.z.string(),
|
|
202
|
+
pool: import_zod2.z.string(),
|
|
203
|
+
state: LimitOrderStateSchema,
|
|
204
|
+
aToB: import_zod2.z.boolean(),
|
|
205
|
+
tickIndex: import_zod2.z.number(),
|
|
206
|
+
fillRatio: import_zod2.z.number(),
|
|
207
|
+
openTxSignature: import_zod2.z.string(),
|
|
208
|
+
closeTxSignature: import_zod2.z.nullable(import_zod2.z.string()),
|
|
209
|
+
amountIn: AmountWithUsdSchema,
|
|
210
|
+
amountOut: AmountWithUsdSchema,
|
|
211
|
+
openedAt: import_zod2.z.coerce.date(),
|
|
212
|
+
closedAt: import_zod2.z.nullable(import_zod2.z.coerce.date())
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// src/client/schemas/lp_positions.ts
|
|
216
|
+
var import_zod5 = __toESM(require("zod"));
|
|
217
|
+
|
|
218
|
+
// src/client/schemas/mint.ts
|
|
219
|
+
var import_zod3 = require("zod");
|
|
220
|
+
var Mint = import_zod3.z.object({
|
|
221
|
+
mint: import_zod3.z.string(),
|
|
222
|
+
symbol: import_zod3.z.string(),
|
|
223
|
+
name: import_zod3.z.string(),
|
|
224
|
+
logo: import_zod3.z.string(),
|
|
225
|
+
decimals: import_zod3.z.number()
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// src/client/schemas/positions_shared.ts
|
|
229
|
+
var import_zod4 = __toESM(require("zod"));
|
|
230
|
+
var TunaPositionPoolSchema = import_zod4.default.object({
|
|
231
|
+
addr: import_zod4.default.string(),
|
|
232
|
+
price: import_zod4.default.number(),
|
|
233
|
+
tickSpacing: import_zod4.default.number()
|
|
234
|
+
});
|
|
235
|
+
var TunaPositionPoolToken = {
|
|
236
|
+
A: "a",
|
|
237
|
+
B: "b"
|
|
264
238
|
};
|
|
239
|
+
var TunaPositionPoolTokenSchema = import_zod4.default.enum(Object.values(TunaPositionPoolToken));
|
|
240
|
+
|
|
241
|
+
// src/client/schemas/lp_positions.ts
|
|
265
242
|
var LpPositionLimitOrderSwap = {
|
|
266
243
|
NO_SWAP: "no_swap",
|
|
267
244
|
SWAP_TO_TOKEN_A: "swap_to_token_a",
|
|
@@ -292,270 +269,173 @@ var LpPositionsActionType = {
|
|
|
292
269
|
SET_FLAGS: "set_flags",
|
|
293
270
|
SET_REBALANCE_THRESHOLD: "set_rebalance_threshold"
|
|
294
271
|
};
|
|
295
|
-
var
|
|
296
|
-
var
|
|
297
|
-
var
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
...Object.values(OrderHistoryUIDirection)
|
|
317
|
-
]);
|
|
318
|
-
var StakingPositionHistoryActionTypeSchema = import_zod.z.enum([
|
|
319
|
-
StakingPositionHistoryActionType.STAKE,
|
|
320
|
-
...Object.values(StakingPositionHistoryActionType)
|
|
321
|
-
]);
|
|
322
|
-
var PoolSubscriptionTopicSchema = import_zod.z.enum([
|
|
323
|
-
PoolSubscriptionTopic.ORDER_BOOK,
|
|
324
|
-
...Object.values(PoolSubscriptionTopic)
|
|
325
|
-
]);
|
|
326
|
-
var WalletSubscriptionTopicSchema = import_zod.z.enum([
|
|
327
|
-
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
328
|
-
...Object.values(WalletSubscriptionTopic)
|
|
329
|
-
]);
|
|
330
|
-
var LpPositionLimitOrderSwapSchema = import_zod.z.enum(Object.values(LpPositionLimitOrderSwap));
|
|
331
|
-
var LpPositionAutoCompoundSchema = import_zod.z.enum(Object.values(LpPositionAutoCompound));
|
|
332
|
-
var LpPositionRebalanceSchema = import_zod.z.enum(Object.values(LpPositionRebalance));
|
|
333
|
-
var LpPositionsActionTypeSchema = import_zod.z.enum(Object.values(LpPositionsActionType));
|
|
334
|
-
var PaginationMeta = import_zod.z.object({
|
|
335
|
-
total: import_zod.z.number()
|
|
336
|
-
});
|
|
337
|
-
var Mint = import_zod.z.object({
|
|
338
|
-
symbol: import_zod.z.string(),
|
|
339
|
-
mint: import_zod.z.string(),
|
|
340
|
-
logo: import_zod.z.string(),
|
|
341
|
-
decimals: import_zod.z.number()
|
|
342
|
-
});
|
|
343
|
-
var Market = import_zod.z.object({
|
|
344
|
-
address: import_zod.z.string(),
|
|
345
|
-
addressLookupTable: import_zod.z.string(),
|
|
346
|
-
poolAddress: import_zod.z.string(),
|
|
347
|
-
poolFeeRate: import_zod.z.number(),
|
|
348
|
-
provider: PoolProviderSchema,
|
|
349
|
-
maxLeverage: import_zod.z.number(),
|
|
350
|
-
maxSwapSlippage: import_zod.z.number(),
|
|
351
|
-
protocolFee: import_zod.z.number(),
|
|
352
|
-
rebalanceProtocolFee: import_zod.z.number(),
|
|
353
|
-
protocolFeeOnCollateral: import_zod.z.number(),
|
|
354
|
-
liquidationFee: import_zod.z.number(),
|
|
355
|
-
liquidationThreshold: import_zod.z.number(),
|
|
356
|
-
oraclePriceDeviationThreshold: import_zod.z.number(),
|
|
357
|
-
limitOrderExecutionFee: import_zod.z.number(),
|
|
358
|
-
maxSpotPositionSizeA: amountWithUsd,
|
|
359
|
-
maxSpotPositionSizeB: amountWithUsd,
|
|
360
|
-
borrowedFundsA: amountWithUsd,
|
|
361
|
-
borrowedFundsB: amountWithUsd,
|
|
362
|
-
availableBorrowA: amountWithUsd,
|
|
363
|
-
availableBorrowB: amountWithUsd,
|
|
364
|
-
borrowLimitA: amountWithUsd,
|
|
365
|
-
borrowLimitB: amountWithUsd,
|
|
366
|
-
disabled: import_zod.z.boolean(),
|
|
367
|
-
createdAt: import_zod.z.coerce.date()
|
|
368
|
-
});
|
|
369
|
-
var TokenOraclePrice = import_zod.z.object({
|
|
370
|
-
mint: import_zod.z.string(),
|
|
371
|
-
price: import_zod.z.coerce.bigint(),
|
|
372
|
-
decimals: import_zod.z.number(),
|
|
373
|
-
time: import_zod.z.coerce.date()
|
|
374
|
-
});
|
|
375
|
-
var Vault = import_zod.z.object({
|
|
376
|
-
address: import_zod.z.string(),
|
|
377
|
-
mint: import_zod.z.string(),
|
|
378
|
-
depositedFunds: amountWithUsd,
|
|
379
|
-
borrowedFunds: amountWithUsd,
|
|
380
|
-
supplyLimit: amountWithUsd,
|
|
381
|
-
borrowedShares: import_zod.z.coerce.bigint(),
|
|
382
|
-
depositedShares: import_zod.z.coerce.bigint(),
|
|
383
|
-
supplyApy: import_zod.z.number(),
|
|
384
|
-
borrowApy: import_zod.z.number(),
|
|
385
|
-
interestRate: import_zod.z.coerce.bigint(),
|
|
386
|
-
utilization: import_zod.z.number(),
|
|
387
|
-
pythOracleFeedId: import_zod.z.string(),
|
|
388
|
-
pythOraclePriceUpdate: import_zod.z.string()
|
|
389
|
-
});
|
|
390
|
-
var VaultHistoricalStats = import_zod.z.object({
|
|
391
|
-
date: import_zod.z.preprocess((val, ctx) => {
|
|
392
|
-
if (typeof val === "string") {
|
|
393
|
-
const [year, month, day] = val.split("-").map(Number);
|
|
394
|
-
return new Date(year, month - 1, day);
|
|
395
|
-
}
|
|
396
|
-
ctx.addIssue({
|
|
397
|
-
code: "custom",
|
|
398
|
-
message: "Not a valid date string"
|
|
399
|
-
});
|
|
400
|
-
return import_zod.z.NEVER;
|
|
401
|
-
}, import_zod.z.date()),
|
|
402
|
-
supply: amountWithUsd,
|
|
403
|
-
borrow: amountWithUsd,
|
|
404
|
-
supplyApy: import_zod.z.number(),
|
|
405
|
-
borrowApr: import_zod.z.number()
|
|
406
|
-
});
|
|
407
|
-
var Pool = import_zod.z.object({
|
|
408
|
-
address: import_zod.z.string(),
|
|
409
|
-
provider: PoolProviderSchema,
|
|
410
|
-
tokenAMint: import_zod.z.string(),
|
|
411
|
-
tokenBMint: import_zod.z.string(),
|
|
412
|
-
tokenAVault: import_zod.z.string(),
|
|
413
|
-
tokenBVault: import_zod.z.string(),
|
|
414
|
-
tvlUsdc: import_zod.z.coerce.number(),
|
|
415
|
-
priceChange24H: import_zod.z.number(),
|
|
416
|
-
tickSpacing: import_zod.z.number(),
|
|
417
|
-
feeRate: import_zod.z.number(),
|
|
418
|
-
olpFeeRate: import_zod.z.nullable(import_zod.z.number()),
|
|
419
|
-
protocolFeeRate: import_zod.z.number(),
|
|
420
|
-
liquidity: import_zod.z.coerce.bigint(),
|
|
421
|
-
sqrtPrice: import_zod.z.coerce.bigint(),
|
|
422
|
-
tickCurrentIndex: import_zod.z.number(),
|
|
423
|
-
stats: import_zod.z.object({
|
|
424
|
-
"24h": import_zod.z.object({
|
|
425
|
-
volume: import_zod.z.coerce.number(),
|
|
426
|
-
fees: import_zod.z.coerce.number(),
|
|
427
|
-
rewards: import_zod.z.coerce.number(),
|
|
428
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
429
|
-
}),
|
|
430
|
-
"7d": import_zod.z.object({
|
|
431
|
-
volume: import_zod.z.coerce.number(),
|
|
432
|
-
fees: import_zod.z.coerce.number(),
|
|
433
|
-
rewards: import_zod.z.coerce.number(),
|
|
434
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
435
|
-
}),
|
|
436
|
-
"30d": import_zod.z.object({
|
|
437
|
-
volume: import_zod.z.coerce.number(),
|
|
438
|
-
fees: import_zod.z.coerce.number(),
|
|
439
|
-
rewards: import_zod.z.coerce.number(),
|
|
440
|
-
yieldOverTvl: import_zod.z.coerce.number()
|
|
441
|
-
})
|
|
442
|
-
})
|
|
443
|
-
});
|
|
444
|
-
var Tick = import_zod.z.object({
|
|
445
|
-
index: import_zod.z.number(),
|
|
446
|
-
liquidity: import_zod.z.coerce.bigint()
|
|
272
|
+
var LpPositionLimitOrderSwapSchema = import_zod5.default.enum(Object.values(LpPositionLimitOrderSwap));
|
|
273
|
+
var LpPositionAutoCompoundSchema = import_zod5.default.enum(Object.values(LpPositionAutoCompound));
|
|
274
|
+
var LpPositionRebalanceSchema = import_zod5.default.enum(Object.values(LpPositionRebalance));
|
|
275
|
+
var LpPositionsActionTypeSchema = import_zod5.default.enum(Object.values(LpPositionsActionType));
|
|
276
|
+
var TunaPositionState = {
|
|
277
|
+
OPEN: "open",
|
|
278
|
+
LIQUIDATED: "liquidated",
|
|
279
|
+
CLOSED_BY_LIMIT_ORDER: "closed_by_limit_order",
|
|
280
|
+
CLOSED: "closed"
|
|
281
|
+
};
|
|
282
|
+
var TunaPositionStateSchema = import_zod5.default.enum([TunaPositionState.OPEN, ...Object.values(TunaPositionState)]);
|
|
283
|
+
var TunaLpPositionAutoCompounding = {
|
|
284
|
+
WITH_LEVERAGE: "with_leverage",
|
|
285
|
+
WITHOUT_LEVERAGE: "without_leverage"
|
|
286
|
+
};
|
|
287
|
+
var TunaLpPositionAutoCompoundingSchema = import_zod5.default.enum(
|
|
288
|
+
Object.values(TunaLpPositionAutoCompounding)
|
|
289
|
+
);
|
|
290
|
+
var TunaPositionTokenPnlSchema = import_zod5.default.object({
|
|
291
|
+
amount: import_zod5.default.coerce.bigint(),
|
|
292
|
+
bps: import_zod5.default.number()
|
|
447
293
|
});
|
|
448
|
-
var
|
|
449
|
-
|
|
450
|
-
|
|
294
|
+
var TunaLpPositionFlagsSchema = import_zod5.default.object({
|
|
295
|
+
lowerLimitOrderSwapToToken: import_zod5.default.nullable(TunaPositionPoolTokenSchema),
|
|
296
|
+
upperLimitOrderSwapToToken: import_zod5.default.nullable(TunaPositionPoolTokenSchema),
|
|
297
|
+
autoCompounding: import_zod5.default.nullable(TunaLpPositionAutoCompoundingSchema),
|
|
298
|
+
autoRebalancing: import_zod5.default.boolean()
|
|
451
299
|
});
|
|
452
|
-
var
|
|
453
|
-
address:
|
|
454
|
-
authority:
|
|
455
|
-
|
|
456
|
-
vault: import_zod.z.string(),
|
|
457
|
-
shares: import_zod.z.coerce.bigint(),
|
|
458
|
-
funds: amountWithUsd,
|
|
459
|
-
earned: amountWithUsd
|
|
460
|
-
});
|
|
461
|
-
var TunaPosition = import_zod.z.object({
|
|
462
|
-
address: import_zod.z.string(),
|
|
463
|
-
authority: import_zod.z.string(),
|
|
464
|
-
version: import_zod.z.number(),
|
|
300
|
+
var TunaLpPositionDtoSchema = import_zod5.default.object({
|
|
301
|
+
address: import_zod5.default.string(),
|
|
302
|
+
authority: import_zod5.default.string(),
|
|
303
|
+
version: import_zod5.default.number(),
|
|
465
304
|
state: TunaPositionStateSchema,
|
|
466
|
-
positionMint:
|
|
467
|
-
liquidity:
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
flags:
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
305
|
+
positionMint: import_zod5.default.string(),
|
|
306
|
+
liquidity: import_zod5.default.coerce.bigint(),
|
|
307
|
+
lowerPrice: import_zod5.default.number(),
|
|
308
|
+
upperPrice: import_zod5.default.number(),
|
|
309
|
+
lowerLimitOrderPrice: import_zod5.default.number(),
|
|
310
|
+
upperLimitOrderPrice: import_zod5.default.number(),
|
|
311
|
+
entryPrice: import_zod5.default.number(),
|
|
312
|
+
flags: TunaLpPositionFlagsSchema,
|
|
313
|
+
mintA: Mint,
|
|
314
|
+
mintB: Mint,
|
|
315
|
+
pool: TunaPositionPoolSchema,
|
|
316
|
+
marketMaker: PoolProviderSchema,
|
|
317
|
+
depositedCollateralA: AmountWithUsdSchema,
|
|
318
|
+
depositedCollateralB: AmountWithUsdSchema,
|
|
319
|
+
leverage: import_zod5.default.number(),
|
|
320
|
+
maxLeverage: import_zod5.default.number(),
|
|
321
|
+
liquidationPriceLower: import_zod5.default.number(),
|
|
322
|
+
liquidationPriceUpper: import_zod5.default.number(),
|
|
323
|
+
initialDebtA: AmountWithUsdSchema,
|
|
324
|
+
initialDebtB: AmountWithUsdSchema,
|
|
325
|
+
currentDebtA: AmountWithUsdSchema,
|
|
326
|
+
currentDebtB: AmountWithUsdSchema,
|
|
327
|
+
leftoversA: AmountWithUsdSchema,
|
|
328
|
+
leftoversB: AmountWithUsdSchema,
|
|
329
|
+
yieldA: AmountWithUsdSchema,
|
|
330
|
+
yieldB: AmountWithUsdSchema,
|
|
331
|
+
compoundedYieldA: AmountWithUsdSchema,
|
|
332
|
+
compoundedYieldB: AmountWithUsdSchema,
|
|
333
|
+
totalA: AmountWithUsdSchema,
|
|
334
|
+
totalB: AmountWithUsdSchema,
|
|
335
|
+
pnlA: TokensPnlSchema,
|
|
336
|
+
pnlB: TokensPnlSchema,
|
|
337
|
+
pnlUsd: UsdPnlSchema,
|
|
338
|
+
openedAt: import_zod5.default.coerce.date(),
|
|
339
|
+
closedAt: import_zod5.default.nullable(import_zod5.default.coerce.date())
|
|
340
|
+
});
|
|
341
|
+
var TunaLpPositionHistorical = import_zod5.default.object({
|
|
342
|
+
positionAddress: import_zod5.default.string(),
|
|
343
|
+
authority: import_zod5.default.string(),
|
|
344
|
+
pool: import_zod5.default.string(),
|
|
504
345
|
state: TunaPositionStateSchema,
|
|
505
|
-
lowerPrice:
|
|
506
|
-
upperPrice:
|
|
507
|
-
lowerLimitOrder:
|
|
508
|
-
upperLimitOrder:
|
|
346
|
+
lowerPrice: import_zod5.default.number(),
|
|
347
|
+
upperPrice: import_zod5.default.number(),
|
|
348
|
+
lowerLimitOrder: import_zod5.default.number().nullable(),
|
|
349
|
+
upperLimitOrder: import_zod5.default.number().nullable(),
|
|
509
350
|
marketMaker: PoolProviderSchema,
|
|
510
|
-
openedAt:
|
|
511
|
-
closedAt:
|
|
512
|
-
totalValueUsd:
|
|
513
|
-
leverage:
|
|
514
|
-
initialLeverage:
|
|
515
|
-
totalDepositUsd:
|
|
516
|
-
totalWithdrawnUsd:
|
|
517
|
-
feesSumUsd:
|
|
518
|
-
closedPnlSumUsd:
|
|
519
|
-
entryPrice:
|
|
520
|
-
exitPrice:
|
|
521
|
-
});
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
351
|
+
openedAt: import_zod5.default.coerce.date(),
|
|
352
|
+
closedAt: import_zod5.default.coerce.date().nullable(),
|
|
353
|
+
totalValueUsd: import_zod5.default.number(),
|
|
354
|
+
leverage: import_zod5.default.number(),
|
|
355
|
+
initialLeverage: import_zod5.default.number(),
|
|
356
|
+
totalDepositUsd: import_zod5.default.number(),
|
|
357
|
+
totalWithdrawnUsd: import_zod5.default.number(),
|
|
358
|
+
feesSumUsd: import_zod5.default.number(),
|
|
359
|
+
closedPnlSumUsd: import_zod5.default.number(),
|
|
360
|
+
entryPrice: import_zod5.default.number(),
|
|
361
|
+
exitPrice: import_zod5.default.number().nullable()
|
|
362
|
+
});
|
|
363
|
+
var TunaPositionLegacy = import_zod5.default.object({
|
|
364
|
+
address: import_zod5.default.string(),
|
|
365
|
+
authority: import_zod5.default.string(),
|
|
366
|
+
version: import_zod5.default.number(),
|
|
367
|
+
state: TunaPositionStateSchema,
|
|
368
|
+
positionMint: import_zod5.default.string(),
|
|
369
|
+
liquidity: import_zod5.default.coerce.bigint(),
|
|
370
|
+
tickLowerIndex: import_zod5.default.number(),
|
|
371
|
+
tickUpperIndex: import_zod5.default.number(),
|
|
372
|
+
entrySqrtPrice: import_zod5.default.coerce.bigint(),
|
|
373
|
+
lowerLimitOrderSqrtPrice: import_zod5.default.coerce.bigint(),
|
|
374
|
+
upperLimitOrderSqrtPrice: import_zod5.default.coerce.bigint(),
|
|
375
|
+
flags: import_zod5.default.number(),
|
|
376
|
+
pool: import_zod5.default.string(),
|
|
377
|
+
poolSqrtPrice: import_zod5.default.coerce.bigint(),
|
|
378
|
+
depositedCollateralA: AmountWithoutUsdSchema,
|
|
379
|
+
depositedCollateralB: AmountWithoutUsdSchema,
|
|
380
|
+
depositedCollateralUsd: import_zod5.default.object({
|
|
381
|
+
amount: import_zod5.default.number()
|
|
382
|
+
}),
|
|
383
|
+
loanFundsA: AmountWithUsdSchema,
|
|
384
|
+
loanFundsB: AmountWithUsdSchema,
|
|
385
|
+
currentLoanA: AmountWithUsdSchema,
|
|
386
|
+
currentLoanB: AmountWithUsdSchema,
|
|
387
|
+
leftoversA: AmountWithUsdSchema,
|
|
388
|
+
leftoversB: AmountWithUsdSchema,
|
|
389
|
+
yieldA: AmountWithUsdSchema,
|
|
390
|
+
yieldB: AmountWithUsdSchema,
|
|
391
|
+
compoundedYieldA: AmountWithUsdSchema,
|
|
392
|
+
compoundedYieldB: AmountWithUsdSchema,
|
|
393
|
+
totalA: AmountWithUsdSchema,
|
|
394
|
+
totalB: AmountWithUsdSchema,
|
|
395
|
+
pnlA: TokensPnlSchema,
|
|
396
|
+
pnlB: TokensPnlSchema,
|
|
397
|
+
pnlUsd: UsdPnlSchema,
|
|
398
|
+
openedAt: import_zod5.default.coerce.date(),
|
|
399
|
+
updatedAtSlot: import_zod5.default.coerce.bigint(),
|
|
400
|
+
closedAt: import_zod5.default.nullable(import_zod5.default.coerce.date())
|
|
401
|
+
});
|
|
402
|
+
var TunaLpPositionParameters = import_zod5.default.object({
|
|
403
|
+
lowerPrice: import_zod5.default.number(),
|
|
404
|
+
upperPrice: import_zod5.default.number(),
|
|
405
|
+
lowerLimitOrder: import_zod5.default.number().nullable(),
|
|
406
|
+
upperLimitOrder: import_zod5.default.number().nullable(),
|
|
527
407
|
lowerLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
528
408
|
upperLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
529
409
|
autoCompound: LpPositionAutoCompoundSchema,
|
|
530
410
|
rebalance: LpPositionRebalanceSchema,
|
|
531
|
-
rebalanceThresholdTicks:
|
|
532
|
-
});
|
|
533
|
-
var TunaLpPositionValue =
|
|
534
|
-
totalValueA:
|
|
535
|
-
totalValueB:
|
|
536
|
-
totalValueUsd:
|
|
537
|
-
loanFundsA:
|
|
538
|
-
loanFundsB:
|
|
539
|
-
loanFundsUsd:
|
|
540
|
-
leverage:
|
|
541
|
-
});
|
|
542
|
-
var TunaLpPositionTransfer =
|
|
543
|
-
amountA:
|
|
544
|
-
amountB:
|
|
545
|
-
amountUsd:
|
|
546
|
-
});
|
|
547
|
-
var TunaLpPositionTokenPrices =
|
|
548
|
-
tokenPriceA:
|
|
549
|
-
tokenPriceB:
|
|
550
|
-
});
|
|
551
|
-
var TunaLpPositionActionOpen =
|
|
411
|
+
rebalanceThresholdTicks: import_zod5.default.number()
|
|
412
|
+
});
|
|
413
|
+
var TunaLpPositionValue = import_zod5.default.object({
|
|
414
|
+
totalValueA: import_zod5.default.number(),
|
|
415
|
+
totalValueB: import_zod5.default.number(),
|
|
416
|
+
totalValueUsd: import_zod5.default.number(),
|
|
417
|
+
loanFundsA: import_zod5.default.number(),
|
|
418
|
+
loanFundsB: import_zod5.default.number(),
|
|
419
|
+
loanFundsUsd: import_zod5.default.number(),
|
|
420
|
+
leverage: import_zod5.default.number()
|
|
421
|
+
});
|
|
422
|
+
var TunaLpPositionTransfer = import_zod5.default.object({
|
|
423
|
+
amountA: import_zod5.default.number(),
|
|
424
|
+
amountB: import_zod5.default.number(),
|
|
425
|
+
amountUsd: import_zod5.default.number()
|
|
426
|
+
});
|
|
427
|
+
var TunaLpPositionTokenPrices = import_zod5.default.object({
|
|
428
|
+
tokenPriceA: import_zod5.default.number(),
|
|
429
|
+
tokenPriceB: import_zod5.default.number()
|
|
430
|
+
});
|
|
431
|
+
var TunaLpPositionActionOpen = import_zod5.default.object({
|
|
552
432
|
parameters: TunaLpPositionParameters
|
|
553
433
|
});
|
|
554
|
-
var TunaLpPositionActionClose =
|
|
434
|
+
var TunaLpPositionActionClose = import_zod5.default.object({
|
|
555
435
|
toOwner: TunaLpPositionTransfer.nullable(),
|
|
556
436
|
prices: TunaLpPositionTokenPrices.nullable()
|
|
557
437
|
});
|
|
558
|
-
var TunaLpPositionActionIncreaseLiquidity =
|
|
438
|
+
var TunaLpPositionActionIncreaseLiquidity = import_zod5.default.object({
|
|
559
439
|
fromPosition: TunaLpPositionValue.nullable(),
|
|
560
440
|
toPosition: TunaLpPositionValue,
|
|
561
441
|
fromOwner: TunaLpPositionTransfer,
|
|
@@ -563,9 +443,9 @@ var TunaLpPositionActionIncreaseLiquidity = import_zod.z.object({
|
|
|
563
443
|
protocolFees: TunaLpPositionTransfer,
|
|
564
444
|
prices: TunaLpPositionTokenPrices
|
|
565
445
|
});
|
|
566
|
-
var TunaLpPositionActionDecreaseLiquidity =
|
|
567
|
-
withdrawPercent:
|
|
568
|
-
closedPnlUsd:
|
|
446
|
+
var TunaLpPositionActionDecreaseLiquidity = import_zod5.default.object({
|
|
447
|
+
withdrawPercent: import_zod5.default.number(),
|
|
448
|
+
closedPnlUsd: import_zod5.default.number(),
|
|
569
449
|
fromPosition: TunaLpPositionValue,
|
|
570
450
|
toPosition: TunaLpPositionValue.nullable(),
|
|
571
451
|
toOwner: TunaLpPositionTransfer,
|
|
@@ -573,28 +453,28 @@ var TunaLpPositionActionDecreaseLiquidity = import_zod.z.object({
|
|
|
573
453
|
collectedFees: TunaLpPositionTransfer,
|
|
574
454
|
prices: TunaLpPositionTokenPrices
|
|
575
455
|
});
|
|
576
|
-
var TunaLpPositionActionLiquidate =
|
|
577
|
-
withdrawPercent:
|
|
456
|
+
var TunaLpPositionActionLiquidate = import_zod5.default.object({
|
|
457
|
+
withdrawPercent: import_zod5.default.number(),
|
|
578
458
|
fromPosition: TunaLpPositionValue,
|
|
579
459
|
toLending: TunaLpPositionTransfer,
|
|
580
460
|
protocolFees: TunaLpPositionTransfer,
|
|
581
461
|
prices: TunaLpPositionTokenPrices
|
|
582
462
|
});
|
|
583
|
-
var TunaLpPositionActionRepayDebt =
|
|
463
|
+
var TunaLpPositionActionRepayDebt = import_zod5.default.object({
|
|
584
464
|
fromPosition: TunaLpPositionValue,
|
|
585
465
|
toPosition: TunaLpPositionValue,
|
|
586
466
|
fromOwner: TunaLpPositionTransfer,
|
|
587
467
|
toLending: TunaLpPositionTransfer,
|
|
588
468
|
prices: TunaLpPositionTokenPrices
|
|
589
469
|
});
|
|
590
|
-
var TunaLpPositionActionCollectFees =
|
|
591
|
-
closedPnlUsd:
|
|
470
|
+
var TunaLpPositionActionCollectFees = import_zod5.default.object({
|
|
471
|
+
closedPnlUsd: import_zod5.default.number(),
|
|
592
472
|
position: TunaLpPositionValue,
|
|
593
473
|
collectedFees: TunaLpPositionTransfer,
|
|
594
474
|
toOwner: TunaLpPositionTransfer,
|
|
595
475
|
prices: TunaLpPositionTokenPrices
|
|
596
476
|
});
|
|
597
|
-
var TunaLpPositionActionCollectAndCompoundFees =
|
|
477
|
+
var TunaLpPositionActionCollectAndCompoundFees = import_zod5.default.object({
|
|
598
478
|
fromPosition: TunaLpPositionValue,
|
|
599
479
|
toPosition: TunaLpPositionValue,
|
|
600
480
|
collectedFees: TunaLpPositionTransfer,
|
|
@@ -602,15 +482,15 @@ var TunaLpPositionActionCollectAndCompoundFees = import_zod.z.object({
|
|
|
602
482
|
protocolFees: TunaLpPositionTransfer,
|
|
603
483
|
prices: TunaLpPositionTokenPrices
|
|
604
484
|
});
|
|
605
|
-
var TunaLpPositionActionParametersUpdate =
|
|
485
|
+
var TunaLpPositionActionParametersUpdate = import_zod5.default.object({
|
|
606
486
|
fromParameters: TunaLpPositionParameters,
|
|
607
487
|
toParameters: TunaLpPositionParameters
|
|
608
488
|
});
|
|
609
|
-
var TunaLpPositionAction =
|
|
489
|
+
var TunaLpPositionAction = import_zod5.default.object({
|
|
610
490
|
action: LpPositionsActionTypeSchema,
|
|
611
|
-
txSignature:
|
|
612
|
-
txTimestamp:
|
|
613
|
-
data:
|
|
491
|
+
txSignature: import_zod5.default.string(),
|
|
492
|
+
txTimestamp: import_zod5.default.coerce.date(),
|
|
493
|
+
data: import_zod5.default.object({
|
|
614
494
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
615
495
|
fromPosition: TunaLpPositionValue.optional().nullable(),
|
|
616
496
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
@@ -638,324 +518,548 @@ var TunaLpPositionAction = import_zod.z.object({
|
|
|
638
518
|
/** defined for: ParametersUpdate */
|
|
639
519
|
toParameters: TunaLpPositionParameters.optional(),
|
|
640
520
|
/** defined for: DecreaseLiquidity */
|
|
641
|
-
withdrawPercent:
|
|
521
|
+
withdrawPercent: import_zod5.default.number().optional(),
|
|
642
522
|
/** defined for: DecreaseLiquidity, CollectFees */
|
|
643
|
-
closedPnlUsd:
|
|
523
|
+
closedPnlUsd: import_zod5.default.number().optional()
|
|
644
524
|
})
|
|
645
525
|
});
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
526
|
+
|
|
527
|
+
// src/client/schemas/spot_positions.ts
|
|
528
|
+
var import_zod6 = require("zod");
|
|
529
|
+
var TunaSpotPositionState = {
|
|
530
|
+
OPEN: "open",
|
|
531
|
+
CLOSED: "closed"
|
|
532
|
+
};
|
|
533
|
+
var TunaSpotPositionStateSchema = import_zod6.z.enum([
|
|
534
|
+
TunaSpotPositionState.OPEN,
|
|
535
|
+
...Object.values(TunaSpotPositionState)
|
|
536
|
+
]);
|
|
537
|
+
var TunaSpotPosition = import_zod6.z.object({
|
|
538
|
+
address: import_zod6.z.string(),
|
|
539
|
+
authority: import_zod6.z.string(),
|
|
540
|
+
version: import_zod6.z.number(),
|
|
650
541
|
state: TunaSpotPositionStateSchema,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
total:
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
closedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
671
|
-
});
|
|
672
|
-
var PoolSwap = import_zod.z.object({
|
|
673
|
-
id: import_zod.z.string(),
|
|
674
|
-
amountIn: import_zod.z.coerce.bigint(),
|
|
675
|
-
amountOut: import_zod.z.coerce.bigint(),
|
|
676
|
-
amountUsd: import_zod.z.number(),
|
|
677
|
-
aToB: import_zod.z.boolean(),
|
|
678
|
-
pool: import_zod.z.string(),
|
|
679
|
-
time: import_zod.z.coerce.date()
|
|
680
|
-
});
|
|
681
|
-
var OrderBookEntry = import_zod.z.object({
|
|
682
|
-
concentratedAmount: import_zod.z.coerce.bigint(),
|
|
683
|
-
concentratedAmountQuote: import_zod.z.coerce.bigint(),
|
|
684
|
-
concentratedTotal: import_zod.z.coerce.bigint(),
|
|
685
|
-
concentratedTotalQuote: import_zod.z.coerce.bigint(),
|
|
686
|
-
limitAmount: import_zod.z.coerce.bigint(),
|
|
687
|
-
limitAmountQuote: import_zod.z.coerce.bigint(),
|
|
688
|
-
limitTotal: import_zod.z.coerce.bigint(),
|
|
689
|
-
limitTotalQuote: import_zod.z.coerce.bigint(),
|
|
690
|
-
price: import_zod.z.number(),
|
|
691
|
-
askSide: import_zod.z.boolean()
|
|
692
|
-
});
|
|
693
|
-
var PoolPriceUpdate = import_zod.z.object({
|
|
694
|
-
pool: import_zod.z.string(),
|
|
695
|
-
price: import_zod.z.number(),
|
|
696
|
-
sqrtPrice: import_zod.z.coerce.bigint(),
|
|
697
|
-
time: import_zod.z.coerce.date()
|
|
698
|
-
});
|
|
699
|
-
var OrderBook = import_zod.z.object({
|
|
700
|
-
entries: OrderBookEntry.array(),
|
|
701
|
-
poolPrice: import_zod.z.number()
|
|
702
|
-
});
|
|
703
|
-
var LimitOrder = import_zod.z.object({
|
|
704
|
-
address: import_zod.z.string(),
|
|
705
|
-
mint: import_zod.z.string(),
|
|
706
|
-
pool: import_zod.z.string(),
|
|
707
|
-
state: LimitOrderStateSchema,
|
|
708
|
-
aToB: import_zod.z.boolean(),
|
|
709
|
-
tickIndex: import_zod.z.number(),
|
|
710
|
-
fillRatio: import_zod.z.number(),
|
|
711
|
-
openTxSignature: import_zod.z.string(),
|
|
712
|
-
closeTxSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
713
|
-
amountIn: amountWithUsd,
|
|
714
|
-
amountOut: amountWithUsd,
|
|
715
|
-
openedAt: import_zod.z.coerce.date(),
|
|
716
|
-
closedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
717
|
-
});
|
|
718
|
-
var TradeHistoryEntry = import_zod.z.object({
|
|
719
|
-
// Internal entry ID
|
|
720
|
-
id: import_zod.z.string(),
|
|
721
|
-
pool: import_zod.z.string(),
|
|
722
|
-
authority: import_zod.z.string(),
|
|
723
|
-
aToB: import_zod.z.boolean(),
|
|
724
|
-
// Trade action which created entry
|
|
725
|
-
action: TradeHistoryActionSchema,
|
|
726
|
-
// Trade direction formatted for ui display
|
|
727
|
-
uiDirection: TradeHistoryUIDirectionSchema,
|
|
728
|
-
// Trade price formatted for ui display
|
|
729
|
-
uiPrice: import_zod.z.number(),
|
|
730
|
-
baseToken: amountWithUsd,
|
|
731
|
-
quoteToken: amountWithUsd,
|
|
732
|
-
fee: amountWithUsd,
|
|
733
|
-
pnl: import_zod.z.nullable(
|
|
734
|
-
import_zod.z.object({
|
|
735
|
-
usd: import_zod.z.number(),
|
|
736
|
-
bps: import_zod.z.number()
|
|
737
|
-
})
|
|
738
|
-
),
|
|
739
|
-
txSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
740
|
-
positionAddress: import_zod.z.nullable(import_zod.z.string()),
|
|
741
|
-
slot: import_zod.z.coerce.bigint(),
|
|
742
|
-
ts: import_zod.z.coerce.date()
|
|
743
|
-
});
|
|
744
|
-
var OrderHistoryEntry = import_zod.z.object({
|
|
745
|
-
// Internal entry ID
|
|
746
|
-
id: import_zod.z.string(),
|
|
747
|
-
pool: import_zod.z.string(),
|
|
748
|
-
authority: import_zod.z.string(),
|
|
749
|
-
orderType: OrderHistoryOrderTypeSchema,
|
|
750
|
-
isReduceOnly: import_zod.z.nullable(import_zod.z.boolean()),
|
|
751
|
-
aToB: import_zod.z.boolean(),
|
|
752
|
-
uiDirection: OrderHistoryUIDirectionSchema,
|
|
753
|
-
uiPrice: import_zod.z.nullable(import_zod.z.number()),
|
|
754
|
-
uiExecutionPrice: import_zod.z.nullable(import_zod.z.number()),
|
|
755
|
-
status: OrderHistoryStatusSchema,
|
|
756
|
-
baseToken: amountWithUsd,
|
|
757
|
-
quoteToken: amountWithUsd,
|
|
758
|
-
baseTokenConsumedAmount: import_zod.z.nullable(amountWithUsd),
|
|
759
|
-
quoteTokenFilledAmount: import_zod.z.nullable(amountWithUsd),
|
|
760
|
-
txSignature: import_zod.z.nullable(import_zod.z.string()),
|
|
761
|
-
positionAddress: import_zod.z.nullable(import_zod.z.string()),
|
|
762
|
-
slot: import_zod.z.coerce.bigint(),
|
|
763
|
-
ts: import_zod.z.coerce.date()
|
|
764
|
-
});
|
|
765
|
-
var StakingTreasury = import_zod.z.object({
|
|
766
|
-
address: import_zod.z.string(),
|
|
767
|
-
stakedTokenMint: import_zod.z.string(),
|
|
768
|
-
rewardTokenMint: import_zod.z.string(),
|
|
769
|
-
apy: import_zod.z.number(),
|
|
770
|
-
uniqueStakers: import_zod.z.number(),
|
|
771
|
-
totalStaked: amountWithUsd,
|
|
772
|
-
totalReward: amountWithUsd,
|
|
773
|
-
unstakeCooldownSeconds: import_zod.z.number(),
|
|
774
|
-
isStakingEnabled: import_zod.z.boolean(),
|
|
775
|
-
isUnstakingEnabled: import_zod.z.boolean(),
|
|
776
|
-
isWithdrawEnabled: import_zod.z.boolean()
|
|
777
|
-
});
|
|
778
|
-
var StakingPosition = import_zod.z.object({
|
|
779
|
-
address: import_zod.z.string(),
|
|
780
|
-
owner: import_zod.z.string(),
|
|
781
|
-
staked: amountWithUsd,
|
|
782
|
-
unstaked: amountWithUsd,
|
|
783
|
-
claimedReward: amountWithUsd,
|
|
784
|
-
unclaimedReward: amountWithUsd,
|
|
785
|
-
rank: import_zod.z.nullable(import_zod.z.number()),
|
|
786
|
-
vesting: import_zod.z.object({
|
|
787
|
-
locked: amountWithUsd,
|
|
788
|
-
unlocked: amountWithUsd,
|
|
789
|
-
unlockRate: import_zod.z.coerce.bigint(),
|
|
790
|
-
unlockEverySeconds: import_zod.z.number(),
|
|
791
|
-
unlockCliffSeconds: import_zod.z.number(),
|
|
792
|
-
lockedAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
793
|
-
}),
|
|
794
|
-
lastUnstakedAt: import_zod.z.nullable(import_zod.z.coerce.date()),
|
|
795
|
-
withdrawAvailableAt: import_zod.z.nullable(import_zod.z.coerce.date())
|
|
796
|
-
});
|
|
797
|
-
var StakingLeaderboardPosition = import_zod.z.object({
|
|
798
|
-
rank: import_zod.z.number(),
|
|
799
|
-
address: import_zod.z.string(),
|
|
800
|
-
owner: import_zod.z.string(),
|
|
801
|
-
staked: amountWithUsd
|
|
802
|
-
});
|
|
803
|
-
var StakingLeaderboardPage = import_zod.z.object({
|
|
804
|
-
data: StakingLeaderboardPosition.array(),
|
|
805
|
-
meta: PaginationMeta
|
|
542
|
+
lowerLimitOrderPrice: import_zod6.z.number(),
|
|
543
|
+
upperLimitOrderPrice: import_zod6.z.number(),
|
|
544
|
+
entryPrice: import_zod6.z.number(),
|
|
545
|
+
mintA: Mint,
|
|
546
|
+
mintB: Mint,
|
|
547
|
+
pool: TunaPositionPoolSchema,
|
|
548
|
+
positionToken: TunaPositionPoolToken,
|
|
549
|
+
collateralToken: TunaPositionPoolToken,
|
|
550
|
+
marketMaker: PoolProviderSchema,
|
|
551
|
+
depositedCollateral: AmountWithUsdSchema,
|
|
552
|
+
initialDebt: AmountWithUsdSchema,
|
|
553
|
+
currentDebt: AmountWithUsdSchema,
|
|
554
|
+
total: AmountWithUsdSchema,
|
|
555
|
+
leverage: import_zod6.z.number(),
|
|
556
|
+
maxLeverage: import_zod6.z.number(),
|
|
557
|
+
liquidationPrice: import_zod6.z.number(),
|
|
558
|
+
pnlUsd: UsdPnlSchema,
|
|
559
|
+
openedAt: import_zod6.z.coerce.date(),
|
|
560
|
+
closedAt: import_zod6.z.nullable(import_zod6.z.coerce.date())
|
|
806
561
|
});
|
|
807
|
-
var
|
|
808
|
-
position: import_zod.z.string(),
|
|
809
|
-
action: StakingPositionHistoryActionTypeSchema,
|
|
810
|
-
txSignature: import_zod.z.string(),
|
|
811
|
-
amount: import_zod.z.coerce.bigint(),
|
|
812
|
-
time: import_zod.z.coerce.date()
|
|
813
|
-
});
|
|
814
|
-
var PoolPriceCandle = import_zod.z.object({
|
|
815
|
-
time: import_zod.z.number(),
|
|
816
|
-
open: import_zod.z.number(),
|
|
817
|
-
close: import_zod.z.number(),
|
|
818
|
-
high: import_zod.z.number(),
|
|
819
|
-
low: import_zod.z.number(),
|
|
820
|
-
volume: import_zod.z.number()
|
|
821
|
-
});
|
|
822
|
-
var FeesStatsGroup = import_zod.z.object({
|
|
823
|
-
time: import_zod.z.coerce.date(),
|
|
824
|
-
addLiquidityFees: import_zod.z.number(),
|
|
825
|
-
limitOrderFees: import_zod.z.number(),
|
|
826
|
-
yieldCompoundingFees: import_zod.z.number(),
|
|
827
|
-
liquidationFees: import_zod.z.number(),
|
|
828
|
-
totalLiquidationsNetworkFees: import_zod.z.number(),
|
|
829
|
-
totalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
830
|
-
totalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
831
|
-
failedNetworkFees: import_zod.z.number(),
|
|
832
|
-
processedNetworkFees: import_zod.z.number(),
|
|
833
|
-
totalCollectedFees: import_zod.z.number(),
|
|
834
|
-
totalNetworkFees: import_zod.z.number(),
|
|
835
|
-
jitoLiquidationFees: import_zod.z.number(),
|
|
836
|
-
jitoLimitOrderFees: import_zod.z.number(),
|
|
837
|
-
jitoYieldCompoundingFees: import_zod.z.number(),
|
|
838
|
-
runningAddLiquidityFees: import_zod.z.number(),
|
|
839
|
-
runningLimitOrderFees: import_zod.z.number(),
|
|
840
|
-
runningYieldCompoundingFees: import_zod.z.number(),
|
|
841
|
-
runningLiquidationFees: import_zod.z.number(),
|
|
842
|
-
runningTotalLiquidationsNetworkFees: import_zod.z.number(),
|
|
843
|
-
runningTotalLimitOrdersNetworkFees: import_zod.z.number(),
|
|
844
|
-
runningTotalYieldCompoundingNetworkFees: import_zod.z.number(),
|
|
845
|
-
runningFailedNetworkFees: import_zod.z.number(),
|
|
846
|
-
runningProcessedNetworkFees: import_zod.z.number(),
|
|
847
|
-
runningJitoLiquidationFees: import_zod.z.number(),
|
|
848
|
-
runningJitoLimitOrderFees: import_zod.z.number(),
|
|
849
|
-
runningJitoYieldCompoundingFees: import_zod.z.number(),
|
|
850
|
-
runningTotalCollectedFees: import_zod.z.number(),
|
|
851
|
-
runningTotalNetworkFees: import_zod.z.number()
|
|
852
|
-
});
|
|
853
|
-
var StakingRevenueStatsGroup = import_zod.z.object({
|
|
854
|
-
time: import_zod.z.coerce.date(),
|
|
855
|
-
totalDepositsUsd: import_zod.z.number(),
|
|
856
|
-
totalDepositsSol: import_zod.z.coerce.bigint(),
|
|
857
|
-
runningTotalDepositsUsd: import_zod.z.number(),
|
|
858
|
-
runningTotalDepositsSol: import_zod.z.coerce.bigint()
|
|
859
|
-
});
|
|
860
|
-
var IncreaseSpotPositionQuote = import_zod.z.object({
|
|
562
|
+
var IncreaseSpotPositionQuote = import_zod6.z.object({
|
|
861
563
|
/** Required collateral amount */
|
|
862
|
-
collateralAmount:
|
|
564
|
+
collateralAmount: import_zod6.z.coerce.bigint(),
|
|
863
565
|
/** Required amount to borrow */
|
|
864
|
-
borrowAmount:
|
|
566
|
+
borrowAmount: import_zod6.z.coerce.bigint(),
|
|
865
567
|
/** Estimated position size in the position token. */
|
|
866
|
-
estimatedAmount:
|
|
568
|
+
estimatedAmount: import_zod6.z.coerce.bigint(),
|
|
867
569
|
/** Swap input amount. */
|
|
868
|
-
swapInputAmount:
|
|
570
|
+
swapInputAmount: import_zod6.z.coerce.bigint(),
|
|
869
571
|
/** Minimum swap output amount according to the provided slippage. */
|
|
870
|
-
minSwapOutputAmount:
|
|
572
|
+
minSwapOutputAmount: import_zod6.z.coerce.bigint(),
|
|
871
573
|
/** Protocol fee in token A */
|
|
872
|
-
protocolFeeA:
|
|
574
|
+
protocolFeeA: import_zod6.z.coerce.bigint(),
|
|
873
575
|
/** Protocol fee in token B */
|
|
874
|
-
protocolFeeB:
|
|
576
|
+
protocolFeeB: import_zod6.z.coerce.bigint(),
|
|
875
577
|
/** Price impact in percents */
|
|
876
|
-
priceImpact:
|
|
578
|
+
priceImpact: import_zod6.z.number(),
|
|
877
579
|
/** Liquidation price */
|
|
878
|
-
|
|
580
|
+
liquidationPrice: import_zod6.z.number()
|
|
879
581
|
});
|
|
880
|
-
var DecreaseSpotPositionQuote =
|
|
582
|
+
var DecreaseSpotPositionQuote = import_zod6.z.object({
|
|
881
583
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
882
|
-
decreasePercent:
|
|
584
|
+
decreasePercent: import_zod6.z.number(),
|
|
883
585
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
884
586
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
885
587
|
*/
|
|
886
|
-
requiredSwapAmount:
|
|
588
|
+
requiredSwapAmount: import_zod6.z.coerce.bigint(),
|
|
887
589
|
/** Estimated total amount of the adjusted position */
|
|
888
|
-
estimatedAmount:
|
|
590
|
+
estimatedAmount: import_zod6.z.coerce.bigint(),
|
|
889
591
|
/** Estimated amount of the withdrawn collateral */
|
|
890
|
-
estimatedWithdrawnCollateral:
|
|
592
|
+
estimatedWithdrawnCollateral: import_zod6.z.coerce.bigint(),
|
|
891
593
|
/** Price impact in percents */
|
|
892
|
-
priceImpact:
|
|
594
|
+
priceImpact: import_zod6.z.number(),
|
|
893
595
|
/** Liquidation price */
|
|
894
|
-
|
|
596
|
+
liquidationPrice: import_zod6.z.number()
|
|
895
597
|
});
|
|
896
|
-
var CloseSpotPositionQuote =
|
|
598
|
+
var CloseSpotPositionQuote = import_zod6.z.object({
|
|
897
599
|
/** Position decrease percentage */
|
|
898
|
-
decreasePercent:
|
|
600
|
+
decreasePercent: import_zod6.z.number(),
|
|
899
601
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
900
602
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
901
603
|
*/
|
|
902
|
-
requiredSwapAmount:
|
|
604
|
+
requiredSwapAmount: import_zod6.z.coerce.bigint(),
|
|
903
605
|
/** Estimated amount of the withdrawn collateral */
|
|
904
|
-
estimatedWithdrawnCollateral:
|
|
606
|
+
estimatedWithdrawnCollateral: import_zod6.z.coerce.bigint(),
|
|
905
607
|
/** Price impact in percents */
|
|
906
|
-
priceImpact:
|
|
608
|
+
priceImpact: import_zod6.z.number()
|
|
907
609
|
});
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
610
|
+
|
|
611
|
+
// src/client/schemas/state_snapshot.ts
|
|
612
|
+
var import_zod7 = __toESM(require("zod"));
|
|
613
|
+
var PoolPriceUpdate = import_zod7.default.object({
|
|
614
|
+
pool: import_zod7.default.string(),
|
|
615
|
+
price: import_zod7.default.number(),
|
|
616
|
+
sqrtPrice: import_zod7.default.coerce.bigint(),
|
|
617
|
+
time: import_zod7.default.coerce.date()
|
|
618
|
+
});
|
|
619
|
+
var StateSnapshot = import_zod7.default.object({
|
|
620
|
+
slot: import_zod7.default.coerce.bigint(),
|
|
621
|
+
blockTime: import_zod7.default.coerce.date(),
|
|
622
|
+
poolPrices: import_zod7.default.optional(import_zod7.default.record(import_zod7.default.string(), PoolPriceUpdate)),
|
|
623
|
+
tunaSpotPositions: import_zod7.default.optional(import_zod7.default.array(TunaSpotPosition)),
|
|
624
|
+
tunaLpPositions: import_zod7.default.optional(import_zod7.default.array(TunaLpPositionDtoSchema)),
|
|
625
|
+
fusionLimitOrders: import_zod7.default.optional(import_zod7.default.array(LimitOrder))
|
|
915
626
|
});
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
627
|
+
|
|
628
|
+
// src/client/schemas.ts
|
|
629
|
+
var NotificationEntity = {
|
|
630
|
+
POOL_SWAP: "pool_swap",
|
|
631
|
+
POOL_PRICE: "pool_price",
|
|
632
|
+
ORDER_BOOK: "order_book",
|
|
633
|
+
TUNA_POSITION: "tuna_position",
|
|
634
|
+
TUNA_SPOT_POSITION: "tuna_spot_position",
|
|
635
|
+
LENDING_POSITION: "lending_position",
|
|
636
|
+
STAKING_POSITION: "staking_position",
|
|
637
|
+
FUSION_LIMIT_ORDER: "fusion_limit_order",
|
|
638
|
+
TRADE_HISTORY_ENTRY: "trade_history_entry",
|
|
639
|
+
ORDER_HISTORY_ENTRY: "order_history_entry",
|
|
640
|
+
STATE_SNAPSHOT: "state_snapshot"
|
|
641
|
+
};
|
|
642
|
+
var NotificationAction = {
|
|
643
|
+
CREATE: "create",
|
|
644
|
+
UPDATE: "update"
|
|
645
|
+
};
|
|
646
|
+
var TradeHistoryAction = {
|
|
647
|
+
SWAP: "swap",
|
|
648
|
+
LIMIT_ORDER_FILL: "limit_order_fill",
|
|
649
|
+
POSITION_INCREASE: "position_increase",
|
|
650
|
+
POSITION_DECREASE: "position_decrease",
|
|
651
|
+
TAKE_PROFIT: "take_profit",
|
|
652
|
+
STOP_LOSS: "stop_loss",
|
|
653
|
+
LIQUIDATION: "liquidation"
|
|
654
|
+
};
|
|
655
|
+
var TradeHistoryUIDirection = {
|
|
656
|
+
BUY: "buy",
|
|
657
|
+
SELL: "sell",
|
|
658
|
+
OPEN_LONG: "open_long",
|
|
659
|
+
CLOSE_LONG: "close_long",
|
|
660
|
+
OPEN_SHORT: "open_short",
|
|
661
|
+
CLOSE_SHORT: "close_short"
|
|
662
|
+
};
|
|
663
|
+
var OrderHistoryOrderType = {
|
|
664
|
+
MARKET: "market",
|
|
665
|
+
LIMIT: "limit",
|
|
666
|
+
TAKE_PROFIT_MARKET: "take_profit_market",
|
|
667
|
+
STOP_LOSS_MARKET: "stop_loss_market",
|
|
668
|
+
LIQUIDATION_MARKET: "liquidation_market"
|
|
669
|
+
};
|
|
670
|
+
var OrderHistoryStatus = {
|
|
671
|
+
OPEN: "open",
|
|
672
|
+
PARTIALLY_FILLED: "partially_filled",
|
|
673
|
+
FILLED: "filled",
|
|
674
|
+
CANCELLED: "cancelled",
|
|
675
|
+
CLAIMED: "claimed",
|
|
676
|
+
REJECTED: "rejected"
|
|
677
|
+
};
|
|
678
|
+
var OrderHistoryUIDirection = {
|
|
679
|
+
BUY: "buy",
|
|
680
|
+
SELL: "sell",
|
|
681
|
+
LONG: "long",
|
|
682
|
+
SHORT: "short"
|
|
683
|
+
};
|
|
684
|
+
var StakingPositionHistoryActionType = {
|
|
685
|
+
STAKE: "stake",
|
|
686
|
+
UNSTAKE: "unstake",
|
|
687
|
+
WITHDRAW: "withdraw",
|
|
688
|
+
CLAIM_REWARDS: "claim_rewards",
|
|
689
|
+
COMPOUND_REWARDS: "compound_rewards"
|
|
690
|
+
};
|
|
691
|
+
var PoolSubscriptionTopic = {
|
|
692
|
+
ORDER_BOOK: "order_book",
|
|
693
|
+
POOL_PRICES: "pool_prices",
|
|
694
|
+
POOL_SWAPS: "pool_swaps"
|
|
695
|
+
};
|
|
696
|
+
var WalletSubscriptionTopic = {
|
|
697
|
+
TUNA_POSITIONS: "tuna_positions",
|
|
698
|
+
TUNA_SPOT_POSITIONS: "tuna_spot_positions",
|
|
699
|
+
LENDING_POSITIONS: "lending_positions",
|
|
700
|
+
FUSION_LIMIT_ORDERS: "fusion_limit_orders",
|
|
701
|
+
STAKING_POSITION: "staking_position",
|
|
702
|
+
TRADE_HISTORY: "trade_history",
|
|
703
|
+
ORDER_HISTORY: "order_history"
|
|
704
|
+
};
|
|
705
|
+
var NotificationEntitySchema = import_zod8.z.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
706
|
+
var NotificationActionSchema = import_zod8.z.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
707
|
+
var TradeHistoryActionSchema = import_zod8.z.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
708
|
+
var TradeHistoryUIDirectionSchema = import_zod8.z.enum([
|
|
709
|
+
TradeHistoryUIDirection.BUY,
|
|
710
|
+
...Object.values(TradeHistoryUIDirection)
|
|
711
|
+
]);
|
|
712
|
+
var OrderHistoryOrderTypeSchema = import_zod8.z.enum([
|
|
713
|
+
OrderHistoryOrderType.MARKET,
|
|
714
|
+
...Object.values(OrderHistoryOrderType)
|
|
715
|
+
]);
|
|
716
|
+
var OrderHistoryStatusSchema = import_zod8.z.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
717
|
+
var OrderHistoryUIDirectionSchema = import_zod8.z.enum([
|
|
718
|
+
OrderHistoryUIDirection.BUY,
|
|
719
|
+
...Object.values(OrderHistoryUIDirection)
|
|
720
|
+
]);
|
|
721
|
+
var StakingPositionHistoryActionTypeSchema = import_zod8.z.enum([
|
|
722
|
+
StakingPositionHistoryActionType.STAKE,
|
|
723
|
+
...Object.values(StakingPositionHistoryActionType)
|
|
724
|
+
]);
|
|
725
|
+
var PoolSubscriptionTopicSchema = import_zod8.z.enum([
|
|
726
|
+
PoolSubscriptionTopic.ORDER_BOOK,
|
|
727
|
+
...Object.values(PoolSubscriptionTopic)
|
|
728
|
+
]);
|
|
729
|
+
var WalletSubscriptionTopicSchema = import_zod8.z.enum([
|
|
730
|
+
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
731
|
+
...Object.values(WalletSubscriptionTopic)
|
|
732
|
+
]);
|
|
733
|
+
var PaginationMeta = import_zod8.z.object({
|
|
734
|
+
total: import_zod8.z.number()
|
|
735
|
+
});
|
|
736
|
+
var Market = import_zod8.z.object({
|
|
737
|
+
address: import_zod8.z.string(),
|
|
738
|
+
addressLookupTable: import_zod8.z.string(),
|
|
739
|
+
poolAddress: import_zod8.z.string(),
|
|
740
|
+
poolFeeRate: import_zod8.z.number(),
|
|
741
|
+
provider: PoolProviderSchema,
|
|
742
|
+
maxLeverage: import_zod8.z.number(),
|
|
743
|
+
maxSwapSlippage: import_zod8.z.number(),
|
|
744
|
+
protocolFee: import_zod8.z.number(),
|
|
745
|
+
rebalanceProtocolFee: import_zod8.z.number(),
|
|
746
|
+
protocolFeeOnCollateral: import_zod8.z.number(),
|
|
747
|
+
liquidationFee: import_zod8.z.number(),
|
|
748
|
+
liquidationThreshold: import_zod8.z.number(),
|
|
749
|
+
oraclePriceDeviationThreshold: import_zod8.z.number(),
|
|
750
|
+
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
751
|
+
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
752
|
+
borrowedFundsA: AmountWithUsdSchema,
|
|
753
|
+
borrowedFundsB: AmountWithUsdSchema,
|
|
754
|
+
availableBorrowA: AmountWithUsdSchema,
|
|
755
|
+
availableBorrowB: AmountWithUsdSchema,
|
|
756
|
+
borrowLimitA: AmountWithUsdSchema,
|
|
757
|
+
borrowLimitB: AmountWithUsdSchema,
|
|
758
|
+
disabled: import_zod8.z.boolean(),
|
|
759
|
+
createdAt: import_zod8.z.coerce.date()
|
|
760
|
+
});
|
|
761
|
+
var TokenOraclePrice = import_zod8.z.object({
|
|
762
|
+
mint: import_zod8.z.string(),
|
|
763
|
+
price: import_zod8.z.coerce.bigint(),
|
|
764
|
+
decimals: import_zod8.z.number(),
|
|
765
|
+
time: import_zod8.z.coerce.date()
|
|
766
|
+
});
|
|
767
|
+
var Vault = import_zod8.z.object({
|
|
768
|
+
address: import_zod8.z.string(),
|
|
769
|
+
mint: import_zod8.z.string(),
|
|
770
|
+
depositedFunds: AmountWithUsdSchema,
|
|
771
|
+
borrowedFunds: AmountWithUsdSchema,
|
|
772
|
+
supplyLimit: AmountWithUsdSchema,
|
|
773
|
+
borrowedShares: import_zod8.z.coerce.bigint(),
|
|
774
|
+
depositedShares: import_zod8.z.coerce.bigint(),
|
|
775
|
+
supplyApy: import_zod8.z.number(),
|
|
776
|
+
borrowApy: import_zod8.z.number(),
|
|
777
|
+
interestRate: import_zod8.z.coerce.bigint(),
|
|
778
|
+
utilization: import_zod8.z.number(),
|
|
779
|
+
pythOracleFeedId: import_zod8.z.string(),
|
|
780
|
+
pythOraclePriceUpdate: import_zod8.z.string()
|
|
781
|
+
});
|
|
782
|
+
var VaultHistoricalStats = import_zod8.z.object({
|
|
783
|
+
date: import_zod8.z.preprocess((val, ctx) => {
|
|
784
|
+
if (typeof val === "string") {
|
|
785
|
+
const [year, month, day] = val.split("-").map(Number);
|
|
786
|
+
return new Date(year, month - 1, day);
|
|
787
|
+
}
|
|
788
|
+
ctx.addIssue({
|
|
789
|
+
code: "custom",
|
|
790
|
+
message: "Not a valid date string"
|
|
791
|
+
});
|
|
792
|
+
return import_zod8.z.NEVER;
|
|
793
|
+
}, import_zod8.z.date()),
|
|
794
|
+
supply: AmountWithUsdSchema,
|
|
795
|
+
borrow: AmountWithUsdSchema,
|
|
796
|
+
supplyApy: import_zod8.z.number(),
|
|
797
|
+
borrowApr: import_zod8.z.number()
|
|
798
|
+
});
|
|
799
|
+
var Pool = import_zod8.z.object({
|
|
800
|
+
address: import_zod8.z.string(),
|
|
801
|
+
provider: PoolProviderSchema,
|
|
802
|
+
tokenAMint: import_zod8.z.string(),
|
|
803
|
+
tokenBMint: import_zod8.z.string(),
|
|
804
|
+
tokenAVault: import_zod8.z.string(),
|
|
805
|
+
tokenBVault: import_zod8.z.string(),
|
|
806
|
+
tvlUsdc: import_zod8.z.coerce.number(),
|
|
807
|
+
priceChange24H: import_zod8.z.number(),
|
|
808
|
+
tickSpacing: import_zod8.z.number(),
|
|
809
|
+
feeRate: import_zod8.z.number(),
|
|
810
|
+
olpFeeRate: import_zod8.z.nullable(import_zod8.z.number()),
|
|
811
|
+
protocolFeeRate: import_zod8.z.number(),
|
|
812
|
+
liquidity: import_zod8.z.coerce.bigint(),
|
|
813
|
+
sqrtPrice: import_zod8.z.coerce.bigint(),
|
|
814
|
+
tickCurrentIndex: import_zod8.z.number(),
|
|
815
|
+
stats: import_zod8.z.object({
|
|
816
|
+
"24h": import_zod8.z.object({
|
|
817
|
+
volume: import_zod8.z.coerce.number(),
|
|
818
|
+
fees: import_zod8.z.coerce.number(),
|
|
819
|
+
rewards: import_zod8.z.coerce.number(),
|
|
820
|
+
yieldOverTvl: import_zod8.z.coerce.number()
|
|
821
|
+
}),
|
|
822
|
+
"7d": import_zod8.z.object({
|
|
823
|
+
volume: import_zod8.z.coerce.number(),
|
|
824
|
+
fees: import_zod8.z.coerce.number(),
|
|
825
|
+
rewards: import_zod8.z.coerce.number(),
|
|
826
|
+
yieldOverTvl: import_zod8.z.coerce.number()
|
|
827
|
+
}),
|
|
828
|
+
"30d": import_zod8.z.object({
|
|
829
|
+
volume: import_zod8.z.coerce.number(),
|
|
830
|
+
fees: import_zod8.z.coerce.number(),
|
|
831
|
+
rewards: import_zod8.z.coerce.number(),
|
|
832
|
+
yieldOverTvl: import_zod8.z.coerce.number()
|
|
833
|
+
})
|
|
834
|
+
})
|
|
835
|
+
});
|
|
836
|
+
var Tick = import_zod8.z.object({
|
|
837
|
+
index: import_zod8.z.number(),
|
|
838
|
+
liquidity: import_zod8.z.coerce.bigint()
|
|
839
|
+
});
|
|
840
|
+
var PoolTicks = import_zod8.z.object({
|
|
841
|
+
tickSpacing: import_zod8.z.number(),
|
|
842
|
+
ticks: Tick.array()
|
|
843
|
+
});
|
|
844
|
+
var LendingPosition = import_zod8.z.object({
|
|
845
|
+
address: import_zod8.z.string(),
|
|
846
|
+
authority: import_zod8.z.string(),
|
|
847
|
+
mint: import_zod8.z.string(),
|
|
848
|
+
vault: import_zod8.z.string(),
|
|
849
|
+
shares: import_zod8.z.coerce.bigint(),
|
|
850
|
+
funds: AmountWithUsdSchema,
|
|
851
|
+
earned: AmountWithUsdSchema
|
|
852
|
+
});
|
|
853
|
+
var PoolSwap = import_zod8.z.object({
|
|
854
|
+
id: import_zod8.z.string(),
|
|
855
|
+
amountIn: import_zod8.z.coerce.bigint(),
|
|
856
|
+
amountOut: import_zod8.z.coerce.bigint(),
|
|
857
|
+
amountUsd: import_zod8.z.number(),
|
|
858
|
+
aToB: import_zod8.z.boolean(),
|
|
859
|
+
pool: import_zod8.z.string(),
|
|
860
|
+
time: import_zod8.z.coerce.date()
|
|
861
|
+
});
|
|
862
|
+
var OrderBookEntry = import_zod8.z.object({
|
|
863
|
+
concentratedAmount: import_zod8.z.coerce.bigint(),
|
|
864
|
+
concentratedAmountQuote: import_zod8.z.coerce.bigint(),
|
|
865
|
+
concentratedTotal: import_zod8.z.coerce.bigint(),
|
|
866
|
+
concentratedTotalQuote: import_zod8.z.coerce.bigint(),
|
|
867
|
+
limitAmount: import_zod8.z.coerce.bigint(),
|
|
868
|
+
limitAmountQuote: import_zod8.z.coerce.bigint(),
|
|
869
|
+
limitTotal: import_zod8.z.coerce.bigint(),
|
|
870
|
+
limitTotalQuote: import_zod8.z.coerce.bigint(),
|
|
871
|
+
price: import_zod8.z.number(),
|
|
872
|
+
askSide: import_zod8.z.boolean()
|
|
873
|
+
});
|
|
874
|
+
var OrderBook = import_zod8.z.object({
|
|
875
|
+
entries: OrderBookEntry.array(),
|
|
876
|
+
poolPrice: import_zod8.z.number()
|
|
877
|
+
});
|
|
878
|
+
var TradeHistoryEntry = import_zod8.z.object({
|
|
879
|
+
// Internal entry ID
|
|
880
|
+
id: import_zod8.z.string(),
|
|
881
|
+
pool: import_zod8.z.string(),
|
|
882
|
+
authority: import_zod8.z.string(),
|
|
883
|
+
aToB: import_zod8.z.boolean(),
|
|
884
|
+
// Trade action which created entry
|
|
885
|
+
action: TradeHistoryActionSchema,
|
|
886
|
+
// Trade direction formatted for ui display
|
|
887
|
+
uiDirection: TradeHistoryUIDirectionSchema,
|
|
888
|
+
// Trade price formatted for ui display
|
|
889
|
+
uiPrice: import_zod8.z.number(),
|
|
890
|
+
baseToken: AmountWithUsdSchema,
|
|
891
|
+
quoteToken: AmountWithUsdSchema,
|
|
892
|
+
fee: AmountWithUsdSchema,
|
|
893
|
+
pnl: import_zod8.z.nullable(
|
|
894
|
+
import_zod8.z.object({
|
|
895
|
+
usd: import_zod8.z.number(),
|
|
896
|
+
bps: import_zod8.z.number()
|
|
897
|
+
})
|
|
898
|
+
),
|
|
899
|
+
txSignature: import_zod8.z.nullable(import_zod8.z.string()),
|
|
900
|
+
positionAddress: import_zod8.z.nullable(import_zod8.z.string()),
|
|
901
|
+
slot: import_zod8.z.coerce.bigint(),
|
|
902
|
+
ts: import_zod8.z.coerce.date()
|
|
903
|
+
});
|
|
904
|
+
var OrderHistoryEntry = import_zod8.z.object({
|
|
905
|
+
// Internal entry ID
|
|
906
|
+
id: import_zod8.z.string(),
|
|
907
|
+
pool: import_zod8.z.string(),
|
|
908
|
+
authority: import_zod8.z.string(),
|
|
909
|
+
orderType: OrderHistoryOrderTypeSchema,
|
|
910
|
+
isReduceOnly: import_zod8.z.nullable(import_zod8.z.boolean()),
|
|
911
|
+
aToB: import_zod8.z.boolean(),
|
|
912
|
+
uiDirection: OrderHistoryUIDirectionSchema,
|
|
913
|
+
uiPrice: import_zod8.z.nullable(import_zod8.z.number()),
|
|
914
|
+
uiExecutionPrice: import_zod8.z.nullable(import_zod8.z.number()),
|
|
915
|
+
status: OrderHistoryStatusSchema,
|
|
916
|
+
baseToken: AmountWithUsdSchema,
|
|
917
|
+
quoteToken: AmountWithUsdSchema,
|
|
918
|
+
baseTokenConsumedAmount: import_zod8.z.nullable(AmountWithUsdSchema),
|
|
919
|
+
quoteTokenFilledAmount: import_zod8.z.nullable(AmountWithUsdSchema),
|
|
920
|
+
txSignature: import_zod8.z.nullable(import_zod8.z.string()),
|
|
921
|
+
positionAddress: import_zod8.z.nullable(import_zod8.z.string()),
|
|
922
|
+
slot: import_zod8.z.coerce.bigint(),
|
|
923
|
+
ts: import_zod8.z.coerce.date()
|
|
924
|
+
});
|
|
925
|
+
var StakingTreasury = import_zod8.z.object({
|
|
926
|
+
address: import_zod8.z.string(),
|
|
927
|
+
stakedTokenMint: import_zod8.z.string(),
|
|
928
|
+
rewardTokenMint: import_zod8.z.string(),
|
|
929
|
+
apy: import_zod8.z.number(),
|
|
930
|
+
uniqueStakers: import_zod8.z.number(),
|
|
931
|
+
totalStaked: AmountWithUsdSchema,
|
|
932
|
+
totalReward: AmountWithUsdSchema,
|
|
933
|
+
unstakeCooldownSeconds: import_zod8.z.number(),
|
|
934
|
+
isStakingEnabled: import_zod8.z.boolean(),
|
|
935
|
+
isUnstakingEnabled: import_zod8.z.boolean(),
|
|
936
|
+
isWithdrawEnabled: import_zod8.z.boolean()
|
|
937
|
+
});
|
|
938
|
+
var StakingPosition = import_zod8.z.object({
|
|
939
|
+
address: import_zod8.z.string(),
|
|
940
|
+
owner: import_zod8.z.string(),
|
|
941
|
+
staked: AmountWithUsdSchema,
|
|
942
|
+
unstaked: AmountWithUsdSchema,
|
|
943
|
+
claimedReward: AmountWithUsdSchema,
|
|
944
|
+
unclaimedReward: AmountWithUsdSchema,
|
|
945
|
+
rank: import_zod8.z.nullable(import_zod8.z.number()),
|
|
946
|
+
vesting: import_zod8.z.object({
|
|
947
|
+
locked: AmountWithUsdSchema,
|
|
948
|
+
unlocked: AmountWithUsdSchema,
|
|
949
|
+
unlockRate: import_zod8.z.coerce.bigint(),
|
|
950
|
+
unlockEverySeconds: import_zod8.z.number(),
|
|
951
|
+
unlockCliffSeconds: import_zod8.z.number(),
|
|
952
|
+
lockedAt: import_zod8.z.nullable(import_zod8.z.coerce.date())
|
|
953
|
+
}),
|
|
954
|
+
lastUnstakedAt: import_zod8.z.nullable(import_zod8.z.coerce.date()),
|
|
955
|
+
withdrawAvailableAt: import_zod8.z.nullable(import_zod8.z.coerce.date())
|
|
956
|
+
});
|
|
957
|
+
var StakingLeaderboardPosition = import_zod8.z.object({
|
|
958
|
+
rank: import_zod8.z.number(),
|
|
959
|
+
address: import_zod8.z.string(),
|
|
960
|
+
owner: import_zod8.z.string(),
|
|
961
|
+
staked: AmountWithUsdSchema
|
|
962
|
+
});
|
|
963
|
+
var StakingLeaderboardPage = import_zod8.z.object({
|
|
964
|
+
data: StakingLeaderboardPosition.array(),
|
|
965
|
+
meta: PaginationMeta
|
|
966
|
+
});
|
|
967
|
+
var StakingPositionHistoryAction = import_zod8.z.object({
|
|
968
|
+
position: import_zod8.z.string(),
|
|
969
|
+
action: StakingPositionHistoryActionTypeSchema,
|
|
970
|
+
txSignature: import_zod8.z.string(),
|
|
971
|
+
amount: import_zod8.z.coerce.bigint(),
|
|
972
|
+
time: import_zod8.z.coerce.date()
|
|
973
|
+
});
|
|
974
|
+
var PoolPriceCandle = import_zod8.z.object({
|
|
975
|
+
time: import_zod8.z.number(),
|
|
976
|
+
open: import_zod8.z.number(),
|
|
977
|
+
close: import_zod8.z.number(),
|
|
978
|
+
high: import_zod8.z.number(),
|
|
979
|
+
low: import_zod8.z.number(),
|
|
980
|
+
volume: import_zod8.z.number()
|
|
981
|
+
});
|
|
982
|
+
var FeesStatsGroup = import_zod8.z.object({
|
|
983
|
+
time: import_zod8.z.coerce.date(),
|
|
984
|
+
addLiquidityFees: import_zod8.z.number(),
|
|
985
|
+
limitOrderFees: import_zod8.z.number(),
|
|
986
|
+
yieldCompoundingFees: import_zod8.z.number(),
|
|
987
|
+
liquidationFees: import_zod8.z.number(),
|
|
988
|
+
totalLiquidationsNetworkFees: import_zod8.z.number(),
|
|
989
|
+
totalLimitOrdersNetworkFees: import_zod8.z.number(),
|
|
990
|
+
totalYieldCompoundingNetworkFees: import_zod8.z.number(),
|
|
991
|
+
failedNetworkFees: import_zod8.z.number(),
|
|
992
|
+
processedNetworkFees: import_zod8.z.number(),
|
|
993
|
+
totalCollectedFees: import_zod8.z.number(),
|
|
994
|
+
totalNetworkFees: import_zod8.z.number(),
|
|
995
|
+
jitoLiquidationFees: import_zod8.z.number(),
|
|
996
|
+
jitoLimitOrderFees: import_zod8.z.number(),
|
|
997
|
+
jitoYieldCompoundingFees: import_zod8.z.number(),
|
|
998
|
+
runningAddLiquidityFees: import_zod8.z.number(),
|
|
999
|
+
runningLimitOrderFees: import_zod8.z.number(),
|
|
1000
|
+
runningYieldCompoundingFees: import_zod8.z.number(),
|
|
1001
|
+
runningLiquidationFees: import_zod8.z.number(),
|
|
1002
|
+
runningTotalLiquidationsNetworkFees: import_zod8.z.number(),
|
|
1003
|
+
runningTotalLimitOrdersNetworkFees: import_zod8.z.number(),
|
|
1004
|
+
runningTotalYieldCompoundingNetworkFees: import_zod8.z.number(),
|
|
1005
|
+
runningFailedNetworkFees: import_zod8.z.number(),
|
|
1006
|
+
runningProcessedNetworkFees: import_zod8.z.number(),
|
|
1007
|
+
runningJitoLiquidationFees: import_zod8.z.number(),
|
|
1008
|
+
runningJitoLimitOrderFees: import_zod8.z.number(),
|
|
1009
|
+
runningJitoYieldCompoundingFees: import_zod8.z.number(),
|
|
1010
|
+
runningTotalCollectedFees: import_zod8.z.number(),
|
|
1011
|
+
runningTotalNetworkFees: import_zod8.z.number()
|
|
1012
|
+
});
|
|
1013
|
+
var StakingRevenueStatsGroup = import_zod8.z.object({
|
|
1014
|
+
time: import_zod8.z.coerce.date(),
|
|
1015
|
+
totalDepositsUsd: import_zod8.z.number(),
|
|
1016
|
+
totalDepositsSol: import_zod8.z.coerce.bigint(),
|
|
1017
|
+
runningTotalDepositsUsd: import_zod8.z.number(),
|
|
1018
|
+
runningTotalDepositsSol: import_zod8.z.coerce.bigint()
|
|
1019
|
+
});
|
|
1020
|
+
var SwapQuoteByInput = import_zod8.z.object({
|
|
1021
|
+
estimatedAmountOut: import_zod8.z.coerce.bigint(),
|
|
1022
|
+
minAmountOut: import_zod8.z.coerce.bigint(),
|
|
1023
|
+
feeAmount: import_zod8.z.coerce.bigint(),
|
|
1024
|
+
feeUsd: import_zod8.z.number(),
|
|
921
1025
|
/** Price impact in percents */
|
|
922
|
-
priceImpact:
|
|
1026
|
+
priceImpact: import_zod8.z.number()
|
|
923
1027
|
});
|
|
924
|
-
var
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1028
|
+
var SwapQuoteByOutput = import_zod8.z.object({
|
|
1029
|
+
estimatedAmountIn: import_zod8.z.coerce.bigint(),
|
|
1030
|
+
maxAmountIn: import_zod8.z.coerce.bigint(),
|
|
1031
|
+
feeAmount: import_zod8.z.coerce.bigint(),
|
|
1032
|
+
feeUsd: import_zod8.z.number(),
|
|
1033
|
+
/** Price impact in percents */
|
|
1034
|
+
priceImpact: import_zod8.z.number()
|
|
931
1035
|
});
|
|
932
|
-
var LimitOrderQuoteByInput =
|
|
933
|
-
amountOut:
|
|
1036
|
+
var LimitOrderQuoteByInput = import_zod8.z.object({
|
|
1037
|
+
amountOut: import_zod8.z.coerce.bigint()
|
|
934
1038
|
});
|
|
935
|
-
var LimitOrderQuoteByOutput =
|
|
936
|
-
amountIn:
|
|
1039
|
+
var LimitOrderQuoteByOutput = import_zod8.z.object({
|
|
1040
|
+
amountIn: import_zod8.z.coerce.bigint()
|
|
937
1041
|
});
|
|
938
|
-
var TradableAmount =
|
|
939
|
-
var UpdateStreamSubscriptionResult =
|
|
940
|
-
status:
|
|
1042
|
+
var TradableAmount = AmountWithUsdSchema;
|
|
1043
|
+
var UpdateStreamSubscriptionResult = import_zod8.z.object({
|
|
1044
|
+
status: import_zod8.z.string()
|
|
941
1045
|
});
|
|
942
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
1046
|
+
var createNotificationSchema = (dataSchema, metaSchema) => import_zod8.z.object({
|
|
943
1047
|
entity: NotificationEntitySchema,
|
|
944
1048
|
action: NotificationActionSchema,
|
|
945
1049
|
data: dataSchema,
|
|
946
|
-
id:
|
|
947
|
-
authority:
|
|
948
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
1050
|
+
id: import_zod8.z.string(),
|
|
1051
|
+
authority: import_zod8.z.nullish(import_zod8.z.string()),
|
|
1052
|
+
...metaSchema ? { meta: metaSchema } : { meta: import_zod8.z.undefined().nullable() }
|
|
949
1053
|
});
|
|
950
|
-
var OrderBookNotificationMeta =
|
|
951
|
-
pool:
|
|
952
|
-
priceStep:
|
|
953
|
-
inverted:
|
|
1054
|
+
var OrderBookNotificationMeta = import_zod8.z.object({
|
|
1055
|
+
pool: import_zod8.z.string(),
|
|
1056
|
+
priceStep: import_zod8.z.number(),
|
|
1057
|
+
inverted: import_zod8.z.boolean()
|
|
954
1058
|
});
|
|
955
1059
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
956
1060
|
var PoolPriceUpdateNotification = createNotificationSchema(PoolPriceUpdate);
|
|
957
1061
|
var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
|
|
958
|
-
var TunaPositionNotification = createNotificationSchema(
|
|
1062
|
+
var TunaPositionNotification = createNotificationSchema(TunaPositionLegacy);
|
|
959
1063
|
var TunaSpotPositionNotification = createNotificationSchema(TunaSpotPosition);
|
|
960
1064
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|
|
961
1065
|
var LimitOrderNotification = createNotificationSchema(LimitOrder);
|
|
@@ -1133,11 +1237,11 @@ var TunaApiClient = class {
|
|
|
1133
1237
|
}
|
|
1134
1238
|
async getUserTunaPositions(userAddress) {
|
|
1135
1239
|
const url = this.buildURL(`users/${userAddress}/tuna-positions`);
|
|
1136
|
-
return await this.httpRequest(url,
|
|
1240
|
+
return await this.httpRequest(url, TunaLpPositionDtoSchema.array());
|
|
1137
1241
|
}
|
|
1138
1242
|
async getUserTunaPositionByAddress(userAddress, tunaPositionAddress) {
|
|
1139
1243
|
const url = this.buildURL(`users/${userAddress}/tuna-positions/${tunaPositionAddress}`);
|
|
1140
|
-
return await this.httpRequest(url,
|
|
1244
|
+
return await this.httpRequest(url, TunaLpPositionDtoSchema);
|
|
1141
1245
|
}
|
|
1142
1246
|
async getUserLpPositions(userAddress, options) {
|
|
1143
1247
|
const query = {};
|
|
@@ -1166,7 +1270,7 @@ var TunaApiClient = class {
|
|
|
1166
1270
|
}
|
|
1167
1271
|
}
|
|
1168
1272
|
const url = this.appendUrlSearchParams(this.buildURL(`users/${userAddress}/lp-positions`), query);
|
|
1169
|
-
return await this.httpRequest(url,
|
|
1273
|
+
return await this.httpRequest(url, TunaLpPositionHistorical.array());
|
|
1170
1274
|
}
|
|
1171
1275
|
async getUserLpPositionActions(userAddress, positionAddress) {
|
|
1172
1276
|
const url = this.buildURL(`users/${userAddress}/lp-positions/${positionAddress}/actions`);
|