@0dotxyz/p0-ts-sdk 2.8.4 → 2.9.0-alpha.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,7 +1,7 @@
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 EmodeImpactStatus, N as Amount, 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-BsUi_Zrx.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-BsUi_Zrx.js';
3
+ import { b as BankType, R as RiskTier, A as AssetTag, c as BankConfigFlag, d as OperationalState, e as OracleSetup, E as EmodeTag, f as EmodeEntryFlags, g as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, h as OperationalStateRaw, i as OracleSetupRaw, j as RiskTierRaw, M as MarginfiProgram, k as BankConfigOpt, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, a as BankConfigOptRaw, o as EmodeSettingsType, p as BankRateLimiterType, q as BankRaw, r as BankRateLimiterRaw, s as EmodeSettingsRaw, t as MarginfiIdlType, H as HealthCacheFlags, u as HealthCacheStatus, v as AccountFlags, w as MarginfiAccountType, x as OraclePrice, P as PriceWithConfidence, y as PriceBias, z as OraclePriceDto, C as BankIntegrationMetadataMap, D as OrderType, F as BalanceType, G as HealthCacheType, J as EmodePair, K as ActiveEmodePair, L as ActionEmodeImpact, N as MarginRequirementType, Q as EmodeImpactStatus, O as OrderTrigger, S as Amount, T as TypedAmount, U as BankVaultType, V as RateLimitWindowType, X as BankIntegrationMetadataMapDto, Y as BankIntegrationMetadataDto, Z as BankIntegrationMetadata, _ as Bank, $ as Environment, a0 as Project0Config, a1 as MintData } from './types-Auh-s318.js';
4
+ export { aA as AccountType, aF as AmountType, az as BankAddress, a2 as BankConfig, B as BankConfigCompactRaw, aC as BankMap, ay as BankMetadata, a5 as BankMetadataRaw, aq as ComputeAssetUsdValueParams, ao as ComputeLiabilityUsdValueParams, am as ComputeUsdValueParams, aa as EmodeConfigRaw, ad as EmodeEntry, af as EmodeImpact, a3 as EmodeSettings, ah as GetAssetWeightParams, a7 as InterestRateConfigCompactRaw, ac as InterestRateConfigOpt, a8 as InterestRateConfigOptRaw, aB as KaminoStates, av as MARGINFI_IDL, aE as MintDataMap, ae as OracleConfigOpt, a9 as OracleConfigOptRaw, aD as OraclePriceMap, at as OrderTriggerKind, au as PriceWithConfidenceDto, aw as Program, a4 as RateLimitWindowRaw, ab as RatePoint, a6 as RatePointRaw, ax as Wallet, ar as computeAssetUsdValue, ap as computeLiabilityUsdValue, al as computeLoopingParams, ak as computeMaxLeverage, as as computeTvl, an as computeUsdValue, ai as getAssetWeight, aj as getLiabilityWeight, ag as isWeightedPrice, aG as resolveAmount } from './types-Auh-s318.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';
@@ -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"
@@ -568,6 +571,7 @@ declare function getLiabilityShares(bank: BankType, liabilityQuantity: BigNumber
568
571
  interface BalanceRaw {
569
572
  active: boolean | number;
570
573
  bankPk: PublicKey;
574
+ tag: number;
571
575
  assetShares: WrappedI80F48;
572
576
  liabilityShares: WrappedI80F48;
573
577
  emissionsOutstanding: WrappedI80F48;
@@ -594,12 +598,31 @@ interface MarginfiAccountRaw {
594
598
  authority: PublicKey;
595
599
  lendingAccount: {
596
600
  balances: BalanceRaw[];
601
+ lastTagUsed: number;
597
602
  };
598
603
  accountFlags: BN;
599
604
  emissionsDestinationAccount: PublicKey;
600
605
  healthCache: HealthCacheRaw;
606
+ activeOrders: number;
601
607
  padding0?: BN[];
602
608
  }
609
+ type OrderTriggerTypeRaw = {
610
+ stopLoss: Record<string, never>;
611
+ } | {
612
+ takeProfit: Record<string, never>;
613
+ } | {
614
+ both: Record<string, never>;
615
+ };
616
+ interface OrderRaw {
617
+ marginfiAccount: PublicKey;
618
+ stopLoss: WrappedI80F48;
619
+ takeProfit: WrappedI80F48;
620
+ createdAt: BN;
621
+ maxSlippage: number;
622
+ tags: number[];
623
+ trigger: OrderTriggerTypeRaw;
624
+ bump: number;
625
+ }
603
626
  type MarginRequirementTypeRaw = {
604
627
  initial: Record<string, never>;
605
628
  } | {
@@ -611,6 +634,8 @@ type MarginRequirementTypeRaw = {
611
634
  interface BalanceTypeDto {
612
635
  active: boolean;
613
636
  bankPk: string;
637
+ /** Optional for backwards compatibility with DTOs serialized before order tags existed. */
638
+ tag?: number;
614
639
  assetShares: string;
615
640
  liabilityShares: string;
616
641
  emissionsOutstanding: string;
@@ -1163,6 +1188,7 @@ declare function runSwapEngine(req: SwapEngineRequest): Promise<SwapEngineResult
1163
1188
 
1164
1189
  declare const EMPTY_HEALTH_CACHE: HealthCacheRaw;
1165
1190
  declare function decodeAccountRaw(encoded: Buffer, idl: MarginfiIdlType): MarginfiAccountRaw;
1191
+ declare function parseOrderRaw(orderAddress: PublicKey, orderRaw: OrderRaw): OrderType;
1166
1192
  declare function parseBalanceRaw(balanceRaw: BalanceRaw): BalanceType;
1167
1193
  declare function parseHealthCacheRaw(healthCacheRaw: HealthCacheRaw): HealthCacheType;
1168
1194
  declare function parseMarginfiAccountRaw(marginfiAccountPk: PublicKey, accountData: MarginfiAccountRaw): MarginfiAccountType;
@@ -2103,6 +2129,33 @@ declare const fetchMarginfiAccountData: (program: MarginfiProgram, marginfiAccou
2103
2129
  marginfiAccount: MarginfiAccountType;
2104
2130
  error?: HealthCacheSimulationError;
2105
2131
  }>;
2132
+ /**
2133
+ * Fetches a single order account by address. Returns null if the order does not exist.
2134
+ *
2135
+ * @param program - The marginfi Anchor program (connection is taken from its provider)
2136
+ * @param orderAddress - The order PDA (see {@link deriveOrderPda})
2137
+ */
2138
+ declare const fetchOrder: (program: MarginfiProgram, orderAddress: PublicKey) => Promise<OrderType | null>;
2139
+ /**
2140
+ * Fetches all open orders for a marginfi account.
2141
+ *
2142
+ * @param program - The marginfi Anchor program (connection is taken from its provider)
2143
+ * @param marginfiAccount - The marginfi account public key
2144
+ */
2145
+ declare const fetchOrdersForAccount: (program: MarginfiProgram, marginfiAccount: PublicKey) => Promise<OrderType[]>;
2146
+ /**
2147
+ * Maps an order's balance tags to the collateral (asset) and debt (liability) banks of the
2148
+ * account that owns it. The tag order in `order.tags` follows the caller-supplied bank key
2149
+ * order at placement time, so the side is inferred from the tagged balances themselves.
2150
+ *
2151
+ * @param marginfiAccount - The parsed marginfi account that owns the order
2152
+ * @param order - The order whose bank pair to resolve
2153
+ * @throws If either tagged balance is missing or no longer has a position (orphaned order)
2154
+ */
2155
+ declare const resolveOrderBanks: (marginfiAccount: MarginfiAccountType, order: Pick<OrderType, "address" | "tags">) => {
2156
+ collateralBank: PublicKey;
2157
+ debtBank: PublicKey;
2158
+ };
2106
2159
  /**
2107
2160
  * Generates a random available account index that doesn't collide with existing accounts.
2108
2161
  * Account indices are 0-255 (u8 range).
@@ -3393,6 +3446,47 @@ declare function makeBulkWithdrawTx(params: MakeBulkWithdrawTxParams): Promise<B
3393
3446
  */
3394
3447
  declare function makeBulkRepayTx(params: MakeBulkRepayTxParams): Promise<BulkLendTxsResult>;
3395
3448
 
3449
+ /**
3450
+ * Converts USD-equity thresholds into the on-chain `OrderTrigger` argument.
3451
+ *
3452
+ * @throws If neither threshold is set, or both are set with take-profit ≤ stop-loss
3453
+ */
3454
+ declare function buildOrderTrigger(params: OrderTriggerParams): OrderTrigger;
3455
+ /**
3456
+ * Creates the instruction that places a take-profit / stop-loss order on a collateral/debt pair.
3457
+ * The order PDA is derived from the pair, so placing a second order on the same pair fails;
3458
+ * use {@link makeUpdateOrderTx} to change an existing order.
3459
+ *
3460
+ * The account must already hold (or, when bundled after a borrow/loop, will hold) an asset
3461
+ * balance in `collateralBank` and a liability balance in `debtBank`. The flat anti-spam fee from
3462
+ * the program's fee state is charged to `feePayer`.
3463
+ */
3464
+ declare function makePlaceOrderIx(params: MakePlaceOrderIxParams): Promise<InstructionsWrapper>;
3465
+ /**
3466
+ * Creates the instruction that closes an order and returns its rent to `feeRecipient`.
3467
+ */
3468
+ declare function makeCloseOrderIx(params: MakeCloseOrderIxParams): Promise<InstructionsWrapper>;
3469
+ /**
3470
+ * Builds a transaction that places a new order on a collateral/debt pair.
3471
+ *
3472
+ * @see {@link makePlaceOrderIx}
3473
+ */
3474
+ declare function makePlaceOrderTx(params: MakePlaceOrderTxParams): Promise<ExtendedV0Transaction>;
3475
+ /**
3476
+ * Builds a transaction that closes an existing order.
3477
+ *
3478
+ * @see {@link makeCloseOrderIx}
3479
+ */
3480
+ declare function makeCloseOrderTx(params: MakeCloseOrderTxParams): Promise<ExtendedV0Transaction>;
3481
+ /**
3482
+ * Builds a transaction that replaces the pair's existing order with new thresholds.
3483
+ *
3484
+ * There is no update instruction on-chain: the existing order (same PDA) is closed and re-placed
3485
+ * in one transaction. Balance tags are preserved across the close, so other orders sharing a
3486
+ * balance are unaffected. The flat anti-spam fee is charged again.
3487
+ */
3488
+ declare function makeUpdateOrderTx(params: MakePlaceOrderTxParams): Promise<ExtendedV0Transaction>;
3489
+
3396
3490
  /**
3397
3491
  * Creates instructions to refresh Kamino lending protocol reserves and obligations.
3398
3492
  *
@@ -3852,14 +3946,14 @@ interface MakeWithdrawIxParams {
3852
3946
  interface MakeWithdrawTxParams extends MakeWithdrawIxParams {
3853
3947
  connection: Connection;
3854
3948
  oraclePrices: Map<string, OraclePrice>;
3855
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
3949
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3856
3950
  luts: AddressLookupTableAccount[];
3857
3951
  }
3858
3952
  interface MakeKaminoWithdrawTxParams extends Omit<MakeKaminoWithdrawIxParams, "cTokenAmount"> {
3859
3953
  amount: Amount | TypedAmount;
3860
3954
  connection: Connection;
3861
3955
  oraclePrices: Map<string, OraclePrice>;
3862
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
3956
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3863
3957
  luts: AddressLookupTableAccount[];
3864
3958
  }
3865
3959
  interface MakeBorrowIxOpts {
@@ -3891,20 +3985,20 @@ interface MakeBorrowIxParams {
3891
3985
  interface MakeBorrowTxParams extends MakeBorrowIxParams {
3892
3986
  connection: Connection;
3893
3987
  oraclePrices: Map<string, OraclePrice>;
3894
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
3988
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3895
3989
  bankMetadataMap: BankIntegrationMetadataMap;
3896
3990
  luts: AddressLookupTableAccount[];
3897
3991
  }
3898
3992
  interface MakeJuplendWithdrawTxParams extends MakeJuplendWithdrawIxParams {
3899
3993
  connection: Connection;
3900
3994
  oraclePrices: Map<string, OraclePrice>;
3901
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
3995
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3902
3996
  luts: AddressLookupTableAccount[];
3903
3997
  }
3904
3998
  interface MakeDriftWithdrawTxParams extends MakeDriftWithdrawIxParams {
3905
3999
  connection: Connection;
3906
4000
  oraclePrices: Map<string, OraclePrice>;
3907
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4001
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3908
4002
  luts: AddressLookupTableAccount[];
3909
4003
  }
3910
4004
  interface MakeCloseAccountIxParams {
@@ -3965,7 +4059,7 @@ interface MakeTransferPositionsTxParams {
3965
4059
  bankMap: Map<string, BankType>;
3966
4060
  oraclePrices: Map<string, OraclePrice>;
3967
4061
  bankMetadataMap: BankIntegrationMetadataMap;
3968
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4062
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
3969
4063
  /** Token program per transferred bank (base58 bank address → token program id). */
3970
4064
  tokenProgramsByBank: Map<string, PublicKey>;
3971
4065
  addressLookupTableAccounts?: AddressLookupTableAccount[];
@@ -3999,7 +4093,7 @@ interface MakeBulkWithdrawTxParams {
3999
4093
  bankMap: Map<string, BankType>;
4000
4094
  oraclePrices: Map<string, OraclePrice>;
4001
4095
  bankMetadataMap: BankIntegrationMetadataMap;
4002
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4096
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4003
4097
  /** Token program per withdrawn bank (base58 bank address → token program id). */
4004
4098
  tokenProgramsByBank: Map<string, PublicKey>;
4005
4099
  luts: AddressLookupTableAccount[];
@@ -4038,7 +4132,7 @@ interface MakeLoopTxParams {
4038
4132
  bankMap: Map<string, BankType>;
4039
4133
  oraclePrices: Map<string, OraclePrice>;
4040
4134
  bankMetadataMap: BankIntegrationMetadataMap;
4041
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4135
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4042
4136
  depositOpts: {
4043
4137
  inputDepositAmount: number;
4044
4138
  depositBank: BankType;
@@ -4099,7 +4193,7 @@ interface MakeRepayWithCollatTxParams {
4099
4193
  connection: Connection;
4100
4194
  bankMap: Map<string, BankType>;
4101
4195
  oraclePrices: Map<string, OraclePrice>;
4102
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4196
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4103
4197
  bankMetadataMap: BankIntegrationMetadataMap;
4104
4198
  withdrawOpts: {
4105
4199
  totalPositionAmount: number;
@@ -4130,7 +4224,7 @@ interface MakeSwapCollateralTxParams {
4130
4224
  bankMap: Map<string, BankType>;
4131
4225
  oraclePrices: Map<string, OraclePrice>;
4132
4226
  bankMetadataMap: BankIntegrationMetadataMap;
4133
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4227
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4134
4228
  withdrawOpts: {
4135
4229
  totalPositionAmount: number;
4136
4230
  withdrawAmount?: number;
@@ -4171,7 +4265,7 @@ interface MakeRollPtTxParams {
4171
4265
  bankMap: Map<string, BankType>;
4172
4266
  oraclePrices: Map<string, OraclePrice>;
4173
4267
  bankMetadataMap: BankIntegrationMetadataMap;
4174
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4268
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4175
4269
  withdrawOpts: {
4176
4270
  totalPositionAmount: number;
4177
4271
  withdrawAmount?: number;
@@ -4255,7 +4349,7 @@ interface MakeSwapDebtTxParams {
4255
4349
  bankMap: Map<string, BankType>;
4256
4350
  oraclePrices: Map<string, OraclePrice>;
4257
4351
  bankMetadataMap: BankIntegrationMetadataMap;
4258
- assetShareValueMultiplierByBank: Map<string, BigNumber>;
4352
+ assetShareValueMultiplierByBank: Map<string, BigNumber$1>;
4259
4353
  repayOpts: {
4260
4354
  totalPositionAmount: number;
4261
4355
  repayAmount?: number;
@@ -4286,6 +4380,50 @@ interface MakeSetupIxParams {
4286
4380
  tokenProgram: PublicKey;
4287
4381
  }[];
4288
4382
  }
4383
+ /**
4384
+ * Trigger thresholds for a take-profit / stop-loss order. Thresholds are the pair's net equity in
4385
+ * USD (collateral value − debt value of the two tagged balances), not a token price. At least one
4386
+ * of `stopLossUsd` / `takeProfitUsd` must be set; both makes a `Both` order.
4387
+ */
4388
+ interface OrderTriggerParams {
4389
+ /** Pair net equity (USD) at or below which the stop-loss fires. */
4390
+ stopLossUsd?: BigNumber$1;
4391
+ /** Pair net equity (USD) at or above which the take-profit fires. */
4392
+ takeProfitUsd?: BigNumber$1;
4393
+ /** Max slippage the keeper may incur when executing, in percent (protocol cap: 10). */
4394
+ maxSlippagePercent: number;
4395
+ }
4396
+ interface MakePlaceOrderIxParams {
4397
+ program: MarginfiProgram;
4398
+ marginfiAccount: MarginfiAccountType;
4399
+ /** Bank of the asset-side (collateral) balance. */
4400
+ collateralBank: PublicKey;
4401
+ /** Bank of the liability-side (debt) balance. */
4402
+ debtBank: PublicKey;
4403
+ trigger: OrderTriggerParams;
4404
+ /** Pays the order rent and the flat anti-spam fee. Defaults to the account authority. */
4405
+ feePayer?: PublicKey;
4406
+ /** Global fee wallet from the program's `FeeState`; fetched from chain when omitted. */
4407
+ globalFeeWallet?: PublicKey;
4408
+ }
4409
+ interface MakePlaceOrderTxParams extends MakePlaceOrderIxParams {
4410
+ connection: Connection;
4411
+ luts: AddressLookupTableAccount[];
4412
+ blockhash?: string;
4413
+ }
4414
+ interface MakeCloseOrderIxParams {
4415
+ program: MarginfiProgram;
4416
+ marginfiAccount: MarginfiAccountType;
4417
+ /** The order PDA to close (see `deriveOrderPda`). */
4418
+ order: PublicKey;
4419
+ /** Receives the order's rent. Defaults to the account authority. */
4420
+ feeRecipient?: PublicKey;
4421
+ }
4422
+ interface MakeCloseOrderTxParams extends MakeCloseOrderIxParams {
4423
+ connection: Connection;
4424
+ luts: AddressLookupTableAccount[];
4425
+ blockhash?: string;
4426
+ }
4289
4427
 
4290
4428
  /**
4291
4429
  * Vault PDA Utilities
@@ -5490,6 +5628,7 @@ declare const PDA_BANK_FEE_STATE_SEED: Buffer<ArrayBuffer>;
5490
5628
  declare const PDA_BANK_EMISSIONS_AUTH_SEED: Buffer<ArrayBuffer>;
5491
5629
  declare const PDA_BANK_EMISSIONS_VAULT_SEED: Buffer<ArrayBuffer>;
5492
5630
  declare const PDA_MARGINFI_ACCOUNT_SEED: Buffer<ArrayBuffer>;
5631
+ declare const PDA_ORDER_SEED: Buffer<ArrayBuffer>;
5493
5632
  /**
5494
5633
  * Derives the liquidity vault authority PDA for a bank
5495
5634
  * Seeds: ["liquidity_vault_auth", bank]
@@ -5540,6 +5679,14 @@ declare function deriveBankEmissionsVault(programId: PublicKey, bank: PublicKey,
5540
5679
  * Seeds: ["marginfi_account", group, authority, accountIndex, thirdPartyId]
5541
5680
  */
5542
5681
  declare function deriveMarginfiAccount(programId: PublicKey, group: PublicKey, authority: PublicKey, accountIndex: number, thirdPartyId?: number): [PublicKey, number];
5682
+ /**
5683
+ * Derives the order PDA for a marginfi account and bank pair
5684
+ * Seeds: ["order", marginfiAccount, sha256(bank keys sorted by raw bytes, concatenated)]
5685
+ *
5686
+ * Matches the on-chain `keys_sha256_hash`: the bank keys are sorted in ascending byte-wise
5687
+ * lexicographical order before hashing, so the caller may pass them in any order.
5688
+ */
5689
+ declare function deriveOrderPda(programId: PublicKey, marginfiAccount: PublicKey, bankKeys: PublicKey[]): [PublicKey, number];
5543
5690
 
5544
5691
  /**
5545
5692
  * Formula source: http://www.linked8.com/blog/158-apy-to-apr-and-apr-to-apy-calculation-methodologies
@@ -5585,6 +5732,18 @@ declare function shortenAddress(pubkey: Address, chars?: number): string;
5585
5732
  * Converts basis points (bps) to a decimal percentage value.
5586
5733
  */
5587
5734
  declare function bpsToPercentile(bps: number): number;
5735
+ /**
5736
+ * Converts a slippage tolerance in percent to the on-chain u32 representation
5737
+ * (a fraction of `u32::MAX`, where 100% = `u32::MAX`).
5738
+ *
5739
+ * @param percent - Slippage in percent, must be in (0, 10] (protocol cap)
5740
+ */
5741
+ declare function percentToMaxSlippageU32(percent: number): number;
5742
+ /**
5743
+ * Inverse of {@link percentToMaxSlippageU32}: converts the on-chain u32 slippage
5744
+ * representation back to a percent value.
5745
+ */
5746
+ declare function maxSlippageU32ToPercent(maxSlippage: number): number;
5588
5747
  /**
5589
5748
  * Prepares transaction remaining accounts by processing bank-oracle groups:
5590
5749
  * 1. Sorts groups in descending order by bank public key (pushes inactive accounts to end)
@@ -5671,7 +5830,8 @@ declare class Balance implements BalanceType {
5671
5830
  liabilityShares: BigNumber$1;
5672
5831
  emissionsOutstanding: BigNumber$1;
5673
5832
  lastUpdate: number;
5674
- constructor(active: boolean, bankPk: PublicKey, assetShares: BigNumber$1, liabilityShares: BigNumber$1, emissionsOutstanding: BigNumber$1, lastUpdate: number);
5833
+ tag: number;
5834
+ constructor(active: boolean, bankPk: PublicKey, assetShares: BigNumber$1, liabilityShares: BigNumber$1, emissionsOutstanding: BigNumber$1, lastUpdate: number, tag: number);
5675
5835
  static from(balanceRaw: BalanceRaw): Balance;
5676
5836
  static fromBalanceType(balance: BalanceType): Balance;
5677
5837
  static createEmpty(bankPk: PublicKey): Balance;
@@ -6378,6 +6538,30 @@ declare class MarginfiAccount implements MarginfiAccountType {
6378
6538
  * @see {@link makeBorrowTx} for detailed implementation
6379
6539
  */
6380
6540
  makeBorrowTx(params: Omit<MakeBorrowTxParams, "marginfiAccount">): Promise<TransactionBuilderResult>;
6541
+ /**
6542
+ * Creates a place-order instruction for this marginfi account.
6543
+ *
6544
+ * @see {@link makePlaceOrderIx} for detailed implementation
6545
+ */
6546
+ makePlaceOrderIx(params: Omit<MakePlaceOrderIxParams, "marginfiAccount">): Promise<InstructionsWrapper>;
6547
+ /**
6548
+ * Creates a transaction placing a take-profit / stop-loss order on a collateral/debt pair.
6549
+ *
6550
+ * @see {@link makePlaceOrderTx} for detailed implementation
6551
+ */
6552
+ makePlaceOrderTx(params: Omit<MakePlaceOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6553
+ /**
6554
+ * Creates a transaction closing an existing order.
6555
+ *
6556
+ * @see {@link makeCloseOrderTx} for detailed implementation
6557
+ */
6558
+ makeCloseOrderTx(params: Omit<MakeCloseOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6559
+ /**
6560
+ * Creates a transaction replacing the pair's existing order with new thresholds.
6561
+ *
6562
+ * @see {@link makeUpdateOrderTx} for detailed implementation
6563
+ */
6564
+ makeUpdateOrderTx(params: Omit<MakePlaceOrderTxParams, "marginfiAccount">): Promise<ExtendedV0Transaction>;
6381
6565
  /**
6382
6566
  * Creates a repay transaction.
6383
6567
  *
@@ -6870,6 +7054,24 @@ declare class MarginfiAccountWrapper {
6870
7054
  * @returns Promise resolving to a TransactionBuilderResult
6871
7055
  */
6872
7056
  makeBorrowTx(bankAddress: PublicKey, amount: Amount, opts?: MakeBorrowIxOpts): Promise<TransactionBuilderResult>;
7057
+ /**
7058
+ * Creates a transaction placing a take-profit / stop-loss order on a collateral/debt pair.
7059
+ *
7060
+ * @param collateralBank - Bank of the asset-side balance
7061
+ * @param debtBank - Bank of the liability-side balance
7062
+ * @param trigger - USD pair-equity thresholds and max slippage
7063
+ */
7064
+ makePlaceOrderTx(collateralBank: PublicKey, debtBank: PublicKey, trigger: OrderTriggerParams): Promise<ExtendedV0Transaction>;
7065
+ /**
7066
+ * Creates a transaction replacing the pair's existing order with new thresholds.
7067
+ */
7068
+ makeUpdateOrderTx(collateralBank: PublicKey, debtBank: PublicKey, trigger: OrderTriggerParams): Promise<ExtendedV0Transaction>;
7069
+ /**
7070
+ * Creates a transaction closing an existing order.
7071
+ *
7072
+ * @param order - The order PDA (from `fetchOrdersForAccount` or `deriveOrderPda`)
7073
+ */
7074
+ makeCloseOrderTx(order: PublicKey): Promise<ExtendedV0Transaction>;
6873
7075
  /**
6874
7076
  * Creates a repay transaction with auto-injected client data.
6875
7077
  *
@@ -7043,4 +7245,4 @@ declare class MarginfiAccountWrapper {
7043
7245
  getClient(): Project0Client;
7044
7246
  }
7045
7247
 
7046
- 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, 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, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, 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, computeBalanceUsdValue, computeBankAvailableLiquidity, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankProjectedAvailableLiquidity, computeBankRateLimitRemaining, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeGroupRateLimitRemainingUsd, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxDepositForBank, computeMaxWithdrawForBank, computeNetApy, computeOracleMultiplier, computeOracleMultipliers, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computePtMultiplier, computeQuantity, computeQuantityUi, computeRateLimitWindowRemainingCapacity, computeRateLimiterRemainingCapacity, computeRemainingCapacity, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeUtilizationRate, computeV0TxSize, computeVenueAvailableLiquidity, configureScopeOracleIx, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decodeMultiplierAccount, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, 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, 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, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, patchDepositAmount, 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 };
7248
+ 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, 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 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, PRIORITY_TX_SIZE, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, type PanicStateCache, 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, buildOrderTrigger, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkJupiterFeeAccount, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeAccrualProjectionSeconds, computeActiveEmodePairs, computeAssetHealthComponent, computeBalanceUsdValue, computeBankAvailableLiquidity, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankProjectedAvailableLiquidity, computeBankRateLimitRemaining, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeGroupRateLimitRemainingUsd, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiquidationPriceForBank, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxDepositForBank, computeMaxWithdrawForBank, computeNetApy, computeOracleMultiplier, computeOracleMultipliers, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computePtMultiplier, computeQuantity, computeQuantityUi, computeRateLimitWindowRemainingCapacity, computeRateLimiterRemainingCapacity, computeRemainingCapacity, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeUtilizationRate, computeV0TxSize, computeVenueAvailableLiquidity, configureScopeOracleIx, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, decodeMultiplierAccount, decompileV0Transaction, deriveBankEmissionsAuth, deriveBankEmissionsVault, deriveBankFeeVault, deriveBankFeeVaultAuthority, deriveBankInsuranceVault, deriveBankInsuranceVaultAuthority, deriveBankLiquidityVault, deriveBankLiquidityVaultAuthority, deriveFeeState, deriveMarginfiAccount, deriveOrderPda, 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, fetchOrder, fetchOrdersForAccount, 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, 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, makePoolConfigureBankIx, 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, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOrderRaw, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, patchDepositAmount, percentToMaxSlippageU32, requireBank, requireTokenProgram, resolveBridgeCandidateBanks, resolveOrderBanks, 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 };