@0dotxyz/p0-ts-sdk 2.5.5-alpha.1 → 2.5.5-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -69926,26 +69926,9 @@ var CU_IXS = () => [
69926
69926
  ComputeBudgetProgram.setComputeUnitLimit({ units: 14e5 }),
69927
69927
  ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 })
69928
69928
  ];
69929
- function requireBank(bankMap, address) {
69930
- const bank = bankMap.get(address.toBase58());
69931
- if (!bank) {
69932
- throw TransactionBuildingError.transferPositionsInvalidSelection(
69933
- `bank ${address.toBase58()} not found`,
69934
- [address.toBase58()]
69935
- );
69936
- }
69937
- return bank;
69938
- }
69939
- function requireTokenProgram(tokenProgramsByBank, address) {
69940
- const tp = tokenProgramsByBank.get(address.toBase58());
69941
- if (!tp) {
69942
- throw TransactionBuildingError.transferPositionsInvalidSelection(
69943
- `token program for bank ${address.toBase58()} not provided`,
69944
- [address.toBase58()]
69945
- );
69946
- }
69947
- return tp;
69948
- }
69929
+ var invalidSelection = (address) => (message) => TransactionBuildingError.transferPositionsInvalidSelection(message, [
69930
+ address.toBase58()
69931
+ ]);
69949
69932
  function classifyAndValidate(params) {
69950
69933
  const {
69951
69934
  marginfiAccount: accountA,
@@ -69968,8 +69951,8 @@ function classifyAndValidate(params) {
69968
69951
  const activeBalancesA = accountA.balances.filter((b) => b.active);
69969
69952
  const positions = [];
69970
69953
  for (const bankAddress of bankAddresses) {
69971
- const bank = requireBank(bankMap, bankAddress);
69972
- const tokenProgram = requireTokenProgram(tokenProgramsByBank, bankAddress);
69954
+ const bank = requireBank(bankMap, bankAddress, invalidSelection(bankAddress));
69955
+ const tokenProgram = requireTokenProgram(tokenProgramsByBank, bankAddress, invalidSelection(bankAddress));
69973
69956
  const balance = activeBalancesA.find((b) => b.bankPk.equals(bankAddress));
69974
69957
  if (!balance) {
69975
69958
  throw TransactionBuildingError.transferPositionsInvalidSelection(
@@ -70334,7 +70317,7 @@ async function makeTransferPositionsTx(params) {
70334
70317
  const innerIxs = await buildInnerIxs(ctx, positions, false);
70335
70318
  const transferred = new Set(positions.map((p) => p.bankAddress.toBase58()));
70336
70319
  const projectedActiveBanksA = dedupeBanks(
70337
- accountA.balances.filter((b) => b.active && !transferred.has(b.bankPk.toBase58())).map((b) => requireBank(bankMap, b.bankPk))
70320
+ accountA.balances.filter((b) => b.active && !transferred.has(b.bankPk.toBase58())).map((b) => requireBank(bankMap, b.bankPk, invalidSelection(b.bankPk)))
70338
70321
  );
70339
70322
  const blockhash = (await connection.getLatestBlockhash("confirmed")).blockhash;
70340
70323
  const preIxs = createIx ? [createIx] : [];
@@ -70382,8 +70365,15 @@ async function makeTransferPositionsTx(params) {
70382
70365
  )
70383
70366
  );
70384
70367
  }
70368
+ const destinationOnlyBalances = accountB.balances.filter(
70369
+ (b) => b.active && !accountA.balances.some((a) => a.active && a.bankPk.equals(b.bankPk))
70370
+ );
70371
+ const crankBalanceView = {
70372
+ ...accountA,
70373
+ balances: [...accountA.balances, ...destinationOnlyBalances]
70374
+ };
70385
70375
  const { instructions: updateFeedIxs, luts: feedLuts } = await makeSmartCrankSwbFeedIx({
70386
- marginfiAccount: accountA,
70376
+ marginfiAccount: crankBalanceView,
70387
70377
  bankMap,
70388
70378
  oraclePrices,
70389
70379
  assetShareValueMultiplierByBank,
@@ -70412,6 +70402,301 @@ async function makeTransferPositionsTx(params) {
70412
70402
  destinationAccount: accountB
70413
70403
  };
70414
70404
  }
70405
+ var BULK_TX_SIZE_MARGIN = 128;
70406
+ function computeV0TxSizeSafe(ixs, payer, luts) {
70407
+ try {
70408
+ return computeV0TxSize(ixs, payer, luts);
70409
+ } catch {
70410
+ return { size: Number.MAX_SAFE_INTEGER, accountCount: Number.MAX_SAFE_INTEGER };
70411
+ }
70412
+ }
70413
+ function fitsInTx(ixs, payer, luts) {
70414
+ const { size, accountCount } = computeV0TxSizeSafe(ixs, payer, luts);
70415
+ return size <= MAX_TX_SIZE - BULK_TX_SIZE_MARGIN && accountCount <= MAX_ACCOUNT_LOCKS;
70416
+ }
70417
+ function buildTxRefreshIxs(args) {
70418
+ const { marginfiAccount, bankMap, bankMetadataMap, txBanks } = args;
70419
+ const ixs = [];
70420
+ const kaminoPks = txBanks.filter((b) => b.config.assetTag === 3 /* KAMINO */).map((b) => b.address);
70421
+ if (kaminoPks.length > 0) {
70422
+ ixs.push(
70423
+ ...makeRefreshKaminoBanksIxs(marginfiAccount, bankMap, kaminoPks, bankMetadataMap).instructions
70424
+ );
70425
+ }
70426
+ const jupPksInTx = txBanks.filter((b) => b.config.assetTag === 6 /* JUPLEND */).map((b) => b.address);
70427
+ if (jupPksInTx.length > 0) {
70428
+ ixs.push(
70429
+ ...makeUpdateJupLendRateIxs(marginfiAccount, bankMap, jupPksInTx, bankMetadataMap).instructions
70430
+ );
70431
+ }
70432
+ return ixs;
70433
+ }
70434
+ async function makeBulkWithdrawTx(params) {
70435
+ const {
70436
+ program,
70437
+ connection,
70438
+ marginfiAccount,
70439
+ bankAddresses,
70440
+ bankMap,
70441
+ bankMetadataMap,
70442
+ oraclePrices,
70443
+ assetShareValueMultiplierByBank,
70444
+ tokenProgramsByBank,
70445
+ overrideInferAccounts
70446
+ } = params;
70447
+ const luts = params.addressLookupTableAccounts ?? [];
70448
+ const groupRateLimiterEnabled = params.groupRateLimiterEnabled ?? false;
70449
+ const authority = marginfiAccount.authority;
70450
+ if (bankAddresses.length === 0) throw new Error("no banks to withdraw");
70451
+ const activeBalances = marginfiAccount.balances.filter((b) => b.active);
70452
+ const legs = [];
70453
+ const withdrawnSoFar = [];
70454
+ for (const bankAddress of bankAddresses) {
70455
+ const bank = requireBank(bankMap, bankAddress);
70456
+ const tokenProgram = requireTokenProgram(tokenProgramsByBank, bankAddress);
70457
+ const balance = activeBalances.find((b) => b.bankPk.equals(bankAddress));
70458
+ if (!balance || !balance.assetShares.gt(0)) {
70459
+ throw new Error(`no active deposit for bank ${bankAddress.toBase58()}`);
70460
+ }
70461
+ const multiplier = assetShareValueMultiplierByBank.get(bankAddress.toBase58());
70462
+ const uiAmount = computeQuantityUi(balance, bank, multiplier).assets;
70463
+ const packBanks = computeHealthCheckAccounts(
70464
+ marginfiAccount.balances,
70465
+ bankMap,
70466
+ [],
70467
+ [...withdrawnSoFar, bankAddress]
70468
+ );
70469
+ const observationBanksOverride = computeHealthAccountMetas(packBanks, true, [bank]);
70470
+ const shared = {
70471
+ program,
70472
+ bank,
70473
+ bankMap,
70474
+ tokenProgram,
70475
+ marginfiAccount,
70476
+ authority,
70477
+ bankMetadataMap,
70478
+ withdrawAll: true,
70479
+ opts: {
70480
+ createAtas: false,
70481
+ // ATAs are created in the prelude txs
70482
+ wrapAndUnwrapSol: true,
70483
+ overrideInferAccounts,
70484
+ observationBanksOverride
70485
+ }
70486
+ };
70487
+ let instructions2;
70488
+ switch (bank.config.assetTag) {
70489
+ case 3 /* KAMINO */: {
70490
+ const reserve = bankMetadataMap[bankAddress.toBase58()]?.kaminoStates?.reserveState;
70491
+ if (!reserve) {
70492
+ throw new Error(`kamino reserve state missing for bank ${bankAddress.toBase58()}`);
70493
+ }
70494
+ const withdraw = await makeKaminoWithdrawIx3({
70495
+ ...shared,
70496
+ cTokenAmount: uiAmount.div(multiplier ?? new BigNumber(1)),
70497
+ reserve
70498
+ });
70499
+ instructions2 = withdraw.instructions;
70500
+ break;
70501
+ }
70502
+ case 6 /* JUPLEND */: {
70503
+ const jupLendingState = bankMetadataMap[bankAddress.toBase58()]?.jupLendStates?.jupLendingState;
70504
+ if (!jupLendingState) {
70505
+ throw new Error(`juplend lending state missing for bank ${bankAddress.toBase58()}`);
70506
+ }
70507
+ const withdraw = await makeJuplendWithdrawIx2({
70508
+ ...shared,
70509
+ amount: uiAmount,
70510
+ jupLendingState
70511
+ });
70512
+ instructions2 = withdraw.instructions;
70513
+ break;
70514
+ }
70515
+ case 4 /* DRIFT */: {
70516
+ const driftState = bankMetadataMap[bankAddress.toBase58()]?.driftStates;
70517
+ if (!driftState) {
70518
+ throw new Error(`drift state missing for bank ${bankAddress.toBase58()}`);
70519
+ }
70520
+ const withdraw = await makeDriftWithdrawIx3({
70521
+ ...shared,
70522
+ amount: uiAmount,
70523
+ driftSpotMarket: driftState.spotMarketState,
70524
+ userRewards: driftState.userRewards
70525
+ });
70526
+ instructions2 = withdraw.instructions;
70527
+ break;
70528
+ }
70529
+ default: {
70530
+ const withdraw = await makeWithdrawIx3({
70531
+ ...shared,
70532
+ amount: uiAmount
70533
+ });
70534
+ instructions2 = withdraw.instructions;
70535
+ break;
70536
+ }
70537
+ }
70538
+ legs.push({ bank, instructions: instructions2 });
70539
+ withdrawnSoFar.push(bankAddress);
70540
+ }
70541
+ const bundles = [];
70542
+ let current = [];
70543
+ const assembleTxIxs = (bundle) => [
70544
+ ...buildTxRefreshIxs({
70545
+ marginfiAccount,
70546
+ bankMap,
70547
+ bankMetadataMap,
70548
+ txBanks: bundle.map((l) => l.bank)
70549
+ }),
70550
+ ...bundle.flatMap((l) => l.instructions)
70551
+ ];
70552
+ for (const leg of legs) {
70553
+ const candidate = [...current, leg];
70554
+ if (current.length > 0 && !fitsInTx(assembleTxIxs(candidate), authority, luts)) {
70555
+ bundles.push(current);
70556
+ current = [leg];
70557
+ } else {
70558
+ current = candidate;
70559
+ }
70560
+ }
70561
+ if (current.length > 0) bundles.push(current);
70562
+ for (const bundle of bundles) {
70563
+ const ixs = assembleTxIxs(bundle);
70564
+ if (bundle.length === 1 && !fitsInTx(ixs, authority, luts)) {
70565
+ throw new Error(
70566
+ `withdraw for bank ${bundle[0].bank.address.toBase58()} does not fit one transaction`
70567
+ );
70568
+ }
70569
+ }
70570
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
70571
+ const withdrawTxs = bundles.map((bundle) => {
70572
+ const message = new TransactionMessage({
70573
+ payerKey: authority,
70574
+ recentBlockhash: blockhash,
70575
+ instructions: assembleTxIxs(bundle)
70576
+ }).compileToV0Message(luts);
70577
+ return addTransactionMetadata(new VersionedTransaction(message), {
70578
+ addressLookupTables: luts,
70579
+ type: "WITHDRAW" /* WITHDRAW */
70580
+ });
70581
+ });
70582
+ const additionalTxs = [];
70583
+ const setupIxs = await makeSetupIx({
70584
+ connection,
70585
+ authority,
70586
+ tokens: legs.map((l) => ({
70587
+ mint: l.bank.mint,
70588
+ tokenProgram: requireTokenProgram(tokenProgramsByBank, l.bank.address)
70589
+ }))
70590
+ });
70591
+ if (setupIxs.length > 0) {
70592
+ const setupTxs = splitInstructionsToFitTransactions([], setupIxs, {
70593
+ blockhash,
70594
+ payerKey: authority,
70595
+ luts
70596
+ });
70597
+ additionalTxs.push(
70598
+ ...setupTxs.map(
70599
+ (tx) => addTransactionMetadata(tx, {
70600
+ type: "CREATE_ATA" /* CREATE_ATA */,
70601
+ addressLookupTables: luts
70602
+ })
70603
+ )
70604
+ );
70605
+ }
70606
+ const { instructions: crankIxs, luts: feedLuts } = await makeSmartCrankSwbFeedIx({
70607
+ marginfiAccount,
70608
+ bankMap,
70609
+ oraclePrices,
70610
+ assetShareValueMultiplierByBank,
70611
+ instructions: legs.flatMap((l) => l.instructions),
70612
+ program,
70613
+ connection,
70614
+ crossbarUrl: params.crossbarUrl,
70615
+ groupRateLimiterEnabled
70616
+ });
70617
+ if (crankIxs.length > 0) {
70618
+ const message = new TransactionMessage({
70619
+ payerKey: authority,
70620
+ recentBlockhash: blockhash,
70621
+ instructions: crankIxs
70622
+ }).compileToV0Message(feedLuts);
70623
+ additionalTxs.push(
70624
+ addTransactionMetadata(new VersionedTransaction(message), {
70625
+ addressLookupTables: feedLuts,
70626
+ type: "CRANK" /* CRANK */
70627
+ })
70628
+ );
70629
+ }
70630
+ return {
70631
+ transactions: [...additionalTxs, ...withdrawTxs],
70632
+ actionTxIndex: additionalTxs.length
70633
+ };
70634
+ }
70635
+ async function makeBulkRepayTx(params) {
70636
+ const {
70637
+ program,
70638
+ connection,
70639
+ marginfiAccount,
70640
+ bankAddresses,
70641
+ bankMap,
70642
+ tokenProgramsByBank,
70643
+ overrideInferAccounts
70644
+ } = params;
70645
+ const luts = params.addressLookupTableAccounts ?? [];
70646
+ const authority = marginfiAccount.authority;
70647
+ if (bankAddresses.length === 0) throw new Error("no banks to repay");
70648
+ const activeBalances = marginfiAccount.balances.filter((b) => b.active);
70649
+ const legs = [];
70650
+ for (const bankAddress of bankAddresses) {
70651
+ const bank = requireBank(bankMap, bankAddress);
70652
+ const tokenProgram = requireTokenProgram(tokenProgramsByBank, bankAddress);
70653
+ const balance = activeBalances.find((b) => b.bankPk.equals(bankAddress));
70654
+ if (!balance || !balance.liabilityShares.gt(0)) {
70655
+ throw new Error(`no active debt for bank ${bankAddress.toBase58()}`);
70656
+ }
70657
+ const uiAmount = computeQuantityUi(balance, bank).liabilities;
70658
+ const repay = await makeRepayIx3({
70659
+ program,
70660
+ bank,
70661
+ tokenProgram,
70662
+ amount: uiAmount,
70663
+ accountAddress: marginfiAccount.address,
70664
+ authority,
70665
+ repayAll: true,
70666
+ opts: {
70667
+ wrapAndUnwrapSol: true,
70668
+ overrideInferAccounts
70669
+ }
70670
+ });
70671
+ legs.push({ bank, instructions: repay.instructions });
70672
+ }
70673
+ const bundles = [];
70674
+ let current = [];
70675
+ for (const leg of legs) {
70676
+ const candidate = [...current, leg];
70677
+ const candidateIxs = candidate.flatMap((l) => l.instructions);
70678
+ if (current.length > 0 && !fitsInTx(candidateIxs, authority, luts)) {
70679
+ bundles.push(current);
70680
+ current = [leg];
70681
+ } else {
70682
+ current = candidate;
70683
+ }
70684
+ }
70685
+ if (current.length > 0) bundles.push(current);
70686
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
70687
+ const transactions = bundles.map((bundle) => {
70688
+ const message = new TransactionMessage({
70689
+ payerKey: authority,
70690
+ recentBlockhash: blockhash,
70691
+ instructions: bundle.flatMap((l) => l.instructions)
70692
+ }).compileToV0Message(luts);
70693
+ return addTransactionMetadata(new VersionedTransaction(message), {
70694
+ addressLookupTables: luts,
70695
+ type: "REPAY" /* REPAY */
70696
+ });
70697
+ });
70698
+ return { transactions, actionTxIndex: 0 };
70699
+ }
70415
70700
 
70416
70701
  // src/services/account/services/account-simulation.service.ts
70417
70702
  async function simulateAccountHealthCacheWithFallback(params) {
@@ -72824,6 +73109,22 @@ function computeBankMetrics(params) {
72824
73109
  };
72825
73110
  }
72826
73111
 
73112
+ // src/services/bank/utils/lookup.utils.ts
73113
+ function requireBank(bankMap, address, makeError = (message) => new Error(message)) {
73114
+ const bank = bankMap.get(address.toBase58());
73115
+ if (!bank) {
73116
+ throw makeError(`bank ${address.toBase58()} not found`);
73117
+ }
73118
+ return bank;
73119
+ }
73120
+ function requireTokenProgram(tokenProgramsByBank, address, makeError = (message) => new Error(message)) {
73121
+ const tokenProgram = tokenProgramsByBank.get(address.toBase58());
73122
+ if (!tokenProgram) {
73123
+ throw makeError(`token program for bank ${address.toBase58()} not provided`);
73124
+ }
73125
+ return tokenProgram;
73126
+ }
73127
+
72827
73128
  // src/services/bank/bank.service.ts
72828
73129
  async function freezeBankConfigIx(program, bankAddress, bankConfigOpt) {
72829
73130
  let bankConfigRaw;
@@ -75731,6 +76032,6 @@ var EmodeSettings = class _EmodeSettings {
75731
76032
  }
75732
76033
  };
75733
76034
 
75734
- export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, AccountFlags, AccountType, AssetTag, BUNDLE_TX_SIZE, Balance, Bank, BankConfig, BankConfigFlag, BankVaultType, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, EMPTY_HEALTH_CACHE, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodeSettings, EmodeTag, FLASHLOAN_ENABLED_FLAG, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheSimulationError, HealthCacheStatus, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, LST_MINT, MARGINFI_IDL, 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, MarginRequirementType, MarginfiAccount, MarginfiAccountWrapper, MarginfiGroup, OperationalState, OracleSetup, 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, PriceBias, Project0Client, RiskTier, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SwapProvider, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionArenaKeyMap, TransactionBuildingError, TransactionBuildingErrorCode, TransactionConfigMap, TransactionType, USDC_DECIMALS, USDC_MINT, WSOL_MINT, ZERO_ORACLE_KEY, accountConflictsWithBridge, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, buildCollateralLegIxs, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiabilityUsdValue, computeLiquidationPriceForBank, computeLoopingParams, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxLeverage, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, 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, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getAssetWeight, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isDecomposableSwapError, isDepositIx, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWeightedPrice, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx3 as makeDepositIx, makeDepositTx, makeDriftDepositIx3 as makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx3 as makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx3 as makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx2 as makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx2 as makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx3 as makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx3 as makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx3 as makePoolAddBankIx, makePoolConfigureBankIx3 as makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx2 as makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshKaminoBanksIxs, makeRepayIx3 as makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTransferPositionsTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, resolveAmount, resolveBridgeBanks, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
76035
+ export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_GROUP_NATIVE_STAKE, ADDRESS_LOOKUP_TABLE_FOR_SWAP, AccountFlags, AccountType, AssetTag, BUNDLE_TX_SIZE, Balance, Bank, BankConfig, BankConfigFlag, BankVaultType, DEFAULT_CROSSBAR_URL, DEFAULT_FALLBACK_CROSSBAR_URL, DEFAULT_ORACLE_MAX_AGE, DEFAULT_REPAY_ALL_EXTRA_BUFFER_BPS, DISABLED_FLAG, EMPTY_HEALTH_CACHE, EmodeEntryFlags, EmodeFlags, EmodeImpactStatus, EmodeSettings, EmodeTag, FLASHLOAN_ENABLED_FLAG, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheSimulationError, HealthCacheStatus, JUPITER_V6_PROGRAM, JUP_SWAP_LUT_PROGRAM_AUTHORITY_INDEX, LST_MINT, MARGINFI_IDL, 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, MarginRequirementType, MarginfiAccount, MarginfiAccountWrapper, MarginfiGroup, OperationalState, OracleSetup, 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, PriceBias, Project0Client, RiskTier, SINGLE_POOL_PROGRAM_ID, STAKED_ORACLE_DISABLED_FLAG, STAKED_ORACLE_USES_ONRAMP_FLAG, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWAP_ADAPTERS, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SwapProvider, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionArenaKeyMap, TransactionBuildingError, TransactionBuildingErrorCode, TransactionConfigMap, TransactionType, USDC_DECIMALS, USDC_MINT, WSOL_MINT, ZERO_ORACLE_KEY, accountConflictsWithBridge, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRateLimiterRawToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, buildCollateralLegIxs, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkJupiterFeeAccount, checkMultipleOraclesCrankability, checkTitanFeeAccount, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, classifyAndValidate, compileFlashloanPrecheck, composeBridgedSwap, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeBorrowEstimateForRepay, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeInterestRates, computeLiabilityHealthComponent, computeLiabilityUsdValue, computeLiquidationPriceForBank, computeLoopingParams, computeLowestEmodeWeights, computeMaxBorrowForBank, computeMaxLeverage, computeMaxWithdrawForBank, computeNetApy, computeProjectedActiveBalancesNoCpi, computeProjectedActiveBanksNoCpi, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeSmartCrank, computeStakedBankMultipliers, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, computeV0TxSize, convertVoteAccCoeffsToBankCoeffs, createActiveEmodePairFromPairs, createEmptyBalance, decodeAccountRaw, decodeBankRaw, decodeInstruction, 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, fetchMarginfiAccountActiveBalancesForBank, fetchMarginfiAccountAddresses, fetchMarginfiAccountAddressesHoldingBank, fetchMarginfiAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchProgramForMints, fetchPythOracleData, fetchPythOraclePricesFromAPI, fetchPythOraclePricesFromChain, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleAccountsFromAPI, fetchSwbOracleAccountsFromChain, fetchSwbOracleData, fetchSwbOraclePricesFromAPI, fetchSwbOraclePricesFromCrossbar, findRandomAvailableAccountIndex, freezeBankConfigIx, generateDummyAccount, getAccountKeys, getActiveAccountFlags, getActiveBalances, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getAssetQuantity, getAssetShares, getAssetWeight, getBalance, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getBirdeyeFallbackPricesByFeedId, getBirdeyePricesForMints, getConfig, getDriftCTokenMultiplier, getDriftMetadata, getDriftStatesDto, getEmodePairs, getExactOutEstimate, getFallbackPricesByFeedId, getFallbackPricesForMints, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterReferralFeeAccount, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapAdapter, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isDecomposableSwapError, isDepositIx, isFlashloan, isGroupRateLimiterEnabled, isStandardBorrowable, isStandardDepositable, isV0Tx, isWeightedPrice, isWholePosition, makeAccountTransferToNewAccountTx, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBulkRepayTx, makeBulkWithdrawTx, makeBundleTipIx, makeCloseMarginfiAccountIx, makeCloseMarginfiAccountTx, makeCrankSwbFeedIx, makeCreateAccountIxWithProjection, makeCreateAccountTxWithProjection, makeCreateMarginfiAccountIx, makeCreateMarginfiAccountTx, makeDepositIx3 as makeDepositIx, makeDepositTx, makeDriftDepositIx3 as makeDriftDepositIx, makeDriftDepositTx, makeDriftWithdrawIx3 as makeDriftWithdrawIx, makeDriftWithdrawTx, makeEndFlashLoanIx3 as makeEndFlashLoanIx, makeFlashLoanTx, makeJuplendDepositIx2 as makeJuplendDepositIx, makeJuplendDepositTx, makeJuplendWithdrawIx2 as makeJuplendWithdrawIx, makeJuplendWithdrawTx, makeKaminoDepositIx3 as makeKaminoDepositIx, makeKaminoDepositTx, makeKaminoWithdrawIx3 as makeKaminoWithdrawIx, makeKaminoWithdrawTx, makeLoopTx, makeMergeStakeAccountsTx, makeMintStakedLstIx, makeMintStakedLstTx, makePoolAddBankIx3 as makePoolAddBankIx, makePoolConfigureBankIx3 as makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx2 as makePulseHealthIx, makeRedeemStakedLstIx, makeRedeemStakedLstTx, makeRefreshKaminoBanksIxs, makeRepayIx3 as makeRepayIx, makeRepayTx, makeRepayWithCollatTx, makeRollPtTx, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTransferPositionsTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, mergeBridgeQuotes, mergeBridgeQuotesDebt, mergeBridgeQuotesLoop, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRateLimiterRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, patchDepositAmount, requireBank, requireTokenProgram, resolveAmount, resolveBridgeBanks, runSwapEngine, selectLutsForAccountAction, selectLutsForBanks, serializeBankConfigOpt, serializeInstruction, serializeInterestRateConfig, serializeLut, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, serializeSwapEngineRequest, serializeSwapEngineResult, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, swapEngineProvidersFromOpts, swapEngineQuoteFieldsFromOpts, toBankConfigDto, toBankDto, toBankRateLimiterDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
75735
76036
  //# sourceMappingURL=index.js.map
75736
76037
  //# sourceMappingURL=index.js.map