@velocity-exchange/sdk 0.9.0 → 0.11.0

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.
Files changed (74) hide show
  1. package/lib/browser/adminClient.d.ts +4 -3
  2. package/lib/browser/adminClient.js +5 -13
  3. package/lib/browser/equityFloorManager.d.ts +9 -5
  4. package/lib/browser/equityFloorManager.js +9 -5
  5. package/lib/browser/idl/velocity.d.ts +119 -3
  6. package/lib/browser/idl/velocity.json +119 -3
  7. package/lib/browser/index.d.ts +2 -0
  8. package/lib/browser/index.js +3 -0
  9. package/lib/browser/jupiter/jupiterClient.d.ts +31 -27
  10. package/lib/browser/jupiter/jupiterClient.js +61 -35
  11. package/lib/browser/math/amm.d.ts +6 -5
  12. package/lib/browser/math/amm.js +39 -19
  13. package/lib/browser/math/margin.d.ts +12 -10
  14. package/lib/browser/math/margin.js +16 -14
  15. package/lib/browser/math/superStake.d.ts +9 -9
  16. package/lib/browser/math/superStake.js +8 -8
  17. package/lib/browser/swap/UnifiedSwapClient.d.ts +38 -76
  18. package/lib/browser/swap/UnifiedSwapClient.js +46 -117
  19. package/lib/browser/swap/routeInstructions.d.ts +19 -0
  20. package/lib/browser/swap/routeInstructions.js +43 -0
  21. package/lib/browser/swap/types.d.ts +196 -0
  22. package/lib/browser/swap/types.js +88 -0
  23. package/lib/browser/titan/titanClient.d.ts +32 -68
  24. package/lib/browser/titan/titanClient.js +128 -102
  25. package/lib/browser/types.d.ts +2 -0
  26. package/lib/browser/user.d.ts +16 -18
  27. package/lib/browser/user.js +24 -26
  28. package/lib/browser/velocityClient.d.ts +122 -101
  29. package/lib/browser/velocityClient.js +221 -289
  30. package/lib/node/adminClient.d.ts +4 -3
  31. package/lib/node/adminClient.d.ts.map +1 -1
  32. package/lib/node/adminClient.js +5 -13
  33. package/lib/node/equityFloorManager.d.ts +9 -5
  34. package/lib/node/equityFloorManager.d.ts.map +1 -1
  35. package/lib/node/equityFloorManager.js +9 -5
  36. package/lib/node/idl/velocity.d.ts +119 -3
  37. package/lib/node/idl/velocity.d.ts.map +1 -1
  38. package/lib/node/idl/velocity.json +119 -3
  39. package/lib/node/index.d.ts +2 -0
  40. package/lib/node/index.d.ts.map +1 -1
  41. package/lib/node/index.js +3 -0
  42. package/lib/node/jupiter/jupiterClient.d.ts +31 -27
  43. package/lib/node/jupiter/jupiterClient.d.ts.map +1 -1
  44. package/lib/node/jupiter/jupiterClient.js +61 -35
  45. package/lib/node/math/amm.d.ts +6 -5
  46. package/lib/node/math/amm.d.ts.map +1 -1
  47. package/lib/node/math/amm.js +39 -19
  48. package/lib/node/math/margin.d.ts +12 -10
  49. package/lib/node/math/margin.d.ts.map +1 -1
  50. package/lib/node/math/margin.js +16 -14
  51. package/lib/node/math/superStake.d.ts +9 -9
  52. package/lib/node/math/superStake.d.ts.map +1 -1
  53. package/lib/node/math/superStake.js +8 -8
  54. package/lib/node/swap/UnifiedSwapClient.d.ts +38 -76
  55. package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
  56. package/lib/node/swap/UnifiedSwapClient.js +46 -117
  57. package/lib/node/swap/routeInstructions.d.ts +20 -0
  58. package/lib/node/swap/routeInstructions.d.ts.map +1 -0
  59. package/lib/node/swap/routeInstructions.js +43 -0
  60. package/lib/node/swap/types.d.ts +197 -0
  61. package/lib/node/swap/types.d.ts.map +1 -0
  62. package/lib/node/swap/types.js +88 -0
  63. package/lib/node/titan/titanClient.d.ts +32 -68
  64. package/lib/node/titan/titanClient.d.ts.map +1 -1
  65. package/lib/node/titan/titanClient.js +128 -102
  66. package/lib/node/types.d.ts +2 -0
  67. package/lib/node/types.d.ts.map +1 -1
  68. package/lib/node/user.d.ts +16 -18
  69. package/lib/node/user.d.ts.map +1 -1
  70. package/lib/node/user.js +24 -26
  71. package/lib/node/velocityClient.d.ts +122 -101
  72. package/lib/node/velocityClient.d.ts.map +1 -1
  73. package/lib/node/velocityClient.js +221 -289
  74. package/package.json +1 -1
