@0dotxyz/p0-ts-sdk 2.10.0-alpha.0 → 2.10.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.
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as superstruct from 'superstruct';
2
2
  import { Infer } from 'superstruct';
3
- import { b as BankType, R as RiskTier, A as AssetTag, c as BankConfigFlag, O as OperationalState, d as OracleSetup, E as EmodeTag, e as EmodeEntryFlags, f as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, g as OperationalStateRaw, h as OracleSetupRaw, i as RiskTierRaw, M as MarginfiProgram, j as BankConfigOpt, k as InterestRateConfig, l as BankConfigType, m as BankConfigRaw, a as BankConfigOptRaw, n as EmodeSettingsType, o as BankRateLimiterType, p as BankRaw, q as BankRateLimiterRaw, r as EmodeSettingsRaw, s as MarginfiIdlType, H as HealthCacheFlags, t as HealthCacheStatus, u as AccountFlags, v as MarginfiAccountType, w as OraclePrice, P as PriceWithConfidence, x as PriceBias, y as OraclePriceDto, z as BankIntegrationMetadataMap, C as BalanceType, D as HealthCacheType, F as EmodePair, G as ActiveEmodePair, J as ActionEmodeImpact, K as MarginRequirementType, L as Amount, N as EmodeImpactStatus, T as TypedAmount, Q as BankVaultType, S as RateLimitWindowType, U as BankIntegrationMetadataMapDto, V as BankIntegrationMetadataDto, X as BankIntegrationMetadata, Y as Bank, Z as Environment, _ as Project0Config, $ as MintData } from './types-Cj6aaTuh.js';
4
- export { ax as AccountType, aC as AmountType, aw as BankAddress, a0 as BankConfig, B as BankConfigCompactRaw, az as BankMap, av as BankMetadata, a3 as BankMetadataRaw, ao as ComputeAssetUsdValueParams, am as ComputeLiabilityUsdValueParams, ak as ComputeUsdValueParams, a8 as EmodeConfigRaw, ab as EmodeEntry, ad as EmodeImpact, a1 as EmodeSettings, af as GetAssetWeightParams, a5 as InterestRateConfigCompactRaw, aa as InterestRateConfigOpt, a6 as InterestRateConfigOptRaw, ay as KaminoStates, as as MARGINFI_IDL, aB as MintDataMap, ac as OracleConfigOpt, a7 as OracleConfigOptRaw, aA as OraclePriceMap, ar as PriceWithConfidenceDto, at as Program, a2 as RateLimitWindowRaw, a9 as RatePoint, a4 as RatePointRaw, au as Wallet, ap as computeAssetUsdValue, an as computeLiabilityUsdValue, aj as computeLoopingParams, ai as computeMaxLeverage, aq as computeTvl, al as computeUsdValue, ag as getAssetWeight, ah as getLiabilityWeight, ae as isWeightedPrice, aD as resolveAmount } from './types-Cj6aaTuh.js';
3
+ import { c as BankType, R as RiskTier, A as AssetTag, d as BankConfigFlag, e as OperationalState, f as OracleSetup, E as EmodeTag, g as EmodeEntryFlags, h as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, i as OperationalStateRaw, j as OracleSetupRaw, k as RiskTierRaw, M as MarginfiProgram, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, o as BankConfigOpt, p as BankConfigOptRaw, q as EmodeSettingsType, r as BankRateLimiterType, s as BankRaw, t as BankRateLimiterRaw, u as EmodeSettingsRaw, v as MarginfiIdlType, H as HealthCacheFlags, w as HealthCacheStatus, x as AccountFlags, y as MarginfiAccountType, z as OraclePrice, P as PriceWithConfidence, C as PriceBias, D as OraclePriceDto, F as BankIntegrationMetadataMap, G as OrderType, J as BalanceType, K as HealthCacheType, L as EmodePair, N as ActiveEmodePair, Q as ActionEmodeImpact, S as MarginRequirementType, a as BankConfigFastRaw, b as BankConfigGovRaw, T as Amount, U as EmodeImpactStatus, O as OrderTrigger, V as TypedAmount, X as BankVaultType, Y as RateLimitWindowType, Z as BankIntegrationMetadataMapDto, _ as BankIntegrationMetadataDto, $ as BankIntegrationMetadata, a0 as Bank, a1 as Environment, a2 as Project0Config, a3 as MintData } from './types--m9sTr2x.js';
4
+ export { aC as AccountType, aH as AmountType, aB as BankAddress, a4 as BankConfig, B as BankConfigCompactRaw, aE as BankMap, aA as BankMetadata, a7 as BankMetadataRaw, as as ComputeAssetUsdValueParams, aq as ComputeLiabilityUsdValueParams, ao as ComputeUsdValueParams, ac as EmodeConfigRaw, af as EmodeEntry, ah as EmodeImpact, a5 as EmodeSettings, aj as GetAssetWeightParams, a9 as InterestRateConfigCompactRaw, ae as InterestRateConfigOpt, aa as InterestRateConfigOptRaw, aD as KaminoStates, ax as MARGINFI_IDL, aG as MintDataMap, ag as OracleConfigOpt, ab as OracleConfigOptRaw, aF as OraclePriceMap, av as OrderTriggerKind, aw as PriceWithConfidenceDto, ay as Program, a6 as RateLimitWindowRaw, ad as RatePoint, a8 as RatePointRaw, az as Wallet, at as computeAssetUsdValue, ar as computeLiabilityUsdValue, an as computeLoopingParams, am as computeMaxLeverage, au as computeTvl, ap as computeUsdValue, ak as getAssetWeight, al as getLiabilityWeight, ai as isWeightedPrice, aI as resolveAmount } from './types--m9sTr2x.js';
5
5
  import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { VersionedTransaction, Transaction, PublicKey, TransactionError, TransactionInstruction, Keypair, Signer, AddressLookupTableAccount, Blockhash, TransactionMessage, Connection, AccountInfo } from '@solana/web3.js';
7
7
  import { Idl, Instruction, Address } from '@coral-xyz/anchor';
8
8
  import BigNumber$1 from 'bignumber.js';
9
9
  import BN from 'bn.js';
10
- import { K as KaminoReserve, D as DriftSpotMarket, d as DriftRewards, J as JupLendingState, f as JupTokenReserve, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, a as KaminoObligation, b as KaminoFarmState, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, c as DriftUser, e as DriftUserStats, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON, g as JupLendingRewardsRateModel, h as JupRateModel } from './dto-farm.types-BAA9xrey.js';
10
+ import { K as KaminoReserve, D as DriftSpotMarket, d as DriftRewards, J as JupLendingState, f as JupTokenReserve, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, a as KaminoObligation, b as KaminoFarmState, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, c as DriftUser, e as DriftUserStats, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON, g as JupLendingRewardsRateModel, h as JupRateModel } from './dto-farm.types-6lrPBcZr.js';
11
11
  import { JupiterClientConfig, QuoteGetRequest, QuoteResponse } from './jupiter.js';
12
12
  import { E as ExponentVault, G as GammaLpVaultRaw, e as GammaWithdrawReceiptRaw } from './types-Pjhu5XMK.js';
13
13
  import { Buffer as Buffer$1 } from 'buffer';
@@ -82,6 +82,9 @@ declare enum TransactionType {
82
82
  UNSTAKE_LST = "UNSTAKE_LST",
83
83
  WITHDRAW_EMISSIONS = "WITHDRAW_EMISSIONS",
84
84
  LIQUIDATE_ACCOUNT = "LIQUIDATE_ACCOUNT",
85
+ PLACE_ORDER = "PLACE_ORDER",
86
+ CLOSE_ORDER = "CLOSE_ORDER",
87
+ UPDATE_ORDER = "UPDATE_ORDER",
85
88
  CREATE_PERM_BANK = "CREATE_PERM_BANK",
86
89
  CREATE_GROUP = "CREATE_GROUP",
87
90
  JUPITER_SWAP = "JUPITER_SWAP"
@@ -138,6 +141,18 @@ declare function selectLutsForAccountAction(luts: AddressLookupTableAccount[], t
138
141
  declare function isV0Tx(tx: Transaction | VersionedTransaction): tx is VersionedTransaction;
139
142
  declare function isFlashloan(tx: SolanaTransaction): boolean;
140
143
  declare function makeVersionedTransaction(blockhash: Blockhash, transaction: Transaction, payer: PublicKey, addressLookupTables?: AddressLookupTableAccount[]): Promise<VersionedTransaction>;
144
+ /**
145
+ * Whether the instructions compile into one v0 transaction within MAX_TX_SIZE (minus
146
+ * `sizeMargin`, if given) and `maxAccountLocks` account locks (if given).
147
+ */
148
+ declare function fitsInOneTransaction(ixs: TransactionInstruction[], opts: {
149
+ payerKey: PublicKey;
150
+ luts: AddressLookupTableAccount[];
151
+ /** Bytes reserved below MAX_TX_SIZE, e.g. for compute-budget ixs appended at send time. */
152
+ sizeMargin?: number;
153
+ /** Also cap the total account locks (e.g. MAX_ACCOUNT_LOCKS). */
154
+ maxAccountLocks?: number;
155
+ }): boolean;
141
156
  /**
142
157
  * Splits your instructions into as many VersionedTransactions as needed
143
158
  * so that none exceed MAX_TX_SIZE (minus `sizeMargin`, if given) nor
@@ -152,6 +167,15 @@ declare function splitInstructionsToFitTransactions(mandatoryIxs: TransactionIns
152
167
  /** Also cap the total account locks per transaction (e.g. MAX_ACCOUNT_LOCKS). */
153
168
  maxAccountLocks?: number;
154
169
  }): VersionedTransaction[];
