@0dotxyz/p0-ts-sdk 2.3.0-alpha.2 → 2.3.0-alpha.4

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/vendor.js CHANGED
@@ -32322,11 +32322,13 @@ function selectBestRoute(quotes, swapMode) {
32322
32322
  }
32323
32323
  function buildSwapQuoteResult(route, swapMode) {
32324
32324
  const slippageBps = route.slippageBps;
32325
+ const outAmount = Number(route.outAmount);
32326
+ const inAmount = Number(route.inAmount);
32325
32327
  let otherAmountThreshold;
32326
32328
  if (swapMode === "ExactIn") {
32327
- otherAmountThreshold = String(Math.floor(route.outAmount * (1 - slippageBps / 1e4)));
32329
+ otherAmountThreshold = String(Math.floor(outAmount * (1 - slippageBps / 1e4)));
32328
32330
  } else {
32329
- otherAmountThreshold = String(Math.ceil(route.inAmount * (1 + slippageBps / 1e4)));
32331
+ otherAmountThreshold = String(Math.ceil(inAmount * (1 + slippageBps / 1e4)));
32330
32332
  }
32331
32333
  return {
32332
32334
  inAmount: String(route.inAmount),
@@ -32490,13 +32492,31 @@ function deserializeTitanWireInstruction(ix) {
32490
32492
  });
32491
32493
  }
32492
32494
  var EXPONENT_CORE_PROGRAM_ID = new PublicKey(
32493
- "XP1BRLn8eCYSygrd8er5P4GKdzqKbC3DLoSsS5UYVZy"
32495
+ "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7"
32494
32496
  );