@@ -30,8 +30,8 @@ import { User } from './user';
30
30
  import { UserSubscriptionConfig } from './userConfig';
31
31
  import { VelocityEnv, VelocityProgram } from './config';
32
32
  import { UserStats } from './userStats';
33
- import { JupiterClient, QuoteResponse } from './jupiter/jupiterClient';
34
- import { SwapMode, UnifiedQuoteResponse } from './swap/UnifiedSwapClient';
33
+ import { JupiterClient, JupiterSwapQuote } from './jupiter/jupiterClient';
34
+ import { SwapMode, SwapProvider, SwapQuote } from './swap/types';
35
35
  import { UserStatsSubscriptionConfig } from './userStatsConfig';
36
36
  import { TxHandler } from './tx/txHandler';
37
37
  import { SignedMsgOrderParams } from './types';
@@ -39,7 +39,6 @@ import { TakerInfo } from './types';
39
39
  import { ConstituentMap } from './constituentMap/constituentMap';
40
40
  import { RevenueShareEscrowMap } from './userMap/revenueShareEscrowMap';
41
41
  import { TitanClient } from './titan/titanClient';
42
- import { UnifiedSwapClient } from './swap/UnifiedSwapClient';
43
42
  /**
44
43
  * Union type for swap clients (Titan and Jupiter) - Legacy type
45
44
  * @deprecated Use UnifiedSwapClient class instead
@@ -451,6 +450,45 @@ export declare class VelocityClient {
451
450
  * @returns The resize instruction.
452
451
  */
453
452
  getResizeSignedMsgUserOrdersInstruction(authority: PublicKey, numOrders: number): Promise<TransactionInstruction>;
