@0dotxyz/p0-ts-sdk 2.2.1 → 2.2.3-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.js CHANGED
@@ -19969,7 +19969,7 @@ function dtoToOraclePrice(dto) {
19969
19969
  }
19970
19970
 
19971
19971
  // src/services/price/utils/crankability.utils.ts
19972
- async function checkBatchOracleCrankability(feedHashes, crossbarUrl = "https://integrator-crossbar.prod.mrgn.app") {
19972
+ async function checkBatchOracleCrankability(feedHashes, crossbarUrl = "https://crossbar.0.xyz") {
19973
19973
  const results = /* @__PURE__ */ new Map();
19974
19974
  if (feedHashes.length === 0) {
19975
19975
  return results;
@@ -20501,16 +20501,72 @@ function createActiveEmodePairFromPairs(pairs) {
20501
20501
  assetWeightInit: bestPair.assetWeightInit
20502
20502
  };
20503
20503
  }
20504
+ function indexConfiguredPairs(emodePairs) {
20505
+ const configured = [];
20506
+ const liabTagByBank = /* @__PURE__ */ new Map();
20507
+ for (const p of emodePairs) {
20508
+ if (p.collateralBankTag === 0 /* UNSET */ || p.liabilityBankTag === 0 /* UNSET */) {
20509
+ continue;
20510
+ }
20511
+ const liabStr = p.liabilityBank.toBase58();
20512
+ const liabTagStr = p.liabilityBankTag.toString();
20513
+ configured.push({
20514
+ orig: p,
20515
+ liabStr,
20516
+ liabTagStr,
20517
+ collTagStr: p.collateralBankTag.toString(),
20518
+ collStrs: p.collateralBanks.map((b) => b.toBase58())
20519
+ });
20520
+ liabTagByBank.set(liabStr, liabTagStr);
20521
+ }
20522
+ return { configured, liabTagByBank };
20523
+ }
20524
+ function activePairsFromIndex(configured, liabTagByBank, liabSet, collSet) {
20525
+ const requiredTags = /* @__PURE__ */ new Set();
20526
+ for (const liab of liabSet) {
20527
+ const tag = liabTagByBank.get(liab);
20528
+ if (!tag) return [];
20529
+ requiredTags.add(tag);
20530
+ }
20531
+ const possible = configured.filter(
20532
+ (p) => liabSet.has(p.liabStr) && p.collStrs.some((c) => collSet.has(c))
20533
+ );
20534
+ if (possible.length === 0) return [];
20535
+ const byCollTag = {};
20536
+ for (const p of possible) {
20537
+ (byCollTag[p.collTagStr] ||= []).push(p);
20538
+ }
20539
+ const validGroups = [];
20540
+ for (const group of Object.values(byCollTag)) {
20541
+ const supports = new Set(group.map((p) => p.liabTagStr));
20542
+ let coversAll = true;
20543
+ for (const rt of requiredTags) {
20544
+ if (!supports.has(rt)) {
20545
+ coversAll = false;
20546
+ break;
20547
+ }
20548
+ }
20549
+ if (coversAll) validGroups.push(group);
20550
+ }
20551
+ if (validGroups.length === 0) return [];
20552
+ return validGroups.flat().map((p) => p.orig);
20553
+ }
20504
20554
  function computeEmodeImpacts(emodePairs, activeLiabilities, activeCollateral, allBanks) {
20505
- const toKey = (k) => k.toBase58();
20506
- const basePairs = computeActiveEmodePairs(emodePairs, activeLiabilities, activeCollateral);
20507
- const baseOn = basePairs.length > 0;
20508
- const liabTagMap = /* @__PURE__ */ new Map();
20555
+ const liabBaseSet = new Set(activeLiabilities.map((b) => b.toBase58()));
20556
+ const collBaseSet = new Set(activeCollateral.map((b) => b.toBase58()));
20557
+ const { configured, liabTagByBank } = indexConfiguredPairs(emodePairs);
20558
+ const liabTagMapAll = /* @__PURE__ */ new Map();
20559
+ for (const p of emodePairs) {
20560
+ liabTagMapAll.set(p.liabilityBank.toBase58(), p.liabilityBankTag.toString());
20561
+ }
20562
+ const allCollateralBankStrs = /* @__PURE__ */ new Set();
20509
20563
  for (const p of emodePairs) {
20510
- liabTagMap.set(p.liabilityBank.toBase58(), p.liabilityBankTag.toString());
20564
+ for (const c of p.collateralBanks) allCollateralBankStrs.add(c.toBase58());
20511
20565
  }
20566
+ const basePairs = activePairsFromIndex(configured, liabTagByBank, liabBaseSet, collBaseSet);
20567
+ const baseOn = basePairs.length > 0;
20512
20568
  const existingTags = new Set(
20513
- activeLiabilities.map((l) => liabTagMap.get(l.toBase58())).filter((t) => !!t)
20569
+ Array.from(liabBaseSet).map((l) => liabTagMapAll.get(l)).filter((t) => !!t)
20514
20570
  );
20515
20571
  function minWeight(ps) {
20516
20572
  let m = ps[0].assetWeightInit;
@@ -20527,27 +20583,26 @@ function computeEmodeImpacts(emodePairs, activeLiabilities, activeCollateral, al
20527
20583
  if (aMin.lt(bMin)) return 3 /* ReduceEmode */;
20528
20584
  return 1 /* ExtendEmode */;
20529
20585
  }
20530
- function simulate(bank, action) {
20531
- bank.equals(new PublicKey("CCKtUs6Cgwo4aaQUmBPmyoApH2gUDErxNZCAntD6LYGh"));
20532
- let L = [...activeLiabilities], C = [...activeCollateral];
20586
+ function simulate(bankStr, action) {
20587
+ const L = new Set(liabBaseSet), C = new Set(collBaseSet);
20533
20588
  switch (action) {
20534
20589
  case "borrow":
20535
- if (!L.some((x) => x.equals(bank))) L.push(bank);
20590
+ L.add(bankStr);
20536
20591
  break;
20537
20592
  case "repay":
20538
- L = L.filter((x) => !x.equals(bank));
20593
+ L.delete(bankStr);
20539
20594
  break;
20540
20595
  case "supply":
20541
- if (!C.some((x) => x.equals(bank))) C.push(bank);
20596
+ C.add(bankStr);
20542
20597
  break;
20543
20598
  case "withdraw":
20544
- C = C.filter((x) => !x.equals(bank));
20599
+ C.delete(bankStr);
20545
20600
  break;
20546
20601
  }
20547
- const after = computeActiveEmodePairs(emodePairs, L, C);
20602
+ const after = activePairsFromIndex(configured, liabTagByBank, L, C);
20548
20603
  let status = diffState(basePairs, after);
20549
20604
  if (action === "borrow") {
20550
- const tag = liabTagMap.get(bank.toBase58());
20605
+ const tag = liabTagMapAll.get(bankStr);
20551
20606
  if (!tag) {
20552
20607
  status = baseOn ? 4 /* RemoveEmode */ : 5 /* InactiveEmode */;
20553
20608
  } else if (baseOn) {
@@ -20583,66 +20638,29 @@ function computeEmodeImpacts(emodePairs, activeLiabilities, activeCollateral, al
20583
20638
  }
20584
20639
  const result = {};
20585
20640
  for (const bank of allBanks) {
20586
- const key = toKey(bank);
20641
+ const key = bank.toBase58();
20587
20642
  const impact = {};
20588
- if (!activeCollateral.some((x) => x.equals(bank))) {
20589
- impact.borrowImpact = simulate(bank, "borrow");
20643
+ if (!collBaseSet.has(key)) {
20644
+ impact.borrowImpact = simulate(key, "borrow");
20590
20645
  }
20591
- const collSet = new Set(emodePairs.flatMap((p) => p.collateralBanks.map((c) => c.toBase58())));
20592
- if (collSet.has(key) && !activeCollateral.some((x) => x.equals(bank)) && !activeLiabilities.some((x) => x.equals(bank))) {
20593
- impact.supplyImpact = simulate(bank, "supply");
20646
+ if (allCollateralBankStrs.has(key) && !collBaseSet.has(key) && !liabBaseSet.has(key)) {
20647
+ impact.supplyImpact = simulate(key, "supply");
20594
20648
  }
20595
- if (activeLiabilities.some((x) => x.equals(bank))) {
20596
- impact.repayAllImpact = simulate(bank, "repay");
20649
+ if (liabBaseSet.has(key)) {
20650
+ impact.repayAllImpact = simulate(key, "repay");
20597
20651
  }
20598
- if (activeCollateral.some((x) => x.equals(bank))) {
20599
- impact.withdrawAllImpact = simulate(bank, "withdraw");
20652
+ if (collBaseSet.has(key)) {
20653
+ impact.withdrawAllImpact = simulate(key, "withdraw");
20600
20654
  }
20601
20655
  result[key] = impact;
20602
20656
  }
20603
20657
  return result;
20604
20658
  }
20605
20659
  function computeActiveEmodePairs(emodePairs, activeLiabilities, activeCollateral) {
20606
- const configured = emodePairs.filter(
20607
- (p) => p.collateralBankTag !== 0 /* UNSET */ && p.liabilityBankTag !== 0 /* UNSET */
20608
- );
20609
- const liabTagByBank = /* @__PURE__ */ new Map();
20610
- for (const p of configured) {
20611
- liabTagByBank.set(p.liabilityBank.toBase58(), p.liabilityBankTag.toString());
20612
- }
20613
- const requiredTags = /* @__PURE__ */ new Set();
20614
- for (const liab of activeLiabilities) {
20615
- const tag = liabTagByBank.get(liab.toBase58());
20616
- if (!tag) {
20617
- return [];
20618
- }
20619
- requiredTags.add(tag);
20620
- }
20621
- const possible = configured.filter(
20622
- (p) => activeLiabilities.some((l) => l.equals(p.liabilityBank)) && p.collateralBanks.some((c) => activeCollateral.some((a) => a.equals(c)))
20623
- );
20624
- if (possible.length === 0) return [];
20625
- const byCollTag = {};
20626
- for (const p of possible) {
20627
- const ct = p.collateralBankTag.toString();
20628
- (byCollTag[ct] ||= []).push(p);
20629
- }
20630
- const validGroups = [];
20631
- for (const group of Object.values(byCollTag)) {
20632
- const supports = new Set(group.map((p) => p.liabilityBankTag.toString()));
20633
- let coversAll = true;
20634
- for (const rt of requiredTags) {
20635
- if (!supports.has(rt)) {
20636
- coversAll = false;
20637
- break;
20638
- }
20639
- }
20640
- if (coversAll) {
20641
- validGroups.push(group);
20642
- }
20643
- }
20644
- if (validGroups.length === 0) return [];
20645
- return validGroups.flat();
20660
+ const { configured, liabTagByBank } = indexConfiguredPairs(emodePairs);
20661
+ const liabSet = new Set(activeLiabilities.map((b) => b.toBase58()));
20662
+ const collSet = new Set(activeCollateral.map((b) => b.toBase58()));
20663
+ return activePairsFromIndex(configured, liabTagByBank, liabSet, collSet);
20646
20664
  }
20647
20665
  function computeBalanceUsdValue(params) {
20648
20666
  const {
@@ -21347,7 +21365,10 @@ function computeProjectedActiveBalancesNoCpi(balances, instructions2, program, b
21347
21365
  if (!bank) {
21348
21366
  throw Error(`Bank ${targetBank.toBase58()} not found in bankMap`);
21349
21367
  }
21350
- const withdrawShares = getAssetShares(bank, withdrawTokenAmount);
21368
+ const isKaminoWithdraw = decoded.name === "kaminoWithdraw";
21369
+ const assetShareValueMultiplier = isKaminoWithdraw ? new BigNumber3(1) : assetShareValueMultiplierByBank.get(targetBank.toBase58()) ?? new BigNumber3(1);
21370
+ const cTokenAmount = withdrawTokenAmount.div(assetShareValueMultiplier);
21371
+ const withdrawShares = getAssetShares(bank, cTokenAmount);
21351
21372
  targetBalance.assetShares = BigNumber3.max(
21352
21373
  0,
21353
21374
  targetBalance.assetShares.minus(withdrawShares)
@@ -48746,7 +48767,8 @@ async function getHealthSimulationTransactions({
48746
48767
  authority,
48747
48768
  luts,
48748
48769
  includeCrankTx,
48749
- blockhash
48770
+ blockhash,
48771
+ crossbarUrl
48750
48772
  }) {
48751
48773
  const additionalTxs = [];
48752
48774
  const computeIx = ComputeBudgetProgram.setComputeUnitLimit({
@@ -48758,7 +48780,8 @@ async function getHealthSimulationTransactions({
48758
48780
  marginfiAccount,
48759
48781
  bankMap,
48760
48782
  projectedActiveBanks,
48761
- program.provider
48783
+ program.provider,
48784
+ crossbarUrl
48762
48785
  );
48763
48786
  }
48764
48787
  const activeBanks = marginfiAccount.balances.filter((b) => b.active).map((b) => b.bankPk);
@@ -49126,7 +49149,7 @@ function computeMaxWithdrawForBank(params) {
49126
49149
  const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice);
49127
49150
  return maxWithdraw;
49128
49151
  }
49129
- var TITAN_FEE_WALLET = new PublicKey("6ryqDDCwKFZfSiHQrYRkjTEarbsLjg9TmuFg1RJorBk3");
49152
+ var TITAN_FEE_WALLET = new PublicKey("FEES6XLN7dMz2iBwKab9Hri9Kwc4WJ6TmDAiT4BNhyej");
49130
49153
  var getTitanFeeAccount = (mint) => {
49131
49154
  return getAssociatedTokenAddressSync(mint, TITAN_FEE_WALLET, true);
49132
49155
  };
@@ -50451,11 +50474,14 @@ async function makeSmartCrankSwbFeedIx(params) {
50451
50474
  const { instructions: instructions2, luts } = await makeUpdateSwbFeedIx({
50452
50475
  swbPullOracles: oraclesToCrank,
50453
50476
  feePayer: params.marginfiAccount.authority,
50454
- connection: params.connection
50477
+ connection: params.connection,
50478
+ crossbarUrl: params.crossbarUrl
50455
50479
  });
50456
50480
  return { instructions: instructions2, luts };
50457
50481
  }
50458
- async function makeCrankSwbFeedIx(marginfiAccount, bankMap, newBanksPk, provider) {
50482
+ var DEFAULT_CROSSBAR_URL = "https://crossbar.0.xyz";
50483
+ var DEFAULT_FALLBACK_CROSSBAR_URL = "https://crossbar.switchboard.xyz";
50484
+ async function makeCrankSwbFeedIx(marginfiAccount, bankMap, newBanksPk, provider, crossbarUrl) {
50459
50485
  const activeBanksPk = marginfiAccount.balances.filter((balance) => balance.active).map((balance) => balance.bankPk);
50460
50486
  const allActiveBanks = [
50461
50487
  ...(/* @__PURE__ */ new Set([
@@ -50474,7 +50500,8 @@ async function makeCrankSwbFeedIx(marginfiAccount, bankMap, newBanksPk, provider
50474
50500
  const { instructions: instructions2, luts } = await makeUpdateSwbFeedIx({
50475
50501
  swbPullOracles: staleOracles.map((oracle) => ({ key: oracle })),
50476
50502
  feePayer: provider.publicKey,
50477
- connection: provider.connection
50503
+ connection: provider.connection,
50504
+ crossbarUrl
50478
50505
  });
50479
50506
  return { instructions: instructions2, luts };
50480
50507
  }
@@ -50504,16 +50531,26 @@ async function makeUpdateSwbFeedIx(props) {
50504
50531
  if (pullFeedInstances.length === 0) {
50505
50532
  return { instructions: [], luts: [] };
50506
50533
  }
50507
- const crossbarClient = new CrossbarClient(
50508
- process.env.NEXT_PUBLIC_SWITCHBOARD_CROSSSBAR_API || "https://integrator-crossbar.prod.mrgn.app"
50509
- );
50510
- const [pullIx, luts] = await PullFeed.fetchUpdateManyIx(swbProgram, {
50511
- feeds: pullFeedInstances,
50512
- numSignatures: 1,
50513
- crossbarClient,
50514
- payer: props.feePayer
50515
- });
50516
- return { instructions: pullIx, luts };
50534
+ const primaryUrl = props.crossbarUrl ?? DEFAULT_CROSSBAR_URL;
50535
+ const fallbackUrl = props.fallbackCrossbarUrl ?? DEFAULT_FALLBACK_CROSSBAR_URL;
50536
+ try {
50537
+ const [pullIx, luts] = await PullFeed.fetchUpdateManyIx(swbProgram, {
50538
+ feeds: pullFeedInstances,
50539
+ numSignatures: 1,
50540
+ crossbarClient: new CrossbarClient(primaryUrl),
50541
+ payer: props.feePayer
50542
+ });
50543
+ return { instructions: pullIx, luts };
50544
+ } catch (primaryError) {
50545
+ console.warn(`Primary crossbar endpoint failed (${primaryUrl}), trying fallback:`, primaryError);
50546
+ const [pullIx, luts] = await PullFeed.fetchUpdateManyIx(swbProgram, {
50547
+ feeds: pullFeedInstances,
50548
+ numSignatures: 1,
50549
+ crossbarClient: new CrossbarClient(fallbackUrl),
50550
+ payer: props.feePayer
50551
+ });
50552
+ return { instructions: pullIx, luts };
50553
+ }
50517
50554
  }
50518
50555
 
50519
50556
  // src/services/price/actions/klend-reserve-refresh.ts
@@ -51004,7 +51041,7 @@ var fetchSwbOracleData = async (banks, opts) => {
51004
51041
  } else {
51005
51042
  crossbarResponse = await fetchSwbOraclePricesFromCrossbar(
51006
51043
  swbFeedIds,
51007
- opts.crossbarEndpoint || "https://34.97.218.183.sslip.io",
51044
+ opts.crossbarEndpoint || "https://crossbar.0.xyz",
51008
51045
  "https://crossbar.switchboard.xyz"
51009
51046
  );
51010
51047
  birdeyeResponse = {};
@@ -55494,6 +55531,6 @@ var EmodeSettings = class _EmodeSettings {
55494
55531
  }
55495
55532
  };
55496
55533
 
55497
- export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, ADDRESS_LOOKUP_TABLE_FOR_SWAP, AccountFlags, AccountType, AssetTag, BUNDLE_TX_SIZE, Balance, Bank, BankConfig, BankConfigFlag, BankVaultType, DEFAULT_ORACLE_MAX_AGE, 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, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, 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, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkMultipleOraclesCrankability, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, compileFlashloanPrecheck, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeHealthComponentsWithoutBiasFromBalances, 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, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountAddresses, 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, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isFlashloan, isV0Tx, isWeightedPrice, isWholePosition, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeClearEmissionsIx, 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, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, resolveAmount, serializeBankConfigOpt, serializeInterestRateConfig, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, toBankConfigDto, toBankDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
55534
+ export { ADDRESS_LOOKUP_TABLE_FOR_GROUP, 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, 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, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, 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, accountFlagToBN, addOracleToBanksIx, addTransactionMetadata, adjustPriceComponent, aprToApy, apyToApr, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankMetadataMapToDto, bankMetadataToDto, bankRawToDto, bigNumberToWrappedI80F48, bpsToPercentile, calculateApyFromInterest, calculateInterestFromApy, capConfidenceInterval, categorizePythBanks, checkBatchOracleCrankability, checkMultipleOraclesCrankability, chunkedGetRawMultipleAccountInfoOrdered, chunkedGetRawMultipleAccountInfoOrderedWithNulls, chunkedGetRawMultipleAccountInfos, compileFlashloanPrecheck, composeRemainingAccounts, computeAccountValue, computeActiveEmodePairs, computeAssetHealthComponent, computeAssetUsdValue, computeBalanceUsdValue, computeBankBorrowApy, computeBankBorrowCapRemaining, computeBankDepositCapRemaining, computeBankMetrics, computeBankPoolSize, computeBankSupplyApy, computeBankTotalBorrows, computeBankTotalBorrowsUsd, computeBankTotalDeposits, computeBankTotalDepositsUsd, computeBaseInterestRate, computeClaimedEmissions, computeClosePositionTokenAmount, computeEmodeImpacts, computeFlashLoanNonSwapBudget, computeFlashloanSwapConstraints, computeFreeCollateralFromBalances, computeFreeCollateralFromCache, computeHealthAccountMetas, computeHealthCacheStatus, computeHealthCheckAccounts, computeHealthComponentsFromBalances, computeHealthComponentsFromCache, computeHealthComponentsWithoutBiasFromBalances, 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, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankMetadata, dtoToBankMetadataMap, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToMarginfiAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, fetchBank, fetchBankIntegrationMetadata, fetchMarginfiAccountAddresses, 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, getHealthCacheStatusDescription, getHealthSimulationTransactions, getJupLendFTokenMultiplier, getJupLendMetadata, getJupLendStatesDto, getJupiterSwapIxsForFlashloan, getKaminoCTokenMultiplier, getKaminoMetadata, getKaminoStatesDto, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getOracleSourceFromBank, getOracleSourceFromOracleSetup, getOracleSourceNameFromKey, getPrice, getPriceWithConfidence, getStakedBankMetadataMap, getSwapIxsForFlashloan, getTitanExactOutEstimate, getTitanSwapIxsForFlashloan, getTotalAccountKeys, getTotalAssetQuantity, getTotalLiabilityQuantity, getTxSize, getValidatorVoteAccountByBank, getWritableAccountKeys, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, isFlashloan, isV0Tx, isWeightedPrice, isWholePosition, makeAddPermissionlessStakedBankIx, makeBeginFlashLoanIx3 as makeBeginFlashLoanIx, makeBorrowIx3 as makeBorrowIx, makeBorrowTx, makeBundleTipIx, makeClearEmissionsIx, 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, makeSetupIx, makeSmartCrankSwbFeedIx, makeSwapCollateralTx, makeSwapDebtTx, makeTxPriorityIx, makeUnwrapSolIx, makeUpdateDriftMarketIxs, makeUpdateJupLendRateIxs, makeUpdateSwbFeedIx, makeVersionedTransaction, makeWithdrawIx3 as makeWithdrawIx, makeWithdrawTx, makeWrapSolIxs, mapBrokenFeedsToOraclePrices, mapJupiterQuoteToSwapQuoteResult, mapPythBanksToOraclePrices, mapSwbBanksToOraclePrices, marginfiAccountToDto, nativeToUi, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseHealthCacheRaw, parseMarginfiAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseRpcPythPriceData, parseSwbOraclePriceData, partitionBanksByCrankability, resolveAmount, serializeBankConfigOpt, serializeInterestRateConfig, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, shortenAddress, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateBundle, splitInstructionsToFitTransactions, toBankConfigDto, toBankDto, toBigNumber, toEmodeSettingsDto, toInterestRateConfigDto, toJupiterConfig, toNumber, uiToNative, uiToNativeBigNumber, validatorStakeGroupToDto, wrappedI80F48toBigNumber };
55498
55535
  //# sourceMappingURL=index.js.map
55499
55536
  //# sourceMappingURL=index.js.map