32495
- var EXPONENT_WRAPPER_PROGRAM_ID = new PublicKey(
32497
+ var EXPONENT_CLMM_PROGRAM_ID = new PublicKey(
32496
32498
  "XPC1MM4dYACDfykNuXYZ5una2DsMDWL24CrYubCvarC"
32497
32499
  );
32498
- var EXPONENT_LOCALNET_PROGRAM_ID = new PublicKey(
32499
- "ExponentnaRg3CQbW6dqQNZKXp7gtZ9DGMp1cwC4HAS7"
32500
+ var EXPONENT_ORDERBOOK_PROGRAM_ID = new PublicKey(
32501
+ "XPBookgQTN2p8Yw1C2La35XkPMmZTCEYH77AdReVvK1"
32502
+ );
32503
+ var EXPONENT_VAULTS_PROGRAM_ID = new PublicKey(
32504
+ "sVau1tXvayVWfotzm9Ahcv2qfnnfRWttt78BCnNC6dD"
32505
+ );
32506
+ var EXPONENT_GENERIC_SY_PROGRAM_ID = new PublicKey(
32507
+ "XP1BRLn8eCYSygrd8er5P4GKdzqKbC3DLoSsS5UYVZy"
32508
+ );
32509
+ var EXPONENT_MARGINFI_SY_PROGRAM_ID = new PublicKey(
32510
+ "XPMfipyhcbq3DBvgvxkbZY7GekwmGNJLMD3wdiCkBc7"
32511
+ );
32512
+ var EXPONENT_KAMINO_SY_PROGRAM_ID = new PublicKey(
32513
+ "XPK1ndTK1xrgRg99ifvdPP1exrx8D1mRXTuxBkkroCx"
32514
+ );
32515
+ var EXPONENT_JITO_RESTAKING_SY_PROGRAM_ID = new PublicKey(
32516
+ "XPJitopeUEhMZVF72CvswnwrS2U2akQvk5s26aEfWv2"
32517
+ );
32518
+ var EXPONENT_PERENA_SY_PROGRAM_ID = new PublicKey(
32519
+ "XPerenaJPyvnjseLCn7rgzxFEum6zX1k89C13SPTyGZ"
32500
32520
  );
32501
32521
  var EXPONENT_EVENT_AUTHORITY_SEED = "__event_authority";
32502
32522
 
@@ -39720,6 +39740,7 @@ function decodeExponentVault(data) {
39720
39740
  const d = EXPONENT_ACCOUNTS_CODER.decode("Vault", data);
39721
39741
  const get = (snake, camel) => d[snake] ?? d[camel];
39722
39742
  const u646 = (v) => BigInt(BN2.isBN(v) ? v.toString() : String(v ?? 0));
39743
+ const cpi = get("cpi_accounts", "cpiAccounts") ?? {};
39723
39744
  return {
39724
39745
  authority: pk(get("authority", "authority")),
39725
39746
  syProgram: pk(get("sy_program", "syProgram")),
@@ -39729,8 +39750,16 @@ function decodeExponentVault(data) {
39729
39750
  escrowSy: pk(get("escrow_sy", "escrowSy")),
39730
39751
  yieldPosition: pk(get("yield_position", "yieldPosition")),
39731
39752
  addressLookupTable: pk(get("address_lookup_table", "addressLookupTable")),
39753
+ cpiAccounts: {
39754
+ getSyState: decodeCpiContexts(cpi.get_sy_state ?? cpi.getSyState),
39755
+ depositSy: decodeCpiContexts(cpi.deposit_sy ?? cpi.depositSy),
39756
+ withdrawSy: decodeCpiContexts(cpi.withdraw_sy ?? cpi.withdrawSy)
39757
+ },
39732
39758
  syForPt: u646(get("sy_for_pt", "syForPt")),
39733
39759
  ptSupply: u646(get("pt_supply", "ptSupply")),
39760
+ lastSeenSyExchangeRate: exponentNumberToBigNumber(
39761
+ get("last_seen_sy_exchange_rate", "lastSeenSyExchangeRate")
39762
+ ),
39734
39763
  finalSyExchangeRate: exponentNumberToBigNumber(
39735
39764
  get("final_sy_exchange_rate", "finalSyExchangeRate")
39736
39765
  ),
@@ -39741,6 +39770,44 @@ function decodeExponentMarketVault(data) {
39741
39770
  const d = EXPONENT_ACCOUNTS_CODER.decode("MarketTwo", data);
39742
39771
  return pk(d.vault);
39743
39772
  }
39773
+ function decodeCpiContexts(raw) {
39774
+ if (!Array.isArray(raw)) return [];
39775
+ return raw.map((c) => {
39776
+ const o = c ?? {};
39777
+ return {
39778
+ altIndex: Number(o.alt_index ?? o.altIndex ?? 0),
39779
+ isSigner: Boolean(o.is_signer ?? o.isSigner ?? false),
39780
+ isWritable: Boolean(o.is_writable ?? o.isWritable ?? false)
39781
+ };
39782
+ });
39783
+ }
39784
+ function decodeExponentMarketTwo(data) {
39785
+ const d = EXPONENT_ACCOUNTS_CODER.decode("MarketTwo", data);
39786
+ const get = (snake, camel) => d[snake] ?? d[camel];
39787
+ const cpi = get("cpi_accounts", "cpiAccounts") ?? {};
39788
+ return {
39789
+ selfAddress: pk(get("self_address", "selfAddress")),
39790
+ mintPt: pk(get("mint_pt", "mintPt")),
39791
+ mintSy: pk(get("mint_sy", "mintSy")),
39792
+ vault: pk(get("vault", "vault")),
39793
+ tokenPtEscrow: pk(get("token_pt_escrow", "tokenPtEscrow")),
39794
+ tokenSyEscrow: pk(get("token_sy_escrow", "tokenSyEscrow")),
39795
+ tokenFeeTreasurySy: pk(get("token_fee_treasury_sy", "tokenFeeTreasurySy")),
39796
+ addressLookupTable: pk(get("address_lookup_table", "addressLookupTable")),
39797
+ syProgram: pk(get("sy_program", "syProgram")),
39798
+ statusFlags: Number(get("status_flags", "statusFlags") ?? 0),
39799
+ cpiAccounts: {
39800
+ getSyState: decodeCpiContexts(cpi.get_sy_state ?? cpi.getSyState),
39801
+ depositSy: decodeCpiContexts(cpi.deposit_sy ?? cpi.depositSy),
39802
+ withdrawSy: decodeCpiContexts(cpi.withdraw_sy ?? cpi.withdrawSy)
39803
+ }
39804
+ };
39805
+ }
39806
+ async function fetchExponentMarketTwo(connection, market) {
39807
+ const info = await connection.getAccountInfo(market);
39808
+ if (!info) throw new Error(`Exponent market account not found: ${market.toBase58()}`);
39809
+ return decodeExponentMarketTwo(info.data);
39810
+ }
39744
39811
  async function fetchExponentVault(connection, vault) {
39745
39812
  const info = await connection.getAccountInfo(vault);
39746
39813
  if (!info) throw new Error(`Exponent vault account not found: ${vault.toBase58()}`);
@@ -39763,6 +39830,180 @@ function deriveExponentEventAuthority() {
39763
39830
  EXPONENT_CORE_PROGRAM_ID
39764
39831
  )[0];
39765
39832
  }
39833
+ var MERGE_DISCRIMINATOR = Buffer.from([5]);
39834
+ function makeExponentMergeIx(accounts, amountNative) {
39835
+ const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39836
+ const eventAuthority = deriveExponentEventAuthority();
39837
+ const data = Buffer.alloc(MERGE_DISCRIMINATOR.length + 8);
39838
+ MERGE_DISCRIMINATOR.copy(data, 0);
39839
+ data.writeBigUInt64LE(amountNative, MERGE_DISCRIMINATOR.length);
39840
+ const keys = [
39841
+ { pubkey: accounts.owner, isSigner: true, isWritable: true },
39842
+ { pubkey: accounts.authority, isSigner: false, isWritable: true },
39843
+ { pubkey: accounts.vault, isSigner: false, isWritable: true },
39844
+ { pubkey: accounts.sySrcDstAta, isSigner: false, isWritable: true },
39845
+ { pubkey: accounts.escrowSy, isSigner: false, isWritable: true },
39846
+ { pubkey: accounts.ytSrcAta, isSigner: false, isWritable: true },
39847
+ { pubkey: accounts.ptSrcAta, isSigner: false, isWritable: true },
39848
+ { pubkey: accounts.mintYt, isSigner: false, isWritable: true },
39849
+ { pubkey: accounts.mintPt, isSigner: false, isWritable: true },
39850
+ { pubkey: tokenProgram, isSigner: false, isWritable: false },
39851
+ { pubkey: accounts.syProgram, isSigner: false, isWritable: false },
39852
+ { pubkey: accounts.addressLookupTable, isSigner: false, isWritable: false },
39853
+ { pubkey: accounts.yieldPosition, isSigner: false, isWritable: true },
39854
+ { pubkey: eventAuthority, isSigner: false, isWritable: false },
39855
+ { pubkey: EXPONENT_CORE_PROGRAM_ID, isSigner: false, isWritable: false },
39856
+ // SY-program CPI accounts (getSyState ++ withdrawSy), ALT-resolved (post-maturity merge
39857
+ // still CPIs into the SY program to move SY out of escrow).
39858
+ ...accounts.remainingAccounts ?? []
39859
+ ];
39860
+ return new TransactionInstruction({
39861
+ keys,
39862
+ programId: EXPONENT_CORE_PROGRAM_ID,
39863
+ data
39864
+ });
39865
+ }
39866
+ var TRADE_PT_DISCRIMINATOR = Buffer.from([17]);
39867
+ function exponentBuyPtArgs({
39868
+ ptOutNative,
39869
+ maxSyInNative
39870
+ }) {
39871
+ return { netTraderPt: ptOutNative, syConstraint: -maxSyInNative };
39872
+ }
39873
+ function makeExponentTradePtIx(accounts, args) {
39874
+ const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39875
+ const eventAuthority = deriveExponentEventAuthority();
39876
+ const data = Buffer.alloc(TRADE_PT_DISCRIMINATOR.length + 16);
39877
+ TRADE_PT_DISCRIMINATOR.copy(data, 0);
39878
+ data.writeBigInt64LE(args.netTraderPt, TRADE_PT_DISCRIMINATOR.length);
39879
+ data.writeBigInt64LE(args.syConstraint, TRADE_PT_DISCRIMINATOR.length + 8);
39880
+ const keys = [
39881
+ { pubkey: accounts.trader, isSigner: true, isWritable: true },
39882
+ { pubkey: accounts.market, isSigner: false, isWritable: true },
39883
+ { pubkey: accounts.tokenSyTrader, isSigner: false, isWritable: true },
39884
+ { pubkey: accounts.tokenPtTrader, isSigner: false, isWritable: true },
39885
+ { pubkey: accounts.tokenSyEscrow, isSigner: false, isWritable: true },
39886
+ { pubkey: accounts.tokenPtEscrow, isSigner: false, isWritable: true },
39887
+ { pubkey: accounts.addressLookupTable, isSigner: false, isWritable: false },
39888
+ { pubkey: tokenProgram, isSigner: false, isWritable: false },
39889
+ { pubkey: accounts.syProgram, isSigner: false, isWritable: false },
39890
+ { pubkey: accounts.tokenFeeTreasurySy, isSigner: false, isWritable: true },
39891
+ { pubkey: eventAuthority, isSigner: false, isWritable: false },
39892
+ { pubkey: EXPONENT_CORE_PROGRAM_ID, isSigner: false, isWritable: false },
39893
+ // SY-program CPI accounts (getSyState ++ depositSy ++ withdrawSy), ALT-resolved.
39894
+ ...accounts.remainingAccounts
39895
+ ];
39896
+ return new TransactionInstruction({
39897
+ keys,
39898
+ programId: EXPONENT_CORE_PROGRAM_ID,
39899
+ data
39900
+ });
39901
+ }
39902
+ var STRIP_DISCRIMINATOR = Buffer.from([4]);
39903
+ function makeExponentStripIx(accounts, amountNative) {
39904
+ const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39905
+ const eventAuthority = deriveExponentEventAuthority();
39906
+ const data = Buffer.alloc(STRIP_DISCRIMINATOR.length + 8);
39907
+ STRIP_DISCRIMINATOR.copy(data, 0);
39908
+ data.writeBigUInt64LE(amountNative, STRIP_DISCRIMINATOR.length);
39909
+ const keys = [
39910
+ { pubkey: accounts.depositor, isSigner: true, isWritable: true },
39911
+ { pubkey: accounts.authority, isSigner: false, isWritable: true },
39912
+ { pubkey: accounts.vault, isSigner: false, isWritable: true },
39913
+ { pubkey: accounts.sySrc, isSigner: false, isWritable: true },
39914
+ { pubkey: accounts.escrowSy, isSigner: false, isWritable: true },
39915
+ { pubkey: accounts.ytDst, isSigner: false, isWritable: true },
39916
+ { pubkey: accounts.ptDst, isSigner: false, isWritable: true },
39917
+ { pubkey: accounts.mintYt, isSigner: false, isWritable: true },
39918
+ { pubkey: accounts.mintPt, isSigner: false, isWritable: true },
39919
+ { pubkey: tokenProgram, isSigner: false, isWritable: false },
39920
+ { pubkey: accounts.addressLookupTable, isSigner: false, isWritable: false },
39921
+ { pubkey: accounts.syProgram, isSigner: false, isWritable: false },
39922
+ { pubkey: accounts.yieldPosition, isSigner: false, isWritable: true },
39923
+ { pubkey: eventAuthority, isSigner: false, isWritable: false },
39924
+ { pubkey: EXPONENT_CORE_PROGRAM_ID, isSigner: false, isWritable: false },
39925
+ // SY-program CPI accounts (depositSy), ALT-resolved.
39926
+ ...accounts.remainingAccounts ?? []
39927
+ ];
39928
+ return new TransactionInstruction({ keys, programId: EXPONENT_CORE_PROGRAM_ID, data });
39929
+ }
39930
+ var WRAPPER_MERGE_DISCRIMINATOR = Buffer.from([39]);
39931
+ function makeExponentWrapperMergeIx(accounts, args) {
39932
+ const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39933
+ const eventAuthority = deriveExponentEventAuthority();
39934
+ const data = Buffer.alloc(WRAPPER_MERGE_DISCRIMINATOR.length + 9);
39935
+ WRAPPER_MERGE_DISCRIMINATOR.copy(data, 0);
39936
+ data.writeBigUInt64LE(args.amountPyNative, WRAPPER_MERGE_DISCRIMINATOR.length);
39937
+ data.writeUInt8(args.redeemSyAccountsUntil, WRAPPER_MERGE_DISCRIMINATOR.length + 8);
39938
+ const keys = [
39939
+ { pubkey: accounts.owner, isSigner: true, isWritable: true },
39940
+ { pubkey: accounts.syAta, isSigner: false, isWritable: true },
39941
+ { pubkey: accounts.vault, isSigner: false, isWritable: true },
39942
+ { pubkey: accounts.escrowSy, isSigner: false, isWritable: true },
39943
+ { pubkey: accounts.ytAta, isSigner: false, isWritable: true },
39944
+ { pubkey: accounts.ptAta, isSigner: false, isWritable: true },
39945
+ { pubkey: accounts.mintYt, isSigner: false, isWritable: true },
39946
+ { pubkey: accounts.mintPt, isSigner: false, isWritable: true },
39947
+ { pubkey: accounts.authority, isSigner: false, isWritable: true },
39948
+ { pubkey: accounts.addressLookupTable, isSigner: false, isWritable: false },
39949
+ { pubkey: tokenProgram, isSigner: false, isWritable: false },
39950
+ { pubkey: accounts.yieldPosition, isSigner: false, isWritable: true },
39951
+ { pubkey: accounts.syProgram, isSigner: false, isWritable: false },
39952
+ { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
39953
+ { pubkey: eventAuthority, isSigner: false, isWritable: false },
39954
+ { pubkey: EXPONENT_CORE_PROGRAM_ID, isSigner: false, isWritable: false },
39955
+ // [...redeem (flavor SY-redeem accounts), ...cpi (withdraw_sy ++ get_sy_state)]
39956
+ ...accounts.remainingAccounts
39957
+ ];
39958
+ return new TransactionInstruction({ keys, programId: EXPONENT_CORE_PROGRAM_ID, data });
39959
+ }
39960
+ var SPL_STAKE_POOL_UPDATE_BALANCE_TAG = Buffer.from([7]);
39961
+ function makeSplStakePoolUpdateBalanceIx(accounts) {
39962
+ const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39963
+ const keys = [
39964
+ { pubkey: accounts.stakePool, isSigner: false, isWritable: true },
39965
+ { pubkey: accounts.withdrawAuthority, isSigner: false, isWritable: false },
39966
+ { pubkey: accounts.validatorList, isSigner: false, isWritable: true },
39967
+ { pubkey: accounts.reserveStake, isSigner: false, isWritable: false },
39968
+ { pubkey: accounts.managerFeeAccount, isSigner: false, isWritable: true },
39969
+ { pubkey: accounts.poolMint, isSigner: false, isWritable: true },
39970
+ { pubkey: tokenProgram, isSigner: false, isWritable: false }
39971
+ ];
39972
+ return new TransactionInstruction({
39973
+ keys,
39974
+ programId: accounts.stakePoolProgram,
39975
+ data: Buffer.from(SPL_STAKE_POOL_UPDATE_BALANCE_TAG)
39976
+ });
39977
+ }
39978
+
39979
+ // src/vendor/exponent/utils/resolve.utils.ts
39980
+ function resolveCpiMetas(contexts, altAddresses, altKey) {
39981
+ return contexts.map((ctx) => {
39982
+ const pubkey = altAddresses[ctx.altIndex];
39983
+ if (!pubkey) {
39984
+ throw new Error(
39985
+ `Exponent CPI account alt_index ${ctx.altIndex} out of range (ALT ${altKey.toBase58()} has ${altAddresses.length} entries)`
39986
+ );
39987
+ }
39988
+ return { pubkey, isSigner: false, isWritable: ctx.isWritable };
39989
+ });
39990
+ }
39991
+ function uniqueRemainingAccounts(metas) {
39992
+ const seen = /* @__PURE__ */ new Map();
39993
+ for (const m of metas) {
39994
+ const key = m.pubkey.toBase58();
39995
+ const prev = seen.get(key);
39996
+ if (prev) prev.isWritable = prev.isWritable || m.isWritable;
39997
+ else seen.set(key, { ...m });
39998
+ }
39999
+ return [...seen.values()];
40000
+ }
40001
+ var STAKE_POOL_OFFSETS = {
40002
+ validatorList: 98,
40003
+ reserveStake: 130,
40004
+ poolMint: 162,
40005
+ managerFeeAccount: 194
40006
+ };
39766
40007
  async function resolveExponentMergeContext(params) {
39767
40008
  const { connection, owner } = params;
39768
40009
  const ptYtTokenProgram = params.ptYtTokenProgram ?? TOKEN_PROGRAM_ID;
@@ -39782,6 +40023,17 @@ async function resolveExponentMergeContext(params) {
39782
40023
  const ptSrcAta = getAssociatedTokenAddressSync(vault.mintPt, owner, true, ptYtTokenProgram);
39783
40024
  const ytSrcAta = getAssociatedTokenAddressSync(vault.mintYt, owner, true, ptYtTokenProgram);
39784
40025
  const sySrcDstAta = getAssociatedTokenAddressSync(vault.mintSy, owner, true, syTokenProgram);
40026
+ const altResult = await connection.getAddressLookupTable(vault.addressLookupTable);
40027
+ const alt = altResult.value;
40028
+ if (!alt) {
40029
+ throw new Error(
40030
+ `Exponent vault address lookup table not found: ${vault.addressLookupTable.toBase58()}`
40031
+ );
40032
+ }
40033
+ const remainingAccounts = [
40034
+ ...resolveCpiMetas(vault.cpiAccounts.getSyState, alt.state.addresses, vault.addressLookupTable),
40035
+ ...resolveCpiMetas(vault.cpiAccounts.withdrawSy, alt.state.addresses, vault.addressLookupTable)
40036
+ ];
39785
40037
  const mergeAccounts = {
39786
40038
  owner,
39787
40039
  authority: vault.authority,
@@ -39795,13 +40047,15 @@ async function resolveExponentMergeContext(params) {
39795
40047
  syProgram: vault.syProgram,
39796
40048
  addressLookupTable: vault.addressLookupTable,
39797
40049
  yieldPosition: vault.yieldPosition,
39798
- tokenProgram: ptYtTokenProgram
40050
+ tokenProgram: ptYtTokenProgram,
40051
+ remainingAccounts
39799
40052
  };
39800
40053
  const decimals = await getMintDecimals(connection, vault.mintSy);
39801
40054
  return {
39802
40055
  vaultAddress,
39803
40056
  vault,
39804
40057
  mergeAccounts,
40058
+ addressLookupTable: alt,
39805
40059
  underlying: { mint: vault.mintSy, decimals, tokenProgram: syTokenProgram },
39806
40060
  computeRedeemedAmountNative(ptAmountNative) {
39807
40061
  if (vault.ptSupply === 0n) return 0n;
@@ -39810,37 +40064,233 @@ async function resolveExponentMergeContext(params) {
39810
40064
  }
39811
40065
  };
39812
40066
  }
39813
- var MERGE_DISCRIMINATOR = Buffer.from([5]);
39814
- function makeExponentMergeIx(accounts, amountNative) {
39815
- const tokenProgram = accounts.tokenProgram ?? TOKEN_PROGRAM_ID;
39816
- const eventAuthority = deriveExponentEventAuthority();
39817
- const data = Buffer.alloc(MERGE_DISCRIMINATOR.length + 8);
39818
- MERGE_DISCRIMINATOR.copy(data, 0);
39819
- data.writeBigUInt64LE(amountNative, MERGE_DISCRIMINATOR.length);
39820
- const keys = [
39821
- { pubkey: accounts.owner, isSigner: true, isWritable: true },
39822
- { pubkey: accounts.authority, isSigner: false, isWritable: true },
39823
- { pubkey: accounts.vault, isSigner: false, isWritable: true },
39824
- { pubkey: accounts.sySrcDstAta, isSigner: false, isWritable: true },
39825
- { pubkey: accounts.escrowSy, isSigner: false, isWritable: true },
39826
- { pubkey: accounts.ytSrcAta, isSigner: false, isWritable: true },
39827
- { pubkey: accounts.ptSrcAta, isSigner: false, isWritable: true },
39828
- { pubkey: accounts.mintYt, isSigner: false, isWritable: true },
39829
- { pubkey: accounts.mintPt, isSigner: false, isWritable: true },
39830
- { pubkey: tokenProgram, isSigner: false, isWritable: false },
39831
- { pubkey: accounts.syProgram, isSigner: false, isWritable: false },
39832
- { pubkey: accounts.addressLookupTable, isSigner: false, isWritable: false },
39833
- { pubkey: accounts.yieldPosition, isSigner: false, isWritable: true },
39834
- { pubkey: eventAuthority, isSigner: false, isWritable: false },
39835
- { pubkey: EXPONENT_CORE_PROGRAM_ID, isSigner: false, isWritable: false }
40067
+ async function resolveExponentTradePtContext(params) {
40068
+ const { connection, owner } = params;
40069
+ const ptTokenProgram = params.ptTokenProgram ?? TOKEN_PROGRAM_ID;
40070
+ const syTokenProgram = params.syTokenProgram ?? TOKEN_PROGRAM_ID;
40071
+ const market = await fetchExponentMarketTwo(connection, params.market);
40072
+ const altResult = await connection.getAddressLookupTable(market.addressLookupTable);
40073
+ const alt = altResult.value;
40074
+ if (!alt) {
40075
+ throw new Error(
40076
+ `Exponent market address lookup table not found: ${market.addressLookupTable.toBase58()}`
40077
+ );
40078
+ }
40079
+ const altAddresses = alt.state.addresses;
40080
+ const altKey = market.addressLookupTable;
40081
+ const remainingAccounts = [
40082
+ ...resolveCpiMetas(market.cpiAccounts.getSyState, altAddresses, altKey),
40083
+ ...resolveCpiMetas(market.cpiAccounts.depositSy, altAddresses, altKey),
40084
+ ...resolveCpiMetas(market.cpiAccounts.withdrawSy, altAddresses, altKey)
39836
40085
  ];
39837
- return new TransactionInstruction({
39838
- keys,
39839
- programId: EXPONENT_CORE_PROGRAM_ID,
39840
- data
40086
+ const tokenSyTrader = getAssociatedTokenAddressSync(market.mintSy, owner, true, syTokenProgram);
40087
+ const tokenPtTrader = getAssociatedTokenAddressSync(market.mintPt, owner, true, ptTokenProgram);
40088
+ const tradePtAccounts = {
40089
+ trader: owner,
40090
+ market: market.selfAddress,
40091
+ tokenSyTrader,
40092
+ tokenPtTrader,
40093
+ tokenSyEscrow: market.tokenSyEscrow,
40094
+ tokenPtEscrow: market.tokenPtEscrow,
40095
+ addressLookupTable: market.addressLookupTable,
40096
+ syProgram: market.syProgram,
40097
+ tokenFeeTreasurySy: market.tokenFeeTreasurySy,
40098
+ tokenProgram: ptTokenProgram,
40099
+ remainingAccounts
40100
+ };
40101
+ const [syDecimals, ptDecimals] = await Promise.all([
40102
+ getMintDecimals(connection, market.mintSy),
40103
+ getMintDecimals(connection, market.mintPt)
40104
+ ]);
40105
+ return {
40106
+ marketAddress: market.selfAddress,
40107
+ market,
40108
+ tradePtAccounts,
40109
+ addressLookupTable: alt,
40110
+ sy: { mint: market.mintSy, decimals: syDecimals, tokenProgram: syTokenProgram },
40111
+ pt: { mint: market.mintPt, decimals: ptDecimals, tokenProgram: ptTokenProgram }
40112
+ };
40113
+ }
40114
+ async function resolveExponentStripContext(params) {
40115
+ const { connection, owner } = params;
40116
+ const ptYtTokenProgram = params.ptYtTokenProgram ?? TOKEN_PROGRAM_ID;
40117
+ const syTokenProgram = params.syTokenProgram ?? TOKEN_PROGRAM_ID;
40118
+ let vaultAddress;
40119
+ let vault;
40120
+ if (params.vault) {
40121
+ vaultAddress = params.vault;
40122
+ vault = await fetchExponentVault(connection, vaultAddress);
40123
+ } else if (params.market) {
40124
+ const res = await fetchExponentVaultFromMarket(connection, params.market);
40125
+ vaultAddress = res.vault;
40126
+ vault = res.account;
40127
+ } else {
40128
+ throw new Error("resolveExponentStripContext: one of `vault` or `market` is required");
40129
+ }
40130
+ const altResult = await connection.getAddressLookupTable(vault.addressLookupTable);
40131
+ const alt = altResult.value;
40132
+ if (!alt) {
40133
+ throw new Error(
40134
+ `Exponent vault address lookup table not found: ${vault.addressLookupTable.toBase58()}`
40135
+ );
40136
+ }
40137
+ const remainingAccounts = resolveCpiMetas(
40138
+ vault.cpiAccounts.depositSy,
40139
+ alt.state.addresses,
40140
+ vault.addressLookupTable
40141
+ );
40142
+ const sySrc = getAssociatedTokenAddressSync(vault.mintSy, owner, true, syTokenProgram);
40143
+ const ptDst = getAssociatedTokenAddressSync(vault.mintPt, owner, true, ptYtTokenProgram);
40144
+ const ytDst = getAssociatedTokenAddressSync(vault.mintYt, owner, true, ptYtTokenProgram);
40145
+ const stripAccounts = {
40146
+ depositor: owner,
40147
+ authority: vault.authority,
40148
+ vault: vaultAddress,
40149
+ sySrc,
40150
+ escrowSy: vault.escrowSy,
40151
+ ytDst,
40152
+ ptDst,
40153
+ mintYt: vault.mintYt,
40154
+ mintPt: vault.mintPt,
40155
+ syProgram: vault.syProgram,
40156
+ addressLookupTable: vault.addressLookupTable,
40157
+ yieldPosition: vault.yieldPosition,
40158
+ tokenProgram: ptYtTokenProgram,
40159
+ remainingAccounts
40160
+ };
40161
+ const [syDecimals, ptDecimals] = await Promise.all([
40162
+ getMintDecimals(connection, vault.mintSy),
40163
+ getMintDecimals(connection, vault.mintPt)
40164
+ ]);
40165
+ const syExchangeRate = vault.lastSeenSyExchangeRate.toNumber();
40166
+ return {
40167
+ vaultAddress,
40168
+ vault,
40169
+ stripAccounts,
40170
+ addressLookupTable: alt,
40171
+ sy: { mint: vault.mintSy, decimals: syDecimals, tokenProgram: syTokenProgram },
40172
+ pt: { mint: vault.mintPt, decimals: ptDecimals, tokenProgram: ptYtTokenProgram },
40173
+ yt: { mint: vault.mintYt, tokenProgram: ptYtTokenProgram },
40174
+ syExchangeRate,
40175
+ computeStrippedPtNative(syInNative) {
40176
+ const pt = vault.lastSeenSyExchangeRate.times(syInNative.toString()).integerValue(BigNumber.ROUND_FLOOR);
40177
+ return BigInt(pt.toFixed(0));
40178
+ }
40179
+ };
40180
+ }
40181
+ async function resolveSplStakePoolRefreshIx(connection, stakePool) {
40182
+ const info = await connection.getAccountInfo(stakePool);
40183
+ if (!info) throw new Error(`SPL stake pool account not found: ${stakePool.toBase58()}`);
40184
+ const stakePoolProgram = info.owner;
40185
+ const at = (off) => new PublicKey(info.data.subarray(off, off + 32));
40186
+ const [withdrawAuthority] = PublicKey.findProgramAddressSync(
40187
+ [stakePool.toBuffer(), Buffer.from("withdraw")],
40188
+ stakePoolProgram
40189
+ );
40190
+ return makeSplStakePoolUpdateBalanceIx({
40191
+ stakePoolProgram,
40192
+ stakePool,
40193
+ withdrawAuthority,
40194
+ validatorList: at(STAKE_POOL_OFFSETS.validatorList),
40195
+ reserveStake: at(STAKE_POOL_OFFSETS.reserveStake),
40196
+ managerFeeAccount: at(STAKE_POOL_OFFSETS.managerFeeAccount),
40197
+ poolMint: at(STAKE_POOL_OFFSETS.poolMint)
39841
40198
  });
39842
40199
  }
40200
+ async function resolveExponentWrapperMergeContext(params) {
40201
+ const { connection, owner, baseMint } = params;
40202
+ const ptYtTokenProgram = params.ptYtTokenProgram ?? TOKEN_PROGRAM_ID;
40203
+ const syTokenProgram = params.syTokenProgram ?? TOKEN_PROGRAM_ID;
40204
+ const baseTokenProgram = params.baseTokenProgram ?? TOKEN_PROGRAM_ID;
40205
+ let vaultAddress;
40206
+ let vault;
40207
+ if (params.vault) {
40208
+ vaultAddress = params.vault;
40209
+ vault = await fetchExponentVault(connection, vaultAddress);
40210
+ } else if (params.market) {
40211
+ const res = await fetchExponentVaultFromMarket(connection, params.market);
40212
+ vaultAddress = res.vault;
40213
+ vault = res.account;
40214
+ } else {
40215
+ throw new Error("resolveExponentWrapperMergeContext: one of `vault` or `market` is required");
40216
+ }
40217
+ const altResult = await connection.getAddressLookupTable(vault.addressLookupTable);
40218
+ const alt = altResult.value;
40219
+ if (!alt) {
40220
+ throw new Error(
40221
+ `Exponent vault address lookup table not found: ${vault.addressLookupTable.toBase58()}`
40222
+ );
40223
+ }
40224
+ const altKey = vault.addressLookupTable;
40225
+ const getSyState = resolveCpiMetas(vault.cpiAccounts.getSyState, alt.state.addresses, altKey);
40226
+ const withdrawSy = resolveCpiMetas(vault.cpiAccounts.withdrawSy, alt.state.addresses, altKey);
40227
+ if (getSyState.length < 4) {
40228
+ throw new Error(
40229
+ "resolveExponentWrapperMergeContext: unexpected get_sy_state shape (expected the generic SPL-stake-pool flavor: [syState, mintSy, tokenSyEscrow, stakePool])"
40230
+ );
40231
+ }
40232
+ const syState = getSyState[0].pubkey;
40233
+ const stakePool = getSyState[3].pubkey;
40234
+ const syAta = getAssociatedTokenAddressSync(vault.mintSy, owner, true, syTokenProgram);
40235
+ const ptAta = getAssociatedTokenAddressSync(vault.mintPt, owner, true, ptYtTokenProgram);
40236
+ const ytAta = getAssociatedTokenAddressSync(vault.mintYt, owner, true, ptYtTokenProgram);
40237
+ const baseAta = getAssociatedTokenAddressSync(baseMint, owner, true, baseTokenProgram);
40238
+ const baseEscrow = getAssociatedTokenAddressSync(baseMint, syState, true, baseTokenProgram);
40239
+ const redeem = [
40240
+ { pubkey: owner, isSigner: true, isWritable: true },
40241
+ { pubkey: syState, isSigner: false, isWritable: true },
40242
+ { pubkey: baseAta, isSigner: false, isWritable: true },
40243
+ { pubkey: baseEscrow, isSigner: false, isWritable: true },
40244
+ { pubkey: syAta, isSigner: false, isWritable: true },
40245
+ { pubkey: vault.mintSy, isSigner: false, isWritable: true },
40246
+ { pubkey: baseMint, isSigner: false, isWritable: false },
40247
+ { pubkey: syTokenProgram, isSigner: false, isWritable: false },
40248
+ { pubkey: baseTokenProgram, isSigner: false, isWritable: false },
40249
+ { pubkey: stakePool, isSigner: false, isWritable: true }
40250
+ ];
40251
+ const cpi = uniqueRemainingAccounts([...withdrawSy, ...getSyState]);
40252
+ const wrapperMergeAccounts = {
40253
+ owner,
40254
+ syAta,
40255
+ vault: vaultAddress,
40256
+ escrowSy: vault.escrowSy,
40257
+ ytAta,
40258
+ ptAta,
40259
+ mintYt: vault.mintYt,
40260
+ mintPt: vault.mintPt,
40261
+ authority: vault.authority,
40262
+ addressLookupTable: vault.addressLookupTable,
40263
+ yieldPosition: vault.yieldPosition,
40264
+ syProgram: vault.syProgram,
40265
+ tokenProgram: ptYtTokenProgram,
40266
+ remainingAccounts: [...redeem, ...cpi],
40267
+ redeemSyAccountsUntil: redeem.length
40268
+ };
40269
+ const [baseDecimals, stakePoolRefreshIx] = await Promise.all([
40270
+ getMintDecimals(connection, baseMint),
40271
+ resolveSplStakePoolRefreshIx(connection, stakePool)
40272
+ ]);
40273
+ return {
40274
+ vaultAddress,
40275
+ vault,
40276
+ wrapperMergeAccounts,
40277
+ preInstructions: [stakePoolRefreshIx],
40278
+ addressLookupTable: alt,
40279
+ baseToken: { mint: baseMint, decimals: baseDecimals, tokenProgram: baseTokenProgram },
40280
+ setupMints: [
40281
+ { mint: baseMint, tokenProgram: baseTokenProgram },
40282
+ { mint: vault.mintSy, tokenProgram: syTokenProgram },
40283
+ { mint: vault.mintPt, tokenProgram: ptYtTokenProgram },
40284
+ { mint: vault.mintYt, tokenProgram: ptYtTokenProgram }
40285
+ ],
40286
+ computeRedeemedBaseNative(ptAmountNative) {
40287
+ if (vault.ptSupply === 0n) return 0n;
40288
+ const base = new BigNumber(ptAmountNative.toString()).times(vault.syForPt.toString()).div(vault.ptSupply.toString()).integerValue(BigNumber.ROUND_FLOOR);
40289
+ return BigInt(base.toFixed(0));
40290
+ }
40291
+ };
40292
+ }
39843
40293
 
39844
- export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, ConnectionClosed, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, EXPONENT_CORE_IDL, EXPONENT_CORE_PROGRAM_ID, EXPONENT_EVENT_AUTHORITY_SEED, EXPONENT_LOCALNET_PROGRAM_ID, EXPONENT_NUMBER_DENOM, EXPONENT_WRAPPER_PROGRAM_ID, ErrorResponse, ExtensionType, FARMS_PROGRAM_ID, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_IDL, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, StreamError, SwapMode, SwapVersion, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, V1Client, ZERO, addSigners, approveInstructionData, buildSwapQuoteResult, buildTitanTemplate, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeExponentMarketVault, decodeExponentVault, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, decodeSwitchboardPullFeedData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveExponentEventAuthority, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, deserializeTitanWireInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, encodeTitanTemplate, exponentNumberToBigNumber, farmRawToDto, fetchExponentVault, fetchExponentVaultFromMarket, fetchTitanQuoteSwapV3, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMintDecimals, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, lutToTitanWire, makeExponentMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveExponentMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
40294
+ export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, ConnectionClosed, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, EXPONENT_CLMM_PROGRAM_ID, EXPONENT_CORE_IDL, EXPONENT_CORE_PROGRAM_ID, EXPONENT_EVENT_AUTHORITY_SEED, EXPONENT_GENERIC_SY_PROGRAM_ID, EXPONENT_JITO_RESTAKING_SY_PROGRAM_ID, EXPONENT_KAMINO_SY_PROGRAM_ID, EXPONENT_MARGINFI_SY_PROGRAM_ID, EXPONENT_NUMBER_DENOM, EXPONENT_ORDERBOOK_PROGRAM_ID, EXPONENT_PERENA_SY_PROGRAM_ID, EXPONENT_VAULTS_PROGRAM_ID, ErrorResponse, ExtensionType, FARMS_PROGRAM_ID, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_IDL, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, StreamError, SwapMode, SwapVersion, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, V1Client, ZERO, addSigners, approveInstructionData, buildSwapQuoteResult, buildTitanTemplate, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeExponentMarketTwo, decodeExponentMarketVault, decodeExponentVault, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, decodeSwitchboardPullFeedData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveExponentEventAuthority, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, deserializeTitanWireInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, encodeTitanTemplate, exponentBuyPtArgs, exponentNumberToBigNumber, farmRawToDto, fetchExponentMarketTwo, fetchExponentVault, fetchExponentVaultFromMarket, fetchTitanQuoteSwapV3, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMintDecimals, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, lutToTitanWire, makeExponentMergeIx, makeExponentStripIx, makeExponentTradePtIx, makeExponentWrapperMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeSplStakePoolUpdateBalanceIx, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveExponentMergeContext, resolveExponentStripContext, resolveExponentTradePtContext, resolveExponentWrapperMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
39845
40295
  //# sourceMappingURL=vendor.js.map
39846
40296
  //# sourceMappingURL=vendor.js.map