453
+ /**
454
+ * Grows a zero-copy account (User, PerpMarket, SpotMarket, State, ...) to the size the
455
+ * deployed program compiles in for its type, as part of an account-size migration after a
456
+ * program upgrade that appended fields. Requires `HotRole.AccountExtension` (cold, warm, or
457
+ * the configured account-extension hot key) — the wallet must hold that role. The payer
458
+ * covers the rent-exempt shortfall and the program zero-fills the new tail. No-op when the
459
+ * account is already at size, so cranking is idempotent. See `docs/ACCOUNT-EXTENSION.md`.
460
+ * @param account - The account to extend.
461
+ * @param txParams - Optional compute-unit/priority-fee overrides for the transaction.
462
+ * @returns The transaction signature.
463
+ */
464
+ extendAccount(account: PublicKey, txParams?: TxParams): Promise<TransactionSignature>;
465
+ /**
466
+ * Builds the `extendAccount` instruction. See `extendAccount` for semantics.
467
+ * @param account - The account to extend.
468
+ * @param payer - Rent payer; defaults to the wallet.
469
+ * @param authority - `HotRole.AccountExtension` holder; defaults to the wallet.
470
+ * @returns The extend instruction.
471
+ */
472
+ getExtendAccountIx(account: PublicKey, payer?: PublicKey, authority?: PublicKey): Promise<TransactionInstruction>;
473
+ /**
474
+ * Devnet/test only: grows a zero-copy account to an arbitrary larger size, simulating the
475
+ * state right after a struct-growing program upgrade. Requires `HotRole.AccountExtension`
476
+ * like `extendAccount`. The instruction is compiled out of mainnet program builds.
477
+ * @param account - The account to extend.
478
+ * @param newLen - Target account data length in bytes (must be >= the current length).
479
+ * @param txParams - Optional compute-unit/priority-fee overrides for the transaction.
480
+ * @returns The transaction signature.
481
+ */
482
+ extendAccountDevnet(account: PublicKey, newLen: number, txParams?: TxParams): Promise<TransactionSignature>;
483
+ /**
484
+ * Builds the `extendAccountDevnet` instruction. See `extendAccountDevnet` for semantics.
485
+ * @param account - The account to extend.
486
+ * @param newLen - Target account data length in bytes.
487
+ * @param payer - Rent payer; defaults to the wallet.
488
+ * @param authority - `HotRole.AccountExtension` holder; defaults to the wallet.
489
+ * @returns The extend instruction.
490
+ */
491
+ getExtendAccountDevnetIx(account: PublicKey, newLen: number, payer?: PublicKey, authority?: PublicKey): Promise<TransactionInstruction>;
454
492
  /**
455
493
  * Initializes `authority`'s `SignedMsgWsDelegates` account, which lists wallets authorized to
456
494
  * co-sign/relay that authority's signed-message ("swift") orders over a websocket connection
@@ -1573,16 +1611,19 @@ export declare class VelocityClient {
1573
1611
  * @param fromSubAccountId - Sub-account id to debit.
1574
1612
  * @param toSubAccountId - Sub-account id to credit.
1575
1613
  * @param equityFloorDelta - Equity floor (QUOTE_PRECISION) to move from the debited to the credited
1576
- * sub-account along with the funds, keeping the sum of floors constant. The debited side must not
1614
+ * sub-account along with the funds, keeping the sum of floors constant. A proportional share of
1615
+ * the debited side's `equityFloorBuffer` travels with the floor (rounded up on the debited side,
1616
+ * so shedding the whole floor also sheds the whole buffer; no orphan buffer is left on a
1617
+ * check-disabled sub-account), keeping the sum of buffers constant too. The debited side must not
1577
1618
  * already be below the floor being reduced (a below-floor sub-account cannot shed floor to defuse a
1578
- * pending equity-breaker trip), must stay at/above its reduced floor plus its `equityFloorBuffer`,
1579
- * and the credited side's collateral (after the transfer lands) must back its increased floor plus
1580
- * its own buffer, else the transfer reverts with `InvalidEquityFloorTransfer`. Pass `'auto'`
1619
+ * pending equity-breaker trip), must stay at/above its reduced floor plus its reduced buffer,
1620
+ * and the credited side's net equity (after the transfer lands) must back its increased floor plus
1621
+ * its increased buffer, else the transfer reverts with `InvalidEquityFloorTransfer`. Pass `'auto'`
1581
1622
  * (quote market only) to move the minimal floor needed for the debited side to stay at/above its
1582
- * buffered floor: `max(0, amount - max(0, collateral - (floor + buffer)))`, capped at the debited
1623
+ * buffered floor: `max(0, amount - max(0, netEquity - (floor + buffer)))`, capped at the debited
1583
1624
  * side's floor (see `calculateEquityFloorAutoDelta`). The auto delta never exceeds `amount`, so the
1584
1625
  * credited side stays backed whenever it was before. Client-side pricing can differ slightly from
1585
- * the on-chain strict check at the exact boundary; retry with an explicit padded delta if an
1626
+ * the onchain check at the exact boundary; retry with an explicit padded delta if an
1586
1627
  * `'auto'` transfer reverts. Defaults to zero.
1587
1628
  * @param txParams - Optional compute-unit/priority-fee overrides for the transaction.
1588
1629
  * @returns The transaction signature.
@@ -2305,34 +2346,32 @@ export declare class VelocityClient {
2305
2346
  * instructions in a single transaction, so the swap is settled directly against the user's
2306
2347
  * deposits/vault balances rather than the wallet's own token accounts. Sends and confirms the
2307
2348
  * transaction.
2308
- * @param swapClient - Swap client used to fetch routes/instructions (`UnifiedSwapClient` or a
2309
- * `TitanClient`); dispatches to `getSwapIxV2` or `getTitanSwapIx` respectively.
2310
- * @param jupiterClient - @deprecated Use `swapClient` instead. When passed (and `swapClient` is
2311
- * not), dispatches to `getJupiterSwapIxV6`.
2349
+ * @param swapClient - Provider used to quote the swap and build its route: a
2350
+ * `UnifiedSwapClient`, or a `TitanClient`/`JupiterClient` directly. See `getProviderSwapIx`.
2351
+ * @param jupiterClient - @deprecated Use `swapClient` instead. Used only when `swapClient` is
2352
+ * not passed.
2312
2353
  * @param outMarketIndex - Spot market index of the token being bought.
2313
2354
  * @param inMarketIndex - Spot market index of the token being sold.
2314
2355
  * @param outAssociatedTokenAccount - Token account to receive the bought token; created
2315
2356
  * idempotently if omitted.
2316
2357
  * @param inAssociatedTokenAccount - Token account to source the sold token from; created
2317
2358
  * idempotently if omitted.
2318
- * @param amount - Amount of the "in" token (or "out" token when `swapMode` is `ExactOut`, in
2319
- * which case this is the desired output amount), in the token's own mint decimals — not a
2320
- * fixed protocol precision.
2359
+ * @param amount - Amount of the "in" token (or "out" token when the effective mode is
2360
+ * `ExactOut`, in which case this is the desired output amount), in the token's own mint
2361
+ * decimals — not a fixed protocol precision.
2321
2362
  * @param slippageBps - Max slippage in basis points passed to the swap provider's routing API.
2322
- * @param swapMode - `ExactIn` (default) or `ExactOut`.
2363
+ * @param swapMode - `ExactIn` (default) or `ExactOut`. Ignored when `quote` is passed — the
2364
+ * quote's own mode wins.
2323
2365
  * @param reduceOnly - Whether the in/out token's position on the velocity account must reduce
2324
2366
  * (not flip sign); enforced by `endSwap` after the swap completes.
2325
- * @param v6 - @deprecated Use `quote` instead. Pre-fetched Jupiter v6 quote response.
2326
- * @param quote - Pre-fetched quote response (skips an extra round-trip to the swap provider).
2367
+ * @param quote - Pre-fetched quote (skips an extra round-trip to the swap provider). Must be
2368
+ * for this pair and this `amount`.
2327
2369
  * @param txParams - Optional compute-unit/priority-fee overrides.
2328
- * @throws If neither `swapClient` nor `jupiterClient` is provided, or if `swapClient` is not a
2329
- * recognized client type.
2370
+ * @throws If neither `swapClient` nor `jupiterClient` is provided.
2330
2371
  * @returns The transaction signature.
2331
2372
  */