170
+ /**
171
+ * Builds the transactions that run before an action: setup (ATA creation and the like) tagged
172
+ * `CREATE_ATA`, then venue refreshes tagged `CRANK`, each split to fit.
173
+ */
174
+ declare function makePreludeTxs(setupIxs: TransactionInstruction[], refreshIxs: TransactionInstruction[], opts: {
175
+ blockhash: string;
176
+ payerKey: PublicKey;
177
+ luts: AddressLookupTableAccount[];
178
+ }): ExtendedV0Transaction[];
155
179
  /**
156
180
  * Enhances a given transaction with additional metadata.
157
181
  *
@@ -302,6 +326,7 @@ interface BankTypeDto {
302
326
  premiumTag?: number;
303
327
  premiumActive?: boolean;
304
328
  premiumActivatedAt?: number;
329
+ kaminoEmergency?: boolean;
305
330
  rateLimiter?: BankRateLimiterDto;
306
331
  feesDestinationAccount?: string;
307
332
  lendingPositionCount?: string;
@@ -412,7 +437,15 @@ interface EmodeEntryRawDto {
412
437
  assetWeightMaint: WrappedI80F48;
413
438
  }
414
439
 
415
- declare function freezeBankConfigIx(program: MarginfiProgram, bankAddress: PublicKey, bankConfigOpt: BankConfigOpt): Promise<InstructionsWrapper>;
440
+ /**
441
+ * Freezes a bank's settings so they can no longer be changed. Signed by the group's governance
442
+ * admin.
443
+ *
444
+ * @param program - The marginfi program
445
+ * @param bankAddress - The bank to freeze
446
+ * @returns The `lending_pool_configure_bank_gov` instruction
447
+ */
448
+ declare function freezeBankConfigIx(program: MarginfiProgram, bankAddress: PublicKey): Promise<InstructionsWrapper>;
416
449
  type AddOracleToBanksIxArgs = {
417
450
  program: MarginfiProgram;
418
451
  bankAddress: PublicKey;
@@ -423,9 +456,9 @@ type AddOracleToBanksIxArgs = {
423
456
  oracleAccounts?: PublicKey[];
424
457
  setup: OracleSetup;
425
458
  groupAddress?: PublicKey;
426
- adminAddress?: PublicKey;
459
+ governanceAdminAddress?: PublicKey;
427
460
  };
428
- declare function addOracleToBanksIx({ program, bankAddress, feedId, oracleKey, oracleAccounts, setup, groupAddress, adminAddress, }: AddOracleToBanksIxArgs): Promise<InstructionsWrapper>;
461
+ declare function addOracleToBanksIx({ program, bankAddress, feedId, oracleKey, oracleAccounts, setup, groupAddress, governanceAdminAddress, }: AddOracleToBanksIxArgs): Promise<InstructionsWrapper>;
429
462
  type SetOraclePriceIxArgs = {
430
463
  program: MarginfiProgram;
431
464
  bankAddress: PublicKey;
@@ -434,19 +467,24 @@ type SetOraclePriceIxArgs = {
434
467
  /** Fixed venue account, [Pyth, Exponent vault], or [Exponent vault], depending on setup. */
435
468
  oracleAccounts?: PublicKey[];
436
469
  groupAddress?: PublicKey;
437
- adminAddress?: PublicKey;
470
+ governanceAdminAddress?: PublicKey;
438
471
  };
439
- /** Configure a flat fixed price or an Exponent PT price using the 0.1.11 instruction. */
440
- declare function setOraclePriceIx({ program, bankAddress, price, setup, oracleAccounts, groupAddress, adminAddress, }: SetOraclePriceIxArgs): Promise<InstructionsWrapper>;
472
+ /** Configure a flat fixed price or an Exponent PT price, signed by the group's governance admin. */
473
+ declare function setOraclePriceIx({ program, bankAddress, price, setup, oracleAccounts, groupAddress, governanceAdminAddress, }: SetOraclePriceIxArgs): Promise<InstructionsWrapper>;
441
474
  type ConfigureScopeOracleIxArgs = {
442
475
  program: MarginfiProgram;
443
- bankAddress: PublicKey;
476
+ bank: BankType;
444
477
  oracle: PublicKey;
445
478
  entryIndex: number;
446
479
  groupAddress?: PublicKey;
447
- adminAddress?: PublicKey;
480
+ governanceAdminAddress?: PublicKey;
448
481
  };
449
- declare function configureScopeOracleIx({ program, bankAddress, oracle, entryIndex, groupAddress, adminAddress, }: ConfigureScopeOracleIxArgs): Promise<InstructionsWrapper>;
482
+ /**
483
+ * Point a bank at an entry in a Scope OraclePrices account, signed by the group's governance admin.
484
+ * The program picks Scope, ScopeKamino or ScopeJuplend from the bank's asset tag; for Kamino and
485
+ * JupLend banks the reserve / lending account it validates is taken from `bank.config.oracleKeys[1]`.
486
+ */
487
+ declare function configureScopeOracleIx({ program, bank, oracle, entryIndex, groupAddress, governanceAdminAddress, }: ConfigureScopeOracleIxArgs): Promise<InstructionsWrapper>;
450
488
 
451
489
  declare function serializeBankConfigOpt(bankConfigOpt: BankConfigOpt): BankConfigOptRaw;
452
490
  declare function serializeInterestRateConfig(interestRateConfig: InterestRateConfig): InterestRateConfigRaw;
@@ -573,6 +611,7 @@ declare function getLiabilityShares(bank: BankType, liabilityQuantity: BigNumber
573
611
  interface BalanceRaw {
574
612
  active: boolean | number;
575
613
  bankPk: PublicKey;
614
+ tag: number;
576
615
  assetShares: WrappedI80F48;
577
616
  liabilityShares: WrappedI80F48;
578
617
  premiumRateSnapshot: number;
@@ -600,12 +639,31 @@ interface MarginfiAccountRaw {
600
639
  authority: PublicKey;
601
640
  lendingAccount: {
602
641
  balances: BalanceRaw[];
642
+ lastTagUsed: number;
603
643
  };
604
644
  accountFlags: BN;
605
645
  emissionsDestinationAccount: PublicKey;
606
646
  healthCache: HealthCacheRaw;
647
+ activeOrders: number;
607
648
  padding0?: BN[];
608
649
  }
650
+ type OrderTriggerTypeRaw = {
651
+ stopLoss: Record<string, never>;
652
+ } | {
653
+ takeProfit: Record<string, never>;
654
+ } | {
655
+ both: Record<string, never>;
656
+ };
657
+ interface OrderRaw {
658
+ marginfiAccount: PublicKey;
659
+ stopLoss: WrappedI80F48;
660
+ takeProfit: WrappedI80F48;
661
+ createdAt: BN;
662
+ maxSlippage: number;
663
+ tags: number[];
664
+ trigger: OrderTriggerTypeRaw;
665
+ bump: number;
666
+ }
609
667
  type MarginRequirementTypeRaw = {
610
668
  initial: Record<string, never>;
611
669
  } | {
@@ -617,6 +675,8 @@ type MarginRequirementTypeRaw = {
617
675
  interface BalanceTypeDto {
618
676
  active: boolean;
619
677
  bankPk: string;
678
+ /** Optional for backwards compatibility with DTOs serialized before order tags existed. */
679
+ tag?: number;
620
680
  assetShares: string;
621
681
  liabilityShares: string;
622
682
  premiumRate: string;
@@ -643,6 +703,8 @@ interface MarginfiAccountTypeDto {
643
703
  accountFlags: AccountFlags[];
644
704
  emissionsDestinationAccount: string;
645
705
  healthCache: HealthCacheTypeDto;
706
+ /** Optional so DTOs cached before the field existed still parse (defaults to 0). */
707
+ activeOrders?: number;
646
708
  }
647
709
 
648
710
  interface SimulationResultRaw {
@@ -1170,6 +1232,7 @@ declare function runSwapEngine(req: SwapEngineRequest): Promise<SwapEngineResult
1170
1232
 
1171
1233
  declare const EMPTY_HEALTH_CACHE: HealthCacheRaw;
1172
1234
  declare function decodeAccountRaw(encoded: Buffer, idl: MarginfiIdlType): MarginfiAccountRaw;
1235
+ declare function parseOrderRaw(orderAddress: PublicKey, orderRaw: OrderRaw): OrderType;
1173
1236
  declare function parseBalanceRaw(balanceRaw: BalanceRaw): BalanceType;
1174
1237
  declare function parseHealthCacheRaw(healthCacheRaw: HealthCacheRaw): HealthCacheType;
1175
1238
  declare function parseMarginfiAccountRaw(marginfiAccountPk: PublicKey, accountData: MarginfiAccountRaw): MarginfiAccountType;
@@ -1637,6 +1700,31 @@ declare function getBalanceUsdValueWithPriceBias(params: GetBalanceUsdValueWithP
1637
1700
  assets: BigNumber$1;
1638
1701
  liabilities: BigNumber$1;
1639
1702
  };
1703
+ interface OrderPairLegValueInput {
1704
+ balance: BalanceType;
1705
+ bank: BankType;
1706
+ oraclePrice: OraclePrice;
1707
+ assetShareValueMultiplier?: BigNumber$1;
1708
+ }
1709
+ /**
1710
+ * Values an order's collateral/debt pair the way the program's trigger does
1711
+ * (`get_tagged_account_health_components`): Equity requirement, so the time-weighted (EMA) price
1712
+ * at weight 1, with the collateral at the low end of the confidence band and the debt at the high
1713
+ * end. Isolated-tier collateral counts as 0. Take-profit fires at `netUsd >= takeProfit`, stop-loss
1714
+ * at `netUsd <= stopLoss`.
1715
+ *
1716
+ * @param params.collateral - The order's asset-side balance with its bank and oracle price
1717
+ * @param params.debt - The order's liability-side balance with its bank and oracle price
1718
+ * @returns USD values of both legs and the net value the trigger compares against
1719
+ */
1720
+ declare function computeOrderPairNetValue(params: {
1721
+ collateral: OrderPairLegValueInput;
1722
+ debt: OrderPairLegValueInput;
1723
+ }): {
1724
+ collateralUsd: BigNumber$1;
1725
+ debtUsd: BigNumber$1;
1726
+ netUsd: BigNumber$1;
1727
+ };
1640
1728
  /**
1641
1729
  * Computes the native token quantities for a balance.
1642
1730
  *
@@ -1748,6 +1836,19 @@ declare function getActiveBalances(balances: BalanceType[]): BalanceType[];
1748
1836
  * ```
1749
1837
  */
1750
1838
  declare function getBalance(bankAddress: PublicKey, balances: BalanceType[]): BalanceType;
1839
+ /**
1840
+ * Maps an order's balance tags to the collateral (asset) and debt (liability) banks of the
1841
+ * account that owns it, without throwing: a leg whose tagged balance was closed comes back null
1842
+ * (the order is orphaned and can no longer execute). The tag order in `order.tags` follows the
1843
+ * caller-supplied bank key order at placement time, so the side is inferred from the balances.
1844
+ *
1845
+ * @param marginfiAccount - The parsed marginfi account that owns the order
1846
+ * @param order - The order whose bank pair to resolve
1847
+ */
1848
+ declare function resolveOrderLegs(marginfiAccount: MarginfiAccountType, order: Pick<OrderType, "tags">): {
1849
+ collateralBank: PublicKey | null;
1850
+ debtBank: PublicKey | null;
1851
+ };
1751
1852
 
1752
1853
  /**
1753
1854
  * Account-Level Metrics
@@ -1966,13 +2067,13 @@ interface MarginfiGroupRaw {
1966
2067
  */
1967
2068
  rateLimiter?: BankRateLimiterRaw;
1968
2069
  /** Variable borrow premium table header; the first `entryCount` of `premiumEntries` are live */
1969
- premiumSettings?: {
2070
+ premiumSettings: {
1970
2071
  timestamp: BN;
1971
2072
  entryCount: number;
1972
2073
  entryCapacity: number;
1973
2074
  };
1974
2075
  /** Premium rate per (collateral tag, liability tag), sorted by that pair */
1975
- premiumEntries?: {
2076
+ premiumEntries: {
1976
2077
  collateralTag: number;
1977
2078
  liabilityTag: number;
1978
2079
  rate: number;
@@ -2016,10 +2117,20 @@ type MarginfiGroupTypeDto = {
2016
2117
  */
2017
2118
  declare function isGroupRateLimiterEnabled(rateLimiter?: BankRateLimiterType): boolean;
2018
2119
 
2019
- declare function makePoolConfigureBankIx(program: MarginfiProgram, bank: PublicKey, args: BankConfigOptRaw): Promise<InstructionsWrapper>;
2120
+ declare function makePoolConfigureBankIx(program: MarginfiProgram, bank: PublicKey, args: BankConfigFastRaw): Promise<InstructionsWrapper>;
2121
+ /**
2122
+ * Configures a bank's governance settings (weights, risk tier, asset tag, oracle limits,
2123
+ * tokenless repayments, freezing, returning to operational). Signed by the group's governance admin.
2124
+ *
2125
+ * @param program - The marginfi program
2126
+ * @param bank - The bank to configure
2127
+ * @param args - The settings to change; `null` leaves a setting unchanged
2128
+ * @returns The `lending_pool_configure_bank_gov` instruction
2129
+ */
2130
+ declare function makePoolConfigureBankGovIx(program: MarginfiProgram, bank: PublicKey, args: BankConfigGovRaw): Promise<InstructionsWrapper>;
2020
2131
  declare function makeAddPermissionlessStakedBankIx(program: MarginfiProgram, group: PublicKey, voteAccountAddress: PublicKey, feePayer: PublicKey, pythOracle: PublicKey): Promise<InstructionsWrapper>;
2021
2132
  declare function makePoolAddBankIx(program: MarginfiProgram, group: PublicKey, bank: PublicKey, feePayer: PublicKey, bankMint: PublicKey, bankConfig: BankConfigOpt, tokenProgram?: PublicKey, overrideOpt?: {
2022
- admin?: PublicKey;
2133
+ governanceAdmin?: PublicKey;
2023
2134
  globalFeeWallet?: PublicKey;
2024
2135
  }): Promise<InstructionsWrapper>;
2025
2136
 
@@ -2079,6 +2190,31 @@ interface ComputePremiumRatesParams {
2079
2190
  * @returns Rate by bank address, for every premium-active bank in `banksMap`
2080
2191
  */
2081
2192
  declare function computePremiumRatesByBank(params: ComputePremiumRatesParams): Map<string, BigNumber>;
2193
+ /**
2194
+ * One collateral's part in a liability's premium rate
2195
+ */
2196
+ interface PremiumCollateralBreakdown {
2197
+ /** Collateral bank address */
2198
+ bank: PublicKey;
2199
+ /** The collateral bank's premium tag (0 = untagged) */
2200
+ tag: number;
2201
+ /** Collateral USD counted toward the rate: unweighted, at the Initial-requirement low price */
2202
+ usd: BigNumber;
2203
+ /** Rate of this collateral's tag against the liability's tag (APR fraction); 0 without a pair */
2204
+ pairRate: BigNumber;
2205
+ /** usd x pairRate / total collateral USD; the rows sum to the liability's rate */
2206
+ contributionApr: BigNumber;
2207
+ }
2208
+ /**
2209
+ * Per-collateral breakdown of the rate {@link computePremiumRatesByBank} gives `liabilityBank`:
2210
+ * one row per collateral that counts toward premium. Isolated, zero-maintenance-weight and unpriced
2211
+ * collateral are left out, as on-chain.
2212
+ *
2213
+ * @param params - Account state and the group's premium table
2214
+ * @param liabilityBank - The premium-active bank borrowed from (or to be borrowed from)
2215
+ * @returns Rows whose `contributionApr` sums to the rate; empty when the bank has no premium
2216
+ */
2217
+ declare function computePremiumBreakdown(params: ComputePremiumRatesParams, liabilityBank: PublicKey): PremiumCollateralBreakdown[];
2082
2218
  /**
2083
2219
  * An action whose effect on premium rates is previewed by {@link computePremiumImpact}
2084
2220
  */
@@ -2100,11 +2236,13 @@ interface PremiumImpact {
2100
2236
  refreshes: boolean;
2101
2237
  /**
2102
2238
  * Every premium-active debt after the actions, by bank address: the stored rate before (absent
2103
- * for a new borrow) and the refreshed rate after. APR fractions.
2239
+ * for a new borrow), the refreshed rate after (APR fractions), and the per-collateral breakdown
2240
+ * of the rate after.
2104
2241
  */
2105
2242
  liabilities: Map<string, {
2106
2243
  before?: BigNumber;
2107
2244
  after: BigNumber;
2245
+ breakdown: PremiumCollateralBreakdown[];
2108
2246
  }>;
2109
2247
  /** Yearly premium in USD across those debts: principal x rate, before and after */
2110
2248
  annualPremiumUsd: {
@@ -2330,6 +2468,25 @@ declare const fetchMarginfiAccountData: (program: MarginfiProgram, marginfiAccou
2330
2468
  marginfiAccount: MarginfiAccountType;
2331
2469
  error?: HealthCacheSimulationError;
2332
2470
  }>;
2471
+ /**
2472
+ * Fetches all open orders for a marginfi account.
2473
+ *
2474
+ * @param program - The marginfi Anchor program (connection is taken from its provider)
2475
+ * @param marginfiAccount - The marginfi account public key
2476
+ */
2477
+ declare const fetchOrdersForAccount: (program: MarginfiProgram, marginfiAccount: PublicKey) => Promise<OrderType[]>;
2478
+ /**
2479
+ * Fetches the order fees from the program's global `FeeState`.
2480
+ *
2481
+ * - `placementFeeLamports`: flat SOL fee charged by `place_order` (and again on every update).
2482
+ * - `executionMaxFee`: the share of the pair's net value a keeper may keep on a take-profit.
2483
+ *
2484
+ * @param program - The marginfi Anchor program
2485
+ */
2486
+ declare const fetchOrderFees: (program: MarginfiProgram) => Promise<{
2487
+ placementFeeLamports: number;
2488
+ executionMaxFee: BigNumber$1;
2489
+ }>;
2333
2490
  /**
2334
2491
  * Generates a random available account index that doesn't collide with existing accounts.
2335
2492
  * Account indices are 0-255 (u8 range).
@@ -2423,6 +2580,27 @@ interface ComputeMaxBorrowForBankParams {
2423
2580
  * ```
2424
2581
  */
2425
2582
  declare function computeMaxBorrowForBank(params: ComputeMaxBorrowForBankParams): BigNumber$1;
2583
+ /**
2584
+ * The binding window of a bank's own outflow (withdraws + borrows) rate limiter.
2585
+ */
2586
+ interface BankOutflowRateLimit {
2587
+ window: "hourly" | "daily";
2588
+ /** Remaining outflow in underlying UI units, clamped at 0 */
2589
+ remaining: BigNumber$1;
2590
+ }
2591
+ /**
2592
+ * The tighter of a bank's hourly and daily outflow windows, in the underlying UI units that
2593
+ * {@link computeMaxWithdrawForBank} and {@link computeMaxBorrowForBank} clamp to.
2594
+ *
2595
+ * Every venue's withdraw records the underlying token amount on the bank limiter (Kamino and
2596
+ * Solend the redeemed liquidity, Drift `token_amount`, JupLend `native_outflow`), except STAKED
2597
+ * banks, which record the LST amount — multiplied here by the LST→SOL rate to reach the SDK's
2598
+ * SOL-equivalent space.
2599
+ *
2600
+ * @returns The window with the least remaining capacity, or `null` when the bank has no rate
2601
+ * limiter enabled
2602
+ */
2603
+ declare function computeBankOutflowRateLimit(bank: BankType, assetShareValueMultiplier?: BigNumber$1): BankOutflowRateLimit | null;
2426
2604
  /**
2427
2605
  * Configuration for computing maximum withdraw amount for a bank
2428
2606
  */
@@ -2656,6 +2834,25 @@ declare function isWholePosition(position: {
2656
2834
  amount: number;
2657
2835
  isLending: boolean;
2658
2836
  }, amount: number, mintDecimals: number): boolean;
2837
+ /**
2838
+ * Whether a position in `bank` counts toward the program's per-account limit on integration
2839
+ * (Kamino, Drift, Solend, JupLend) and staked positions.
2840
+ *
2841
+ * @param bank - The bank to check
2842
+ * @returns True for integration and staked banks
2843
+ */
2844
+ declare function isCostlyBank(bank: BankType): boolean;
2845
+ /**
2846
+ * Whether depositing into `bank` opens a position past the program's limit of
2847
+ * {@link MAX_COSTLY_POSITIONS} integration and staked positions. Topping up an existing position
2848
+ * never does.
2849
+ *
2850
+ * @param balances - The account's balances before the deposit
2851
+ * @param bankMap - Map of bank addresses to bank data
2852
+ * @param bank - The bank deposited into
2853
+ * @returns True when the program would reject the deposit (6073)
2854
+ */
2855
+ declare function exceedsCostlyPositionLimit(balances: BalanceType[], bankMap: Map<string, BankType>, bank: BankType): boolean;
2659
2856
 
2660
2857
  /**
2661
2858
  * Synchronous flashloan TX size estimator.
@@ -2968,6 +3165,7 @@ declare function makeCloseMarginfiAccountTx({ connection, program, marginfiAccou
2968
3165
  * wallet adapter; a `Keypair` is a separate fee payer that signs directly.
2969
3166
  * Defaults to the account's current authority.
2970
3167
  * @returns Versioned transaction to transfer the account
3168
+ * @throws TransactionBuildingError (ACCOUNT_DISABLED) when the account is disabled, e.g. already transferred
2971
3169
  */
2972
3170
  declare function makeAccountTransferToNewAccountTx({ connection, program, marginfiAccount, newMarginfiAccount, newAuthority, feePayer, }: MakeAccountTransferToNewAccountTxParams): Promise<ExtendedV0Transaction>;
2973
3171
  /**
@@ -3028,6 +3226,9 @@ declare function makePulseHealthIx(program: MarginfiProgram, marginfiAccount: Ma
3028
3226
  * rewrites the account's variable borrow premium rates from its collateral after the action.
3029
3227
  * See {@link needsPremiumRefresh} for when it's needed.
3030
3228
  *
3229
+ * Best-effort: returns no instructions when a bank to refresh has no venue state in
3230
+ * `bankMetadataMap`, since `pulse_health` skips the premium write when a leg can't be priced.
3231
+ *
3031
3232
  * @param program - The Marginfi program instance
3032
3233
  * @param state - The account (before the action), bank map and venue state
3033
3234
  * @param mandatoryBanks - Banks the action opens (the deposited bank)
@@ -3035,6 +3236,31 @@ declare function makePulseHealthIx(program: MarginfiProgram, marginfiAccount: Ma
3035
3236
  * @returns Instructions to append after the action
3036
3237
  */
3037
3238
  declare function makePremiumRefreshIxs(program: MarginfiProgram, { marginfiAccount, bankMap, bankMetadataMap }: PremiumRefreshParams, mandatoryBanks: PublicKey[], excludedBanks: PublicKey[]): Promise<TransactionInstruction[]>;
3239
+ /**
3240
+ * Appends the premium refresh ({@link makePremiumRefreshIxs}) to a deposit or repay that lands in
3241
+ * one transaction, and picks the lookup tables to compile it with. The refresh is left out when
3242
+ * `opts.skipPremiumRefresh` is set, no premium-bearing debt remains, venue state is missing, or
3243
+ * it would push the transaction past MAX_TX_SIZE / MAX_ACCOUNT_LOCKS.
3244
+ *
3245
+ * @param params - The builder's params: account (before the action), bank map, venue state,
3246
+ * acted-on bank, authority and lookup tables
3247
+ * @param actionIxs - The action's instructions
3248
+ * @param mandatoryBanks - Banks the action opens (the deposited bank)
3249
+ * @param excludedBanks - Banks the action closes (fully repaid banks)
3250
+ * @returns The transaction's instructions and lookup tables
3251
+ */
3252
+ declare function appendPremiumRefresh(params: PremiumRefreshParams & {
3253
+ program: MarginfiProgram;
3254
+ bank: BankType;
3255
+ authority: PublicKey;
3256
+ luts: AddressLookupTableAccount[];
3257
+ opts?: {
3258
+ skipPremiumRefresh?: boolean;
3259
+ };
3260
+ }, actionIxs: TransactionInstruction[], mandatoryBanks: PublicKey[], excludedBanks: PublicKey[]): Promise<{
3261
+ instructions: TransactionInstruction[];
3262
+ luts: AddressLookupTableAccount[];
3263
+ }>;
3038
3264
  declare function generateDummyAccount(group: PublicKey, authority: PublicKey, accountKey: PublicKey): MarginfiAccountType;
3039
3265
 
3040
3266
  declare function makeDriftWithdrawIx({ program, bank, bankMap, tokenProgram, amount, marginfiAccount, driftSpotMarket, userRewards, authority, withdrawAll, isSync, opts, }: MakeDriftWithdrawIxParams): Promise<InstructionsWrapper>;
@@ -3469,6 +3695,8 @@ declare function makeRollPtTx(params: MakeRollPtTxParams): Promise<{
3469
3695
  transactions: ExtendedV0Transaction[];
3470
3696
  actionTxIndex: number;
3471
3697
  quoteResponse: SwapQuoteResult | undefined;
3698
+ /** true → send as ONE atomic Jito bundle (integration refreshes go stale within a slot) */
3699
+ mustBeAtomicBundle: boolean;
3472
3700
  }>;
3473
3701
 
3474
3702
  /** A single built swap leg (its txs + the swap-engine quote). */
@@ -3627,11 +3855,55 @@ declare function makeTransferPositionsTx(params: MakeTransferPositionsTxParams):
3627
3855
  declare function makeBulkWithdrawTx(params: MakeBulkWithdrawTxParams): Promise<BulkLendTxsResult>;
3628
3856
  /**
3629
3857
  * Repay the FULL debt of every given bank from the wallet, packing as many
3630
- * repays per transaction as fit. Repays carry no health pack and need no
3631
- * oracle cranks, so most batches are a single transaction.
3858
+ * repays per transaction as fit, followed by the premium refresh while
3859
+ * premium-bearing debt remains. Most batches are a single transaction; one
3860
+ * that splits with a premium refresh in it must land as one bundle.
3632
3861
  */
3633
3862
  declare function makeBulkRepayTx(params: MakeBulkRepayTxParams): Promise<BulkLendTxsResult>;
3634
3863
 
3864
+ /**
3865
+ * Converts USD-equity thresholds into the on-chain `OrderTrigger` argument.
3866
+ *
3867
+ * @throws {TransactionBuildingError} `ORDER_INVALID_TRIGGER` if neither threshold is set, a
3868
+ * threshold is not above 0, or take-profit ≤ stop-loss; `ORDER_INVALID_SLIPPAGE` via
3869
+ * {@link percentToMaxSlippageU32}
3870
+ */
3871
+ declare function buildOrderTrigger(params: OrderTriggerParams): OrderTrigger;
3872
+ /**
3873
+ * Creates the instruction that places a take-profit / stop-loss order on a collateral/debt pair.
3874
+ * The order PDA is derived from the pair, so placing a second order on the same pair fails;
3875
+ * use {@link makeUpdateOrderTx} to change an existing order.
3876
+ *
3877
+ * The account must already hold (or, when bundled after a borrow/loop, will hold) an asset
3878
+ * balance in `collateralBank` and a liability balance in `debtBank`. The flat anti-spam fee from
3879
+ * the program's fee state is charged to `feePayer`.
3880
+ */
3881
+ declare function makePlaceOrderIx(params: MakePlaceOrderIxParams): Promise<InstructionsWrapper>;
3882
+ /**
3883
+ * Creates the instruction that closes an order and returns its rent to `feeRecipient`.
3884
+ */
3885
+ declare function makeCloseOrderIx(params: MakeCloseOrderIxParams): Promise<InstructionsWrapper>;
3886
+ /**
3887
+ * Builds a transaction that places a new order on a collateral/debt pair.
3888
+ *
3889
+ * @see {@link makePlaceOrderIx}
3890
+ */
3891
+ declare function makePlaceOrderTx(params: MakePlaceOrderTxParams): Promise<ExtendedV0Transaction>;
3892
+ /**
3893
+ * Builds a transaction that closes an existing order.
3894
+ *
3895
+ * @see {@link makeCloseOrderIx}
3896
+ */
3897
+ declare function makeCloseOrderTx(params: MakeCloseOrderTxParams): Promise<ExtendedV0Transaction>;
3898
+ /**
3899
+ * Builds a transaction that replaces the pair's existing order with new thresholds.
3900
+ *
3901
+ * There is no update instruction on-chain: the existing order (same PDA) is closed and re-placed
3902
+ * in one transaction. Balance tags are preserved across the close, so other orders sharing a
3903
+ * balance are unaffected. The flat anti-spam fee is charged again.
3904
+ */
3905
+ declare function makeUpdateOrderTx(params: MakePlaceOrderTxParams): Promise<ExtendedV0Transaction>;
3906
+
3635
3907
  /**
3636
3908
  * Creates instructions to refresh Kamino lending protocol reserves and obligations.
3637
3909
  *
@@ -3644,6 +3916,7 @@ declare function makeBulkRepayTx(params: MakeBulkRepayTxParams): Promise<BulkLen
3644
3916
  * @param newBanksPk - Public keys of new banks being added to the account
3645
3917
  * @param bankMetadataMap - Map containing Bank-specific metadata (reserve states, lending markets)
3646
3918
  * @returns InstructionsWrapper containing refresh reserve and obligation instructions
3919
+ * @throws TransactionBuildingError (KAMINO_RESERVE_NOT_FOUND) when a Kamino bank has no reserve state in `bankMetadataMap`
3647
3920
  */
3648
3921
  declare function makeRefreshKaminoBanksIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, newBanksPk: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap): InstructionsWrapper;
3649
3922
 
@@ -3660,6 +3933,7 @@ declare function makeRefreshKaminoBanksIxs(marginfiAccount: MarginfiAccountType,
3660
3933
  * @param banksToExclude - Public keys of banks to exclude from the update
3661
3934
  * @param bankMetadataMap - Map containing Bank-specific metadata (Drift spot market states)
3662
3935
  * @returns InstructionsWrapper containing Drift spot market update instructions
3936
+ * @throws TransactionBuildingError (DRIFT_STATE_NOT_FOUND) when a Drift bank has no spot market state in `bankMetadataMap`
3663
3937
  */
3664
3938
  declare function makeUpdateDriftMarketIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, banksToExclude: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap): InstructionsWrapper;
3665
3939
 
@@ -3679,6 +3953,7 @@ declare function makeUpdateDriftMarketIxs(marginfiAccount: MarginfiAccountType,
3679
3953
  * @param banksToExclude - Public keys of banks to exclude from the update
3680
3954
  * @param bankMetadataMap - Map containing Bank-specific metadata (JupLend lending states)
3681
3955
  * @returns InstructionsWrapper containing update_rate instructions
3956
+ * @throws TransactionBuildingError (JUPLEND_STATE_NOT_FOUND) when a JupLend bank has no lending state in `bankMetadataMap`
3682
3957
  */
3683
3958
  declare function makeUpdateJupLendRateIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, banksToExclude: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap): InstructionsWrapper;
3684
3959
 
@@ -3696,6 +3971,7 @@ declare function makeUpdateJupLendRateIxs(marginfiAccount: MarginfiAccountType,
3696
3971
  * @param bankMetadataMap - Map containing Bank-specific metadata (integration states)
3697
3972
  * @param kaminoNewBanksPk - Banks to union into the Kamino refresh set, defaults to `banksToExclude`
3698
3973
  * @returns InstructionsWrapper with instructions ordered kamino -> drift -> juplend
3974
+ * @throws TransactionBuildingError (KAMINO_RESERVE_NOT_FOUND, DRIFT_STATE_NOT_FOUND, JUPLEND_STATE_NOT_FOUND) when a bank to refresh has no venue state in `bankMetadataMap`
3699
3975
  */
3700
3976
  declare function makeRefreshIntegrationBanksIxs(marginfiAccount: MarginfiAccountType, bankMap: Map<string, BankType>, banksToExclude: PublicKey[], bankMetadataMap: BankIntegrationMetadataMap, kaminoNewBanksPk?: PublicKey[]): InstructionsWrapper;
3701
3977
 
@@ -3987,7 +4263,8 @@ interface MakeKaminoDepositIxParams {
3987
4263
  * Account state the deposit and repay transaction builders use to add `pulse_health` after the
3988
4264
  * action while the account has premium-bearing debt, so the program rewrites its variable borrow
3989
4265
  * premium rates as the transaction lands (deposits and repays don't refresh them on their own).
3990
- * Opt out with `opts.skipPremiumRefresh`.
4266
+ * Opt out with `opts.skipPremiumRefresh`. The single-transaction builders leave it out when it
4267
+ * doesn't fit next to the action.
3991
4268
  */
3992
4269
  interface PremiumRefreshParams {
3993
4270
  /** The account before the action */
@@ -4107,14 +4384,14 @@ interface MakeWithdrawIxParams {
4107
4384
  interface MakeWithdrawTxParams extends MakeWithdrawIxParams {
4108
4385
  connection: Connection;
4109
4386
  oraclePrices: Map<string, OraclePrice>;
4110
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4387
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4111
4388
  luts: AddressLookupTableAccount[];
4112
4389
  }
4113
4390
  interface MakeKaminoWithdrawTxParams extends Omit<MakeKaminoWithdrawIxParams, "cTokenAmount"> {
4114
4391
  amount: Amount | TypedAmount;
4115
4392
  connection: Connection;
4116
4393
  oraclePrices: Map<string, OraclePrice>;
4117
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4394
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4118
4395
  luts: AddressLookupTableAccount[];
4119
4396
  }
4120
4397
  interface MakeBorrowIxOpts {
@@ -4146,20 +4423,20 @@ interface MakeBorrowIxParams {
4146
4423
  interface MakeBorrowTxParams extends MakeBorrowIxParams {
4147
4424
  connection: Connection;
4148
4425
  oraclePrices: Map<string, OraclePrice>;
4149
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4426
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4150
4427
  bankMetadataMap: BankIntegrationMetadataMap;
4151
4428
  luts: AddressLookupTableAccount[];
4152
4429
  }
4153
4430
  interface MakeJuplendWithdrawTxParams extends MakeJuplendWithdrawIxParams {
4154
4431
  connection: Connection;
4155
4432
  oraclePrices: Map<string, OraclePrice>;
4156
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4433
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4157
4434
  luts: AddressLookupTableAccount[];
4158
4435
  }
4159
4436
  interface MakeDriftWithdrawTxParams extends MakeDriftWithdrawIxParams {
4160
4437
  connection: Connection;
4161
4438
  oraclePrices: Map<string, OraclePrice>;
4162
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4439
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4163
4440
  luts: AddressLookupTableAccount[];
4164
4441
  }
4165
4442
  interface MakeCloseAccountIxParams {
@@ -4220,7 +4497,7 @@ interface MakeTransferPositionsTxParams {
4220
4497
  bankMap: Map<string, BankType>;
4221
4498
  oraclePrices: Map<string, OraclePrice>;
4222
4499
  bankMetadataMap: BankIntegrationMetadataMap;
4223
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4500
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4224
4501
  /** Token program per transferred bank (base58 bank address → token program id). */
4225
4502
  tokenProgramsByBank: Map<string, PublicKey>;
4226
4503
  addressLookupTableAccounts?: AddressLookupTableAccount[];
@@ -4254,7 +4531,7 @@ interface MakeBulkWithdrawTxParams {
4254
4531
  bankMap: Map<string, BankType>;
4255
4532
  oraclePrices: Map<string, OraclePrice>;
4256
4533
  bankMetadataMap: BankIntegrationMetadataMap;
4257
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4534
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4258
4535
  /** Token program per withdrawn bank (base58 bank address → token program id). */
4259
4536
  tokenProgramsByBank: Map<string, PublicKey>;
4260
4537
  luts: AddressLookupTableAccount[];
@@ -4297,7 +4574,7 @@ interface MakeLoopTxParams {
4297
4574
  bankMap: Map<string, BankType>;
4298
4575
  oraclePrices: Map<string, OraclePrice>;
4299
4576
  bankMetadataMap: BankIntegrationMetadataMap;
4300
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4577
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4301
4578
  depositOpts: {
4302
4579
  inputDepositAmount: number;
4303
4580
  depositBank: BankType;
@@ -4358,7 +4635,7 @@ interface MakeRepayWithCollatTxParams {
4358
4635
  connection: Connection;
4359
4636
  bankMap: Map<string, BankType>;
4360
4637
  oraclePrices: Map<string, OraclePrice>;
4361
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4638
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4362
4639
  bankMetadataMap: BankIntegrationMetadataMap;
4363
4640
  withdrawOpts: {
4364
4641
  totalPositionAmount: number;
@@ -4389,7 +4666,7 @@ interface MakeSwapCollateralTxParams {
4389
4666
  bankMap: Map<string, BankType>;
4390
4667
  oraclePrices: Map<string, OraclePrice>;
4391
4668
  bankMetadataMap: BankIntegrationMetadataMap;
4392
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4669
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4393
4670
  withdrawOpts: {
4394
4671
  totalPositionAmount: number;
4395
4672
  withdrawAmount?: number;
@@ -4430,7 +4707,7 @@ interface MakeRollPtTxParams {
4430
4707
  bankMap: Map<string, BankType>;
4431
4708
  oraclePrices: Map<string, OraclePrice>;
4432
4709
  bankMetadataMap: BankIntegrationMetadataMap;
4433
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4710
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4434
4711
  withdrawOpts: {
4435
4712
  totalPositionAmount: number;
4436
4713
  withdrawAmount?: number;
@@ -4514,7 +4791,7 @@ interface MakeSwapDebtTxParams {
4514
4791
  bankMap: Map<string, BankType>;
4515
4792
  oraclePrices: Map<string, OraclePrice>;
4516
4793
  bankMetadataMap: BankIntegrationMetadataMap;
4517
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4794
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4518
4795
  repayOpts: {
4519
4796
  totalPositionAmount: number;
4520
4797
  repayAmount?: number;
@@ -4545,6 +4822,50 @@ interface MakeSetupIxParams {
4545
4822
  tokenProgram: PublicKey;
4546
4823
  }[];
4547
4824
  }
4825
+ /**
4826
+ * Trigger thresholds for a take-profit / stop-loss order. Thresholds are the pair's net equity in
4827
+ * USD (collateral value − debt value of the two tagged balances), not a token price. At least one
4828
+ * of `stopLossUsd` / `takeProfitUsd` must be set; both makes a `Both` order.
4829
+ */
4830
+ interface OrderTriggerParams {
4831
+ /** Pair net equity (USD) at or below which the stop-loss fires. */
4832
+ stopLossUsd?: BigNumber$1;
4833
+ /** Pair net equity (USD) at or above which the take-profit fires. */
4834
+ takeProfitUsd?: BigNumber$1;
4835
+ /** Max slippage the keeper may incur when executing, in percent (protocol cap: 10). */
4836
+ maxSlippagePercent: number;
4837
+ }
4838
+ interface MakePlaceOrderIxParams {
4839
+ program: MarginfiProgram;
4840
+ marginfiAccount: MarginfiAccountType;
4841
+ /** Bank of the asset-side (collateral) balance. */
4842
+ collateralBank: PublicKey;
4843
+ /** Bank of the liability-side (debt) balance. */
4844
+ debtBank: PublicKey;
4845
+ trigger: OrderTriggerParams;
4846
+ /** Pays the order rent and the flat anti-spam fee. Defaults to the account authority. */
4847
+ feePayer?: PublicKey;
4848
+ /** Global fee wallet from the program's `FeeState`; fetched from chain when omitted. */
4849
+ globalFeeWallet?: PublicKey;
4850
+ }
4851
+ interface MakePlaceOrderTxParams extends MakePlaceOrderIxParams {
4852
+ connection: Connection;
4853
+ luts: AddressLookupTableAccount[];
4854
+ blockhash?: string;
4855
+ }
4856
+ interface MakeCloseOrderIxParams {
4857
+ program: MarginfiProgram;
4858
+ marginfiAccount: MarginfiAccountType;
4859
+ /** The order PDA to close (see `deriveOrderPda`). */
4860
+ order: PublicKey;
4861
+ /** Receives the order's rent. Defaults to the account authority. */
4862
+ feeRecipient?: PublicKey;
4863
+ }
4864
+ interface MakeCloseOrderTxParams extends MakeCloseOrderIxParams {
4865
+ connection: Connection;
4866
+ luts: AddressLookupTableAccount[];
4867
+ blockhash?: string;
4868
+ }
4548
4869
 
4549
4870
  /**
4550
4871
  * Vault PDA Utilities
@@ -5260,6 +5581,17 @@ declare function getKaminoMetadata(options: FetchKaminoMetadataOptions): Promise
5260
5581
  declare function getKaminoStatesDto(connection: Connection, kaminoBanks: KaminoBankInput[]): Promise<KaminoStateJsonByBank>;
5261
5582
 
5262
5583
  declare function getKaminoCTokenMultiplier(reserve: KaminoReserve): BigNumber$1;
5584
+ /**
5585
+ * Joins a Kamino bank with its reserve's emergency mode. Decoding a bank or converting its DTO
5586
+ * only sees the market's emergency (bank flags bit 14), so call this wherever a Kamino bank meets
5587
+ * its reserve; otherwise initial health, max borrow and max withdraw overstate borrowing power
5588
+ * while the reserve is in emergency.
5589
+ *
5590
+ * @param bank - The Kamino bank
5591
+ * @param reserve - The bank's Kamino reserve
5592
+ * @returns The bank, with `kaminoEmergency` also set when the reserve is in emergency mode
5593
+ */
5594
+ declare function withKaminoReserveEmergency(bank: BankType, reserve: KaminoReserve): BankType;
5263
5595
 
5264
5596
  type DriftStateJsonByBank = Record<string, {
5265
5597
  driftSpotMarketState: DriftSpotMarketJSON;
@@ -5430,7 +5762,11 @@ declare enum TransactionBuildingErrorCode {
5430
5762
  TRANSFER_POSITIONS_INVALID_SELECTION = "TRANSFER_POSITIONS_INVALID_SELECTION",
5431
5763
  TRANSFER_POSITIONS_UNSUPPORTED_BANK = "TRANSFER_POSITIONS_UNSUPPORTED_BANK",
5432
5764
  TRANSFER_POSITIONS_UNSPLITTABLE = "TRANSFER_POSITIONS_UNSPLITTABLE",
5433
- BRIDGE_CONFLICT = "BRIDGE_CONFLICT"
5765
+ BRIDGE_CONFLICT = "BRIDGE_CONFLICT",
5766
+ ORDER_INVALID_TRIGGER = "ORDER_INVALID_TRIGGER",
5767
+ ORDER_INVALID_SLIPPAGE = "ORDER_INVALID_SLIPPAGE",
5768
+ COSTLY_POSITION_LIMIT_EXCEEDED = "COSTLY_POSITION_LIMIT_EXCEEDED",
5769
+ ACCOUNT_DISABLED = "ACCOUNT_DISABLED"
5434
5770
  }
5435
5771
  /**
5436
5772
  * Typed details for each error code
@@ -5510,6 +5846,24 @@ interface TransactionBuildingErrorDetails {
5510
5846
  /** Whether the bridge token would have been held as collateral ("deposit") or debt ("borrow"). */
5511
5847
  bridgeTokenSide: "deposit" | "borrow";
5512
5848
  };
5849
+ [TransactionBuildingErrorCode.ORDER_INVALID_TRIGGER]: {
5850
+ reason: string;
5851
+ takeProfitUsd?: string;
5852
+ stopLossUsd?: string;
5853
+ };
5854
+ [TransactionBuildingErrorCode.ORDER_INVALID_SLIPPAGE]: {
5855
+ maxSlippagePercent: number;
5856
+ maxAllowedPercent: number;
5857
+ };
5858
+ [TransactionBuildingErrorCode.COSTLY_POSITION_LIMIT_EXCEEDED]: {
5859
+ /** Integration/staked bank the action would open a position in */
5860
+ bankAddress: string;
5861
+ /** Max integration + staked positions per account */
5862
+ limit: number;
5863
+ };
5864
+ [TransactionBuildingErrorCode.ACCOUNT_DISABLED]: {
5865
+ accountAddress: string;
5866
+ };
5513
5867
  }
5514
5868
  /**
5515
5869
  * Error thrown during transaction building in the SDK.
@@ -5579,6 +5933,25 @@ declare class TransactionBuildingError<T extends TransactionBuildingErrorCode =
5579
5933
  mint: string;
5580
5934
  symbol?: string;
5581
5935
  }>, bridgeTokenSide: "deposit" | "borrow"): TransactionBuildingError<TransactionBuildingErrorCode.BRIDGE_CONFLICT>;
5936
+ /**
5937
+ * The order trigger can't be placed: no threshold set, a threshold not above 0, or take-profit
5938
+ * at or below stop-loss (the program rejects all three with `InvalidOrderTakeProfitOrStopLoss`).
5939
+ */
5940
+ static orderInvalidTrigger(reason: string, takeProfitUsd?: string, stopLossUsd?: string): TransactionBuildingError<TransactionBuildingErrorCode.ORDER_INVALID_TRIGGER>;
5941
+ /**
5942
+ * The action would open an integration (Kamino, Drift, Solend, JupLend) or staked position
5943
+ * beyond the per-account limit on such positions.
5944
+ */
5945
+ static costlyPositionLimitExceeded(bankAddress: string): TransactionBuildingError<TransactionBuildingErrorCode.COSTLY_POSITION_LIMIT_EXCEEDED>;
5946
+ /**
5947
+ * The order's max slippage is outside (0, cap]. The program accepts 0, but a keeper can't
5948
+ * execute an order that allows no slippage, so the SDK rejects it.
5949
+ */
5950
+ static orderInvalidSlippage(maxSlippagePercent: number, maxAllowedPercent: number): TransactionBuildingError<TransactionBuildingErrorCode.ORDER_INVALID_SLIPPAGE>;
5951
+ /**
5952
+ * The marginfi account is disabled (e.g. already transferred to a new account), so it can't act.
5953
+ */
5954
+ static accountDisabled(accountAddress: string): TransactionBuildingError<TransactionBuildingErrorCode.ACCOUNT_DISABLED>;
5582
5955
  /**
5583
5956
  * Generic escape hatch for custom errors
5584
5957
  */
@@ -5613,6 +5986,7 @@ declare const PDA_BANK_FEE_STATE_SEED: Buffer<ArrayBuffer>;
5613
5986
  declare const PDA_BANK_EMISSIONS_AUTH_SEED: Buffer<ArrayBuffer>;
5614
5987
  declare const PDA_BANK_EMISSIONS_VAULT_SEED: Buffer<ArrayBuffer>;
5615
5988
  declare const PDA_MARGINFI_ACCOUNT_SEED: Buffer<ArrayBuffer>;
5989
+ declare const PDA_ORDER_SEED: Buffer<ArrayBuffer>;
5616
5990
  declare const PDA_REBALANCE_FEE_POOL_SEED: Buffer<ArrayBuffer>;
5617
5991
  /**
5618
5992
  * Derives the liquidity vault authority PDA for a bank
@@ -5664,6 +6038,14 @@ declare function deriveBankEmissionsVault(programId: PublicKey, bank: PublicKey,
5664
6038
  * Seeds: ["marginfi_account", group, authority, accountIndex, thirdPartyId]
5665
6039
  */
5666
6040
  declare function deriveMarginfiAccount(programId: PublicKey, group: PublicKey, authority: PublicKey, accountIndex: number, thirdPartyId?: number): [PublicKey, number];
6041
+ /**
6042
+ * Derives the order PDA for a marginfi account and bank pair
6043
+ * Seeds: ["order", marginfiAccount, sha256(bank keys sorted by raw bytes, concatenated)]
6044
+ *
6045
+ * Matches the on-chain `keys_sha256_hash`: the bank keys are sorted in ascending byte-wise
6046
+ * lexicographical order before hashing, so the caller may pass them in any order.
6047
+ */
6048
+ declare function deriveOrderPda(programId: PublicKey, marginfiAccount: PublicKey, bankKeys: PublicKey[]): [PublicKey, number];
5667
6049
  /**
5668
6050
  * Derives the auto-rebalance fee pool PDA of a marginfi account (required by account close since 0.1.12)
5669
6051
  * Seeds: ["rebalance_fee_pool", marginfiAccount]
@@ -5714,6 +6096,20 @@ declare function shortenAddress(pubkey: Address, chars?: number): string;
5714
6096
  * Converts basis points (bps) to a decimal percentage value.
5715
6097
  */
5716
6098
  declare function bpsToPercentile(bps: number): number;
6099
+ /**
6100
+ * Converts a slippage tolerance in percent to the on-chain u32 representation
6101
+ * (a fraction of `u32::MAX`, where 100% = `u32::MAX`).
6102
+ *
6103
+ * @param percent - Slippage in percent, must be in (0, 10] (protocol cap). The program accepts 0,
6104
+ * but a keeper can't execute an order that allows no slippage, so 0 is rejected.
6105
+ * @throws {TransactionBuildingError} `ORDER_INVALID_SLIPPAGE` if `percent` is outside (0, 10]
6106
+ */
6107
+ declare function percentToMaxSlippageU32(percent: number): number;
6108
+ /**
6109
+ * Inverse of {@link percentToMaxSlippageU32}: converts the on-chain u32 slippage
6110
+ * representation back to a percent value.
6111
+ */
6112
+ declare function maxSlippageU32ToPercent(maxSlippage: number): number;
5717
6113
  /**
5718
6114
  * Prepares transaction remaining accounts by processing bank-oracle groups:
5719
6115
  * 1. Sorts groups in descending order by bank public key (pushes inactive accounts to end)
@@ -5748,6 +6144,10 @@ declare const STAKED_ORACLE_DISABLED_FLAG: number;
5748
6144
  declare const STAKED_ORACLE_USES_ONRAMP_FLAG: number;
5749
6145
  /** Bank flags bit 13: liabilities in this bank accrue the variable borrow premium */
5750
6146
  declare const PREMIUM_ACTIVE_FLAG: number;
6147
+ /** Bank flags bit 14: the Kamino bank's lending market is in emergency mode (zero initial weight) */
6148
+ declare const KAMINO_MARKET_EMERGENCY_FLAG: number;
6149
+ /** Max integration (Kamino, Drift, Solend, JupLend) + staked positions one account can open (0.1.12) */
6150
+ declare const MAX_COSTLY_POSITIONS = 4;
5751
6151
  declare const MARGINFI_PROGRAM: PublicKey;
5752
6152
  declare const MARGINFI_PROGRAM_STAGING: PublicKey;
5753
6153
  declare const MARGINFI_PROGRAM_STAGING_ALT: PublicKey;
@@ -5803,7 +6203,8 @@ declare class Balance implements BalanceType {
5803
6203
  premiumRate: BigNumber$1;
5804
6204
  premiumOutstanding: BigNumber$1;
5805
6205
  lastUpdate: number;
5806
- constructor(active: boolean, bankPk: PublicKey, assetShares: BigNumber$1, liabilityShares: BigNumber$1, premiumRate: BigNumber$1, premiumOutstanding: BigNumber$1, lastUpdate: number);
6206
+ tag: number;
6207
+ constructor(active: boolean, bankPk: PublicKey, assetShares: BigNumber$1, liabilityShares: BigNumber$1, premiumRate: BigNumber$1, premiumOutstanding: BigNumber$1, lastUpdate: number, tag: number);
5807
6208
  static from(balanceRaw: BalanceRaw): Balance;
5808
6209
  static fromBalanceType(balance: BalanceType): Balance;
5809
6210
  static createEmpty(bankPk: PublicKey): Balance;
@@ -5852,7 +6253,7 @@ declare class MarginfiGroup implements MarginfiGroupType {
5852
6253
  static fromBuffer(address: PublicKey, rawData: Buffer, idl: MarginfiIdlType): MarginfiGroup;
5853
6254
  static decode(encoded: Buffer, idl: MarginfiIdlType): MarginfiGroupRaw;
5854
6255
  static encode(decoded: MarginfiGroupRaw, idl: MarginfiIdlType): Promise<Buffer>;
5855
- makePoolConfigureBankIx(program: MarginfiProgram, bank: PublicKey, args: BankConfigOptRaw): Promise<InstructionsWrapper>;
6256
+ makePoolConfigureBankIx(program: MarginfiProgram, bank: PublicKey, args: BankConfigFastRaw): Promise<InstructionsWrapper>;
5856
6257
  makeAddPermissionlessStakedBankIx(program: MarginfiProgram, voteAccountAddress: PublicKey, feePayer: PublicKey, pythOracle: PublicKey): Promise<InstructionsWrapper>;
5857
6258
  makePoolAddBankIx(program: MarginfiProgram, bankPubkey: PublicKey, bankMint: PublicKey, bankConfig: BankConfigOpt, feePayer?: PublicKey): Promise<InstructionsWrapper>;
5858
6259
  }
@@ -5881,7 +6282,8 @@ declare class MarginfiAccount implements MarginfiAccountType {
5881
6282
  readonly accountFlags: AccountFlags[];
5882
6283
  readonly emissionsDestinationAccount: PublicKey;
5883
6284
  healthCache: HealthCache;
5884
- constructor(address: PublicKey, group: PublicKey, authority: PublicKey, balances: Balance[], accountFlags: AccountFlags[], emissionsDestinationAccount: PublicKey, healthCache: HealthCache);
6285
+ readonly activeOrders: number;
6286
+ constructor(address: PublicKey, group: PublicKey, authority: PublicKey, balances: Balance[], accountFlags: AccountFlags[], emissionsDestinationAccount: PublicKey, healthCache: HealthCache, activeOrders?: number);
5885
6287
  /**
5886
6288
  * Fetches a marginfi account from on-chain data.
5887
6289
  *
@@ -6438,6 +6840,7 @@ declare class MarginfiAccount implements MarginfiAccountType {
6438
6840
  transactions: ExtendedV0Transaction[];
6439
6841
  actionTxIndex: number;
6440
6842
  quoteResponse: SwapQuoteResult | undefined;
6843
+ mustBeAtomicBundle: boolean;
6441
6844
  }>;
6442
6845
  /**
6443
6846
  * Creates a transaction to swap one debt position to another using a flash loan.
@@ -6510,6 +6913,36 @@ declare class MarginfiAccount implements MarginfiAccountType {
6510
6913
  * @see {@link makeBorrowTx} for detailed implementation
6511
6914
  */
6512
6915
  makeBorrowTx(params: Omit<MakeBorrowTxParams, "marginfiAccount">): Promise<TransactionBuilderResult>;
6916
+ /**
6917
+ * Creates a place-order instruction for this marginfi account.
6918
+ *
6919
+ * @see {@link makePlaceOrderIx} for detailed implementation
6920
+ */
6921
+ makePlaceOrderIx(params: Omit<MakePlaceOrderIxParams, "marginfiAccount">): Promise<InstructionsWrapper>;
6922
+ /**
6923
+ * Creates a transaction placing a take-profit / stop-loss order on a collateral/debt pair.
6924
+ *
6925
+ * @see {@link makePlaceOrderTx} for detailed implementation
6926
+ */
6927
+ makePlaceOrderTx(params: Omit<MakePlaceOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6928
+ /**
6929
+ * Creates a close-order instruction for this marginfi account.
6930
+ *
6931
+ * @see {@link makeCloseOrderIx} for detailed implementation
6932
+ */
6933
+ makeCloseOrderIx(params: Omit<MakeCloseOrderIxParams, "marginfiAccount">): Promise<InstructionsWrapper>;
6934
+ /**
6935
+ * Creates a transaction closing an existing order.
6936
+ *
6937
+ * @see {@link makeCloseOrderTx} for detailed implementation
6938
+ */
6939
+ makeCloseOrderTx(params: Omit<MakeCloseOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6940
+ /**
6941
+ * Creates a transaction replacing the pair's existing order with new thresholds.
6942
+ *
6943
+ * @see {@link makeUpdateOrderTx} for detailed implementation
6944
+ */
6945
+ makeUpdateOrderTx(params: Omit<MakePlaceOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6513
6946
  /**
6514
6947
  * Creates a repay transaction.
6515
6948
  *
@@ -6891,6 +7324,7 @@ declare class MarginfiAccountWrapper {
6891
7324
  transactions: ExtendedV0Transaction[];
6892
7325
  actionTxIndex: number;
6893
7326
  quoteResponse: SwapQuoteResult | undefined;
7327
+ mustBeAtomicBundle: boolean;
6894
7328
  }>;
6895
7329
  /**
6896
7330
  * Creates a swap debt transaction with auto-injected client data.
@@ -7002,6 +7436,38 @@ declare class MarginfiAccountWrapper {
7002
7436
  * @returns Promise resolving to a TransactionBuilderResult
7003
7437
  */
7004
7438
  makeBorrowTx(bankAddress: PublicKey, amount: Amount, opts?: MakeBorrowIxOpts): Promise<TransactionBuilderResult>;
7439
+ /**
7440
+ * Creates a place-order instruction, for composing into a larger transaction.
7441
+ *
7442
+ * @param collateralBank - Bank of the asset-side balance
7443
+ * @param debtBank - Bank of the liability-side balance
7444
+ * @param trigger - USD pair-equity thresholds and max slippage
7445
+ */
7446
+ makePlaceOrderIx(collateralBank: PublicKey, debtBank: PublicKey, trigger: OrderTriggerParams): Promise<InstructionsWrapper>;
7447
+ /**
7448
+ * Creates a close-order instruction, for composing into a larger transaction.
7449
+ *
7450
+ * @param order - The order PDA (from `fetchOrdersForAccount` or `deriveOrderPda`)
7451
+ */
7452
+ makeCloseOrderIx(order: PublicKey): Promise<InstructionsWrapper>;
7453
+ /**
7454
+ * Creates a transaction placing a take-profit / stop-loss order on a collateral/debt pair.
7455
+ *
7456
+ * @param collateralBank - Bank of the asset-side balance
7457
+ * @param debtBank - Bank of the liability-side balance
7458
+ * @param trigger - USD pair-equity thresholds and max slippage
7459
+ */
7460
+ makePlaceOrderTx(collateralBank: PublicKey, debtBank: PublicKey, trigger: OrderTriggerParams): Promise<ExtendedV0Transaction>;
7461
+ /**
7462
+ * Creates a transaction replacing the pair's existing order with new thresholds.
7463
+ */
7464
+ makeUpdateOrderTx(collateralBank: PublicKey, debtBank: PublicKey, trigger: OrderTriggerParams): Promise<ExtendedV0Transaction>;
7465
+ /**
7466
+ * Creates a transaction closing an existing order.
7467
+ *
7468
+ * @param order - The order PDA (from `fetchOrdersForAccount` or `deriveOrderPda`)
7469
+ */
7470
+ makeCloseOrderTx(order: PublicKey): Promise<ExtendedV0Transaction>;
7005
7471
  /**
7006
7472
  * Creates a repay transaction with auto-injected client data.
7007
7473
  *
@@ -7082,6 +7548,11 @@ declare class MarginfiAccountWrapper {
7082
7548
  * given its current collateral, by bank address. See {@link computePremiumRatesByBank}.
7083
7549
  */
7084
7550
  getPremiumRatesByBank(): Map<string, BigNumber$1>;
7551
+ /**
7552
+ * Per-collateral breakdown of the premium rate `liabilityBank` would charge this account.
7553
+ * See {@link computePremiumBreakdown}.
7554
+ */
7555
+ getPremiumBreakdown(liabilityBank: PublicKey): PremiumCollateralBreakdown[];
7085
7556
  /**
7086
7557
  * How `actions` would change this account's premium rates and yearly premium.
7087
7558
  * See {@link computePremiumImpact}.
@@ -7186,4 +7657,4 @@ declare class MarginfiAccountWrapper {
7186
7657
  getClient(): Project0Client;
7187
7658
  }
7188
7659
 
7189
- export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, type AccountActiveBalanceForBank, AccountFlags, ActionEmodeImpact, ActiveEmodePair, type ActiveStakePoolMap, Amount, AssetTag, BUNDLE_TX_SIZE, Balance, type BalanceRaw, BalanceType, type BalanceTypeDto, Bank, type BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, type BankConfigRawDto, BankConfigType, BankIntegrationMetadata, BankIntegrationMetadataDto, BankIntegrationMetadataMap, BankIntegrationMetadataMapDto, type BankMetrics, type BankRateLimiterDto, BankRateLimiterRaw, type BankRateLimiterRawDto, BankRateLimiterType, BankRaw, type BankRawDto, BankType, type BankTypeDto, BankVaultType, type BankVenueStates, type BridgeOpts, type BridgeTokenSide, type BridgedSwapLeg, type BridgedTxResult, type BuildContext, type BulkLendTxsResult, type ClassifiedPosition, type ComposeBridgedSwapParams, type ComposeBridgedSwapResult, type ComputeAssetHealthComponentParams, type ComputeBalanceUsdValueParams, type ComputeBankMetricsParams, type ComputeFreeCollateralFromBalancesParams, type ComputeHealthCacheStatusParams, type ComputeHealthComponentsFromBalancesParams, type ComputeLiabilityHealthComponentParams, type ComputeLiquidationPriceForBankParams, type ComputeMaxBorrowForBankParams, type ComputeMaxDepositForBankParams, type ComputeMaxWithdrawForBankParams, type ComputeNetApyParams, type ComputePremiumRatesParams, ConfigRaw, DEFAULT_BRIDGE_MINTS, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, type DriftBankInput, type DriftMetadata, type DriftStateByBank, type DriftStateJsonByBank, EMPTY_HEALTH_CACHE, EXECUTION_HEADROOM_SECONDS, type EmodeConfigRawDto, type EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodePair, type EmodeSettingsDto, EmodeSettingsRaw, type EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, type ExactOutEstimateResult, type ExtendedTransaction, type ExtendedTransactionProperties, type ExtendedV0Transaction, FLASHLOAN_ENABLED_FLAG, type FeeStateCache, type FetchBankIntegrationMetadataOptions, type FetchDriftMetadataOptions, type FetchJupLendMetadataOptions, type FetchKaminoMetadataOptions, type FlashloanActionResult, type FlashloanBudgetIx, type FlashloanPrecheckResult, type FlashloanSwapConstraints, type GetBalanceUsdValueWithPriceBiasParams, type GetExactOutEstimateParams, type GetSwapIxsForFlashloanParams, type GetTitanExactOutEstimateParams, type GetTitanSwapIxsParams, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, type HealthCacheRaw, HealthCacheSimulationError, HealthCacheStatus, HealthCacheType, type HealthCacheTypeDto, type InstructionsWrapper, type IntegrationType, InterestRateConfig, type InterestRateConfigDto, InterestRateConfigRaw, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, type JupLendBankInput, type JupLendMetadata, type JupLendStateByBank, type JupLendStateJsonByBank, type KaminoBankInput, type KaminoMetadata, type KaminoStateByBank, type KaminoStateJsonByBank, LST_MINT, type LoopFlashloanDescriptor, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, type MakeAccountTransferToNewAccountTxParams, type MakeBorrowIxOpts, type MakeBorrowIxParams, type MakeBorrowTxParams, type MakeBridgedLoopTxParams, type MakeBridgedSwapCollateralTxParams, type MakeBridgedSwapDebtTxParams, type MakeBulkRepayTxParams, type MakeBulkWithdrawTxParams, type MakeCloseAccountIxParams, type MakeCloseAccountTxParams, type MakeDepositIxOpts, type MakeDepositIxParams, type MakeDepositTxParams, type MakeDriftDepositIxParams, type MakeDriftDepositTxParams, type MakeDriftWithdrawIxParams, type MakeDriftWithdrawTxParams, type MakeFlashLoanTxParams, type MakeJuplendDepositIxParams, type MakeJuplendDepositTxParams, type MakeJuplendWithdrawIxParams, type MakeJuplendWithdrawTxParams, type MakeKaminoDepositIxParams, type MakeKaminoDepositTxParams, type MakeKaminoWithdrawIxParams, type MakeKaminoWithdrawTxParams, type MakeLoopTxParams, type MakeMergeStakeAccountsTxParams, type MakeMintStakedLstIxParams, type MakeMintStakedLstTxParams, type MakeRedeemStakedLstIxParams, type MakeRedeemStakedLstTxParams, type MakeRepayIxOpts, type MakeRepayIxParams, type MakeRepayTxParams, type MakeRepayWithCollatTxParams, type MakeRollPtTxParams, type MakeSetupIxParams, type MakeSwapCollateralTxParams, type MakeSwapDebtTxParams, type MakeTransferPositionsTxParams, type MakeVaultCompleteWithdrawalIxParams, type MakeVaultCompleteWithdrawalTxParams, type MakeVaultDepositIxParams, type MakeVaultDepositTxParams, type MakeVaultDepositWithSwapTxParams, type MakeVaultWithdrawIxParams, type MakeVaultWithdrawTxParams, type MakeWithdrawIxOpts, type MakeWithdrawIxParams, type MakeWithdrawTxParams, MarginRequirementType, type MarginRequirementTypeRaw, MarginfiAccount, type MarginfiAccountRaw, MarginfiAccountType, type MarginfiAccountTypeDto, MarginfiAccountWrapper, MarginfiGroup, type MarginfiGroupRaw, type MarginfiGroupType, type MarginfiGroupTypeDto, MarginfiIdlType, MarginfiProgram, type MintAuthorityBalance, MintData, type MultiplierAccountState, type MultiplierAccountStates, OperationalState, OperationalStateRaw, type OracleMultiplierBankInput, type OracleMultiplierServiceOpts, OraclePrice, OraclePriceDto, OracleSetup, OracleSetupRaw, type OracleSourceKey, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PDA_REBALANCE_FEE_POOL_SEED, PREMIUM_ACTIVE_FLAG, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, type PremiumAction, type PremiumEntry, type PremiumImpact, type PremiumRefreshParams, PriceBias, PriceWithConfidence, Project0Client, Project0Config, Project0ConfigRaw, type ProviderSwapRoute, type PythOracleServiceOpts, type RateLimitWindowDto, type RateLimitWindowRawDto, RateLimitWindowType, type RatePointDto, type ResolveBridgeCandidateBanksParams, type ResolvedPinnedSwapRoute, RiskTier, RiskTierRaw, type RollPtOpts, type RollQuoteSimResult, type RollQuoteSimulator, type RollQuoteTokenBalance, SECONDS_PER_YEAR, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, type ScopeOracleServiceOpts, type SerializedInstruction, type SerializedLut, type SerializedSwapEngineRequest, type SerializedSwapEngineResult, type SerializedTxFootprint, type SharedBridgeLegContext, type SimulateAccountHealthCacheWithFallbackParams, type SimulationResultRaw, type SolanaTransaction, type StakeAccount, type StakePoolMevMap, type StakedBankMetadata, type SwapAdapter, type SwapApiConfig, type SwapCandidate, type SwapEngineRequest, type SwapEngineResult, type SwapEngineRunner, type SwapIxsResult, type SwapOpts, SwapProvider, type SwapProviderConfig, type SwapProviderEntry, type SwapQuoteResult, TRANSFER_ACCOUNT_AUTHORITY_FLAG, type TitanQuoteParams, TransactionArenaKeyMap, type TransactionBuilderResult, TransactionBuildingError, TransactionBuildingErrorCode, type TransactionBuildingErrorDetails, TransactionConfigMap, TransactionType, type TransferPositionSide, type TransferPositionsResult, type TxFootprint, TypedAmount, U64_MAX, USDC_DECIMALS, USDC_MINT, USDT_MINT, VENUE_AVAILABLE_LIQUIDITY_BUFFER, type ValidatorRateData, type ValidatorStakeGroup, type ValidatorStakeGroupDto, WSOL_MINT, type WithdrawWindowCache, WrappedI80F48, ZERO_ORACLE_KEY, accountConflictsWithBridgeBank, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, buildCollateralLegIxs, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkJupiterFeeAccount, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeAccrualProjectionSeconds, computeActiveEmodePairs, computeAssetHealthComponent, computeBalancePremium, computeBalanceUsdValue, computeBankAvailableLiquidity, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankProjectedAvailableLiquidity, computeBankRateLimitRemaining, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeGroupRateLimitRemainingUsd, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxDepositForBank, computeMaxWithdrawForBank, computeNetApy, computeOracleMultiplier, computeOracleMultipliers, computePremiumImpact, computePremiumRatesByBank, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computePtMultiplier, computeQuantity, computeQuantityUi, computeRateLimitWindowRemainingCapacity, computeRateLimiterRemainingCapacity, computeRemainingCapacity, computeStakedBankMultipliers, computeUtilizationRate, computeV0TxSize, computeVenueAvailableLiquidity, configureScopeOracleIx, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decodeMultiplierAccount, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deriveRebalanceFeePool, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRateLimiter, dtoToBankRateLimiterRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchGammaLpVault, fetchGammaWithdrawReceipt, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchMultiplierAccountStates, fetchMultiplierAccountStatesFromAPI, fetchNativeStakeAccounts, fetchOracleData, fetchOracleMultipliers, fetchOracleMultipliersFromAPI, fetchOracleMultipliersFromChain, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchScopeOracleData, fetchScopeOraclePricesFromAPI, fetchScopeOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEffectiveDepositLimit, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getOracleMultiplierBankInput, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isBorrowLimitActive, isBridgeConflictError, isDecomposableSwapError, isDepositIx, isDepositLimitActive, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx, makeBorrowIx, makeBorrowTx, makeBridgedLoopTx, makeBridgedSwapCollateralTx, makeBridgedSwapDebtTx, makeBulkRepayTx, makeBulkWithdrawTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx, makeDepositTx, makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx, makePoolConfigureBankIx, makePremiumRefreshIxs, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshIntegrationBanksIxs, makeRefreshKaminoBanksIxs, makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSwapCollateralTx, makeSwapDebtTx, makeTransferPositionsTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeVaultCompleteWithdrawalIx, makeVaultCompleteWithdrawalTx, makeVaultDepositIx, makeVaultDepositTx, makeVaultDepositWithSwapTx, makeVaultWithdrawIx, makeVaultWithdrawTx, makeVersionedTransaction, makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, marginfiAccountToDto, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, needsPremiumRefresh, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, patchDepositAmount, rateFromU32, requireBank, requireTokenProgram, resolveBridgeCandidateBanks, resolvePinnedSwapRoute, resolveTokenProgramForMint, resolveVaultTokenProgram, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, selectSwapBridges, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, setOraclePriceIx, sharedBridgeLegContext, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, tryBridgeCandidates, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
7660
+ export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, type AccountActiveBalanceForBank, AccountFlags, ActionEmodeImpact, ActiveEmodePair, type ActiveStakePoolMap, Amount, AssetTag, BUNDLE_TX_SIZE, Balance, type BalanceRaw, BalanceType, type BalanceTypeDto, Bank, type BankConfigDto, BankConfigFastRaw, BankConfigFlag, BankConfigGovRaw, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, type BankConfigRawDto, BankConfigType, BankIntegrationMetadata, BankIntegrationMetadataDto, BankIntegrationMetadataMap, BankIntegrationMetadataMapDto, type BankMetrics, type BankOutflowRateLimit, type BankRateLimiterDto, BankRateLimiterRaw, type BankRateLimiterRawDto, BankRateLimiterType, BankRaw, type BankRawDto, BankType, type BankTypeDto, BankVaultType, type BankVenueStates, type BridgeOpts, type BridgeTokenSide, type BridgedSwapLeg, type BridgedTxResult, type BuildContext, type BulkLendTxsResult, type ClassifiedPosition, type ComposeBridgedSwapParams, type ComposeBridgedSwapResult, type ComputeAssetHealthComponentParams, type ComputeBalanceUsdValueParams, type ComputeBankMetricsParams, type ComputeFreeCollateralFromBalancesParams, type ComputeHealthCacheStatusParams, type ComputeHealthComponentsFromBalancesParams, type ComputeLiabilityHealthComponentParams, type ComputeLiquidationPriceForBankParams, type ComputeMaxBorrowForBankParams, type ComputeMaxDepositForBankParams, type ComputeMaxWithdrawForBankParams, type ComputeNetApyParams, type ComputePremiumRatesParams, ConfigRaw, DEFAULT_BRIDGE_MINTS, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, type DriftBankInput, type DriftMetadata, type DriftStateByBank, type DriftStateJsonByBank, EMPTY_HEALTH_CACHE, EXECUTION_HEADROOM_SECONDS, type EmodeConfigRawDto, type EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodePair, type EmodeSettingsDto, EmodeSettingsRaw, type EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, type ExactOutEstimateResult, type ExtendedTransaction, type ExtendedTransactionProperties, type ExtendedV0Transaction, FLASHLOAN_ENABLED_FLAG, type FeeStateCache, type FetchBankIntegrationMetadataOptions, type FetchDriftMetadataOptions, type FetchJupLendMetadataOptions, type FetchKaminoMetadataOptions, type FlashloanActionResult, type FlashloanBudgetIx, type FlashloanPrecheckResult, type FlashloanSwapConstraints, type GetBalanceUsdValueWithPriceBiasParams, type GetExactOutEstimateParams, type GetSwapIxsForFlashloanParams, type GetTitanExactOutEstimateParams, type GetTitanSwapIxsParams, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, type HealthCacheRaw, HealthCacheSimulationError, HealthCacheStatus, HealthCacheType, type HealthCacheTypeDto, type InstructionsWrapper, type IntegrationType, InterestRateConfig, type InterestRateConfigDto, InterestRateConfigRaw, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, type JupLendBankInput, type JupLendMetadata, type JupLendStateByBank, type JupLendStateJsonByBank, KAMINO_MARKET_EMERGENCY_FLAG, type KaminoBankInput, type KaminoMetadata, type KaminoStateByBank, type KaminoStateJsonByBank, LST_MINT, type LoopFlashloanDescriptor, MARGINFI_PROGRAM, MARGINFI_PROGRAM_STAGING, MARGINFI_PROGRAM_STAGING_ALT, MARGINFI_SPONSORED_SHARD_ID, MAX_ACCOUNT_LOCKS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_COSTLY_POSITIONS, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, type MakeAccountTransferToNewAccountTxParams, type MakeBorrowIxOpts, type MakeBorrowIxParams, type MakeBorrowTxParams, type MakeBridgedLoopTxParams, type MakeBridgedSwapCollateralTxParams, type MakeBridgedSwapDebtTxParams, type MakeBulkRepayTxParams, type MakeBulkWithdrawTxParams, type MakeCloseAccountIxParams, type MakeCloseAccountTxParams, type MakeCloseOrderIxParams, type MakeCloseOrderTxParams, type MakeDepositIxOpts, type MakeDepositIxParams, type MakeDepositTxParams, type MakeDriftDepositIxParams, type MakeDriftDepositTxParams, type MakeDriftWithdrawIxParams, type MakeDriftWithdrawTxParams, type MakeFlashLoanTxParams, type MakeJuplendDepositIxParams, type MakeJuplendDepositTxParams, type MakeJuplendWithdrawIxParams, type MakeJuplendWithdrawTxParams, type MakeKaminoDepositIxParams, type MakeKaminoDepositTxParams, type MakeKaminoWithdrawIxParams, type MakeKaminoWithdrawTxParams, type MakeLoopTxParams, type MakeMergeStakeAccountsTxParams, type MakeMintStakedLstIxParams, type MakeMintStakedLstTxParams, type MakePlaceOrderIxParams, type MakePlaceOrderTxParams, type MakeRedeemStakedLstIxParams, type MakeRedeemStakedLstTxParams, type MakeRepayIxOpts, type MakeRepayIxParams, type MakeRepayTxParams, type MakeRepayWithCollatTxParams, type MakeRollPtTxParams, type MakeSetupIxParams, type MakeSwapCollateralTxParams, type MakeSwapDebtTxParams, type MakeTransferPositionsTxParams, type MakeVaultCompleteWithdrawalIxParams, type MakeVaultCompleteWithdrawalTxParams, type MakeVaultDepositIxParams, type MakeVaultDepositTxParams, type MakeVaultDepositWithSwapTxParams, type MakeVaultWithdrawIxParams, type MakeVaultWithdrawTxParams, type MakeWithdrawIxOpts, type MakeWithdrawIxParams, type MakeWithdrawTxParams, MarginRequirementType, type MarginRequirementTypeRaw, MarginfiAccount, type MarginfiAccountRaw, MarginfiAccountType, type MarginfiAccountTypeDto, MarginfiAccountWrapper, MarginfiGroup, type MarginfiGroupRaw, type MarginfiGroupType, type MarginfiGroupTypeDto, MarginfiIdlType, MarginfiProgram, type MintAuthorityBalance, MintData, type MultiplierAccountState, type MultiplierAccountStates, OperationalState, OperationalStateRaw, type OracleMultiplierBankInput, type OracleMultiplierServiceOpts, OraclePrice, OraclePriceDto, OracleSetup, OracleSetupRaw, type OracleSourceKey, type OrderRaw, OrderTrigger, type OrderTriggerParams, type OrderTriggerTypeRaw, OrderType, PDA_BANK_EMISSIONS_AUTH_SEED, PDA_BANK_EMISSIONS_VAULT_SEED, PDA_BANK_FEE_STATE_SEED, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PDA_MARGINFI_ACCOUNT_SEED, PDA_ORDER_SEED, PDA_REBALANCE_FEE_POOL_SEED, PREMIUM_ACTIVE_FLAG, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, type PremiumAction, type PremiumCollateralBreakdown, type PremiumEntry, type PremiumImpact, type PremiumRefreshParams, PriceBias, PriceWithConfidence, Project0Client, Project0Config, Project0ConfigRaw, type ProviderSwapRoute, type PythOracleServiceOpts, type RateLimitWindowDto, type RateLimitWindowRawDto, RateLimitWindowType, type RatePointDto, type ResolveBridgeCandidateBanksParams, type ResolvedPinnedSwapRoute, RiskTier, RiskTierRaw, type RollPtOpts, type RollQuoteSimResult, type RollQuoteSimulator, type RollQuoteTokenBalance, SECONDS_PER_YEAR, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, type ScopeOracleServiceOpts, type SerializedInstruction, type SerializedLut, type SerializedSwapEngineRequest, type SerializedSwapEngineResult, type SerializedTxFootprint, type SharedBridgeLegContext, type SimulateAccountHealthCacheWithFallbackParams, type SimulationResultRaw, type SolanaTransaction, type StakeAccount, type StakePoolMevMap, type StakedBankMetadata, type SwapAdapter, type SwapApiConfig, type SwapCandidate, type SwapEngineRequest, type SwapEngineResult, type SwapEngineRunner, type SwapIxsResult, type SwapOpts, SwapProvider, type SwapProviderConfig, type SwapProviderEntry, type SwapQuoteResult, TRANSFER_ACCOUNT_AUTHORITY_FLAG, type TitanQuoteParams, TransactionArenaKeyMap, type TransactionBuilderResult, TransactionBuildingError, TransactionBuildingErrorCode, type TransactionBuildingErrorDetails, TransactionConfigMap, TransactionType, type TransferPositionSide, type TransferPositionsResult, type TxFootprint, TypedAmount, U64_MAX, USDC_DECIMALS, USDC_MINT, USDT_MINT, VENUE_AVAILABLE_LIQUIDITY_BUFFER, type ValidatorRateData, type ValidatorStakeGroup, type ValidatorStakeGroupDto, WSOL_MINT, type WithdrawWindowCache, WrappedI80F48, ZERO_ORACLE_KEY, accountConflictsWithBridgeBank, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, appendPremiumRefresh, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, buildCollateralLegIxs, buildOrderTrigger, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkJupiterFeeAccount, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeAccrualProjectionSeconds, computeActiveEmodePairs, computeAssetHealthComponent, computeBalancePremium, computeBalanceUsdValue, computeBankAvailableLiquidity, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankOutflowRateLimit, computeBankPoolSize, computeBankProjectedAvailableLiquidity, computeBankRateLimitRemaining, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeGroupRateLimitRemainingUsd, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxDepositForBank, computeMaxWithdrawForBank, computeNetApy, computeOracleMultiplier, computeOracleMultipliers, computeOrderPairNetValue, computePremiumBreakdown, computePremiumImpact, computePremiumRatesByBank, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computePtMultiplier, computeQuantity, computeQuantityUi, computeRateLimitWindowRemainingCapacity, computeRateLimiterRemainingCapacity, computeRemainingCapacity, computeStakedBankMultipliers, computeUtilizationRate, computeV0TxSize, computeVenueAvailableLiquidity, configureScopeOracleIx, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decodeMultiplierAccount, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deriveOrderPda, deriveRebalanceFeePool, deserializeInstruction, deserializeLut, deserializeSwapEngineRequest, deserializeSwapEngineResult, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRateLimiter, dtoToBankRateLimiterRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, exceedsCostlyPositionLimit, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchGammaLpVault, fetchGammaWithdrawReceipt, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchMultiplierAccountStates, fetchMultiplierAccountStatesFromAPI, fetchNativeStakeAccounts, fetchOracleData, fetchOracleMultipliers, fetchOracleMultipliersFromAPI, fetchOracleMultipliersFromChain, fetchOrderFees, fetchOrdersForAccount, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchScopeOracleData, fetchScopeOraclePricesFromAPI, fetchScopeOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, findRandomAvailableAccountIndex, fitsInOneTransaction, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEffectiveDepositLimit, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getOracleMultiplierBankInput, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isBorrowLimitActive, isBridgeConflictError, isCostlyBank, isDecomposableSwapError, isDepositIx, isDepositLimitActive, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx, makeBorrowIx, makeBorrowTx, makeBridgedLoopTx, makeBridgedSwapCollateralTx, makeBridgedSwapDebtTx, makeBulkRepayTx, makeBulkWithdrawTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCloseOrderIx, makeCloseOrderTx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx, makeDepositTx, makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePlaceOrderIx, makePlaceOrderTx, makePoolAddBankIx, makePoolConfigureBankGovIx, makePoolConfigureBankIx, makePreludeTxs, makePremiumRefreshIxs, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshIntegrationBanksIxs, makeRefreshKaminoBanksIxs, makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSwapCollateralTx, makeSwapDebtTx, makeTransferPositionsTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateOrderTx, makeVaultCompleteWithdrawalIx, makeVaultCompleteWithdrawalTx, makeVaultDepositIx, makeVaultDepositTx, makeVaultDepositWithSwapTx, makeVaultWithdrawIx, makeVaultWithdrawTx, makeVersionedTransaction, makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, marginfiAccountToDto, maxSlippageU32ToPercent, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, needsPremiumRefresh, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOrderRaw, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, patchDepositAmount, percentToMaxSlippageU32, rateFromU32, requireBank, requireTokenProgram, resolveBridgeCandidateBanks, resolveOrderLegs, resolvePinnedSwapRoute, resolveTokenProgramForMint, resolveVaultTokenProgram, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, selectSwapBridges, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, setOraclePriceIx, sharedBridgeLegContext, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, tryBridgeCandidates, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, withKaminoReserveEmergency, wrappedI80F48toBigNumber };