@crypticdot/defituna-api 1.10.1 → 1.10.3
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 +77 -41
- package/dist/index.d.ts +77 -41
- package/dist/index.js +442 -444
- package/dist/index.mjs +418 -420
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -143,7 +143,6 @@ __export(schemas_exports, {
|
|
|
143
143
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
144
144
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
145
145
|
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
146
|
-
TunaPositionMintSchema: () => TunaPositionMintSchema,
|
|
147
146
|
TunaPositionNotification: () => TunaPositionNotification,
|
|
148
147
|
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
149
148
|
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
@@ -162,7 +161,7 @@ __export(schemas_exports, {
|
|
|
162
161
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
163
162
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
164
163
|
});
|
|
165
|
-
var
|
|
164
|
+
var import_zod8 = require("zod");
|
|
166
165
|
|
|
167
166
|
// src/client/schemas/basic.ts
|
|
168
167
|
var import_zod = require("zod");
|
|
@@ -214,25 +213,30 @@ var LimitOrder = import_zod2.z.object({
|
|
|
214
213
|
});
|
|
215
214
|
|
|
216
215
|
// src/client/schemas/lp_positions.ts
|
|
217
|
-
var
|
|
216
|
+
var import_zod5 = __toESM(require("zod"));
|
|
218
217
|
|
|
219
|
-
// src/client/schemas/
|
|
220
|
-
var import_zod3 =
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
-
symbol: import_zod3.
|
|
224
|
-
|
|
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()
|
|
225
226
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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()
|
|
230
234
|
});
|
|
231
235
|
var TunaPositionPoolToken = {
|
|
232
236
|
A: "a",
|
|
233
237
|
B: "b"
|
|
234
238
|
};
|
|
235
|
-
var TunaPositionPoolTokenSchema =
|
|
239
|
+
var TunaPositionPoolTokenSchema = import_zod4.default.enum(Object.values(TunaPositionPoolToken));
|
|
236
240
|
|
|
237
241
|
// src/client/schemas/lp_positions.ts
|
|
238
242
|
var LpPositionLimitOrderSwap = {
|
|
@@ -265,57 +269,57 @@ var LpPositionsActionType = {
|
|
|
265
269
|
SET_FLAGS: "set_flags",
|
|
266
270
|
SET_REBALANCE_THRESHOLD: "set_rebalance_threshold"
|
|
267
271
|
};
|
|
268
|
-
var LpPositionLimitOrderSwapSchema =
|
|
269
|
-
var LpPositionAutoCompoundSchema =
|
|
270
|
-
var LpPositionRebalanceSchema =
|
|
271
|
-
var LpPositionsActionTypeSchema =
|
|
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));
|
|
272
276
|
var TunaPositionState = {
|
|
273
277
|
OPEN: "open",
|
|
274
278
|
LIQUIDATED: "liquidated",
|
|
275
279
|
CLOSED_BY_LIMIT_ORDER: "closed_by_limit_order",
|
|
276
280
|
CLOSED: "closed"
|
|
277
281
|
};
|
|
278
|
-
var TunaPositionStateSchema =
|
|
282
|
+
var TunaPositionStateSchema = import_zod5.default.enum([TunaPositionState.OPEN, ...Object.values(TunaPositionState)]);
|
|
279
283
|
var TunaLpPositionAutoCompounding = {
|
|
280
284
|
WITH_LEVERAGE: "with_leverage",
|
|
281
285
|
WITHOUT_LEVERAGE: "without_leverage"
|
|
282
286
|
};
|
|
283
|
-
var TunaLpPositionAutoCompoundingSchema =
|
|
287
|
+
var TunaLpPositionAutoCompoundingSchema = import_zod5.default.enum(
|
|
284
288
|
Object.values(TunaLpPositionAutoCompounding)
|
|
285
289
|
);
|
|
286
|
-
var TunaPositionTokenPnlSchema =
|
|
287
|
-
amount:
|
|
288
|
-
bps:
|
|
289
|
-
});
|
|
290
|
-
var TunaLpPositionFlagsSchema =
|
|
291
|
-
lowerLimitOrderSwapToToken:
|
|
292
|
-
upperLimitOrderSwapToToken:
|
|
293
|
-
autoCompounding:
|
|
294
|
-
autoRebalancing:
|
|
295
|
-
});
|
|
296
|
-
var TunaLpPositionDtoSchema =
|
|
297
|
-
address:
|
|
298
|
-
authority:
|
|
299
|
-
version:
|
|
290
|
+
var TunaPositionTokenPnlSchema = import_zod5.default.object({
|
|
291
|
+
amount: import_zod5.default.coerce.bigint(),
|
|
292
|
+
bps: import_zod5.default.number()
|
|
293
|
+
});
|
|
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()
|
|
299
|
+
});
|
|
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(),
|
|
300
304
|
state: TunaPositionStateSchema,
|
|
301
|
-
positionMint:
|
|
302
|
-
liquidity:
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
lowerLimitOrderPrice:
|
|
306
|
-
upperLimitOrderPrice:
|
|
307
|
-
entryPrice:
|
|
305
|
+
positionMint: import_zod5.default.string(),
|
|
306
|
+
liquidity: import_zod5.default.coerce.bigint(),
|
|
307
|
+
tickLowerIndex: import_zod5.default.number(),
|
|
308
|
+
tickUpperIndex: import_zod5.default.number(),
|
|
309
|
+
lowerLimitOrderPrice: import_zod5.default.number(),
|
|
310
|
+
upperLimitOrderPrice: import_zod5.default.number(),
|
|
311
|
+
entryPrice: import_zod5.default.number(),
|
|
308
312
|
flags: TunaLpPositionFlagsSchema,
|
|
309
|
-
mintA:
|
|
310
|
-
mintB:
|
|
313
|
+
mintA: Mint,
|
|
314
|
+
mintB: Mint,
|
|
311
315
|
pool: TunaPositionPoolSchema,
|
|
312
316
|
marketMaker: PoolProviderSchema,
|
|
313
317
|
depositedCollateralA: AmountWithUsdSchema,
|
|
314
318
|
depositedCollateralB: AmountWithUsdSchema,
|
|
315
|
-
leverage:
|
|
316
|
-
maxLeverage:
|
|
317
|
-
liquidationPriceLower:
|
|
318
|
-
liquidationPriceUpper:
|
|
319
|
+
leverage: import_zod5.default.number(),
|
|
320
|
+
maxLeverage: import_zod5.default.number(),
|
|
321
|
+
liquidationPriceLower: import_zod5.default.number(),
|
|
322
|
+
liquidationPriceUpper: import_zod5.default.number(),
|
|
319
323
|
initialDebtA: AmountWithUsdSchema,
|
|
320
324
|
initialDebtB: AmountWithUsdSchema,
|
|
321
325
|
currentDebtA: AmountWithUsdSchema,
|
|
@@ -331,50 +335,50 @@ var TunaLpPositionDtoSchema = import_zod4.default.object({
|
|
|
331
335
|
pnlA: TokensPnlSchema,
|
|
332
336
|
pnlB: TokensPnlSchema,
|
|
333
337
|
pnlUsd: UsdPnlSchema,
|
|
334
|
-
openedAt:
|
|
335
|
-
closedAt:
|
|
338
|
+
openedAt: import_zod5.default.coerce.date(),
|
|
339
|
+
closedAt: import_zod5.default.nullable(import_zod5.default.coerce.date())
|
|
336
340
|
});
|
|
337
|
-
var TunaLpPositionHistorical =
|
|
338
|
-
positionAddress:
|
|
339
|
-
authority:
|
|
340
|
-
pool:
|
|
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(),
|
|
341
345
|
state: TunaPositionStateSchema,
|
|
342
|
-
lowerPrice:
|
|
343
|
-
upperPrice:
|
|
344
|
-
lowerLimitOrder:
|
|
345
|
-
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(),
|
|
346
350
|
marketMaker: PoolProviderSchema,
|
|
347
|
-
openedAt:
|
|
348
|
-
closedAt:
|
|
349
|
-
totalValueUsd:
|
|
350
|
-
leverage:
|
|
351
|
-
initialLeverage:
|
|
352
|
-
totalDepositUsd:
|
|
353
|
-
totalWithdrawnUsd:
|
|
354
|
-
feesSumUsd:
|
|
355
|
-
closedPnlSumUsd:
|
|
356
|
-
entryPrice:
|
|
357
|
-
exitPrice:
|
|
358
|
-
});
|
|
359
|
-
var TunaPositionLegacy =
|
|
360
|
-
address:
|
|
361
|
-
authority:
|
|
362
|
-
version:
|
|
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(),
|
|
363
367
|
state: TunaPositionStateSchema,
|
|
364
|
-
positionMint:
|
|
365
|
-
liquidity:
|
|
366
|
-
tickLowerIndex:
|
|
367
|
-
tickUpperIndex:
|
|
368
|
-
entrySqrtPrice:
|
|
369
|
-
lowerLimitOrderSqrtPrice:
|
|
370
|
-
upperLimitOrderSqrtPrice:
|
|
371
|
-
flags:
|
|
372
|
-
pool:
|
|
373
|
-
poolSqrtPrice:
|
|
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(),
|
|
374
378
|
depositedCollateralA: AmountWithoutUsdSchema,
|
|
375
379
|
depositedCollateralB: AmountWithoutUsdSchema,
|
|
376
|
-
depositedCollateralUsd:
|
|
377
|
-
amount:
|
|
380
|
+
depositedCollateralUsd: import_zod5.default.object({
|
|
381
|
+
amount: import_zod5.default.number()
|
|
378
382
|
}),
|
|
379
383
|
loanFundsA: AmountWithUsdSchema,
|
|
380
384
|
loanFundsB: AmountWithUsdSchema,
|
|
@@ -391,47 +395,47 @@ var TunaPositionLegacy = import_zod4.default.object({
|
|
|
391
395
|
pnlA: TokensPnlSchema,
|
|
392
396
|
pnlB: TokensPnlSchema,
|
|
393
397
|
pnlUsd: UsdPnlSchema,
|
|
394
|
-
openedAt:
|
|
395
|
-
updatedAtSlot:
|
|
396
|
-
closedAt:
|
|
397
|
-
});
|
|
398
|
-
var TunaLpPositionParameters =
|
|
399
|
-
lowerPrice:
|
|
400
|
-
upperPrice:
|
|
401
|
-
lowerLimitOrder:
|
|
402
|
-
upperLimitOrder:
|
|
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(),
|
|
403
407
|
lowerLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
404
408
|
upperLimitOrderSwap: LpPositionLimitOrderSwapSchema,
|
|
405
409
|
autoCompound: LpPositionAutoCompoundSchema,
|
|
406
410
|
rebalance: LpPositionRebalanceSchema,
|
|
407
|
-
rebalanceThresholdTicks:
|
|
408
|
-
});
|
|
409
|
-
var TunaLpPositionValue =
|
|
410
|
-
totalValueA:
|
|
411
|
-
totalValueB:
|
|
412
|
-
totalValueUsd:
|
|
413
|
-
loanFundsA:
|
|
414
|
-
loanFundsB:
|
|
415
|
-
loanFundsUsd:
|
|
416
|
-
leverage:
|
|
417
|
-
});
|
|
418
|
-
var TunaLpPositionTransfer =
|
|
419
|
-
amountA:
|
|
420
|
-
amountB:
|
|
421
|
-
amountUsd:
|
|
422
|
-
});
|
|
423
|
-
var TunaLpPositionTokenPrices =
|
|
424
|
-
tokenPriceA:
|
|
425
|
-
tokenPriceB:
|
|
426
|
-
});
|
|
427
|
-
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({
|
|
428
432
|
parameters: TunaLpPositionParameters
|
|
429
433
|
});
|
|
430
|
-
var TunaLpPositionActionClose =
|
|
434
|
+
var TunaLpPositionActionClose = import_zod5.default.object({
|
|
431
435
|
toOwner: TunaLpPositionTransfer.nullable(),
|
|
432
436
|
prices: TunaLpPositionTokenPrices.nullable()
|
|
433
437
|
});
|
|
434
|
-
var TunaLpPositionActionIncreaseLiquidity =
|
|
438
|
+
var TunaLpPositionActionIncreaseLiquidity = import_zod5.default.object({
|
|
435
439
|
fromPosition: TunaLpPositionValue.nullable(),
|
|
436
440
|
toPosition: TunaLpPositionValue,
|
|
437
441
|
fromOwner: TunaLpPositionTransfer,
|
|
@@ -439,9 +443,9 @@ var TunaLpPositionActionIncreaseLiquidity = import_zod4.default.object({
|
|
|
439
443
|
protocolFees: TunaLpPositionTransfer,
|
|
440
444
|
prices: TunaLpPositionTokenPrices
|
|
441
445
|
});
|
|
442
|
-
var TunaLpPositionActionDecreaseLiquidity =
|
|
443
|
-
withdrawPercent:
|
|
444
|
-
closedPnlUsd:
|
|
446
|
+
var TunaLpPositionActionDecreaseLiquidity = import_zod5.default.object({
|
|
447
|
+
withdrawPercent: import_zod5.default.number(),
|
|
448
|
+
closedPnlUsd: import_zod5.default.number(),
|
|
445
449
|
fromPosition: TunaLpPositionValue,
|
|
446
450
|
toPosition: TunaLpPositionValue.nullable(),
|
|
447
451
|
toOwner: TunaLpPositionTransfer,
|
|
@@ -449,28 +453,28 @@ var TunaLpPositionActionDecreaseLiquidity = import_zod4.default.object({
|
|
|
449
453
|
collectedFees: TunaLpPositionTransfer,
|
|
450
454
|
prices: TunaLpPositionTokenPrices
|
|
451
455
|
});
|
|
452
|
-
var TunaLpPositionActionLiquidate =
|
|
453
|
-
withdrawPercent:
|
|
456
|
+
var TunaLpPositionActionLiquidate = import_zod5.default.object({
|
|
457
|
+
withdrawPercent: import_zod5.default.number(),
|
|
454
458
|
fromPosition: TunaLpPositionValue,
|
|
455
459
|
toLending: TunaLpPositionTransfer,
|
|
456
460
|
protocolFees: TunaLpPositionTransfer,
|
|
457
461
|
prices: TunaLpPositionTokenPrices
|
|
458
462
|
});
|
|
459
|
-
var TunaLpPositionActionRepayDebt =
|
|
463
|
+
var TunaLpPositionActionRepayDebt = import_zod5.default.object({
|
|
460
464
|
fromPosition: TunaLpPositionValue,
|
|
461
465
|
toPosition: TunaLpPositionValue,
|
|
462
466
|
fromOwner: TunaLpPositionTransfer,
|
|
463
467
|
toLending: TunaLpPositionTransfer,
|
|
464
468
|
prices: TunaLpPositionTokenPrices
|
|
465
469
|
});
|
|
466
|
-
var TunaLpPositionActionCollectFees =
|
|
467
|
-
closedPnlUsd:
|
|
470
|
+
var TunaLpPositionActionCollectFees = import_zod5.default.object({
|
|
471
|
+
closedPnlUsd: import_zod5.default.number(),
|
|
468
472
|
position: TunaLpPositionValue,
|
|
469
473
|
collectedFees: TunaLpPositionTransfer,
|
|
470
474
|
toOwner: TunaLpPositionTransfer,
|
|
471
475
|
prices: TunaLpPositionTokenPrices
|
|
472
476
|
});
|
|
473
|
-
var TunaLpPositionActionCollectAndCompoundFees =
|
|
477
|
+
var TunaLpPositionActionCollectAndCompoundFees = import_zod5.default.object({
|
|
474
478
|
fromPosition: TunaLpPositionValue,
|
|
475
479
|
toPosition: TunaLpPositionValue,
|
|
476
480
|
collectedFees: TunaLpPositionTransfer,
|
|
@@ -478,15 +482,15 @@ var TunaLpPositionActionCollectAndCompoundFees = import_zod4.default.object({
|
|
|
478
482
|
protocolFees: TunaLpPositionTransfer,
|
|
479
483
|
prices: TunaLpPositionTokenPrices
|
|
480
484
|
});
|
|
481
|
-
var TunaLpPositionActionParametersUpdate =
|
|
485
|
+
var TunaLpPositionActionParametersUpdate = import_zod5.default.object({
|
|
482
486
|
fromParameters: TunaLpPositionParameters,
|
|
483
487
|
toParameters: TunaLpPositionParameters
|
|
484
488
|
});
|
|
485
|
-
var TunaLpPositionAction =
|
|
489
|
+
var TunaLpPositionAction = import_zod5.default.object({
|
|
486
490
|
action: LpPositionsActionTypeSchema,
|
|
487
|
-
txSignature:
|
|
488
|
-
txTimestamp:
|
|
489
|
-
data:
|
|
491
|
+
txSignature: import_zod5.default.string(),
|
|
492
|
+
txTimestamp: import_zod5.default.coerce.date(),
|
|
493
|
+
data: import_zod5.default.object({
|
|
490
494
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
491
495
|
fromPosition: TunaLpPositionValue.optional().nullable(),
|
|
492
496
|
/** defined for: IncreaseLiquidity, DecreaseLiquidity, Liquidate, ExecuteLimitOrder, RepayDebt, CollectAndCompoundFees */
|
|
@@ -514,32 +518,32 @@ var TunaLpPositionAction = import_zod4.default.object({
|
|
|
514
518
|
/** defined for: ParametersUpdate */
|
|
515
519
|
toParameters: TunaLpPositionParameters.optional(),
|
|
516
520
|
/** defined for: DecreaseLiquidity */
|
|
517
|
-
withdrawPercent:
|
|
521
|
+
withdrawPercent: import_zod5.default.number().optional(),
|
|
518
522
|
/** defined for: DecreaseLiquidity, CollectFees */
|
|
519
|
-
closedPnlUsd:
|
|
523
|
+
closedPnlUsd: import_zod5.default.number().optional()
|
|
520
524
|
})
|
|
521
525
|
});
|
|
522
526
|
|
|
523
527
|
// src/client/schemas/spot_positions.ts
|
|
524
|
-
var
|
|
528
|
+
var import_zod6 = require("zod");
|
|
525
529
|
var TunaSpotPositionState = {
|
|
526
530
|
OPEN: "open",
|
|
527
531
|
CLOSED: "closed"
|
|
528
532
|
};
|
|
529
|
-
var TunaSpotPositionStateSchema =
|
|
533
|
+
var TunaSpotPositionStateSchema = import_zod6.z.enum([
|
|
530
534
|
TunaSpotPositionState.OPEN,
|
|
531
535
|
...Object.values(TunaSpotPositionState)
|
|
532
536
|
]);
|
|
533
|
-
var TunaSpotPosition =
|
|
534
|
-
address:
|
|
535
|
-
authority:
|
|
536
|
-
version:
|
|
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(),
|
|
537
541
|
state: TunaSpotPositionStateSchema,
|
|
538
|
-
lowerLimitOrderPrice:
|
|
539
|
-
upperLimitOrderPrice:
|
|
540
|
-
entryPrice:
|
|
541
|
-
mintA:
|
|
542
|
-
mintB:
|
|
542
|
+
lowerLimitOrderPrice: import_zod6.z.number(),
|
|
543
|
+
upperLimitOrderPrice: import_zod6.z.number(),
|
|
544
|
+
entryPrice: import_zod6.z.number(),
|
|
545
|
+
mintA: Mint,
|
|
546
|
+
mintB: Mint,
|
|
543
547
|
pool: TunaPositionPoolSchema,
|
|
544
548
|
positionToken: TunaPositionPoolToken,
|
|
545
549
|
collateralToken: TunaPositionPoolToken,
|
|
@@ -548,77 +552,77 @@ var TunaSpotPosition = import_zod5.z.object({
|
|
|
548
552
|
initialDebt: AmountWithUsdSchema,
|
|
549
553
|
currentDebt: AmountWithUsdSchema,
|
|
550
554
|
total: AmountWithUsdSchema,
|
|
551
|
-
leverage:
|
|
552
|
-
maxLeverage:
|
|
553
|
-
liquidationPrice:
|
|
555
|
+
leverage: import_zod6.z.number(),
|
|
556
|
+
maxLeverage: import_zod6.z.number(),
|
|
557
|
+
liquidationPrice: import_zod6.z.number(),
|
|
554
558
|
pnlUsd: UsdPnlSchema,
|
|
555
|
-
openedAt:
|
|
556
|
-
closedAt:
|
|
559
|
+
openedAt: import_zod6.z.coerce.date(),
|
|
560
|
+
closedAt: import_zod6.z.nullable(import_zod6.z.coerce.date())
|
|
557
561
|
});
|
|
558
|
-
var IncreaseSpotPositionQuote =
|
|
562
|
+
var IncreaseSpotPositionQuote = import_zod6.z.object({
|
|
559
563
|
/** Required collateral amount */
|
|
560
|
-
collateralAmount:
|
|
564
|
+
collateralAmount: import_zod6.z.coerce.bigint(),
|
|
561
565
|
/** Required amount to borrow */
|
|
562
|
-
borrowAmount:
|
|
566
|
+
borrowAmount: import_zod6.z.coerce.bigint(),
|
|
563
567
|
/** Estimated position size in the position token. */
|
|
564
|
-
estimatedAmount:
|
|
568
|
+
estimatedAmount: import_zod6.z.coerce.bigint(),
|
|
565
569
|
/** Swap input amount. */
|
|
566
|
-
swapInputAmount:
|
|
570
|
+
swapInputAmount: import_zod6.z.coerce.bigint(),
|
|
567
571
|
/** Minimum swap output amount according to the provided slippage. */
|
|
568
|
-
minSwapOutputAmount:
|
|
572
|
+
minSwapOutputAmount: import_zod6.z.coerce.bigint(),
|
|
569
573
|
/** Protocol fee in token A */
|
|
570
|
-
protocolFeeA:
|
|
574
|
+
protocolFeeA: import_zod6.z.coerce.bigint(),
|
|
571
575
|
/** Protocol fee in token B */
|
|
572
|
-
protocolFeeB:
|
|
576
|
+
protocolFeeB: import_zod6.z.coerce.bigint(),
|
|
573
577
|
/** Price impact in percents */
|
|
574
|
-
priceImpact:
|
|
578
|
+
priceImpact: import_zod6.z.number(),
|
|
575
579
|
/** Liquidation price */
|
|
576
|
-
liquidationPrice:
|
|
580
|
+
liquidationPrice: import_zod6.z.number()
|
|
577
581
|
});
|
|
578
|
-
var DecreaseSpotPositionQuote =
|
|
582
|
+
var DecreaseSpotPositionQuote = import_zod6.z.object({
|
|
579
583
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
580
|
-
decreasePercent:
|
|
584
|
+
decreasePercent: import_zod6.z.number(),
|
|
581
585
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
582
586
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
583
587
|
*/
|
|
584
|
-
requiredSwapAmount:
|
|
588
|
+
requiredSwapAmount: import_zod6.z.coerce.bigint(),
|
|
585
589
|
/** Estimated total amount of the adjusted position */
|
|
586
|
-
estimatedAmount:
|
|
590
|
+
estimatedAmount: import_zod6.z.coerce.bigint(),
|
|
587
591
|
/** Estimated amount of the withdrawn collateral */
|
|
588
|
-
estimatedWithdrawnCollateral:
|
|
592
|
+
estimatedWithdrawnCollateral: import_zod6.z.coerce.bigint(),
|
|
589
593
|
/** Price impact in percents */
|
|
590
|
-
priceImpact:
|
|
594
|
+
priceImpact: import_zod6.z.number(),
|
|
591
595
|
/** Liquidation price */
|
|
592
|
-
liquidationPrice:
|
|
596
|
+
liquidationPrice: import_zod6.z.number()
|
|
593
597
|
});
|
|
594
|
-
var CloseSpotPositionQuote =
|
|
598
|
+
var CloseSpotPositionQuote = import_zod6.z.object({
|
|
595
599
|
/** Position decrease percentage */
|
|
596
|
-
decreasePercent:
|
|
600
|
+
decreasePercent: import_zod6.z.number(),
|
|
597
601
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
598
602
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
599
603
|
*/
|
|
600
|
-
requiredSwapAmount:
|
|
604
|
+
requiredSwapAmount: import_zod6.z.coerce.bigint(),
|
|
601
605
|
/** Estimated amount of the withdrawn collateral */
|
|
602
|
-
estimatedWithdrawnCollateral:
|
|
606
|
+
estimatedWithdrawnCollateral: import_zod6.z.coerce.bigint(),
|
|
603
607
|
/** Price impact in percents */
|
|
604
|
-
priceImpact:
|
|
608
|
+
priceImpact: import_zod6.z.number()
|
|
605
609
|
});
|
|
606
610
|
|
|
607
611
|
// src/client/schemas/state_snapshot.ts
|
|
608
|
-
var
|
|
609
|
-
var PoolPriceUpdate =
|
|
610
|
-
pool:
|
|
611
|
-
price:
|
|
612
|
-
sqrtPrice:
|
|
613
|
-
time:
|
|
614
|
-
});
|
|
615
|
-
var StateSnapshot =
|
|
616
|
-
slot:
|
|
617
|
-
blockTime:
|
|
618
|
-
poolPrices:
|
|
619
|
-
tunaSpotPositions:
|
|
620
|
-
tunaLpPositions:
|
|
621
|
-
fusionLimitOrders:
|
|
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))
|
|
622
626
|
});
|
|
623
627
|
|
|
624
628
|
// src/client/schemas.ts
|
|
@@ -698,57 +702,51 @@ var WalletSubscriptionTopic = {
|
|
|
698
702
|
TRADE_HISTORY: "trade_history",
|
|
699
703
|
ORDER_HISTORY: "order_history"
|
|
700
704
|
};
|
|
701
|
-
var NotificationEntitySchema =
|
|
702
|
-
var NotificationActionSchema =
|
|
703
|
-
var TradeHistoryActionSchema =
|
|
704
|
-
var TradeHistoryUIDirectionSchema =
|
|
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([
|
|
705
709
|
TradeHistoryUIDirection.BUY,
|
|
706
710
|
...Object.values(TradeHistoryUIDirection)
|
|
707
711
|
]);
|
|
708
|
-
var OrderHistoryOrderTypeSchema =
|
|
712
|
+
var OrderHistoryOrderTypeSchema = import_zod8.z.enum([
|
|
709
713
|
OrderHistoryOrderType.MARKET,
|
|
710
714
|
...Object.values(OrderHistoryOrderType)
|
|
711
715
|
]);
|
|
712
|
-
var OrderHistoryStatusSchema =
|
|
713
|
-
var OrderHistoryUIDirectionSchema =
|
|
716
|
+
var OrderHistoryStatusSchema = import_zod8.z.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
717
|
+
var OrderHistoryUIDirectionSchema = import_zod8.z.enum([
|
|
714
718
|
OrderHistoryUIDirection.BUY,
|
|
715
719
|
...Object.values(OrderHistoryUIDirection)
|
|
716
720
|
]);
|
|
717
|
-
var StakingPositionHistoryActionTypeSchema =
|
|
721
|
+
var StakingPositionHistoryActionTypeSchema = import_zod8.z.enum([
|
|
718
722
|
StakingPositionHistoryActionType.STAKE,
|
|
719
723
|
...Object.values(StakingPositionHistoryActionType)
|
|
720
724
|
]);
|
|
721
|
-
var PoolSubscriptionTopicSchema =
|
|
725
|
+
var PoolSubscriptionTopicSchema = import_zod8.z.enum([
|
|
722
726
|
PoolSubscriptionTopic.ORDER_BOOK,
|
|
723
727
|
...Object.values(PoolSubscriptionTopic)
|
|
724
728
|
]);
|
|
725
|
-
var WalletSubscriptionTopicSchema =
|
|
729
|
+
var WalletSubscriptionTopicSchema = import_zod8.z.enum([
|
|
726
730
|
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
727
731
|
...Object.values(WalletSubscriptionTopic)
|
|
728
732
|
]);
|
|
729
|
-
var PaginationMeta =
|
|
730
|
-
total:
|
|
731
|
-
});
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
});
|
|
738
|
-
var Market = import_zod7.z.object({
|
|
739
|
-
address: import_zod7.z.string(),
|
|
740
|
-
addressLookupTable: import_zod7.z.string(),
|
|
741
|
-
poolAddress: import_zod7.z.string(),
|
|
742
|
-
poolFeeRate: import_zod7.z.number(),
|
|
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(),
|
|
743
741
|
provider: PoolProviderSchema,
|
|
744
|
-
maxLeverage:
|
|
745
|
-
maxSwapSlippage:
|
|
746
|
-
protocolFee:
|
|
747
|
-
rebalanceProtocolFee:
|
|
748
|
-
protocolFeeOnCollateral:
|
|
749
|
-
liquidationFee:
|
|
750
|
-
liquidationThreshold:
|
|
751
|
-
oraclePriceDeviationThreshold:
|
|
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(),
|
|
752
750
|
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
753
751
|
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
754
752
|
borrowedFundsA: AmountWithUsdSchema,
|
|
@@ -757,32 +755,32 @@ var Market = import_zod7.z.object({
|
|
|
757
755
|
availableBorrowB: AmountWithUsdSchema,
|
|
758
756
|
borrowLimitA: AmountWithUsdSchema,
|
|
759
757
|
borrowLimitB: AmountWithUsdSchema,
|
|
760
|
-
disabled:
|
|
761
|
-
createdAt:
|
|
762
|
-
});
|
|
763
|
-
var TokenOraclePrice =
|
|
764
|
-
mint:
|
|
765
|
-
price:
|
|
766
|
-
decimals:
|
|
767
|
-
time:
|
|
768
|
-
});
|
|
769
|
-
var Vault =
|
|
770
|
-
address:
|
|
771
|
-
mint:
|
|
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(),
|
|
772
770
|
depositedFunds: AmountWithUsdSchema,
|
|
773
771
|
borrowedFunds: AmountWithUsdSchema,
|
|
774
772
|
supplyLimit: AmountWithUsdSchema,
|
|
775
|
-
borrowedShares:
|
|
776
|
-
depositedShares:
|
|
777
|
-
supplyApy:
|
|
778
|
-
borrowApy:
|
|
779
|
-
interestRate:
|
|
780
|
-
utilization:
|
|
781
|
-
pythOracleFeedId:
|
|
782
|
-
pythOraclePriceUpdate:
|
|
783
|
-
});
|
|
784
|
-
var VaultHistoricalStats =
|
|
785
|
-
date:
|
|
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) => {
|
|
786
784
|
if (typeof val === "string") {
|
|
787
785
|
const [year, month, day] = val.split("-").map(Number);
|
|
788
786
|
return new Date(year, month - 1, day);
|
|
@@ -791,272 +789,272 @@ var VaultHistoricalStats = import_zod7.z.object({
|
|
|
791
789
|
code: "custom",
|
|
792
790
|
message: "Not a valid date string"
|
|
793
791
|
});
|
|
794
|
-
return
|
|
795
|
-
},
|
|
792
|
+
return import_zod8.z.NEVER;
|
|
793
|
+
}, import_zod8.z.date()),
|
|
796
794
|
supply: AmountWithUsdSchema,
|
|
797
795
|
borrow: AmountWithUsdSchema,
|
|
798
|
-
supplyApy:
|
|
799
|
-
borrowApr:
|
|
796
|
+
supplyApy: import_zod8.z.number(),
|
|
797
|
+
borrowApr: import_zod8.z.number()
|
|
800
798
|
});
|
|
801
|
-
var Pool =
|
|
802
|
-
address:
|
|
799
|
+
var Pool = import_zod8.z.object({
|
|
800
|
+
address: import_zod8.z.string(),
|
|
803
801
|
provider: PoolProviderSchema,
|
|
804
|
-
tokenAMint:
|
|
805
|
-
tokenBMint:
|
|
806
|
-
tokenAVault:
|
|
807
|
-
tokenBVault:
|
|
808
|
-
tvlUsdc:
|
|
809
|
-
priceChange24H:
|
|
810
|
-
tickSpacing:
|
|
811
|
-
feeRate:
|
|
812
|
-
olpFeeRate:
|
|
813
|
-
protocolFeeRate:
|
|
814
|
-
liquidity:
|
|
815
|
-
sqrtPrice:
|
|
816
|
-
tickCurrentIndex:
|
|
817
|
-
stats:
|
|
818
|
-
"24h":
|
|
819
|
-
volume:
|
|
820
|
-
fees:
|
|
821
|
-
rewards:
|
|
822
|
-
yieldOverTvl:
|
|
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()
|
|
823
821
|
}),
|
|
824
|
-
"7d":
|
|
825
|
-
volume:
|
|
826
|
-
fees:
|
|
827
|
-
rewards:
|
|
828
|
-
yieldOverTvl:
|
|
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()
|
|
829
827
|
}),
|
|
830
|
-
"30d":
|
|
831
|
-
volume:
|
|
832
|
-
fees:
|
|
833
|
-
rewards:
|
|
834
|
-
yieldOverTvl:
|
|
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()
|
|
835
833
|
})
|
|
836
834
|
})
|
|
837
835
|
});
|
|
838
|
-
var Tick =
|
|
839
|
-
index:
|
|
840
|
-
liquidity:
|
|
836
|
+
var Tick = import_zod8.z.object({
|
|
837
|
+
index: import_zod8.z.number(),
|
|
838
|
+
liquidity: import_zod8.z.coerce.bigint()
|
|
841
839
|
});
|
|
842
|
-
var PoolTicks =
|
|
843
|
-
tickSpacing:
|
|
840
|
+
var PoolTicks = import_zod8.z.object({
|
|
841
|
+
tickSpacing: import_zod8.z.number(),
|
|
844
842
|
ticks: Tick.array()
|
|
845
843
|
});
|
|
846
|
-
var LendingPosition =
|
|
847
|
-
address:
|
|
848
|
-
authority:
|
|
849
|
-
mint:
|
|
850
|
-
vault:
|
|
851
|
-
shares:
|
|
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(),
|
|
852
850
|
funds: AmountWithUsdSchema,
|
|
853
851
|
earned: AmountWithUsdSchema
|
|
854
852
|
});
|
|
855
|
-
var PoolSwap =
|
|
856
|
-
id:
|
|
857
|
-
amountIn:
|
|
858
|
-
amountOut:
|
|
859
|
-
amountUsd:
|
|
860
|
-
aToB:
|
|
861
|
-
pool:
|
|
862
|
-
time:
|
|
863
|
-
});
|
|
864
|
-
var OrderBookEntry =
|
|
865
|
-
concentratedAmount:
|
|
866
|
-
concentratedAmountQuote:
|
|
867
|
-
concentratedTotal:
|
|
868
|
-
concentratedTotalQuote:
|
|
869
|
-
limitAmount:
|
|
870
|
-
limitAmountQuote:
|
|
871
|
-
limitTotal:
|
|
872
|
-
limitTotalQuote:
|
|
873
|
-
price:
|
|
874
|
-
askSide:
|
|
875
|
-
});
|
|
876
|
-
var OrderBook =
|
|
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({
|
|
877
875
|
entries: OrderBookEntry.array(),
|
|
878
|
-
poolPrice:
|
|
876
|
+
poolPrice: import_zod8.z.number()
|
|
879
877
|
});
|
|
880
|
-
var TradeHistoryEntry =
|
|
878
|
+
var TradeHistoryEntry = import_zod8.z.object({
|
|
881
879
|
// Internal entry ID
|
|
882
|
-
id:
|
|
883
|
-
pool:
|
|
884
|
-
authority:
|
|
885
|
-
aToB:
|
|
880
|
+
id: import_zod8.z.string(),
|
|
881
|
+
pool: import_zod8.z.string(),
|
|
882
|
+
authority: import_zod8.z.string(),
|
|
883
|
+
aToB: import_zod8.z.boolean(),
|
|
886
884
|
// Trade action which created entry
|
|
887
885
|
action: TradeHistoryActionSchema,
|
|
888
886
|
// Trade direction formatted for ui display
|
|
889
887
|
uiDirection: TradeHistoryUIDirectionSchema,
|
|
890
888
|
// Trade price formatted for ui display
|
|
891
|
-
uiPrice:
|
|
889
|
+
uiPrice: import_zod8.z.number(),
|
|
892
890
|
baseToken: AmountWithUsdSchema,
|
|
893
891
|
quoteToken: AmountWithUsdSchema,
|
|
894
892
|
fee: AmountWithUsdSchema,
|
|
895
|
-
pnl:
|
|
896
|
-
|
|
897
|
-
usd:
|
|
898
|
-
bps:
|
|
893
|
+
pnl: import_zod8.z.nullable(
|
|
894
|
+
import_zod8.z.object({
|
|
895
|
+
usd: import_zod8.z.number(),
|
|
896
|
+
bps: import_zod8.z.number()
|
|
899
897
|
})
|
|
900
898
|
),
|
|
901
|
-
txSignature:
|
|
902
|
-
positionAddress:
|
|
903
|
-
slot:
|
|
904
|
-
ts:
|
|
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()
|
|
905
903
|
});
|
|
906
|
-
var OrderHistoryEntry =
|
|
904
|
+
var OrderHistoryEntry = import_zod8.z.object({
|
|
907
905
|
// Internal entry ID
|
|
908
|
-
id:
|
|
909
|
-
pool:
|
|
910
|
-
authority:
|
|
906
|
+
id: import_zod8.z.string(),
|
|
907
|
+
pool: import_zod8.z.string(),
|
|
908
|
+
authority: import_zod8.z.string(),
|
|
911
909
|
orderType: OrderHistoryOrderTypeSchema,
|
|
912
|
-
isReduceOnly:
|
|
913
|
-
aToB:
|
|
910
|
+
isReduceOnly: import_zod8.z.nullable(import_zod8.z.boolean()),
|
|
911
|
+
aToB: import_zod8.z.boolean(),
|
|
914
912
|
uiDirection: OrderHistoryUIDirectionSchema,
|
|
915
|
-
uiPrice:
|
|
916
|
-
uiExecutionPrice:
|
|
913
|
+
uiPrice: import_zod8.z.nullable(import_zod8.z.number()),
|
|
914
|
+
uiExecutionPrice: import_zod8.z.nullable(import_zod8.z.number()),
|
|
917
915
|
status: OrderHistoryStatusSchema,
|
|
918
916
|
baseToken: AmountWithUsdSchema,
|
|
919
917
|
quoteToken: AmountWithUsdSchema,
|
|
920
|
-
baseTokenConsumedAmount:
|
|
921
|
-
quoteTokenFilledAmount:
|
|
922
|
-
txSignature:
|
|
923
|
-
positionAddress:
|
|
924
|
-
slot:
|
|
925
|
-
ts:
|
|
926
|
-
});
|
|
927
|
-
var StakingTreasury =
|
|
928
|
-
address:
|
|
929
|
-
stakedTokenMint:
|
|
930
|
-
rewardTokenMint:
|
|
931
|
-
apy:
|
|
932
|
-
uniqueStakers:
|
|
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(),
|
|
933
931
|
totalStaked: AmountWithUsdSchema,
|
|
934
932
|
totalReward: AmountWithUsdSchema,
|
|
935
|
-
unstakeCooldownSeconds:
|
|
936
|
-
isStakingEnabled:
|
|
937
|
-
isUnstakingEnabled:
|
|
938
|
-
isWithdrawEnabled:
|
|
939
|
-
});
|
|
940
|
-
var StakingPosition =
|
|
941
|
-
address:
|
|
942
|
-
owner:
|
|
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(),
|
|
943
941
|
staked: AmountWithUsdSchema,
|
|
944
942
|
unstaked: AmountWithUsdSchema,
|
|
945
943
|
claimedReward: AmountWithUsdSchema,
|
|
946
944
|
unclaimedReward: AmountWithUsdSchema,
|
|
947
|
-
rank:
|
|
948
|
-
vesting:
|
|
945
|
+
rank: import_zod8.z.nullable(import_zod8.z.number()),
|
|
946
|
+
vesting: import_zod8.z.object({
|
|
949
947
|
locked: AmountWithUsdSchema,
|
|
950
948
|
unlocked: AmountWithUsdSchema,
|
|
951
|
-
unlockRate:
|
|
952
|
-
unlockEverySeconds:
|
|
953
|
-
unlockCliffSeconds:
|
|
954
|
-
lockedAt:
|
|
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())
|
|
955
953
|
}),
|
|
956
|
-
lastUnstakedAt:
|
|
957
|
-
withdrawAvailableAt:
|
|
954
|
+
lastUnstakedAt: import_zod8.z.nullable(import_zod8.z.coerce.date()),
|
|
955
|
+
withdrawAvailableAt: import_zod8.z.nullable(import_zod8.z.coerce.date())
|
|
958
956
|
});
|
|
959
|
-
var StakingLeaderboardPosition =
|
|
960
|
-
rank:
|
|
961
|
-
address:
|
|
962
|
-
owner:
|
|
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(),
|
|
963
961
|
staked: AmountWithUsdSchema
|
|
964
962
|
});
|
|
965
|
-
var StakingLeaderboardPage =
|
|
963
|
+
var StakingLeaderboardPage = import_zod8.z.object({
|
|
966
964
|
data: StakingLeaderboardPosition.array(),
|
|
967
965
|
meta: PaginationMeta
|
|
968
966
|
});
|
|
969
|
-
var StakingPositionHistoryAction =
|
|
970
|
-
position:
|
|
967
|
+
var StakingPositionHistoryAction = import_zod8.z.object({
|
|
968
|
+
position: import_zod8.z.string(),
|
|
971
969
|
action: StakingPositionHistoryActionTypeSchema,
|
|
972
|
-
txSignature:
|
|
973
|
-
amount:
|
|
974
|
-
time:
|
|
975
|
-
});
|
|
976
|
-
var PoolPriceCandle =
|
|
977
|
-
time:
|
|
978
|
-
open:
|
|
979
|
-
close:
|
|
980
|
-
high:
|
|
981
|
-
low:
|
|
982
|
-
volume:
|
|
983
|
-
});
|
|
984
|
-
var FeesStatsGroup =
|
|
985
|
-
time:
|
|
986
|
-
addLiquidityFees:
|
|
987
|
-
limitOrderFees:
|
|
988
|
-
yieldCompoundingFees:
|
|
989
|
-
liquidationFees:
|
|
990
|
-
totalLiquidationsNetworkFees:
|
|
991
|
-
totalLimitOrdersNetworkFees:
|
|
992
|
-
totalYieldCompoundingNetworkFees:
|
|
993
|
-
failedNetworkFees:
|
|
994
|
-
processedNetworkFees:
|
|
995
|
-
totalCollectedFees:
|
|
996
|
-
totalNetworkFees:
|
|
997
|
-
jitoLiquidationFees:
|
|
998
|
-
jitoLimitOrderFees:
|
|
999
|
-
jitoYieldCompoundingFees:
|
|
1000
|
-
runningAddLiquidityFees:
|
|
1001
|
-
runningLimitOrderFees:
|
|
1002
|
-
runningYieldCompoundingFees:
|
|
1003
|
-
runningLiquidationFees:
|
|
1004
|
-
runningTotalLiquidationsNetworkFees:
|
|
1005
|
-
runningTotalLimitOrdersNetworkFees:
|
|
1006
|
-
runningTotalYieldCompoundingNetworkFees:
|
|
1007
|
-
runningFailedNetworkFees:
|
|
1008
|
-
runningProcessedNetworkFees:
|
|
1009
|
-
runningJitoLiquidationFees:
|
|
1010
|
-
runningJitoLimitOrderFees:
|
|
1011
|
-
runningJitoYieldCompoundingFees:
|
|
1012
|
-
runningTotalCollectedFees:
|
|
1013
|
-
runningTotalNetworkFees:
|
|
1014
|
-
});
|
|
1015
|
-
var StakingRevenueStatsGroup =
|
|
1016
|
-
time:
|
|
1017
|
-
totalDepositsUsd:
|
|
1018
|
-
totalDepositsSol:
|
|
1019
|
-
runningTotalDepositsUsd:
|
|
1020
|
-
runningTotalDepositsSol:
|
|
1021
|
-
});
|
|
1022
|
-
var SwapQuoteByInput =
|
|
1023
|
-
estimatedAmountOut:
|
|
1024
|
-
minAmountOut:
|
|
1025
|
-
feeAmount:
|
|
1026
|
-
feeUsd:
|
|
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(),
|
|
1027
1025
|
/** Price impact in percents */
|
|
1028
|
-
priceImpact:
|
|
1026
|
+
priceImpact: import_zod8.z.number()
|
|
1029
1027
|
});
|
|
1030
|
-
var SwapQuoteByOutput =
|
|
1031
|
-
estimatedAmountIn:
|
|
1032
|
-
maxAmountIn:
|
|
1033
|
-
feeAmount:
|
|
1034
|
-
feeUsd:
|
|
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(),
|
|
1035
1033
|
/** Price impact in percents */
|
|
1036
|
-
priceImpact:
|
|
1034
|
+
priceImpact: import_zod8.z.number()
|
|
1037
1035
|
});
|
|
1038
|
-
var LimitOrderQuoteByInput =
|
|
1039
|
-
amountOut:
|
|
1036
|
+
var LimitOrderQuoteByInput = import_zod8.z.object({
|
|
1037
|
+
amountOut: import_zod8.z.coerce.bigint()
|
|
1040
1038
|
});
|
|
1041
|
-
var LimitOrderQuoteByOutput =
|
|
1042
|
-
amountIn:
|
|
1039
|
+
var LimitOrderQuoteByOutput = import_zod8.z.object({
|
|
1040
|
+
amountIn: import_zod8.z.coerce.bigint()
|
|
1043
1041
|
});
|
|
1044
1042
|
var TradableAmount = AmountWithUsdSchema;
|
|
1045
|
-
var UpdateStreamSubscriptionResult =
|
|
1046
|
-
status:
|
|
1043
|
+
var UpdateStreamSubscriptionResult = import_zod8.z.object({
|
|
1044
|
+
status: import_zod8.z.string()
|
|
1047
1045
|
});
|
|
1048
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
1046
|
+
var createNotificationSchema = (dataSchema, metaSchema) => import_zod8.z.object({
|
|
1049
1047
|
entity: NotificationEntitySchema,
|
|
1050
1048
|
action: NotificationActionSchema,
|
|
1051
1049
|
data: dataSchema,
|
|
1052
|
-
id:
|
|
1053
|
-
authority:
|
|
1054
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
1055
|
-
});
|
|
1056
|
-
var OrderBookNotificationMeta =
|
|
1057
|
-
pool:
|
|
1058
|
-
priceStep:
|
|
1059
|
-
inverted:
|
|
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() }
|
|
1053
|
+
});
|
|
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()
|
|
1060
1058
|
});
|
|
1061
1059
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1062
1060
|
var PoolPriceUpdateNotification = createNotificationSchema(PoolPriceUpdate);
|