2332
- swap({ swapClient, jupiterClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, reduceOnly, txParams, v6, quote, onlyDirectRoutes, }: {
2333
- swapClient?: UnifiedSwapClient | SwapClient;
2334
- /** @deprecated Use swapClient instead. Legacy parameter for backward compatibility */
2335
- jupiterClient?: JupiterClient;
2373
+ swap({ swapClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, reduceOnly, txParams, quote, onlyDirectRoutes, }: {
2374
+ swapClient?: SwapProvider;
2336
2375
  outMarketIndex: number;
2337
2376
  inMarketIndex: number;
2338
2377
  outAssociatedTokenAccount?: PublicKey;
@@ -2343,49 +2382,59 @@ export declare class VelocityClient {
2343
2382
  reduceOnly?: SwapReduceOnly;
2344
2383
  txParams?: TxParams;
2345
2384
  onlyDirectRoutes?: boolean;
2346
- v6?: {
2347
- quote?: QuoteResponse;
2348
- };
2349
- quote?: UnifiedQuoteResponse;
2385
+ quote?: SwapQuote;
2350
2386
  }): Promise<TransactionSignature>;
2351
2387
  /**
2352
- * Builds the instruction list for a Titan-routed swap: creates any missing associated token
2353
- * accounts, wraps Titan's routing instructions between `beginSwap`/`endSwap`. See `swap` for
2354
- * parameter semantics; `amount` is in the "in" token's mint decimals.
2355
- * @param userAccountPublicKey - Optional user account override (e.g. when the account is being
2356
- * created in the same transaction and not yet resolvable via `getUserAccountPublicKey`).
2357
- * @returns `ixs` — instruction list (ATA creation, `beginSwap`, Titan swap instructions,
2358
- * `endSwap`, in order) and `lookupTables` needed to fit it in a versioned transaction.
2388
+ * Throws unless a quote swaps exactly the pair the `beginSwap`/`endSwap` pair is being built
2389
+ * for. A mismatched quote routes and executes normally, but deposits its output into a token
2390
+ * account `endSwap` isn't watching, so it reverts with `InvalidSwap: amount_out must be
2391
+ * greater than 0` only after the funds have already moved.
2359
2392
  */
2360
- getTitanSwapIx({ titanClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, reduceOnly, userAccountPublicKey, }: {
2361
- titanClient: TitanClient;
2362
- outMarketIndex: number;
2363
- inMarketIndex: number;
2364
- outAssociatedTokenAccount?: PublicKey;
2365
- inAssociatedTokenAccount?: PublicKey;
2366
- amount: BN;
2367
- slippageBps?: number;
2368
- swapMode?: string;
2369
- onlyDirectRoutes?: boolean;
2370
- reduceOnly?: SwapReduceOnly;
2371
- userAccountPublicKey?: PublicKey;
2372
- }): Promise<{
2373
- ixs: TransactionInstruction[];
2374
- lookupTables: AddressLookupTableAccount[];
2375
- }>;
2393
+ protected assertQuoteMatchesMarkets(quote: {
2394
+ inputMint: string;
2395
+ outputMint: string;
2396
+ }, inMarket: SpotMarketAccount, outMarket: SpotMarketAccount): void;
2397
+ /**
2398
+ * Throws unless a quote is for the size the caller asked to swap. `beginSwap` releases funds
2399
+ * sized off the quote, so a quote for a different size moves the wrong amount out of the user's
2400
+ * deposits.
2401
+ */
2402
+ private assertQuoteMatchesAmount;
2376
2403
  /**
2377
- * Builds the instruction list for a Jupiter v6-routed swap: fetches a quote if none is passed,
2378
- * creates any missing associated token accounts, and wraps Jupiter's routing instructions
2379
- * between `beginSwap`/`endSwap`. See `swap` for parameter semantics; `amount` is in the "in"
2380
- * token's mint decimals.
2404
+ * Resolves the wallet's associated token account for a spot market, plus the instruction that
2405
+ * creates it when it doesn't exist yet.
2406
+ */
2407
+ private getOrCreateSwapTokenAccount;
2408
+ /**
2409
+ * Builds the instruction list for a swap routed through any `SwapProvider` (Jupiter, Titan, or
2410
+ * a `UnifiedSwapClient` wrapping either): creates any missing associated token accounts and
2411
+ * wraps the provider's routing instructions between `beginSwap`/`endSwap`.
2412
+ * @param swapProvider - Provider that quotes the swap and builds its route instructions.
2413
+ * @param outMarketIndex - Spot market index of the token being bought.
2414
+ * @param inMarketIndex - Spot market index of the token being sold.
2415
+ * @param outAssociatedTokenAccount - Token account to receive the bought token; created
2416
+ * idempotently if omitted.
2417
+ * @param inAssociatedTokenAccount - Token account to source the sold token from; created
2418
+ * idempotently if omitted.
2419
+ * @param amount - Amount in the "in" token's mint decimals, or the "out" token's when the
2420
+ * effective mode is `ExactOut`.
2421
+ * @param slippageBps - Max slippage in basis points; only used when a quote has to be fetched.
2422
+ * @param swapMode - `ExactIn` (default) or `ExactOut`. The mode a quote is fetched at; the
2423
+ * resulting quote's own mode is what sizes the swap, so it is ignored when `quote` is passed.
2424
+ * @param onlyDirectRoutes - Restricts a fetched quote to single-hop routes.
2425
+ * @param maxAccounts - Account budget for a fetched route.
2426
+ * @param reduceOnly - Which side must not increase in magnitude; enforced by `endSwap`.
2427
+ * @param quote - Pre-fetched quote. Authoritative when passed: its `swapMode` is the effective
2428
+ * mode, and it must be for this pair and this `amount`.
2381
2429
  * @param userAccountPublicKey - Optional user account override (e.g. when the account is being
2382
- * created in the same transaction).
2383
- * @throws If no quote is passed and Jupiter's quote API returns none.
2384
- * @returns `ixs` instruction list (ATA creation, `beginSwap`, Jupiter swap instructions,
2385
- * `endSwap`, in order) and `lookupTables` needed to fit it in a versioned transaction.
2430
+ * created in the same transaction and not yet resolvable via `getUserAccountPublicKey`).
2431
+ * @throws If the quote passed in or freshly fetched is for a different pair or a different
2432
+ * size than the swap being built.
2433
+ * @returns `ixs` ATA creation, `beginSwap`, the route's instructions, `endSwap`, in order
2434
+ * and the `lookupTables` needed to fit them in a versioned transaction.
2386
2435
  */
2387
- getJupiterSwapIxV6({ jupiterClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, quote, reduceOnly, userAccountPublicKey, }: {
2388
- jupiterClient: JupiterClient;
2436
+ getProviderSwapIx({ swapProvider, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, maxAccounts, reduceOnly, quote, userAccountPublicKey, }: {
2437
+ swapProvider: SwapProvider;
2389
2438
  outMarketIndex: number;
2390
2439
  inMarketIndex: number;
2391
2440
  outAssociatedTokenAccount?: PublicKey;
@@ -2394,8 +2443,9 @@ export declare class VelocityClient {
2394
2443
  slippageBps?: number;
2395
2444
  swapMode?: SwapMode;
2396
2445
  onlyDirectRoutes?: boolean;
2397
- quote?: QuoteResponse;
2446
+ maxAccounts?: number;
2398
2447
  reduceOnly?: SwapReduceOnly;
2448
+ quote?: SwapQuote;
2399
2449
  userAccountPublicKey?: PublicKey;
2400
2450
  }): Promise<{
2401
2451
  ixs: TransactionInstruction[];
@@ -2435,37 +2485,6 @@ export declare class VelocityClient {
2435
2485
  beginSwapIx: TransactionInstruction;
2436
2486
  endSwapIx: TransactionInstruction;
2437
2487
  }>;
2438
- /**
2439
- * Builds the instruction list for a swap routed through a `UnifiedSwapClient` (the current
2440
- * preferred swap path). Creates any missing associated token accounts and wraps the client's
2441
- * routing instructions between `beginSwap`/`endSwap`. See `swap` for parameter semantics;
2442
- * `amount` is in the "in" token's mint decimals (or "out" token's decimals when `swapMode` is
2443
- * `ExactOut`).
2444
- * @param userAccountPublicKey - Optional user account override (e.g. when the account is being
2445
- * created in the same transaction).
2446
- * @returns `ixs` — instruction list (ATA creation, `beginSwap`, routed swap instructions,
2447
- * `endSwap`, in order) and `lookupTables` needed to fit it in a versioned transaction.
2448
- */
2449
- getSwapIxV2({ swapClient, outMarketIndex, inMarketIndex, outAssociatedTokenAccount, inAssociatedTokenAccount, amount, slippageBps, swapMode, onlyDirectRoutes, reduceOnly, quote, v6, userAccountPublicKey, }: {
2450
- swapClient: UnifiedSwapClient;
2451
- outMarketIndex: number;
2452
- inMarketIndex: number;
2453
- outAssociatedTokenAccount?: PublicKey;
2454
- inAssociatedTokenAccount?: PublicKey;
2455
- amount: BN;
2456
- slippageBps?: number;
2457
- swapMode?: SwapMode;
2458
- onlyDirectRoutes?: boolean;
2459
- reduceOnly?: SwapReduceOnly;
2460
- quote?: UnifiedQuoteResponse;
2461
- v6?: {
2462
- quote?: QuoteResponse;
2463
- };
2464
- userAccountPublicKey?: PublicKey;
2465
- }): Promise<{
2466
- ixs: TransactionInstruction[];
2467
- lookupTables: AddressLookupTableAccount[];
2468
- }>;
2469
2488
  /**
2470
2489
  * Converts a portion of the user's deposited wSOL (spot market index 1) into mSOL (spot market
2471
2490
  * index 2) by staking it with Marinade Finance, then swapping the resulting mSOL back into the
@@ -2534,11 +2553,12 @@ export declare class VelocityClient {
2534
2553
  getForceCancelOrdersIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, fillerPublicKey?: PublicKey): Promise<TransactionInstruction>;
2535
2554
  /**
2536
2555
  * Keeper instruction: trips the authority-wide equity floor breaker. Proves on-chain that the
2537
- * given subaccount's cross-margin total collateral is below its `equityFloor` (reverts with
2538
- * `SufficientCollateral` otherwise, or if no floor is set) and sets `equityBreakerTripped` on the
2539
- * authority's `UserStats` every subaccount of the authority then rejects risk-increasing fills,
2540
- * withdrawals and transfers out until the warm admin calls `resetEquityFloorBreaker`.
2541
- * Permissionless any signer may trip it; the margin calculation is the proof.
2556
+ * given subaccount's net equity (unweighted assets and perp PnL minus spot liabilities) is below
2557
+ * its `equityFloor` (reverts with `SufficientCollateral` otherwise, if no floor is set, or with
2558
+ * `InvalidOracle` if any of the subaccount's oracles is invalid) and sets `equityBreakerTripped`
2559
+ * on the authority's `UserStats` every subaccount of the authority then rejects risk-increasing
2560
+ * fills, withdrawals and transfers out until the warm admin calls `resetEquityFloorBreaker`.
2561
+ * Permissionless — any signer may trip it; the equity calculation is the proof.
2542
2562
  * @param userAccountPublicKey - Public key of the breached subaccount's user account.
2543
2563
  * @param user - Decoded user account of the breached subaccount.
2544
2564
  * @param txParams - Optional compute-unit/priority-fee overrides.
@@ -3326,7 +3346,8 @@ export declare class VelocityClient {
3326
3346
  * @param userAccountPublicKey - Public key of the user account being liquidated.
3327
3347
  * @param liquidatorSubAccountId - Liquidator's sub-account to credit; defaults to the active sub-account.
3328
3348
  * @param maxAccounts - Caps the number of accounts Jupiter's route may use.
3329
- * @throws If no quote can be fetched and `quote` was not supplied.
3349
+ * @throws If no quote can be fetched and `quote` was not supplied, or if the quote — passed in or
3350
+ * freshly fetched — is for a different pair or a different size than the swap being built.
3330
3351
  * @returns The ordered instructions (pre-instructions, `beginSwap`, Jupiter swap, `endSwap`) and
3331
3352
  * any address lookup tables the Jupiter route requires.
3332
3353
  */
@@ -3340,7 +3361,7 @@ export declare class VelocityClient {
3340
3361
  slippageBps?: number;
3341
3362
  swapMode?: SwapMode;
3342
3363
  onlyDirectRoutes?: boolean;
3343
- quote?: QuoteResponse;
3364
+ quote?: JupiterSwapQuote;
3344
3365
  userAccount: UserAccount;
3345
3366
  userAccountPublicKey: PublicKey;
3346
3367
  liquidatorSubAccountId?: number;