@crypticdot/defituna-client 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _solana_kit from '@solana/kit';
2
- import { ReadonlyUint8Array, Address, Encoder, Decoder, Codec, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, IAccountMeta, IInstruction, IInstructionWithData, IInstructionWithAccounts, WritableSignerAccount, IAccountSignerMeta, ReadonlyAccount, WritableAccount, TransactionSigner, ReadonlySignerAccount, ProgramDerivedAddress, GetProgramAccountsMemcmpFilter, Rpc, GetProgramAccountsApi, GetAccountInfoApi, Slot, GetMultipleAccountsApi } from '@solana/kit';
2
+ import { ReadonlyUint8Array, Address, Encoder, Decoder, Codec, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, IAccountMeta, IInstruction, IInstructionWithData, IInstructionWithAccounts, WritableSignerAccount, IAccountSignerMeta, ReadonlyAccount, WritableAccount, TransactionSigner, ReadonlySignerAccount, ProgramDerivedAddress, GetProgramAccountsMemcmpFilter, Rpc, GetProgramAccountsApi, GetAccountInfoApi, Slot, GetMultipleAccountsApi, Lamports } from '@solana/kit';
3
3
  import { Whirlpool } from '@orca-so/whirlpools-client';
4
4
  import { FusionPool } from '@crypticdot/fusionamm-client';
5
5
  import { Mint } from '@solana-program/token-2022';
@@ -4751,16 +4751,32 @@ declare function openPositionOrcaInstruction(rpc: Rpc<GetAccountInfoApi & GetMul
4751
4751
 
4752
4752
  declare function openPositionFusionInstruction(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionFusionInstructionDataArgs): Promise<IInstruction>;
4753
4753
 
4754
+ type OpenPositionWithLiquidityOrca = {
4755
+ /** The mint address of the position NFT. */
4756
+ positionMint: Address;
4757
+ /** List of Solana transaction instructions to execute. */
4758
+ instructions: IInstruction[];
4759
+ /** The initialization cost for opening the position in lamports. */
4760
+ initializationCost: Lamports;
4761
+ };
4754
4762
  type OpenPositionWithLiquidityOrcaInstructionsArgs = Omit<OpenPositionWithLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo" | "minAddedAmountA" | "minAddedAmountB"> & {
4755
4763
  maxAmountSlippage: number;
4756
4764
  };
4757
- declare function openPositionWithLiquidityOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, whirlpoolAddress: Address, args: OpenPositionWithLiquidityOrcaInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4765
+ declare function openPositionWithLiquidityOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, whirlpoolAddress: Address, args: OpenPositionWithLiquidityOrcaInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<OpenPositionWithLiquidityOrca>;
4758
4766
  declare function openPositionWithLiquidityOrcaInstruction(authority: TransactionSigner, positionMint: TransactionSigner, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, whirlpool: Account<Whirlpool>, args: Omit<OpenPositionWithLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo">): Promise<IInstruction>;
4759
4767
 
4768
+ type OpenPositionWithLiquidityFusion = {
4769
+ /** The mint address of the position NFT. */
4770
+ positionMint: Address;
4771
+ /** List of Solana transaction instructions to execute. */
4772
+ instructions: IInstruction[];
4773
+ /** The initialization cost for opening the position in lamports. */
4774
+ initializationCost: Lamports;
4775
+ };
4760
4776
  type OpenPositionWithLiquidityFusionInstructionsArgs = Omit<OpenPositionWithLiquidityFusionInstructionDataArgs, "remainingAccountsInfo" | "minAddedAmountA" | "minAddedAmountB"> & {
4761
4777
  maxAmountSlippage: number;
4762
4778
  };
4763
- declare function openPositionWithLiquidityFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionWithLiquidityFusionInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4779
+ declare function openPositionWithLiquidityFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionWithLiquidityFusionInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<OpenPositionWithLiquidityFusion>;
4764
4780
  declare function openPositionWithLiquidityFusionInstruction(authority: TransactionSigner, positionMint: TransactionSigner, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, fusionPool: Account<FusionPool>, args: Omit<OpenPositionWithLiquidityFusionInstructionDataArgs, "remainingAccountsInfo">): Promise<IInstruction>;
4765
4781
 
4766
4782
  type RemoveLiquidityOrcaInstructionsArgs = Omit<RemoveLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo" | "minRemovedAmountA" | "minRemovedAmountB"> & {
@@ -4791,10 +4807,22 @@ declare function createAddressLookupTableForMarketInstructions(rpc: Rpc<GetAccou
4791
4807
  declare function repayDebtInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, collateralA: bigint, collateralB: bigint, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4792
4808
  declare function repayDebtInstruction(authority: TransactionSigner, positionMint: Address, mintA: Account<Mint>, mintB: Account<Mint>, marketAddress: Address, collateralA: bigint, collateralB: bigint): Promise<IInstruction>;
4793
4809
 
4794
- declare function rebalancePositionOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4810
+ type RebalancePositionOrca = {
4811
+ /** List of Solana transaction instructions to execute. */
4812
+ instructions: IInstruction[];
4813
+ /** The initialization cost for opening the position in lamports. */
4814
+ initializationCost: Lamports;
4815
+ };
4816
+ declare function rebalancePositionOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<RebalancePositionOrca>;
4795
4817
  declare function rebalancePositionOrcaInstruction(authority: TransactionSigner, tunaPosition: Account<TunaPosition>, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, whirlpool: Account<Whirlpool>): Promise<IInstruction>;
4796
4818
 
4797
- declare function rebalancePositionFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4819
+ type RebalancePositionFusion = {
4820
+ /** List of Solana transaction instructions to execute. */
4821
+ instructions: IInstruction[];
4822
+ /** The initialization cost for opening the position in lamports. */
4823
+ initializationCost: Lamports;
4824
+ };
4825
+ declare function rebalancePositionFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<RebalancePositionFusion>;
4798
4826
  declare function rebalancePositionFusionInstruction(authority: TransactionSigner, tunaPosition: Account<TunaPosition>, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, fusionPool: Account<FusionPool>): Promise<IInstruction>;
4799
4827
 
4800
4828
  declare const DEFAULT_ADDRESS: _solana_kit.Address<"11111111111111111111111111111111">;
@@ -4818,4 +4846,4 @@ declare const TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE: number;
4818
4846
  declare const TUNA_POSITION_FLAGS_ALLOW_REBALANCING: number;
4819
4847
  declare const WP_NFT_UPDATE_AUTH: _solana_kit.Address<"3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr">;
4820
4848
 
4821
- export { ADD_LIQUIDITY_FUSION_DISCRIMINATOR, ADD_LIQUIDITY_ORCA_DISCRIMINATOR, AccountsType, type AccountsTypeArgs, type AddLiquidityFusionInput, type AddLiquidityFusionInstruction, type AddLiquidityFusionInstructionData, type AddLiquidityFusionInstructionDataArgs, type AddLiquidityFusionInstructionsArgs, type AddLiquidityOrcaInput, type AddLiquidityOrcaInstruction, type AddLiquidityOrcaInstructionData, type AddLiquidityOrcaInstructionDataArgs, type AddLiquidityOrcaInstructionsArgs, CLOSE_POSITION_FUSION_DISCRIMINATOR, CLOSE_POSITION_ORCA_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_FUSION_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_ORCA_DISCRIMINATOR, COLLECT_FEES_FUSION_DISCRIMINATOR, COLLECT_FEES_ORCA_DISCRIMINATOR, COLLECT_REWARD_ORCA_DISCRIMINATOR, COMPUTED_AMOUNT, CREATE_MARKET_DISCRIMINATOR, CREATE_TUNA_CONFIG_DISCRIMINATOR, CREATE_VAULT_DISCRIMINATOR, type ClosePositionFusionInput, type ClosePositionFusionInstruction, type ClosePositionFusionInstructionData, type ClosePositionFusionInstructionDataArgs, type ClosePositionOrcaInput, type ClosePositionOrcaInstruction, type ClosePositionOrcaInstructionData, type ClosePositionOrcaInstructionDataArgs, type ClosePositionWithLiquidityFusionInstructionArgs, type ClosePositionWithLiquidityOrcaInstructionArgs, type CollectAndCompoundFeesFusionInput, type CollectAndCompoundFeesFusionInstruction, type CollectAndCompoundFeesFusionInstructionData, type CollectAndCompoundFeesFusionInstructionDataArgs, type CollectAndCompoundFeesOrcaInput, type CollectAndCompoundFeesOrcaInstruction, type CollectAndCompoundFeesOrcaInstructionData, type CollectAndCompoundFeesOrcaInstructionDataArgs, type CollectFeesFusionInput, type CollectFeesFusionInstruction, type CollectFeesFusionInstructionData, type CollectFeesFusionInstructionDataArgs, type CollectFeesOrcaInput, type CollectFeesOrcaInstruction, type CollectFeesOrcaInstructionData, type CollectFeesOrcaInstructionDataArgs, type CollectRewardOrcaInput, type CollectRewardOrcaInstruction, type CollectRewardOrcaInstructionData, type CollectRewardOrcaInstructionDataArgs, type CreateAddressLookupTableResult, type CreateMarketInput, type CreateMarketInstruction, type CreateMarketInstructionData, type CreateMarketInstructionDataArgs, type CreateTunaConfigInput, type CreateTunaConfigInstruction, type CreateTunaConfigInstructionData, type CreateTunaConfigInstructionDataArgs, type CreateVaultInput, type CreateVaultInstruction, type CreateVaultInstructionData, type CreateVaultInstructionDataArgs, DEFAULT_ADDRESS, DEFAULT_MAX_AMOUNT_SLIPPAGE, DEFAULT_MAX_SWAP_SLIPPAGE, DEPOSIT_DISCRIMINATOR, type DepositInput, type DepositInstruction, type DepositInstructionData, type DepositInstructionDataArgs, FusionUtils, HUNDRED_PERCENT, type IncreaseLiquidityQuoteArgs, type IncreaseLiquidityQuoteResult, LENDING_POSITION_DISCRIMINATOR, LEVERAGE_ONE, LIQUIDATE_POSITION_FUSION_DISCRIMINATOR, LIQUIDATE_POSITION_ORCA_DISCRIMINATOR, type LendingPosition, type LendingPositionArgs, type LiquidatePositionFusionInput, type LiquidatePositionFusionInstruction, type LiquidatePositionFusionInstructionData, type LiquidatePositionFusionInstructionDataArgs, type LiquidatePositionOrcaInput, type LiquidatePositionOrcaInstruction, type LiquidatePositionOrcaInstructionData, type LiquidatePositionOrcaInstructionDataArgs, MARKET_DISCRIMINATOR, MAX_LEVERAGE, MAX_LIMIT_ORDER_EXECUTION_FEE, MAX_LIQUIDATION_FEE, MAX_LIQUIDATION_THRESHOLD, MAX_PROTOCOL_FEE, type Market, type MarketArgs, MarketMaker, type MarketMakerArgs, NATIVE_MINT, NO_STOP_LOSS, NO_TAKE_PROFIT, OPEN_LENDING_POSITION_DISCRIMINATOR, OPEN_POSITION_FUSION_DISCRIMINATOR, OPEN_POSITION_ORCA_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_FUSION_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_ORCA_DISCRIMINATOR, type OpenLendingPositionInput, type OpenLendingPositionInstruction, type OpenLendingPositionInstructionData, type OpenLendingPositionInstructionDataArgs, type OpenPositionFusionInput, type OpenPositionFusionInstruction, type OpenPositionFusionInstructionData, type OpenPositionFusionInstructionDataArgs, type OpenPositionOrcaInput, type OpenPositionOrcaInstruction, type OpenPositionOrcaInstructionData, type OpenPositionOrcaInstructionDataArgs, type OpenPositionWithLiquidityFusionInput, type OpenPositionWithLiquidityFusionInstruction, type OpenPositionWithLiquidityFusionInstructionData, type OpenPositionWithLiquidityFusionInstructionDataArgs, type OpenPositionWithLiquidityFusionInstructionsArgs, type OpenPositionWithLiquidityOrcaInput, type OpenPositionWithLiquidityOrcaInstruction, type OpenPositionWithLiquidityOrcaInstructionData, type OpenPositionWithLiquidityOrcaInstructionDataArgs, type OpenPositionWithLiquidityOrcaInstructionsArgs, OrcaUtils, type ParsedAddLiquidityFusionInstruction, type ParsedAddLiquidityOrcaInstruction, type ParsedClosePositionFusionInstruction, type ParsedClosePositionOrcaInstruction, type ParsedCollectAndCompoundFeesFusionInstruction, type ParsedCollectAndCompoundFeesOrcaInstruction, type ParsedCollectFeesFusionInstruction, type ParsedCollectFeesOrcaInstruction, type ParsedCollectRewardOrcaInstruction, type ParsedCreateMarketInstruction, type ParsedCreateTunaConfigInstruction, type ParsedCreateVaultInstruction, type ParsedDepositInstruction, type ParsedLiquidatePositionFusionInstruction, type ParsedLiquidatePositionOrcaInstruction, type ParsedOpenLendingPositionInstruction, type ParsedOpenPositionFusionInstruction, type ParsedOpenPositionOrcaInstruction, type ParsedOpenPositionWithLiquidityFusionInstruction, type ParsedOpenPositionWithLiquidityOrcaInstruction, type ParsedRebalancePositionFusionInstruction, type ParsedRebalancePositionOrcaInstruction, type ParsedRemoveLiquidityFusionInstruction, type ParsedRemoveLiquidityOrcaInstruction, type ParsedRepayBadDebtInstruction, type ParsedRepayDebtInstruction, type ParsedSetAdminAuthorityInstruction, type ParsedSetDefaultMaxPercentageOfLeftoversInstruction, type ParsedSetDefaultMaxSwapSlippageInstruction, type ParsedSetDefaultOraclePriceDeviationThresholdInstruction, type ParsedSetFeeRecipientInstruction, type ParsedSetLimitOrdersInstruction, type ParsedSetLiquidatorAuthorityInstruction, type ParsedSetOwnerAuthorityInstruction, type ParsedSetSuspendedStateInstruction, type ParsedSetTunaPositionFlagsInstruction, type ParsedSetTunaPositionRebalanceThresholdInstruction, type ParsedTunaInstruction, type ParsedUpdateMarketInstruction, type ParsedUpdateVaultInstruction, type ParsedWithdrawInstruction, REBALANCE_POSITION_FUSION_DISCRIMINATOR, REBALANCE_POSITION_ORCA_DISCRIMINATOR, REMOVE_LIQUIDITY_FUSION_DISCRIMINATOR, REMOVE_LIQUIDITY_ORCA_DISCRIMINATOR, REPAY_BAD_DEBT_DISCRIMINATOR, REPAY_DEBT_DISCRIMINATOR, type RebalancePositionFusionInput, type RebalancePositionFusionInstruction, type RebalancePositionFusionInstructionData, type RebalancePositionFusionInstructionDataArgs, type RebalancePositionOrcaInput, type RebalancePositionOrcaInstruction, type RebalancePositionOrcaInstructionData, type RebalancePositionOrcaInstructionDataArgs, type RemainingAccountsInfo, type RemainingAccountsInfoArgs, type RemainingAccountsSlice, type RemainingAccountsSliceArgs, type RemoveLiquidityFusionInput, type RemoveLiquidityFusionInstruction, type RemoveLiquidityFusionInstructionData, type RemoveLiquidityFusionInstructionDataArgs, type RemoveLiquidityFusionInstructionsArgs, type RemoveLiquidityOrcaInput, type RemoveLiquidityOrcaInstruction, type RemoveLiquidityOrcaInstructionData, type RemoveLiquidityOrcaInstructionDataArgs, type RemoveLiquidityOrcaInstructionsArgs, type RepayBadDebtInput, type RepayBadDebtInstruction, type RepayBadDebtInstructionData, type RepayBadDebtInstructionDataArgs, type RepayDebtInput, type RepayDebtInstruction, type RepayDebtInstructionData, type RepayDebtInstructionDataArgs, SET_ADMIN_AUTHORITY_DISCRIMINATOR, SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR, SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR, SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR, SET_FEE_RECIPIENT_DISCRIMINATOR, SET_LIMIT_ORDERS_DISCRIMINATOR, SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR, SET_OWNER_AUTHORITY_DISCRIMINATOR, SET_SUSPENDED_STATE_DISCRIMINATOR, SET_TUNA_POSITION_FLAGS_DISCRIMINATOR, SET_TUNA_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR, type SetAdminAuthorityInput, type SetAdminAuthorityInstruction, type SetAdminAuthorityInstructionData, type SetAdminAuthorityInstructionDataArgs, type SetDefaultMaxPercentageOfLeftoversInput, type SetDefaultMaxPercentageOfLeftoversInstruction, type SetDefaultMaxPercentageOfLeftoversInstructionData, type SetDefaultMaxPercentageOfLeftoversInstructionDataArgs, type SetDefaultMaxSwapSlippageInput, type SetDefaultMaxSwapSlippageInstruction, type SetDefaultMaxSwapSlippageInstructionData, type SetDefaultMaxSwapSlippageInstructionDataArgs, type SetDefaultOraclePriceDeviationThresholdInput, type SetDefaultOraclePriceDeviationThresholdInstruction, type SetDefaultOraclePriceDeviationThresholdInstructionData, type SetDefaultOraclePriceDeviationThresholdInstructionDataArgs, type SetFeeRecipientInput, type SetFeeRecipientInstruction, type SetFeeRecipientInstructionData, type SetFeeRecipientInstructionDataArgs, type SetLimitOrdersInput, type SetLimitOrdersInstruction, type SetLimitOrdersInstructionData, type SetLimitOrdersInstructionDataArgs, type SetLiquidatorAuthorityInput, type SetLiquidatorAuthorityInstruction, type SetLiquidatorAuthorityInstructionData, type SetLiquidatorAuthorityInstructionDataArgs, type SetOwnerAuthorityInput, type SetOwnerAuthorityInstruction, type SetOwnerAuthorityInstructionData, type SetOwnerAuthorityInstructionDataArgs, type SetSuspendedStateInput, type SetSuspendedStateInstruction, type SetSuspendedStateInstructionData, type SetSuspendedStateInstructionDataArgs, type SetTunaPositionFlagsInput, type SetTunaPositionFlagsInstruction, type SetTunaPositionFlagsInstructionData, type SetTunaPositionFlagsInstructionDataArgs, type SetTunaPositionRebalanceThresholdInput, type SetTunaPositionRebalanceThresholdInstruction, type SetTunaPositionRebalanceThresholdInstructionData, type SetTunaPositionRebalanceThresholdInstructionDataArgs, TUNA_CONFIG_DISCRIMINATOR, TUNA_ERROR__AMOUNT_SLIPPAGE_EXCEEDED, TUNA_ERROR__BAD_DEBT, TUNA_ERROR__INSUFFICIENT_LIQUIDITY, TUNA_ERROR__INTEREST_RATE_IS_OUT_OF_RANGE, TUNA_ERROR__INVALID_ACCOUNT_OWNER, TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS, TUNA_ERROR__INVALID_MARKET_MAKER, TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH, TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION, TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE, TUNA_ERROR__LEFTOVERS_EXCEEDED, TUNA_ERROR__LEVERAGE_IS_OUT_OF_RANGE, TUNA_ERROR__LIMIT_ORDER_EXECUTION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_THRESHOLD_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDITY_ZERO, TUNA_ERROR__MARKET_DEBT_LIMIT_EXCEEDED, TUNA_ERROR__MARKET_DISABLED, TUNA_ERROR__MATH_OVERFLOW, TUNA_ERROR__MATH_UNDERFLOW, TUNA_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_EXCEEDED, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_OUT_OF_RANGE, TUNA_ERROR__ORACLE_STALE_PRICE, TUNA_ERROR__PARTIAL_FILL_ERROR, TUNA_ERROR__POSITION_IS_AUTO_REBALANCEABLE, TUNA_ERROR__POSITION_IS_HEALTHY, TUNA_ERROR__POSITION_IS_LIQUIDATED, TUNA_ERROR__POSITION_IS_UNHEALTHY, TUNA_ERROR__POSITION_NOT_EMPTY, TUNA_ERROR__PROTOCOL_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__REBALANCE_CONDITIONS_NOT_MET, TUNA_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE, TUNA_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE_LENGTH, TUNA_ERROR__REQUIRED_REMAINING_ACCOUNT_NOT_PROVIDED, TUNA_ERROR__SOLVER_FAILED_TO_FIND_ROOT, TUNA_ERROR__SQRT_PRICE_OUT_OF_BOUNDS, TUNA_ERROR__SUPPLY_LIMIT_EXCEEDED, TUNA_ERROR__SUSPENDED, TUNA_ERROR__SWAP_QUOTE_NOT_EQUAL_TO_ACTUAL_SWAP_AMOUNT, TUNA_ERROR__SWAP_SLIPPAGE_EXCEEDED, TUNA_ERROR__SWAP_SLIPPAGE_IS_OUT_OF_RANGE, TUNA_ERROR__SWAP_TO_POSITION_RATIO_ESTIMATION_FAILED, TUNA_ERROR__TICK_INDEX_OF_BOUNDS, TUNA_ERROR__TRANSFER_FEE_CALCULATION_ERROR, TUNA_ERROR__TYPE_CAST_OVERFLOW, TUNA_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT_DATA, TUNA_ERROR__UNABLE_TO_LOAD_ACCOUNT_DATA, TUNA_ERROR__UNEXPECTED_VALUE, TUNA_ERROR__UNSUPPORTED_TOKEN_MINT, TUNA_ERROR__VAULT_NOT_INITIALIZED, TUNA_ERROR__WITHDRAW_REQUEST_EXCEEDS_USER_BALANCE, TUNA_ERROR__ZERO_PRICE_RANGE, TUNA_ERROR__ZERO_TRADABLE_AMOUNT, TUNA_ERROR__ZERO_YIELD, TUNA_POSITION_DISCRIMINATOR, TUNA_POSITION_FLAGS_ALLOW_REBALANCING, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_B, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_B, TUNA_PROGRAM_ADDRESS, TunaAccount, type TunaConfig, type TunaConfigArgs, type TunaError, TunaInstruction, type TunaPosition, type TunaPositionArgs, TunaPositionState, type TunaPositionStateArgs, UPDATE_MARKET_DISCRIMINATOR, UPDATE_VAULT_DISCRIMINATOR, type UpdateMarketInput, type UpdateMarketInstruction, type UpdateMarketInstructionData, type UpdateMarketInstructionDataArgs, type UpdateVaultInput, type UpdateVaultInstruction, type UpdateVaultInstructionData, type UpdateVaultInstructionDataArgs, VAULT_DISCRIMINATOR, type Vault, type VaultArgs, WITHDRAW_DISCRIMINATOR, WP_NFT_UPDATE_AUTH, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, addLiquidityFusionInstruction, addLiquidityFusionInstructions, addLiquidityOrcaInstruction, addLiquidityOrcaInstructions, calculateProtocolFee, closePositionFusionInstruction, closePositionOrcaInstruction, closePositionWithLiquidityFusionInstructions, closePositionWithLiquidityOrcaInstructions, collectAndCompoundFeesFusionInstruction, collectAndCompoundFeesFusionInstructions, collectAndCompoundFeesOrcaInstruction, collectAndCompoundFeesOrcaInstructions, collectFeesFusionInstruction, collectFeesFusionInstructions, collectFeesOrcaInstruction, collectFeesOrcaInstructions, createAddressLookupTableForMarketInstructions, createAddressLookupTableInstructions, createMarketInstruction, createTunaConfigInstruction, createVaultInstructions, decodeLendingPosition, decodeMarket, decodeTunaConfig, decodeTunaPosition, decodeVault, depositInstruction, depositInstructions, fetchAllLendingPosition, fetchAllLendingPositionWithFilter, fetchAllMarket, fetchAllMaybeLendingPosition, fetchAllMaybeMarket, fetchAllMaybeTunaConfig, fetchAllMaybeTunaPosition, fetchAllMaybeVault, fetchAllTunaConfig, fetchAllTunaPosition, fetchAllTunaPositionWithFilter, fetchAllVault, fetchLendingPosition, fetchMarket, fetchMaybeLendingPosition, fetchMaybeMarket, fetchMaybeTunaConfig, fetchMaybeTunaPosition, fetchMaybeVault, fetchTunaConfig, fetchTunaPosition, fetchVault, getAccountsTypeCodec, getAccountsTypeDecoder, getAccountsTypeEncoder, getAddLiquidityFusionDiscriminatorBytes, getAddLiquidityFusionInstruction, getAddLiquidityFusionInstructionDataCodec, getAddLiquidityFusionInstructionDataDecoder, getAddLiquidityFusionInstructionDataEncoder, getAddLiquidityOrcaDiscriminatorBytes, getAddLiquidityOrcaInstruction, getAddLiquidityOrcaInstructionDataCodec, getAddLiquidityOrcaInstructionDataDecoder, getAddLiquidityOrcaInstructionDataEncoder, getClosePositionFusionDiscriminatorBytes, getClosePositionFusionInstruction, getClosePositionFusionInstructionDataCodec, getClosePositionFusionInstructionDataDecoder, getClosePositionFusionInstructionDataEncoder, getClosePositionOrcaDiscriminatorBytes, getClosePositionOrcaInstruction, getClosePositionOrcaInstructionDataCodec, getClosePositionOrcaInstructionDataDecoder, getClosePositionOrcaInstructionDataEncoder, getCollectAndCompoundFeesFusionDiscriminatorBytes, getCollectAndCompoundFeesFusionInstruction, getCollectAndCompoundFeesFusionInstructionDataCodec, getCollectAndCompoundFeesFusionInstructionDataDecoder, getCollectAndCompoundFeesFusionInstructionDataEncoder, getCollectAndCompoundFeesOrcaDiscriminatorBytes, getCollectAndCompoundFeesOrcaInstruction, getCollectAndCompoundFeesOrcaInstructionDataCodec, getCollectAndCompoundFeesOrcaInstructionDataDecoder, getCollectAndCompoundFeesOrcaInstructionDataEncoder, getCollectFeesFusionDiscriminatorBytes, getCollectFeesFusionInstruction, getCollectFeesFusionInstructionDataCodec, getCollectFeesFusionInstructionDataDecoder, getCollectFeesFusionInstructionDataEncoder, getCollectFeesOrcaDiscriminatorBytes, getCollectFeesOrcaInstruction, getCollectFeesOrcaInstructionDataCodec, getCollectFeesOrcaInstructionDataDecoder, getCollectFeesOrcaInstructionDataEncoder, getCollectRewardOrcaDiscriminatorBytes, getCollectRewardOrcaInstruction, getCollectRewardOrcaInstructionDataCodec, getCollectRewardOrcaInstructionDataDecoder, getCollectRewardOrcaInstructionDataEncoder, getCreateAtaInstruction, getCreateAtaInstructions, getCreateMarketDiscriminatorBytes, getCreateMarketInstruction, getCreateMarketInstructionDataCodec, getCreateMarketInstructionDataDecoder, getCreateMarketInstructionDataEncoder, getCreateTunaConfigDiscriminatorBytes, getCreateTunaConfigInstruction, getCreateTunaConfigInstructionDataCodec, getCreateTunaConfigInstructionDataDecoder, getCreateTunaConfigInstructionDataEncoder, getCreateVaultDiscriminatorBytes, getCreateVaultInstruction, getCreateVaultInstructionDataCodec, getCreateVaultInstructionDataDecoder, getCreateVaultInstructionDataEncoder, getDepositDiscriminatorBytes, getDepositInstruction, getDepositInstructionDataCodec, getDepositInstructionDataDecoder, getDepositInstructionDataEncoder, getLendingPositionAddress, getLendingPositionCodec, getLendingPositionDecoder, getLendingPositionDiscriminatorBytes, getLendingPositionEncoder, getLendingPositionSize, getLendingVaultAddress, getLiquidatePositionFusionDiscriminatorBytes, getLiquidatePositionFusionInstruction, getLiquidatePositionFusionInstructionDataCodec, getLiquidatePositionFusionInstructionDataDecoder, getLiquidatePositionFusionInstructionDataEncoder, getLiquidatePositionOrcaDiscriminatorBytes, getLiquidatePositionOrcaInstruction, getLiquidatePositionOrcaInstructionDataCodec, getLiquidatePositionOrcaInstructionDataDecoder, getLiquidatePositionOrcaInstructionDataEncoder, getLiquidityIncreaseQuote, getMarketAddress, getMarketCodec, getMarketDecoder, getMarketDiscriminatorBytes, getMarketEncoder, getMarketMakerCodec, getMarketMakerDecoder, getMarketMakerEncoder, getMarketSize, getOpenLendingPositionDiscriminatorBytes, getOpenLendingPositionInstruction, getOpenLendingPositionInstructionDataCodec, getOpenLendingPositionInstructionDataDecoder, getOpenLendingPositionInstructionDataEncoder, getOpenPositionFusionDiscriminatorBytes, getOpenPositionFusionInstruction, getOpenPositionFusionInstructionDataCodec, getOpenPositionFusionInstructionDataDecoder, getOpenPositionFusionInstructionDataEncoder, getOpenPositionOrcaDiscriminatorBytes, getOpenPositionOrcaInstruction, getOpenPositionOrcaInstructionDataCodec, getOpenPositionOrcaInstructionDataDecoder, getOpenPositionOrcaInstructionDataEncoder, getOpenPositionWithLiquidityFusionDiscriminatorBytes, getOpenPositionWithLiquidityFusionInstruction, getOpenPositionWithLiquidityFusionInstructionDataCodec, getOpenPositionWithLiquidityFusionInstructionDataDecoder, getOpenPositionWithLiquidityFusionInstructionDataEncoder, getOpenPositionWithLiquidityOrcaDiscriminatorBytes, getOpenPositionWithLiquidityOrcaInstruction, getOpenPositionWithLiquidityOrcaInstructionDataCodec, getOpenPositionWithLiquidityOrcaInstructionDataDecoder, getOpenPositionWithLiquidityOrcaInstructionDataEncoder, getRebalancePositionFusionDiscriminatorBytes, getRebalancePositionFusionInstruction, getRebalancePositionFusionInstructionDataCodec, getRebalancePositionFusionInstructionDataDecoder, getRebalancePositionFusionInstructionDataEncoder, getRebalancePositionOrcaDiscriminatorBytes, getRebalancePositionOrcaInstruction, getRebalancePositionOrcaInstructionDataCodec, getRebalancePositionOrcaInstructionDataDecoder, getRebalancePositionOrcaInstructionDataEncoder, getRemainingAccountsInfoCodec, getRemainingAccountsInfoDecoder, getRemainingAccountsInfoEncoder, getRemainingAccountsSliceCodec, getRemainingAccountsSliceDecoder, getRemainingAccountsSliceEncoder, getRemoveLiquidityFusionDiscriminatorBytes, getRemoveLiquidityFusionInstruction, getRemoveLiquidityFusionInstructionDataCodec, getRemoveLiquidityFusionInstructionDataDecoder, getRemoveLiquidityFusionInstructionDataEncoder, getRemoveLiquidityOrcaDiscriminatorBytes, getRemoveLiquidityOrcaInstruction, getRemoveLiquidityOrcaInstructionDataCodec, getRemoveLiquidityOrcaInstructionDataDecoder, getRemoveLiquidityOrcaInstructionDataEncoder, getRepayBadDebtDiscriminatorBytes, getRepayBadDebtInstruction, getRepayBadDebtInstructionDataCodec, getRepayBadDebtInstructionDataDecoder, getRepayBadDebtInstructionDataEncoder, getRepayDebtDiscriminatorBytes, getRepayDebtInstruction, getRepayDebtInstructionDataCodec, getRepayDebtInstructionDataDecoder, getRepayDebtInstructionDataEncoder, getSetAdminAuthorityDiscriminatorBytes, getSetAdminAuthorityInstruction, getSetAdminAuthorityInstructionDataCodec, getSetAdminAuthorityInstructionDataDecoder, getSetAdminAuthorityInstructionDataEncoder, getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes, getSetDefaultMaxPercentageOfLeftoversInstruction, getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec, getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder, getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder, getSetDefaultMaxSwapSlippageDiscriminatorBytes, getSetDefaultMaxSwapSlippageInstruction, getSetDefaultMaxSwapSlippageInstructionDataCodec, getSetDefaultMaxSwapSlippageInstructionDataDecoder, getSetDefaultMaxSwapSlippageInstructionDataEncoder, getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes, getSetDefaultOraclePriceDeviationThresholdInstruction, getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec, getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder, getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder, getSetFeeRecipientDiscriminatorBytes, getSetFeeRecipientInstruction, getSetFeeRecipientInstructionDataCodec, getSetFeeRecipientInstructionDataDecoder, getSetFeeRecipientInstructionDataEncoder, getSetLimitOrdersDiscriminatorBytes, getSetLimitOrdersInstruction, getSetLimitOrdersInstructionDataCodec, getSetLimitOrdersInstructionDataDecoder, getSetLimitOrdersInstructionDataEncoder, getSetLiquidatorAuthorityDiscriminatorBytes, getSetLiquidatorAuthorityInstruction, getSetLiquidatorAuthorityInstructionDataCodec, getSetLiquidatorAuthorityInstructionDataDecoder, getSetLiquidatorAuthorityInstructionDataEncoder, getSetOwnerAuthorityDiscriminatorBytes, getSetOwnerAuthorityInstruction, getSetOwnerAuthorityInstructionDataCodec, getSetOwnerAuthorityInstructionDataDecoder, getSetOwnerAuthorityInstructionDataEncoder, getSetSuspendedStateDiscriminatorBytes, getSetSuspendedStateInstruction, getSetSuspendedStateInstructionDataCodec, getSetSuspendedStateInstructionDataDecoder, getSetSuspendedStateInstructionDataEncoder, getSetTunaPositionFlagsDiscriminatorBytes, getSetTunaPositionFlagsInstruction, getSetTunaPositionFlagsInstructionDataCodec, getSetTunaPositionFlagsInstructionDataDecoder, getSetTunaPositionFlagsInstructionDataEncoder, getSetTunaPositionRebalanceThresholdDiscriminatorBytes, getSetTunaPositionRebalanceThresholdInstruction, getSetTunaPositionRebalanceThresholdInstructionDataCodec, getSetTunaPositionRebalanceThresholdInstructionDataDecoder, getSetTunaPositionRebalanceThresholdInstructionDataEncoder, getTunaConfigAddress, getTunaConfigCodec, getTunaConfigDecoder, getTunaConfigDiscriminatorBytes, getTunaConfigEncoder, getTunaConfigSize, getTunaErrorMessage, getTunaPositionAddress, getTunaPositionCodec, getTunaPositionDecoder, getTunaPositionDiscriminatorBytes, getTunaPositionEncoder, getTunaPositionSize, getTunaPositionStateCodec, getTunaPositionStateDecoder, getTunaPositionStateEncoder, getUpdateMarketDiscriminatorBytes, getUpdateMarketInstruction, getUpdateMarketInstructionDataCodec, getUpdateMarketInstructionDataDecoder, getUpdateMarketInstructionDataEncoder, getUpdateVaultDiscriminatorBytes, getUpdateVaultInstruction, getUpdateVaultInstructionDataCodec, getUpdateVaultInstructionDataDecoder, getUpdateVaultInstructionDataEncoder, getVaultCodec, getVaultDecoder, getVaultDiscriminatorBytes, getVaultEncoder, getVaultSize, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyTunaAccount, identifyTunaInstruction, isTunaError, lendingPositionAuthorityFilter, lendingPositionMintFilter, liquidatePositionFusionInstruction, liquidatePositionFusionInstructions, liquidatePositionOrcaInstruction, liquidatePositionOrcaInstructions, openLendingPositionAndDepositInstructions, openLendingPositionInstruction, openPositionFusionInstruction, openPositionOrcaInstruction, openPositionWithLiquidityFusionInstruction, openPositionWithLiquidityFusionInstructions, openPositionWithLiquidityOrcaInstruction, openPositionWithLiquidityOrcaInstructions, parseAddLiquidityFusionInstruction, parseAddLiquidityOrcaInstruction, parseClosePositionFusionInstruction, parseClosePositionOrcaInstruction, parseCollectAndCompoundFeesFusionInstruction, parseCollectAndCompoundFeesOrcaInstruction, parseCollectFeesFusionInstruction, parseCollectFeesOrcaInstruction, parseCollectRewardOrcaInstruction, parseCreateMarketInstruction, parseCreateTunaConfigInstruction, parseCreateVaultInstruction, parseDepositInstruction, parseLiquidatePositionFusionInstruction, parseLiquidatePositionOrcaInstruction, parseOpenLendingPositionInstruction, parseOpenPositionFusionInstruction, parseOpenPositionOrcaInstruction, parseOpenPositionWithLiquidityFusionInstruction, parseOpenPositionWithLiquidityOrcaInstruction, parseRebalancePositionFusionInstruction, parseRebalancePositionOrcaInstruction, parseRemoveLiquidityFusionInstruction, parseRemoveLiquidityOrcaInstruction, parseRepayBadDebtInstruction, parseRepayDebtInstruction, parseSetAdminAuthorityInstruction, parseSetDefaultMaxPercentageOfLeftoversInstruction, parseSetDefaultMaxSwapSlippageInstruction, parseSetDefaultOraclePriceDeviationThresholdInstruction, parseSetFeeRecipientInstruction, parseSetLimitOrdersInstruction, parseSetLiquidatorAuthorityInstruction, parseSetOwnerAuthorityInstruction, parseSetSuspendedStateInstruction, parseSetTunaPositionFlagsInstruction, parseSetTunaPositionRebalanceThresholdInstruction, parseUpdateMarketInstruction, parseUpdateVaultInstruction, parseWithdrawInstruction, rebalancePositionFusionInstruction, rebalancePositionFusionInstructions, rebalancePositionOrcaInstruction, rebalancePositionOrcaInstructions, removeLiquidityFusionInstruction, removeLiquidityFusionInstructions, removeLiquidityOrcaInstruction, removeLiquidityOrcaInstructions, repayBadDebtInstruction, repayDebtInstruction, repayDebtInstructions, setLimitOrdersInstruction, tunaPositionAuthorityFilter, tunaPositionMarketMakerFilter, tunaPositionMintAFilter, tunaPositionMintBFilter, tunaPositionMintFilter, tunaPositionPoolFilter, updateMarketInstruction, updateVaultInstruction, withdrawInstruction, withdrawInstructions };
4849
+ export { ADD_LIQUIDITY_FUSION_DISCRIMINATOR, ADD_LIQUIDITY_ORCA_DISCRIMINATOR, AccountsType, type AccountsTypeArgs, type AddLiquidityFusionInput, type AddLiquidityFusionInstruction, type AddLiquidityFusionInstructionData, type AddLiquidityFusionInstructionDataArgs, type AddLiquidityFusionInstructionsArgs, type AddLiquidityOrcaInput, type AddLiquidityOrcaInstruction, type AddLiquidityOrcaInstructionData, type AddLiquidityOrcaInstructionDataArgs, type AddLiquidityOrcaInstructionsArgs, CLOSE_POSITION_FUSION_DISCRIMINATOR, CLOSE_POSITION_ORCA_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_FUSION_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_ORCA_DISCRIMINATOR, COLLECT_FEES_FUSION_DISCRIMINATOR, COLLECT_FEES_ORCA_DISCRIMINATOR, COLLECT_REWARD_ORCA_DISCRIMINATOR, COMPUTED_AMOUNT, CREATE_MARKET_DISCRIMINATOR, CREATE_TUNA_CONFIG_DISCRIMINATOR, CREATE_VAULT_DISCRIMINATOR, type ClosePositionFusionInput, type ClosePositionFusionInstruction, type ClosePositionFusionInstructionData, type ClosePositionFusionInstructionDataArgs, type ClosePositionOrcaInput, type ClosePositionOrcaInstruction, type ClosePositionOrcaInstructionData, type ClosePositionOrcaInstructionDataArgs, type ClosePositionWithLiquidityFusionInstructionArgs, type ClosePositionWithLiquidityOrcaInstructionArgs, type CollectAndCompoundFeesFusionInput, type CollectAndCompoundFeesFusionInstruction, type CollectAndCompoundFeesFusionInstructionData, type CollectAndCompoundFeesFusionInstructionDataArgs, type CollectAndCompoundFeesOrcaInput, type CollectAndCompoundFeesOrcaInstruction, type CollectAndCompoundFeesOrcaInstructionData, type CollectAndCompoundFeesOrcaInstructionDataArgs, type CollectFeesFusionInput, type CollectFeesFusionInstruction, type CollectFeesFusionInstructionData, type CollectFeesFusionInstructionDataArgs, type CollectFeesOrcaInput, type CollectFeesOrcaInstruction, type CollectFeesOrcaInstructionData, type CollectFeesOrcaInstructionDataArgs, type CollectRewardOrcaInput, type CollectRewardOrcaInstruction, type CollectRewardOrcaInstructionData, type CollectRewardOrcaInstructionDataArgs, type CreateAddressLookupTableResult, type CreateMarketInput, type CreateMarketInstruction, type CreateMarketInstructionData, type CreateMarketInstructionDataArgs, type CreateTunaConfigInput, type CreateTunaConfigInstruction, type CreateTunaConfigInstructionData, type CreateTunaConfigInstructionDataArgs, type CreateVaultInput, type CreateVaultInstruction, type CreateVaultInstructionData, type CreateVaultInstructionDataArgs, DEFAULT_ADDRESS, DEFAULT_MAX_AMOUNT_SLIPPAGE, DEFAULT_MAX_SWAP_SLIPPAGE, DEPOSIT_DISCRIMINATOR, type DepositInput, type DepositInstruction, type DepositInstructionData, type DepositInstructionDataArgs, FusionUtils, HUNDRED_PERCENT, type IncreaseLiquidityQuoteArgs, type IncreaseLiquidityQuoteResult, LENDING_POSITION_DISCRIMINATOR, LEVERAGE_ONE, LIQUIDATE_POSITION_FUSION_DISCRIMINATOR, LIQUIDATE_POSITION_ORCA_DISCRIMINATOR, type LendingPosition, type LendingPositionArgs, type LiquidatePositionFusionInput, type LiquidatePositionFusionInstruction, type LiquidatePositionFusionInstructionData, type LiquidatePositionFusionInstructionDataArgs, type LiquidatePositionOrcaInput, type LiquidatePositionOrcaInstruction, type LiquidatePositionOrcaInstructionData, type LiquidatePositionOrcaInstructionDataArgs, MARKET_DISCRIMINATOR, MAX_LEVERAGE, MAX_LIMIT_ORDER_EXECUTION_FEE, MAX_LIQUIDATION_FEE, MAX_LIQUIDATION_THRESHOLD, MAX_PROTOCOL_FEE, type Market, type MarketArgs, MarketMaker, type MarketMakerArgs, NATIVE_MINT, NO_STOP_LOSS, NO_TAKE_PROFIT, OPEN_LENDING_POSITION_DISCRIMINATOR, OPEN_POSITION_FUSION_DISCRIMINATOR, OPEN_POSITION_ORCA_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_FUSION_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_ORCA_DISCRIMINATOR, type OpenLendingPositionInput, type OpenLendingPositionInstruction, type OpenLendingPositionInstructionData, type OpenLendingPositionInstructionDataArgs, type OpenPositionFusionInput, type OpenPositionFusionInstruction, type OpenPositionFusionInstructionData, type OpenPositionFusionInstructionDataArgs, type OpenPositionOrcaInput, type OpenPositionOrcaInstruction, type OpenPositionOrcaInstructionData, type OpenPositionOrcaInstructionDataArgs, type OpenPositionWithLiquidityFusion, type OpenPositionWithLiquidityFusionInput, type OpenPositionWithLiquidityFusionInstruction, type OpenPositionWithLiquidityFusionInstructionData, type OpenPositionWithLiquidityFusionInstructionDataArgs, type OpenPositionWithLiquidityFusionInstructionsArgs, type OpenPositionWithLiquidityOrca, type OpenPositionWithLiquidityOrcaInput, type OpenPositionWithLiquidityOrcaInstruction, type OpenPositionWithLiquidityOrcaInstructionData, type OpenPositionWithLiquidityOrcaInstructionDataArgs, type OpenPositionWithLiquidityOrcaInstructionsArgs, OrcaUtils, type ParsedAddLiquidityFusionInstruction, type ParsedAddLiquidityOrcaInstruction, type ParsedClosePositionFusionInstruction, type ParsedClosePositionOrcaInstruction, type ParsedCollectAndCompoundFeesFusionInstruction, type ParsedCollectAndCompoundFeesOrcaInstruction, type ParsedCollectFeesFusionInstruction, type ParsedCollectFeesOrcaInstruction, type ParsedCollectRewardOrcaInstruction, type ParsedCreateMarketInstruction, type ParsedCreateTunaConfigInstruction, type ParsedCreateVaultInstruction, type ParsedDepositInstruction, type ParsedLiquidatePositionFusionInstruction, type ParsedLiquidatePositionOrcaInstruction, type ParsedOpenLendingPositionInstruction, type ParsedOpenPositionFusionInstruction, type ParsedOpenPositionOrcaInstruction, type ParsedOpenPositionWithLiquidityFusionInstruction, type ParsedOpenPositionWithLiquidityOrcaInstruction, type ParsedRebalancePositionFusionInstruction, type ParsedRebalancePositionOrcaInstruction, type ParsedRemoveLiquidityFusionInstruction, type ParsedRemoveLiquidityOrcaInstruction, type ParsedRepayBadDebtInstruction, type ParsedRepayDebtInstruction, type ParsedSetAdminAuthorityInstruction, type ParsedSetDefaultMaxPercentageOfLeftoversInstruction, type ParsedSetDefaultMaxSwapSlippageInstruction, type ParsedSetDefaultOraclePriceDeviationThresholdInstruction, type ParsedSetFeeRecipientInstruction, type ParsedSetLimitOrdersInstruction, type ParsedSetLiquidatorAuthorityInstruction, type ParsedSetOwnerAuthorityInstruction, type ParsedSetSuspendedStateInstruction, type ParsedSetTunaPositionFlagsInstruction, type ParsedSetTunaPositionRebalanceThresholdInstruction, type ParsedTunaInstruction, type ParsedUpdateMarketInstruction, type ParsedUpdateVaultInstruction, type ParsedWithdrawInstruction, REBALANCE_POSITION_FUSION_DISCRIMINATOR, REBALANCE_POSITION_ORCA_DISCRIMINATOR, REMOVE_LIQUIDITY_FUSION_DISCRIMINATOR, REMOVE_LIQUIDITY_ORCA_DISCRIMINATOR, REPAY_BAD_DEBT_DISCRIMINATOR, REPAY_DEBT_DISCRIMINATOR, type RebalancePositionFusion, type RebalancePositionFusionInput, type RebalancePositionFusionInstruction, type RebalancePositionFusionInstructionData, type RebalancePositionFusionInstructionDataArgs, type RebalancePositionOrca, type RebalancePositionOrcaInput, type RebalancePositionOrcaInstruction, type RebalancePositionOrcaInstructionData, type RebalancePositionOrcaInstructionDataArgs, type RemainingAccountsInfo, type RemainingAccountsInfoArgs, type RemainingAccountsSlice, type RemainingAccountsSliceArgs, type RemoveLiquidityFusionInput, type RemoveLiquidityFusionInstruction, type RemoveLiquidityFusionInstructionData, type RemoveLiquidityFusionInstructionDataArgs, type RemoveLiquidityFusionInstructionsArgs, type RemoveLiquidityOrcaInput, type RemoveLiquidityOrcaInstruction, type RemoveLiquidityOrcaInstructionData, type RemoveLiquidityOrcaInstructionDataArgs, type RemoveLiquidityOrcaInstructionsArgs, type RepayBadDebtInput, type RepayBadDebtInstruction, type RepayBadDebtInstructionData, type RepayBadDebtInstructionDataArgs, type RepayDebtInput, type RepayDebtInstruction, type RepayDebtInstructionData, type RepayDebtInstructionDataArgs, SET_ADMIN_AUTHORITY_DISCRIMINATOR, SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR, SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR, SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR, SET_FEE_RECIPIENT_DISCRIMINATOR, SET_LIMIT_ORDERS_DISCRIMINATOR, SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR, SET_OWNER_AUTHORITY_DISCRIMINATOR, SET_SUSPENDED_STATE_DISCRIMINATOR, SET_TUNA_POSITION_FLAGS_DISCRIMINATOR, SET_TUNA_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR, type SetAdminAuthorityInput, type SetAdminAuthorityInstruction, type SetAdminAuthorityInstructionData, type SetAdminAuthorityInstructionDataArgs, type SetDefaultMaxPercentageOfLeftoversInput, type SetDefaultMaxPercentageOfLeftoversInstruction, type SetDefaultMaxPercentageOfLeftoversInstructionData, type SetDefaultMaxPercentageOfLeftoversInstructionDataArgs, type SetDefaultMaxSwapSlippageInput, type SetDefaultMaxSwapSlippageInstruction, type SetDefaultMaxSwapSlippageInstructionData, type SetDefaultMaxSwapSlippageInstructionDataArgs, type SetDefaultOraclePriceDeviationThresholdInput, type SetDefaultOraclePriceDeviationThresholdInstruction, type SetDefaultOraclePriceDeviationThresholdInstructionData, type SetDefaultOraclePriceDeviationThresholdInstructionDataArgs, type SetFeeRecipientInput, type SetFeeRecipientInstruction, type SetFeeRecipientInstructionData, type SetFeeRecipientInstructionDataArgs, type SetLimitOrdersInput, type SetLimitOrdersInstruction, type SetLimitOrdersInstructionData, type SetLimitOrdersInstructionDataArgs, type SetLiquidatorAuthorityInput, type SetLiquidatorAuthorityInstruction, type SetLiquidatorAuthorityInstructionData, type SetLiquidatorAuthorityInstructionDataArgs, type SetOwnerAuthorityInput, type SetOwnerAuthorityInstruction, type SetOwnerAuthorityInstructionData, type SetOwnerAuthorityInstructionDataArgs, type SetSuspendedStateInput, type SetSuspendedStateInstruction, type SetSuspendedStateInstructionData, type SetSuspendedStateInstructionDataArgs, type SetTunaPositionFlagsInput, type SetTunaPositionFlagsInstruction, type SetTunaPositionFlagsInstructionData, type SetTunaPositionFlagsInstructionDataArgs, type SetTunaPositionRebalanceThresholdInput, type SetTunaPositionRebalanceThresholdInstruction, type SetTunaPositionRebalanceThresholdInstructionData, type SetTunaPositionRebalanceThresholdInstructionDataArgs, TUNA_CONFIG_DISCRIMINATOR, TUNA_ERROR__AMOUNT_SLIPPAGE_EXCEEDED, TUNA_ERROR__BAD_DEBT, TUNA_ERROR__INSUFFICIENT_LIQUIDITY, TUNA_ERROR__INTEREST_RATE_IS_OUT_OF_RANGE, TUNA_ERROR__INVALID_ACCOUNT_OWNER, TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS, TUNA_ERROR__INVALID_MARKET_MAKER, TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH, TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION, TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE, TUNA_ERROR__LEFTOVERS_EXCEEDED, TUNA_ERROR__LEVERAGE_IS_OUT_OF_RANGE, TUNA_ERROR__LIMIT_ORDER_EXECUTION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_THRESHOLD_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDITY_ZERO, TUNA_ERROR__MARKET_DEBT_LIMIT_EXCEEDED, TUNA_ERROR__MARKET_DISABLED, TUNA_ERROR__MATH_OVERFLOW, TUNA_ERROR__MATH_UNDERFLOW, TUNA_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_EXCEEDED, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_OUT_OF_RANGE, TUNA_ERROR__ORACLE_STALE_PRICE, TUNA_ERROR__PARTIAL_FILL_ERROR, TUNA_ERROR__POSITION_IS_AUTO_REBALANCEABLE, TUNA_ERROR__POSITION_IS_HEALTHY, TUNA_ERROR__POSITION_IS_LIQUIDATED, TUNA_ERROR__POSITION_IS_UNHEALTHY, TUNA_ERROR__POSITION_NOT_EMPTY, TUNA_ERROR__PROTOCOL_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__REBALANCE_CONDITIONS_NOT_MET, TUNA_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE, TUNA_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE_LENGTH, TUNA_ERROR__REQUIRED_REMAINING_ACCOUNT_NOT_PROVIDED, TUNA_ERROR__SOLVER_FAILED_TO_FIND_ROOT, TUNA_ERROR__SQRT_PRICE_OUT_OF_BOUNDS, TUNA_ERROR__SUPPLY_LIMIT_EXCEEDED, TUNA_ERROR__SUSPENDED, TUNA_ERROR__SWAP_QUOTE_NOT_EQUAL_TO_ACTUAL_SWAP_AMOUNT, TUNA_ERROR__SWAP_SLIPPAGE_EXCEEDED, TUNA_ERROR__SWAP_SLIPPAGE_IS_OUT_OF_RANGE, TUNA_ERROR__SWAP_TO_POSITION_RATIO_ESTIMATION_FAILED, TUNA_ERROR__TICK_INDEX_OF_BOUNDS, TUNA_ERROR__TRANSFER_FEE_CALCULATION_ERROR, TUNA_ERROR__TYPE_CAST_OVERFLOW, TUNA_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT_DATA, TUNA_ERROR__UNABLE_TO_LOAD_ACCOUNT_DATA, TUNA_ERROR__UNEXPECTED_VALUE, TUNA_ERROR__UNSUPPORTED_TOKEN_MINT, TUNA_ERROR__VAULT_NOT_INITIALIZED, TUNA_ERROR__WITHDRAW_REQUEST_EXCEEDS_USER_BALANCE, TUNA_ERROR__ZERO_PRICE_RANGE, TUNA_ERROR__ZERO_TRADABLE_AMOUNT, TUNA_ERROR__ZERO_YIELD, TUNA_POSITION_DISCRIMINATOR, TUNA_POSITION_FLAGS_ALLOW_REBALANCING, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_B, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_B, TUNA_PROGRAM_ADDRESS, TunaAccount, type TunaConfig, type TunaConfigArgs, type TunaError, TunaInstruction, type TunaPosition, type TunaPositionArgs, TunaPositionState, type TunaPositionStateArgs, UPDATE_MARKET_DISCRIMINATOR, UPDATE_VAULT_DISCRIMINATOR, type UpdateMarketInput, type UpdateMarketInstruction, type UpdateMarketInstructionData, type UpdateMarketInstructionDataArgs, type UpdateVaultInput, type UpdateVaultInstruction, type UpdateVaultInstructionData, type UpdateVaultInstructionDataArgs, VAULT_DISCRIMINATOR, type Vault, type VaultArgs, WITHDRAW_DISCRIMINATOR, WP_NFT_UPDATE_AUTH, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, addLiquidityFusionInstruction, addLiquidityFusionInstructions, addLiquidityOrcaInstruction, addLiquidityOrcaInstructions, calculateProtocolFee, closePositionFusionInstruction, closePositionOrcaInstruction, closePositionWithLiquidityFusionInstructions, closePositionWithLiquidityOrcaInstructions, collectAndCompoundFeesFusionInstruction, collectAndCompoundFeesFusionInstructions, collectAndCompoundFeesOrcaInstruction, collectAndCompoundFeesOrcaInstructions, collectFeesFusionInstruction, collectFeesFusionInstructions, collectFeesOrcaInstruction, collectFeesOrcaInstructions, createAddressLookupTableForMarketInstructions, createAddressLookupTableInstructions, createMarketInstruction, createTunaConfigInstruction, createVaultInstructions, decodeLendingPosition, decodeMarket, decodeTunaConfig, decodeTunaPosition, decodeVault, depositInstruction, depositInstructions, fetchAllLendingPosition, fetchAllLendingPositionWithFilter, fetchAllMarket, fetchAllMaybeLendingPosition, fetchAllMaybeMarket, fetchAllMaybeTunaConfig, fetchAllMaybeTunaPosition, fetchAllMaybeVault, fetchAllTunaConfig, fetchAllTunaPosition, fetchAllTunaPositionWithFilter, fetchAllVault, fetchLendingPosition, fetchMarket, fetchMaybeLendingPosition, fetchMaybeMarket, fetchMaybeTunaConfig, fetchMaybeTunaPosition, fetchMaybeVault, fetchTunaConfig, fetchTunaPosition, fetchVault, getAccountsTypeCodec, getAccountsTypeDecoder, getAccountsTypeEncoder, getAddLiquidityFusionDiscriminatorBytes, getAddLiquidityFusionInstruction, getAddLiquidityFusionInstructionDataCodec, getAddLiquidityFusionInstructionDataDecoder, getAddLiquidityFusionInstructionDataEncoder, getAddLiquidityOrcaDiscriminatorBytes, getAddLiquidityOrcaInstruction, getAddLiquidityOrcaInstructionDataCodec, getAddLiquidityOrcaInstructionDataDecoder, getAddLiquidityOrcaInstructionDataEncoder, getClosePositionFusionDiscriminatorBytes, getClosePositionFusionInstruction, getClosePositionFusionInstructionDataCodec, getClosePositionFusionInstructionDataDecoder, getClosePositionFusionInstructionDataEncoder, getClosePositionOrcaDiscriminatorBytes, getClosePositionOrcaInstruction, getClosePositionOrcaInstructionDataCodec, getClosePositionOrcaInstructionDataDecoder, getClosePositionOrcaInstructionDataEncoder, getCollectAndCompoundFeesFusionDiscriminatorBytes, getCollectAndCompoundFeesFusionInstruction, getCollectAndCompoundFeesFusionInstructionDataCodec, getCollectAndCompoundFeesFusionInstructionDataDecoder, getCollectAndCompoundFeesFusionInstructionDataEncoder, getCollectAndCompoundFeesOrcaDiscriminatorBytes, getCollectAndCompoundFeesOrcaInstruction, getCollectAndCompoundFeesOrcaInstructionDataCodec, getCollectAndCompoundFeesOrcaInstructionDataDecoder, getCollectAndCompoundFeesOrcaInstructionDataEncoder, getCollectFeesFusionDiscriminatorBytes, getCollectFeesFusionInstruction, getCollectFeesFusionInstructionDataCodec, getCollectFeesFusionInstructionDataDecoder, getCollectFeesFusionInstructionDataEncoder, getCollectFeesOrcaDiscriminatorBytes, getCollectFeesOrcaInstruction, getCollectFeesOrcaInstructionDataCodec, getCollectFeesOrcaInstructionDataDecoder, getCollectFeesOrcaInstructionDataEncoder, getCollectRewardOrcaDiscriminatorBytes, getCollectRewardOrcaInstruction, getCollectRewardOrcaInstructionDataCodec, getCollectRewardOrcaInstructionDataDecoder, getCollectRewardOrcaInstructionDataEncoder, getCreateAtaInstruction, getCreateAtaInstructions, getCreateMarketDiscriminatorBytes, getCreateMarketInstruction, getCreateMarketInstructionDataCodec, getCreateMarketInstructionDataDecoder, getCreateMarketInstructionDataEncoder, getCreateTunaConfigDiscriminatorBytes, getCreateTunaConfigInstruction, getCreateTunaConfigInstructionDataCodec, getCreateTunaConfigInstructionDataDecoder, getCreateTunaConfigInstructionDataEncoder, getCreateVaultDiscriminatorBytes, getCreateVaultInstruction, getCreateVaultInstructionDataCodec, getCreateVaultInstructionDataDecoder, getCreateVaultInstructionDataEncoder, getDepositDiscriminatorBytes, getDepositInstruction, getDepositInstructionDataCodec, getDepositInstructionDataDecoder, getDepositInstructionDataEncoder, getLendingPositionAddress, getLendingPositionCodec, getLendingPositionDecoder, getLendingPositionDiscriminatorBytes, getLendingPositionEncoder, getLendingPositionSize, getLendingVaultAddress, getLiquidatePositionFusionDiscriminatorBytes, getLiquidatePositionFusionInstruction, getLiquidatePositionFusionInstructionDataCodec, getLiquidatePositionFusionInstructionDataDecoder, getLiquidatePositionFusionInstructionDataEncoder, getLiquidatePositionOrcaDiscriminatorBytes, getLiquidatePositionOrcaInstruction, getLiquidatePositionOrcaInstructionDataCodec, getLiquidatePositionOrcaInstructionDataDecoder, getLiquidatePositionOrcaInstructionDataEncoder, getLiquidityIncreaseQuote, getMarketAddress, getMarketCodec, getMarketDecoder, getMarketDiscriminatorBytes, getMarketEncoder, getMarketMakerCodec, getMarketMakerDecoder, getMarketMakerEncoder, getMarketSize, getOpenLendingPositionDiscriminatorBytes, getOpenLendingPositionInstruction, getOpenLendingPositionInstructionDataCodec, getOpenLendingPositionInstructionDataDecoder, getOpenLendingPositionInstructionDataEncoder, getOpenPositionFusionDiscriminatorBytes, getOpenPositionFusionInstruction, getOpenPositionFusionInstructionDataCodec, getOpenPositionFusionInstructionDataDecoder, getOpenPositionFusionInstructionDataEncoder, getOpenPositionOrcaDiscriminatorBytes, getOpenPositionOrcaInstruction, getOpenPositionOrcaInstructionDataCodec, getOpenPositionOrcaInstructionDataDecoder, getOpenPositionOrcaInstructionDataEncoder, getOpenPositionWithLiquidityFusionDiscriminatorBytes, getOpenPositionWithLiquidityFusionInstruction, getOpenPositionWithLiquidityFusionInstructionDataCodec, getOpenPositionWithLiquidityFusionInstructionDataDecoder, getOpenPositionWithLiquidityFusionInstructionDataEncoder, getOpenPositionWithLiquidityOrcaDiscriminatorBytes, getOpenPositionWithLiquidityOrcaInstruction, getOpenPositionWithLiquidityOrcaInstructionDataCodec, getOpenPositionWithLiquidityOrcaInstructionDataDecoder, getOpenPositionWithLiquidityOrcaInstructionDataEncoder, getRebalancePositionFusionDiscriminatorBytes, getRebalancePositionFusionInstruction, getRebalancePositionFusionInstructionDataCodec, getRebalancePositionFusionInstructionDataDecoder, getRebalancePositionFusionInstructionDataEncoder, getRebalancePositionOrcaDiscriminatorBytes, getRebalancePositionOrcaInstruction, getRebalancePositionOrcaInstructionDataCodec, getRebalancePositionOrcaInstructionDataDecoder, getRebalancePositionOrcaInstructionDataEncoder, getRemainingAccountsInfoCodec, getRemainingAccountsInfoDecoder, getRemainingAccountsInfoEncoder, getRemainingAccountsSliceCodec, getRemainingAccountsSliceDecoder, getRemainingAccountsSliceEncoder, getRemoveLiquidityFusionDiscriminatorBytes, getRemoveLiquidityFusionInstruction, getRemoveLiquidityFusionInstructionDataCodec, getRemoveLiquidityFusionInstructionDataDecoder, getRemoveLiquidityFusionInstructionDataEncoder, getRemoveLiquidityOrcaDiscriminatorBytes, getRemoveLiquidityOrcaInstruction, getRemoveLiquidityOrcaInstructionDataCodec, getRemoveLiquidityOrcaInstructionDataDecoder, getRemoveLiquidityOrcaInstructionDataEncoder, getRepayBadDebtDiscriminatorBytes, getRepayBadDebtInstruction, getRepayBadDebtInstructionDataCodec, getRepayBadDebtInstructionDataDecoder, getRepayBadDebtInstructionDataEncoder, getRepayDebtDiscriminatorBytes, getRepayDebtInstruction, getRepayDebtInstructionDataCodec, getRepayDebtInstructionDataDecoder, getRepayDebtInstructionDataEncoder, getSetAdminAuthorityDiscriminatorBytes, getSetAdminAuthorityInstruction, getSetAdminAuthorityInstructionDataCodec, getSetAdminAuthorityInstructionDataDecoder, getSetAdminAuthorityInstructionDataEncoder, getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes, getSetDefaultMaxPercentageOfLeftoversInstruction, getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec, getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder, getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder, getSetDefaultMaxSwapSlippageDiscriminatorBytes, getSetDefaultMaxSwapSlippageInstruction, getSetDefaultMaxSwapSlippageInstructionDataCodec, getSetDefaultMaxSwapSlippageInstructionDataDecoder, getSetDefaultMaxSwapSlippageInstructionDataEncoder, getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes, getSetDefaultOraclePriceDeviationThresholdInstruction, getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec, getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder, getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder, getSetFeeRecipientDiscriminatorBytes, getSetFeeRecipientInstruction, getSetFeeRecipientInstructionDataCodec, getSetFeeRecipientInstructionDataDecoder, getSetFeeRecipientInstructionDataEncoder, getSetLimitOrdersDiscriminatorBytes, getSetLimitOrdersInstruction, getSetLimitOrdersInstructionDataCodec, getSetLimitOrdersInstructionDataDecoder, getSetLimitOrdersInstructionDataEncoder, getSetLiquidatorAuthorityDiscriminatorBytes, getSetLiquidatorAuthorityInstruction, getSetLiquidatorAuthorityInstructionDataCodec, getSetLiquidatorAuthorityInstructionDataDecoder, getSetLiquidatorAuthorityInstructionDataEncoder, getSetOwnerAuthorityDiscriminatorBytes, getSetOwnerAuthorityInstruction, getSetOwnerAuthorityInstructionDataCodec, getSetOwnerAuthorityInstructionDataDecoder, getSetOwnerAuthorityInstructionDataEncoder, getSetSuspendedStateDiscriminatorBytes, getSetSuspendedStateInstruction, getSetSuspendedStateInstructionDataCodec, getSetSuspendedStateInstructionDataDecoder, getSetSuspendedStateInstructionDataEncoder, getSetTunaPositionFlagsDiscriminatorBytes, getSetTunaPositionFlagsInstruction, getSetTunaPositionFlagsInstructionDataCodec, getSetTunaPositionFlagsInstructionDataDecoder, getSetTunaPositionFlagsInstructionDataEncoder, getSetTunaPositionRebalanceThresholdDiscriminatorBytes, getSetTunaPositionRebalanceThresholdInstruction, getSetTunaPositionRebalanceThresholdInstructionDataCodec, getSetTunaPositionRebalanceThresholdInstructionDataDecoder, getSetTunaPositionRebalanceThresholdInstructionDataEncoder, getTunaConfigAddress, getTunaConfigCodec, getTunaConfigDecoder, getTunaConfigDiscriminatorBytes, getTunaConfigEncoder, getTunaConfigSize, getTunaErrorMessage, getTunaPositionAddress, getTunaPositionCodec, getTunaPositionDecoder, getTunaPositionDiscriminatorBytes, getTunaPositionEncoder, getTunaPositionSize, getTunaPositionStateCodec, getTunaPositionStateDecoder, getTunaPositionStateEncoder, getUpdateMarketDiscriminatorBytes, getUpdateMarketInstruction, getUpdateMarketInstructionDataCodec, getUpdateMarketInstructionDataDecoder, getUpdateMarketInstructionDataEncoder, getUpdateVaultDiscriminatorBytes, getUpdateVaultInstruction, getUpdateVaultInstructionDataCodec, getUpdateVaultInstructionDataDecoder, getUpdateVaultInstructionDataEncoder, getVaultCodec, getVaultDecoder, getVaultDiscriminatorBytes, getVaultEncoder, getVaultSize, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyTunaAccount, identifyTunaInstruction, isTunaError, lendingPositionAuthorityFilter, lendingPositionMintFilter, liquidatePositionFusionInstruction, liquidatePositionFusionInstructions, liquidatePositionOrcaInstruction, liquidatePositionOrcaInstructions, openLendingPositionAndDepositInstructions, openLendingPositionInstruction, openPositionFusionInstruction, openPositionOrcaInstruction, openPositionWithLiquidityFusionInstruction, openPositionWithLiquidityFusionInstructions, openPositionWithLiquidityOrcaInstruction, openPositionWithLiquidityOrcaInstructions, parseAddLiquidityFusionInstruction, parseAddLiquidityOrcaInstruction, parseClosePositionFusionInstruction, parseClosePositionOrcaInstruction, parseCollectAndCompoundFeesFusionInstruction, parseCollectAndCompoundFeesOrcaInstruction, parseCollectFeesFusionInstruction, parseCollectFeesOrcaInstruction, parseCollectRewardOrcaInstruction, parseCreateMarketInstruction, parseCreateTunaConfigInstruction, parseCreateVaultInstruction, parseDepositInstruction, parseLiquidatePositionFusionInstruction, parseLiquidatePositionOrcaInstruction, parseOpenLendingPositionInstruction, parseOpenPositionFusionInstruction, parseOpenPositionOrcaInstruction, parseOpenPositionWithLiquidityFusionInstruction, parseOpenPositionWithLiquidityOrcaInstruction, parseRebalancePositionFusionInstruction, parseRebalancePositionOrcaInstruction, parseRemoveLiquidityFusionInstruction, parseRemoveLiquidityOrcaInstruction, parseRepayBadDebtInstruction, parseRepayDebtInstruction, parseSetAdminAuthorityInstruction, parseSetDefaultMaxPercentageOfLeftoversInstruction, parseSetDefaultMaxSwapSlippageInstruction, parseSetDefaultOraclePriceDeviationThresholdInstruction, parseSetFeeRecipientInstruction, parseSetLimitOrdersInstruction, parseSetLiquidatorAuthorityInstruction, parseSetOwnerAuthorityInstruction, parseSetSuspendedStateInstruction, parseSetTunaPositionFlagsInstruction, parseSetTunaPositionRebalanceThresholdInstruction, parseUpdateMarketInstruction, parseUpdateVaultInstruction, parseWithdrawInstruction, rebalancePositionFusionInstruction, rebalancePositionFusionInstructions, rebalancePositionOrcaInstruction, rebalancePositionOrcaInstructions, removeLiquidityFusionInstruction, removeLiquidityFusionInstructions, removeLiquidityOrcaInstruction, removeLiquidityOrcaInstructions, repayBadDebtInstruction, repayDebtInstruction, repayDebtInstructions, setLimitOrdersInstruction, tunaPositionAuthorityFilter, tunaPositionMarketMakerFilter, tunaPositionMintAFilter, tunaPositionMintBFilter, tunaPositionMintFilter, tunaPositionPoolFilter, updateMarketInstruction, updateVaultInstruction, withdrawInstruction, withdrawInstructions };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _solana_kit from '@solana/kit';
2
- import { ReadonlyUint8Array, Address, Encoder, Decoder, Codec, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, IAccountMeta, IInstruction, IInstructionWithData, IInstructionWithAccounts, WritableSignerAccount, IAccountSignerMeta, ReadonlyAccount, WritableAccount, TransactionSigner, ReadonlySignerAccount, ProgramDerivedAddress, GetProgramAccountsMemcmpFilter, Rpc, GetProgramAccountsApi, GetAccountInfoApi, Slot, GetMultipleAccountsApi } from '@solana/kit';
2
+ import { ReadonlyUint8Array, Address, Encoder, Decoder, Codec, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, IAccountMeta, IInstruction, IInstructionWithData, IInstructionWithAccounts, WritableSignerAccount, IAccountSignerMeta, ReadonlyAccount, WritableAccount, TransactionSigner, ReadonlySignerAccount, ProgramDerivedAddress, GetProgramAccountsMemcmpFilter, Rpc, GetProgramAccountsApi, GetAccountInfoApi, Slot, GetMultipleAccountsApi, Lamports } from '@solana/kit';
3
3
  import { Whirlpool } from '@orca-so/whirlpools-client';
4
4
  import { FusionPool } from '@crypticdot/fusionamm-client';
5
5
  import { Mint } from '@solana-program/token-2022';
@@ -4751,16 +4751,32 @@ declare function openPositionOrcaInstruction(rpc: Rpc<GetAccountInfoApi & GetMul
4751
4751
 
4752
4752
  declare function openPositionFusionInstruction(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionFusionInstructionDataArgs): Promise<IInstruction>;
4753
4753
 
4754
+ type OpenPositionWithLiquidityOrca = {
4755
+ /** The mint address of the position NFT. */
4756
+ positionMint: Address;
4757
+ /** List of Solana transaction instructions to execute. */
4758
+ instructions: IInstruction[];
4759
+ /** The initialization cost for opening the position in lamports. */
4760
+ initializationCost: Lamports;
4761
+ };
4754
4762
  type OpenPositionWithLiquidityOrcaInstructionsArgs = Omit<OpenPositionWithLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo" | "minAddedAmountA" | "minAddedAmountB"> & {
4755
4763
  maxAmountSlippage: number;
4756
4764
  };
4757
- declare function openPositionWithLiquidityOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, whirlpoolAddress: Address, args: OpenPositionWithLiquidityOrcaInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4765
+ declare function openPositionWithLiquidityOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, whirlpoolAddress: Address, args: OpenPositionWithLiquidityOrcaInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<OpenPositionWithLiquidityOrca>;
4758
4766
  declare function openPositionWithLiquidityOrcaInstruction(authority: TransactionSigner, positionMint: TransactionSigner, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, whirlpool: Account<Whirlpool>, args: Omit<OpenPositionWithLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo">): Promise<IInstruction>;
4759
4767
 
4768
+ type OpenPositionWithLiquidityFusion = {
4769
+ /** The mint address of the position NFT. */
4770
+ positionMint: Address;
4771
+ /** List of Solana transaction instructions to execute. */
4772
+ instructions: IInstruction[];
4773
+ /** The initialization cost for opening the position in lamports. */
4774
+ initializationCost: Lamports;
4775
+ };
4760
4776
  type OpenPositionWithLiquidityFusionInstructionsArgs = Omit<OpenPositionWithLiquidityFusionInstructionDataArgs, "remainingAccountsInfo" | "minAddedAmountA" | "minAddedAmountB"> & {
4761
4777
  maxAmountSlippage: number;
4762
4778
  };
4763
- declare function openPositionWithLiquidityFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionWithLiquidityFusionInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4779
+ declare function openPositionWithLiquidityFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, fusionPoolAddress: Address, args: OpenPositionWithLiquidityFusionInstructionsArgs, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<OpenPositionWithLiquidityFusion>;
4764
4780
  declare function openPositionWithLiquidityFusionInstruction(authority: TransactionSigner, positionMint: TransactionSigner, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, fusionPool: Account<FusionPool>, args: Omit<OpenPositionWithLiquidityFusionInstructionDataArgs, "remainingAccountsInfo">): Promise<IInstruction>;
4765
4781
 
4766
4782
  type RemoveLiquidityOrcaInstructionsArgs = Omit<RemoveLiquidityOrcaInstructionDataArgs, "remainingAccountsInfo" | "minRemovedAmountA" | "minRemovedAmountB"> & {
@@ -4791,10 +4807,22 @@ declare function createAddressLookupTableForMarketInstructions(rpc: Rpc<GetAccou
4791
4807
  declare function repayDebtInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, collateralA: bigint, collateralB: bigint, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4792
4808
  declare function repayDebtInstruction(authority: TransactionSigner, positionMint: Address, mintA: Account<Mint>, mintB: Account<Mint>, marketAddress: Address, collateralA: bigint, collateralB: bigint): Promise<IInstruction>;
4793
4809
 
4794
- declare function rebalancePositionOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4810
+ type RebalancePositionOrca = {
4811
+ /** List of Solana transaction instructions to execute. */
4812
+ instructions: IInstruction[];
4813
+ /** The initialization cost for opening the position in lamports. */
4814
+ initializationCost: Lamports;
4815
+ };
4816
+ declare function rebalancePositionOrcaInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<RebalancePositionOrca>;
4795
4817
  declare function rebalancePositionOrcaInstruction(authority: TransactionSigner, tunaPosition: Account<TunaPosition>, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, whirlpool: Account<Whirlpool>): Promise<IInstruction>;
4796
4818
 
4797
- declare function rebalancePositionFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<IInstruction[]>;
4819
+ type RebalancePositionFusion = {
4820
+ /** List of Solana transaction instructions to execute. */
4821
+ instructions: IInstruction[];
4822
+ /** The initialization cost for opening the position in lamports. */
4823
+ initializationCost: Lamports;
4824
+ };
4825
+ declare function rebalancePositionFusionInstructions(rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>, authority: TransactionSigner, positionMint: Address, createInstructions?: IInstruction[], cleanupInstructions?: IInstruction[]): Promise<RebalancePositionFusion>;
4798
4826
  declare function rebalancePositionFusionInstruction(authority: TransactionSigner, tunaPosition: Account<TunaPosition>, tunaConfig: Account<TunaConfig>, mintA: Account<Mint>, mintB: Account<Mint>, vaultA: Account<Vault>, vaultB: Account<Vault>, fusionPool: Account<FusionPool>): Promise<IInstruction>;
4799
4827
 
4800
4828
  declare const DEFAULT_ADDRESS: _solana_kit.Address<"11111111111111111111111111111111">;
@@ -4818,4 +4846,4 @@ declare const TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE: number;
4818
4846
  declare const TUNA_POSITION_FLAGS_ALLOW_REBALANCING: number;
4819
4847
  declare const WP_NFT_UPDATE_AUTH: _solana_kit.Address<"3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr">;
4820
4848
 
4821
- export { ADD_LIQUIDITY_FUSION_DISCRIMINATOR, ADD_LIQUIDITY_ORCA_DISCRIMINATOR, AccountsType, type AccountsTypeArgs, type AddLiquidityFusionInput, type AddLiquidityFusionInstruction, type AddLiquidityFusionInstructionData, type AddLiquidityFusionInstructionDataArgs, type AddLiquidityFusionInstructionsArgs, type AddLiquidityOrcaInput, type AddLiquidityOrcaInstruction, type AddLiquidityOrcaInstructionData, type AddLiquidityOrcaInstructionDataArgs, type AddLiquidityOrcaInstructionsArgs, CLOSE_POSITION_FUSION_DISCRIMINATOR, CLOSE_POSITION_ORCA_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_FUSION_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_ORCA_DISCRIMINATOR, COLLECT_FEES_FUSION_DISCRIMINATOR, COLLECT_FEES_ORCA_DISCRIMINATOR, COLLECT_REWARD_ORCA_DISCRIMINATOR, COMPUTED_AMOUNT, CREATE_MARKET_DISCRIMINATOR, CREATE_TUNA_CONFIG_DISCRIMINATOR, CREATE_VAULT_DISCRIMINATOR, type ClosePositionFusionInput, type ClosePositionFusionInstruction, type ClosePositionFusionInstructionData, type ClosePositionFusionInstructionDataArgs, type ClosePositionOrcaInput, type ClosePositionOrcaInstruction, type ClosePositionOrcaInstructionData, type ClosePositionOrcaInstructionDataArgs, type ClosePositionWithLiquidityFusionInstructionArgs, type ClosePositionWithLiquidityOrcaInstructionArgs, type CollectAndCompoundFeesFusionInput, type CollectAndCompoundFeesFusionInstruction, type CollectAndCompoundFeesFusionInstructionData, type CollectAndCompoundFeesFusionInstructionDataArgs, type CollectAndCompoundFeesOrcaInput, type CollectAndCompoundFeesOrcaInstruction, type CollectAndCompoundFeesOrcaInstructionData, type CollectAndCompoundFeesOrcaInstructionDataArgs, type CollectFeesFusionInput, type CollectFeesFusionInstruction, type CollectFeesFusionInstructionData, type CollectFeesFusionInstructionDataArgs, type CollectFeesOrcaInput, type CollectFeesOrcaInstruction, type CollectFeesOrcaInstructionData, type CollectFeesOrcaInstructionDataArgs, type CollectRewardOrcaInput, type CollectRewardOrcaInstruction, type CollectRewardOrcaInstructionData, type CollectRewardOrcaInstructionDataArgs, type CreateAddressLookupTableResult, type CreateMarketInput, type CreateMarketInstruction, type CreateMarketInstructionData, type CreateMarketInstructionDataArgs, type CreateTunaConfigInput, type CreateTunaConfigInstruction, type CreateTunaConfigInstructionData, type CreateTunaConfigInstructionDataArgs, type CreateVaultInput, type CreateVaultInstruction, type CreateVaultInstructionData, type CreateVaultInstructionDataArgs, DEFAULT_ADDRESS, DEFAULT_MAX_AMOUNT_SLIPPAGE, DEFAULT_MAX_SWAP_SLIPPAGE, DEPOSIT_DISCRIMINATOR, type DepositInput, type DepositInstruction, type DepositInstructionData, type DepositInstructionDataArgs, FusionUtils, HUNDRED_PERCENT, type IncreaseLiquidityQuoteArgs, type IncreaseLiquidityQuoteResult, LENDING_POSITION_DISCRIMINATOR, LEVERAGE_ONE, LIQUIDATE_POSITION_FUSION_DISCRIMINATOR, LIQUIDATE_POSITION_ORCA_DISCRIMINATOR, type LendingPosition, type LendingPositionArgs, type LiquidatePositionFusionInput, type LiquidatePositionFusionInstruction, type LiquidatePositionFusionInstructionData, type LiquidatePositionFusionInstructionDataArgs, type LiquidatePositionOrcaInput, type LiquidatePositionOrcaInstruction, type LiquidatePositionOrcaInstructionData, type LiquidatePositionOrcaInstructionDataArgs, MARKET_DISCRIMINATOR, MAX_LEVERAGE, MAX_LIMIT_ORDER_EXECUTION_FEE, MAX_LIQUIDATION_FEE, MAX_LIQUIDATION_THRESHOLD, MAX_PROTOCOL_FEE, type Market, type MarketArgs, MarketMaker, type MarketMakerArgs, NATIVE_MINT, NO_STOP_LOSS, NO_TAKE_PROFIT, OPEN_LENDING_POSITION_DISCRIMINATOR, OPEN_POSITION_FUSION_DISCRIMINATOR, OPEN_POSITION_ORCA_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_FUSION_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_ORCA_DISCRIMINATOR, type OpenLendingPositionInput, type OpenLendingPositionInstruction, type OpenLendingPositionInstructionData, type OpenLendingPositionInstructionDataArgs, type OpenPositionFusionInput, type OpenPositionFusionInstruction, type OpenPositionFusionInstructionData, type OpenPositionFusionInstructionDataArgs, type OpenPositionOrcaInput, type OpenPositionOrcaInstruction, type OpenPositionOrcaInstructionData, type OpenPositionOrcaInstructionDataArgs, type OpenPositionWithLiquidityFusionInput, type OpenPositionWithLiquidityFusionInstruction, type OpenPositionWithLiquidityFusionInstructionData, type OpenPositionWithLiquidityFusionInstructionDataArgs, type OpenPositionWithLiquidityFusionInstructionsArgs, type OpenPositionWithLiquidityOrcaInput, type OpenPositionWithLiquidityOrcaInstruction, type OpenPositionWithLiquidityOrcaInstructionData, type OpenPositionWithLiquidityOrcaInstructionDataArgs, type OpenPositionWithLiquidityOrcaInstructionsArgs, OrcaUtils, type ParsedAddLiquidityFusionInstruction, type ParsedAddLiquidityOrcaInstruction, type ParsedClosePositionFusionInstruction, type ParsedClosePositionOrcaInstruction, type ParsedCollectAndCompoundFeesFusionInstruction, type ParsedCollectAndCompoundFeesOrcaInstruction, type ParsedCollectFeesFusionInstruction, type ParsedCollectFeesOrcaInstruction, type ParsedCollectRewardOrcaInstruction, type ParsedCreateMarketInstruction, type ParsedCreateTunaConfigInstruction, type ParsedCreateVaultInstruction, type ParsedDepositInstruction, type ParsedLiquidatePositionFusionInstruction, type ParsedLiquidatePositionOrcaInstruction, type ParsedOpenLendingPositionInstruction, type ParsedOpenPositionFusionInstruction, type ParsedOpenPositionOrcaInstruction, type ParsedOpenPositionWithLiquidityFusionInstruction, type ParsedOpenPositionWithLiquidityOrcaInstruction, type ParsedRebalancePositionFusionInstruction, type ParsedRebalancePositionOrcaInstruction, type ParsedRemoveLiquidityFusionInstruction, type ParsedRemoveLiquidityOrcaInstruction, type ParsedRepayBadDebtInstruction, type ParsedRepayDebtInstruction, type ParsedSetAdminAuthorityInstruction, type ParsedSetDefaultMaxPercentageOfLeftoversInstruction, type ParsedSetDefaultMaxSwapSlippageInstruction, type ParsedSetDefaultOraclePriceDeviationThresholdInstruction, type ParsedSetFeeRecipientInstruction, type ParsedSetLimitOrdersInstruction, type ParsedSetLiquidatorAuthorityInstruction, type ParsedSetOwnerAuthorityInstruction, type ParsedSetSuspendedStateInstruction, type ParsedSetTunaPositionFlagsInstruction, type ParsedSetTunaPositionRebalanceThresholdInstruction, type ParsedTunaInstruction, type ParsedUpdateMarketInstruction, type ParsedUpdateVaultInstruction, type ParsedWithdrawInstruction, REBALANCE_POSITION_FUSION_DISCRIMINATOR, REBALANCE_POSITION_ORCA_DISCRIMINATOR, REMOVE_LIQUIDITY_FUSION_DISCRIMINATOR, REMOVE_LIQUIDITY_ORCA_DISCRIMINATOR, REPAY_BAD_DEBT_DISCRIMINATOR, REPAY_DEBT_DISCRIMINATOR, type RebalancePositionFusionInput, type RebalancePositionFusionInstruction, type RebalancePositionFusionInstructionData, type RebalancePositionFusionInstructionDataArgs, type RebalancePositionOrcaInput, type RebalancePositionOrcaInstruction, type RebalancePositionOrcaInstructionData, type RebalancePositionOrcaInstructionDataArgs, type RemainingAccountsInfo, type RemainingAccountsInfoArgs, type RemainingAccountsSlice, type RemainingAccountsSliceArgs, type RemoveLiquidityFusionInput, type RemoveLiquidityFusionInstruction, type RemoveLiquidityFusionInstructionData, type RemoveLiquidityFusionInstructionDataArgs, type RemoveLiquidityFusionInstructionsArgs, type RemoveLiquidityOrcaInput, type RemoveLiquidityOrcaInstruction, type RemoveLiquidityOrcaInstructionData, type RemoveLiquidityOrcaInstructionDataArgs, type RemoveLiquidityOrcaInstructionsArgs, type RepayBadDebtInput, type RepayBadDebtInstruction, type RepayBadDebtInstructionData, type RepayBadDebtInstructionDataArgs, type RepayDebtInput, type RepayDebtInstruction, type RepayDebtInstructionData, type RepayDebtInstructionDataArgs, SET_ADMIN_AUTHORITY_DISCRIMINATOR, SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR, SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR, SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR, SET_FEE_RECIPIENT_DISCRIMINATOR, SET_LIMIT_ORDERS_DISCRIMINATOR, SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR, SET_OWNER_AUTHORITY_DISCRIMINATOR, SET_SUSPENDED_STATE_DISCRIMINATOR, SET_TUNA_POSITION_FLAGS_DISCRIMINATOR, SET_TUNA_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR, type SetAdminAuthorityInput, type SetAdminAuthorityInstruction, type SetAdminAuthorityInstructionData, type SetAdminAuthorityInstructionDataArgs, type SetDefaultMaxPercentageOfLeftoversInput, type SetDefaultMaxPercentageOfLeftoversInstruction, type SetDefaultMaxPercentageOfLeftoversInstructionData, type SetDefaultMaxPercentageOfLeftoversInstructionDataArgs, type SetDefaultMaxSwapSlippageInput, type SetDefaultMaxSwapSlippageInstruction, type SetDefaultMaxSwapSlippageInstructionData, type SetDefaultMaxSwapSlippageInstructionDataArgs, type SetDefaultOraclePriceDeviationThresholdInput, type SetDefaultOraclePriceDeviationThresholdInstruction, type SetDefaultOraclePriceDeviationThresholdInstructionData, type SetDefaultOraclePriceDeviationThresholdInstructionDataArgs, type SetFeeRecipientInput, type SetFeeRecipientInstruction, type SetFeeRecipientInstructionData, type SetFeeRecipientInstructionDataArgs, type SetLimitOrdersInput, type SetLimitOrdersInstruction, type SetLimitOrdersInstructionData, type SetLimitOrdersInstructionDataArgs, type SetLiquidatorAuthorityInput, type SetLiquidatorAuthorityInstruction, type SetLiquidatorAuthorityInstructionData, type SetLiquidatorAuthorityInstructionDataArgs, type SetOwnerAuthorityInput, type SetOwnerAuthorityInstruction, type SetOwnerAuthorityInstructionData, type SetOwnerAuthorityInstructionDataArgs, type SetSuspendedStateInput, type SetSuspendedStateInstruction, type SetSuspendedStateInstructionData, type SetSuspendedStateInstructionDataArgs, type SetTunaPositionFlagsInput, type SetTunaPositionFlagsInstruction, type SetTunaPositionFlagsInstructionData, type SetTunaPositionFlagsInstructionDataArgs, type SetTunaPositionRebalanceThresholdInput, type SetTunaPositionRebalanceThresholdInstruction, type SetTunaPositionRebalanceThresholdInstructionData, type SetTunaPositionRebalanceThresholdInstructionDataArgs, TUNA_CONFIG_DISCRIMINATOR, TUNA_ERROR__AMOUNT_SLIPPAGE_EXCEEDED, TUNA_ERROR__BAD_DEBT, TUNA_ERROR__INSUFFICIENT_LIQUIDITY, TUNA_ERROR__INTEREST_RATE_IS_OUT_OF_RANGE, TUNA_ERROR__INVALID_ACCOUNT_OWNER, TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS, TUNA_ERROR__INVALID_MARKET_MAKER, TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH, TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION, TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE, TUNA_ERROR__LEFTOVERS_EXCEEDED, TUNA_ERROR__LEVERAGE_IS_OUT_OF_RANGE, TUNA_ERROR__LIMIT_ORDER_EXECUTION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_THRESHOLD_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDITY_ZERO, TUNA_ERROR__MARKET_DEBT_LIMIT_EXCEEDED, TUNA_ERROR__MARKET_DISABLED, TUNA_ERROR__MATH_OVERFLOW, TUNA_ERROR__MATH_UNDERFLOW, TUNA_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_EXCEEDED, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_OUT_OF_RANGE, TUNA_ERROR__ORACLE_STALE_PRICE, TUNA_ERROR__PARTIAL_FILL_ERROR, TUNA_ERROR__POSITION_IS_AUTO_REBALANCEABLE, TUNA_ERROR__POSITION_IS_HEALTHY, TUNA_ERROR__POSITION_IS_LIQUIDATED, TUNA_ERROR__POSITION_IS_UNHEALTHY, TUNA_ERROR__POSITION_NOT_EMPTY, TUNA_ERROR__PROTOCOL_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__REBALANCE_CONDITIONS_NOT_MET, TUNA_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE, TUNA_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE_LENGTH, TUNA_ERROR__REQUIRED_REMAINING_ACCOUNT_NOT_PROVIDED, TUNA_ERROR__SOLVER_FAILED_TO_FIND_ROOT, TUNA_ERROR__SQRT_PRICE_OUT_OF_BOUNDS, TUNA_ERROR__SUPPLY_LIMIT_EXCEEDED, TUNA_ERROR__SUSPENDED, TUNA_ERROR__SWAP_QUOTE_NOT_EQUAL_TO_ACTUAL_SWAP_AMOUNT, TUNA_ERROR__SWAP_SLIPPAGE_EXCEEDED, TUNA_ERROR__SWAP_SLIPPAGE_IS_OUT_OF_RANGE, TUNA_ERROR__SWAP_TO_POSITION_RATIO_ESTIMATION_FAILED, TUNA_ERROR__TICK_INDEX_OF_BOUNDS, TUNA_ERROR__TRANSFER_FEE_CALCULATION_ERROR, TUNA_ERROR__TYPE_CAST_OVERFLOW, TUNA_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT_DATA, TUNA_ERROR__UNABLE_TO_LOAD_ACCOUNT_DATA, TUNA_ERROR__UNEXPECTED_VALUE, TUNA_ERROR__UNSUPPORTED_TOKEN_MINT, TUNA_ERROR__VAULT_NOT_INITIALIZED, TUNA_ERROR__WITHDRAW_REQUEST_EXCEEDS_USER_BALANCE, TUNA_ERROR__ZERO_PRICE_RANGE, TUNA_ERROR__ZERO_TRADABLE_AMOUNT, TUNA_ERROR__ZERO_YIELD, TUNA_POSITION_DISCRIMINATOR, TUNA_POSITION_FLAGS_ALLOW_REBALANCING, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_B, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_B, TUNA_PROGRAM_ADDRESS, TunaAccount, type TunaConfig, type TunaConfigArgs, type TunaError, TunaInstruction, type TunaPosition, type TunaPositionArgs, TunaPositionState, type TunaPositionStateArgs, UPDATE_MARKET_DISCRIMINATOR, UPDATE_VAULT_DISCRIMINATOR, type UpdateMarketInput, type UpdateMarketInstruction, type UpdateMarketInstructionData, type UpdateMarketInstructionDataArgs, type UpdateVaultInput, type UpdateVaultInstruction, type UpdateVaultInstructionData, type UpdateVaultInstructionDataArgs, VAULT_DISCRIMINATOR, type Vault, type VaultArgs, WITHDRAW_DISCRIMINATOR, WP_NFT_UPDATE_AUTH, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, addLiquidityFusionInstruction, addLiquidityFusionInstructions, addLiquidityOrcaInstruction, addLiquidityOrcaInstructions, calculateProtocolFee, closePositionFusionInstruction, closePositionOrcaInstruction, closePositionWithLiquidityFusionInstructions, closePositionWithLiquidityOrcaInstructions, collectAndCompoundFeesFusionInstruction, collectAndCompoundFeesFusionInstructions, collectAndCompoundFeesOrcaInstruction, collectAndCompoundFeesOrcaInstructions, collectFeesFusionInstruction, collectFeesFusionInstructions, collectFeesOrcaInstruction, collectFeesOrcaInstructions, createAddressLookupTableForMarketInstructions, createAddressLookupTableInstructions, createMarketInstruction, createTunaConfigInstruction, createVaultInstructions, decodeLendingPosition, decodeMarket, decodeTunaConfig, decodeTunaPosition, decodeVault, depositInstruction, depositInstructions, fetchAllLendingPosition, fetchAllLendingPositionWithFilter, fetchAllMarket, fetchAllMaybeLendingPosition, fetchAllMaybeMarket, fetchAllMaybeTunaConfig, fetchAllMaybeTunaPosition, fetchAllMaybeVault, fetchAllTunaConfig, fetchAllTunaPosition, fetchAllTunaPositionWithFilter, fetchAllVault, fetchLendingPosition, fetchMarket, fetchMaybeLendingPosition, fetchMaybeMarket, fetchMaybeTunaConfig, fetchMaybeTunaPosition, fetchMaybeVault, fetchTunaConfig, fetchTunaPosition, fetchVault, getAccountsTypeCodec, getAccountsTypeDecoder, getAccountsTypeEncoder, getAddLiquidityFusionDiscriminatorBytes, getAddLiquidityFusionInstruction, getAddLiquidityFusionInstructionDataCodec, getAddLiquidityFusionInstructionDataDecoder, getAddLiquidityFusionInstructionDataEncoder, getAddLiquidityOrcaDiscriminatorBytes, getAddLiquidityOrcaInstruction, getAddLiquidityOrcaInstructionDataCodec, getAddLiquidityOrcaInstructionDataDecoder, getAddLiquidityOrcaInstructionDataEncoder, getClosePositionFusionDiscriminatorBytes, getClosePositionFusionInstruction, getClosePositionFusionInstructionDataCodec, getClosePositionFusionInstructionDataDecoder, getClosePositionFusionInstructionDataEncoder, getClosePositionOrcaDiscriminatorBytes, getClosePositionOrcaInstruction, getClosePositionOrcaInstructionDataCodec, getClosePositionOrcaInstructionDataDecoder, getClosePositionOrcaInstructionDataEncoder, getCollectAndCompoundFeesFusionDiscriminatorBytes, getCollectAndCompoundFeesFusionInstruction, getCollectAndCompoundFeesFusionInstructionDataCodec, getCollectAndCompoundFeesFusionInstructionDataDecoder, getCollectAndCompoundFeesFusionInstructionDataEncoder, getCollectAndCompoundFeesOrcaDiscriminatorBytes, getCollectAndCompoundFeesOrcaInstruction, getCollectAndCompoundFeesOrcaInstructionDataCodec, getCollectAndCompoundFeesOrcaInstructionDataDecoder, getCollectAndCompoundFeesOrcaInstructionDataEncoder, getCollectFeesFusionDiscriminatorBytes, getCollectFeesFusionInstruction, getCollectFeesFusionInstructionDataCodec, getCollectFeesFusionInstructionDataDecoder, getCollectFeesFusionInstructionDataEncoder, getCollectFeesOrcaDiscriminatorBytes, getCollectFeesOrcaInstruction, getCollectFeesOrcaInstructionDataCodec, getCollectFeesOrcaInstructionDataDecoder, getCollectFeesOrcaInstructionDataEncoder, getCollectRewardOrcaDiscriminatorBytes, getCollectRewardOrcaInstruction, getCollectRewardOrcaInstructionDataCodec, getCollectRewardOrcaInstructionDataDecoder, getCollectRewardOrcaInstructionDataEncoder, getCreateAtaInstruction, getCreateAtaInstructions, getCreateMarketDiscriminatorBytes, getCreateMarketInstruction, getCreateMarketInstructionDataCodec, getCreateMarketInstructionDataDecoder, getCreateMarketInstructionDataEncoder, getCreateTunaConfigDiscriminatorBytes, getCreateTunaConfigInstruction, getCreateTunaConfigInstructionDataCodec, getCreateTunaConfigInstructionDataDecoder, getCreateTunaConfigInstructionDataEncoder, getCreateVaultDiscriminatorBytes, getCreateVaultInstruction, getCreateVaultInstructionDataCodec, getCreateVaultInstructionDataDecoder, getCreateVaultInstructionDataEncoder, getDepositDiscriminatorBytes, getDepositInstruction, getDepositInstructionDataCodec, getDepositInstructionDataDecoder, getDepositInstructionDataEncoder, getLendingPositionAddress, getLendingPositionCodec, getLendingPositionDecoder, getLendingPositionDiscriminatorBytes, getLendingPositionEncoder, getLendingPositionSize, getLendingVaultAddress, getLiquidatePositionFusionDiscriminatorBytes, getLiquidatePositionFusionInstruction, getLiquidatePositionFusionInstructionDataCodec, getLiquidatePositionFusionInstructionDataDecoder, getLiquidatePositionFusionInstructionDataEncoder, getLiquidatePositionOrcaDiscriminatorBytes, getLiquidatePositionOrcaInstruction, getLiquidatePositionOrcaInstructionDataCodec, getLiquidatePositionOrcaInstructionDataDecoder, getLiquidatePositionOrcaInstructionDataEncoder, getLiquidityIncreaseQuote, getMarketAddress, getMarketCodec, getMarketDecoder, getMarketDiscriminatorBytes, getMarketEncoder, getMarketMakerCodec, getMarketMakerDecoder, getMarketMakerEncoder, getMarketSize, getOpenLendingPositionDiscriminatorBytes, getOpenLendingPositionInstruction, getOpenLendingPositionInstructionDataCodec, getOpenLendingPositionInstructionDataDecoder, getOpenLendingPositionInstructionDataEncoder, getOpenPositionFusionDiscriminatorBytes, getOpenPositionFusionInstruction, getOpenPositionFusionInstructionDataCodec, getOpenPositionFusionInstructionDataDecoder, getOpenPositionFusionInstructionDataEncoder, getOpenPositionOrcaDiscriminatorBytes, getOpenPositionOrcaInstruction, getOpenPositionOrcaInstructionDataCodec, getOpenPositionOrcaInstructionDataDecoder, getOpenPositionOrcaInstructionDataEncoder, getOpenPositionWithLiquidityFusionDiscriminatorBytes, getOpenPositionWithLiquidityFusionInstruction, getOpenPositionWithLiquidityFusionInstructionDataCodec, getOpenPositionWithLiquidityFusionInstructionDataDecoder, getOpenPositionWithLiquidityFusionInstructionDataEncoder, getOpenPositionWithLiquidityOrcaDiscriminatorBytes, getOpenPositionWithLiquidityOrcaInstruction, getOpenPositionWithLiquidityOrcaInstructionDataCodec, getOpenPositionWithLiquidityOrcaInstructionDataDecoder, getOpenPositionWithLiquidityOrcaInstructionDataEncoder, getRebalancePositionFusionDiscriminatorBytes, getRebalancePositionFusionInstruction, getRebalancePositionFusionInstructionDataCodec, getRebalancePositionFusionInstructionDataDecoder, getRebalancePositionFusionInstructionDataEncoder, getRebalancePositionOrcaDiscriminatorBytes, getRebalancePositionOrcaInstruction, getRebalancePositionOrcaInstructionDataCodec, getRebalancePositionOrcaInstructionDataDecoder, getRebalancePositionOrcaInstructionDataEncoder, getRemainingAccountsInfoCodec, getRemainingAccountsInfoDecoder, getRemainingAccountsInfoEncoder, getRemainingAccountsSliceCodec, getRemainingAccountsSliceDecoder, getRemainingAccountsSliceEncoder, getRemoveLiquidityFusionDiscriminatorBytes, getRemoveLiquidityFusionInstruction, getRemoveLiquidityFusionInstructionDataCodec, getRemoveLiquidityFusionInstructionDataDecoder, getRemoveLiquidityFusionInstructionDataEncoder, getRemoveLiquidityOrcaDiscriminatorBytes, getRemoveLiquidityOrcaInstruction, getRemoveLiquidityOrcaInstructionDataCodec, getRemoveLiquidityOrcaInstructionDataDecoder, getRemoveLiquidityOrcaInstructionDataEncoder, getRepayBadDebtDiscriminatorBytes, getRepayBadDebtInstruction, getRepayBadDebtInstructionDataCodec, getRepayBadDebtInstructionDataDecoder, getRepayBadDebtInstructionDataEncoder, getRepayDebtDiscriminatorBytes, getRepayDebtInstruction, getRepayDebtInstructionDataCodec, getRepayDebtInstructionDataDecoder, getRepayDebtInstructionDataEncoder, getSetAdminAuthorityDiscriminatorBytes, getSetAdminAuthorityInstruction, getSetAdminAuthorityInstructionDataCodec, getSetAdminAuthorityInstructionDataDecoder, getSetAdminAuthorityInstructionDataEncoder, getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes, getSetDefaultMaxPercentageOfLeftoversInstruction, getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec, getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder, getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder, getSetDefaultMaxSwapSlippageDiscriminatorBytes, getSetDefaultMaxSwapSlippageInstruction, getSetDefaultMaxSwapSlippageInstructionDataCodec, getSetDefaultMaxSwapSlippageInstructionDataDecoder, getSetDefaultMaxSwapSlippageInstructionDataEncoder, getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes, getSetDefaultOraclePriceDeviationThresholdInstruction, getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec, getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder, getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder, getSetFeeRecipientDiscriminatorBytes, getSetFeeRecipientInstruction, getSetFeeRecipientInstructionDataCodec, getSetFeeRecipientInstructionDataDecoder, getSetFeeRecipientInstructionDataEncoder, getSetLimitOrdersDiscriminatorBytes, getSetLimitOrdersInstruction, getSetLimitOrdersInstructionDataCodec, getSetLimitOrdersInstructionDataDecoder, getSetLimitOrdersInstructionDataEncoder, getSetLiquidatorAuthorityDiscriminatorBytes, getSetLiquidatorAuthorityInstruction, getSetLiquidatorAuthorityInstructionDataCodec, getSetLiquidatorAuthorityInstructionDataDecoder, getSetLiquidatorAuthorityInstructionDataEncoder, getSetOwnerAuthorityDiscriminatorBytes, getSetOwnerAuthorityInstruction, getSetOwnerAuthorityInstructionDataCodec, getSetOwnerAuthorityInstructionDataDecoder, getSetOwnerAuthorityInstructionDataEncoder, getSetSuspendedStateDiscriminatorBytes, getSetSuspendedStateInstruction, getSetSuspendedStateInstructionDataCodec, getSetSuspendedStateInstructionDataDecoder, getSetSuspendedStateInstructionDataEncoder, getSetTunaPositionFlagsDiscriminatorBytes, getSetTunaPositionFlagsInstruction, getSetTunaPositionFlagsInstructionDataCodec, getSetTunaPositionFlagsInstructionDataDecoder, getSetTunaPositionFlagsInstructionDataEncoder, getSetTunaPositionRebalanceThresholdDiscriminatorBytes, getSetTunaPositionRebalanceThresholdInstruction, getSetTunaPositionRebalanceThresholdInstructionDataCodec, getSetTunaPositionRebalanceThresholdInstructionDataDecoder, getSetTunaPositionRebalanceThresholdInstructionDataEncoder, getTunaConfigAddress, getTunaConfigCodec, getTunaConfigDecoder, getTunaConfigDiscriminatorBytes, getTunaConfigEncoder, getTunaConfigSize, getTunaErrorMessage, getTunaPositionAddress, getTunaPositionCodec, getTunaPositionDecoder, getTunaPositionDiscriminatorBytes, getTunaPositionEncoder, getTunaPositionSize, getTunaPositionStateCodec, getTunaPositionStateDecoder, getTunaPositionStateEncoder, getUpdateMarketDiscriminatorBytes, getUpdateMarketInstruction, getUpdateMarketInstructionDataCodec, getUpdateMarketInstructionDataDecoder, getUpdateMarketInstructionDataEncoder, getUpdateVaultDiscriminatorBytes, getUpdateVaultInstruction, getUpdateVaultInstructionDataCodec, getUpdateVaultInstructionDataDecoder, getUpdateVaultInstructionDataEncoder, getVaultCodec, getVaultDecoder, getVaultDiscriminatorBytes, getVaultEncoder, getVaultSize, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyTunaAccount, identifyTunaInstruction, isTunaError, lendingPositionAuthorityFilter, lendingPositionMintFilter, liquidatePositionFusionInstruction, liquidatePositionFusionInstructions, liquidatePositionOrcaInstruction, liquidatePositionOrcaInstructions, openLendingPositionAndDepositInstructions, openLendingPositionInstruction, openPositionFusionInstruction, openPositionOrcaInstruction, openPositionWithLiquidityFusionInstruction, openPositionWithLiquidityFusionInstructions, openPositionWithLiquidityOrcaInstruction, openPositionWithLiquidityOrcaInstructions, parseAddLiquidityFusionInstruction, parseAddLiquidityOrcaInstruction, parseClosePositionFusionInstruction, parseClosePositionOrcaInstruction, parseCollectAndCompoundFeesFusionInstruction, parseCollectAndCompoundFeesOrcaInstruction, parseCollectFeesFusionInstruction, parseCollectFeesOrcaInstruction, parseCollectRewardOrcaInstruction, parseCreateMarketInstruction, parseCreateTunaConfigInstruction, parseCreateVaultInstruction, parseDepositInstruction, parseLiquidatePositionFusionInstruction, parseLiquidatePositionOrcaInstruction, parseOpenLendingPositionInstruction, parseOpenPositionFusionInstruction, parseOpenPositionOrcaInstruction, parseOpenPositionWithLiquidityFusionInstruction, parseOpenPositionWithLiquidityOrcaInstruction, parseRebalancePositionFusionInstruction, parseRebalancePositionOrcaInstruction, parseRemoveLiquidityFusionInstruction, parseRemoveLiquidityOrcaInstruction, parseRepayBadDebtInstruction, parseRepayDebtInstruction, parseSetAdminAuthorityInstruction, parseSetDefaultMaxPercentageOfLeftoversInstruction, parseSetDefaultMaxSwapSlippageInstruction, parseSetDefaultOraclePriceDeviationThresholdInstruction, parseSetFeeRecipientInstruction, parseSetLimitOrdersInstruction, parseSetLiquidatorAuthorityInstruction, parseSetOwnerAuthorityInstruction, parseSetSuspendedStateInstruction, parseSetTunaPositionFlagsInstruction, parseSetTunaPositionRebalanceThresholdInstruction, parseUpdateMarketInstruction, parseUpdateVaultInstruction, parseWithdrawInstruction, rebalancePositionFusionInstruction, rebalancePositionFusionInstructions, rebalancePositionOrcaInstruction, rebalancePositionOrcaInstructions, removeLiquidityFusionInstruction, removeLiquidityFusionInstructions, removeLiquidityOrcaInstruction, removeLiquidityOrcaInstructions, repayBadDebtInstruction, repayDebtInstruction, repayDebtInstructions, setLimitOrdersInstruction, tunaPositionAuthorityFilter, tunaPositionMarketMakerFilter, tunaPositionMintAFilter, tunaPositionMintBFilter, tunaPositionMintFilter, tunaPositionPoolFilter, updateMarketInstruction, updateVaultInstruction, withdrawInstruction, withdrawInstructions };
4849
+ export { ADD_LIQUIDITY_FUSION_DISCRIMINATOR, ADD_LIQUIDITY_ORCA_DISCRIMINATOR, AccountsType, type AccountsTypeArgs, type AddLiquidityFusionInput, type AddLiquidityFusionInstruction, type AddLiquidityFusionInstructionData, type AddLiquidityFusionInstructionDataArgs, type AddLiquidityFusionInstructionsArgs, type AddLiquidityOrcaInput, type AddLiquidityOrcaInstruction, type AddLiquidityOrcaInstructionData, type AddLiquidityOrcaInstructionDataArgs, type AddLiquidityOrcaInstructionsArgs, CLOSE_POSITION_FUSION_DISCRIMINATOR, CLOSE_POSITION_ORCA_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_FUSION_DISCRIMINATOR, COLLECT_AND_COMPOUND_FEES_ORCA_DISCRIMINATOR, COLLECT_FEES_FUSION_DISCRIMINATOR, COLLECT_FEES_ORCA_DISCRIMINATOR, COLLECT_REWARD_ORCA_DISCRIMINATOR, COMPUTED_AMOUNT, CREATE_MARKET_DISCRIMINATOR, CREATE_TUNA_CONFIG_DISCRIMINATOR, CREATE_VAULT_DISCRIMINATOR, type ClosePositionFusionInput, type ClosePositionFusionInstruction, type ClosePositionFusionInstructionData, type ClosePositionFusionInstructionDataArgs, type ClosePositionOrcaInput, type ClosePositionOrcaInstruction, type ClosePositionOrcaInstructionData, type ClosePositionOrcaInstructionDataArgs, type ClosePositionWithLiquidityFusionInstructionArgs, type ClosePositionWithLiquidityOrcaInstructionArgs, type CollectAndCompoundFeesFusionInput, type CollectAndCompoundFeesFusionInstruction, type CollectAndCompoundFeesFusionInstructionData, type CollectAndCompoundFeesFusionInstructionDataArgs, type CollectAndCompoundFeesOrcaInput, type CollectAndCompoundFeesOrcaInstruction, type CollectAndCompoundFeesOrcaInstructionData, type CollectAndCompoundFeesOrcaInstructionDataArgs, type CollectFeesFusionInput, type CollectFeesFusionInstruction, type CollectFeesFusionInstructionData, type CollectFeesFusionInstructionDataArgs, type CollectFeesOrcaInput, type CollectFeesOrcaInstruction, type CollectFeesOrcaInstructionData, type CollectFeesOrcaInstructionDataArgs, type CollectRewardOrcaInput, type CollectRewardOrcaInstruction, type CollectRewardOrcaInstructionData, type CollectRewardOrcaInstructionDataArgs, type CreateAddressLookupTableResult, type CreateMarketInput, type CreateMarketInstruction, type CreateMarketInstructionData, type CreateMarketInstructionDataArgs, type CreateTunaConfigInput, type CreateTunaConfigInstruction, type CreateTunaConfigInstructionData, type CreateTunaConfigInstructionDataArgs, type CreateVaultInput, type CreateVaultInstruction, type CreateVaultInstructionData, type CreateVaultInstructionDataArgs, DEFAULT_ADDRESS, DEFAULT_MAX_AMOUNT_SLIPPAGE, DEFAULT_MAX_SWAP_SLIPPAGE, DEPOSIT_DISCRIMINATOR, type DepositInput, type DepositInstruction, type DepositInstructionData, type DepositInstructionDataArgs, FusionUtils, HUNDRED_PERCENT, type IncreaseLiquidityQuoteArgs, type IncreaseLiquidityQuoteResult, LENDING_POSITION_DISCRIMINATOR, LEVERAGE_ONE, LIQUIDATE_POSITION_FUSION_DISCRIMINATOR, LIQUIDATE_POSITION_ORCA_DISCRIMINATOR, type LendingPosition, type LendingPositionArgs, type LiquidatePositionFusionInput, type LiquidatePositionFusionInstruction, type LiquidatePositionFusionInstructionData, type LiquidatePositionFusionInstructionDataArgs, type LiquidatePositionOrcaInput, type LiquidatePositionOrcaInstruction, type LiquidatePositionOrcaInstructionData, type LiquidatePositionOrcaInstructionDataArgs, MARKET_DISCRIMINATOR, MAX_LEVERAGE, MAX_LIMIT_ORDER_EXECUTION_FEE, MAX_LIQUIDATION_FEE, MAX_LIQUIDATION_THRESHOLD, MAX_PROTOCOL_FEE, type Market, type MarketArgs, MarketMaker, type MarketMakerArgs, NATIVE_MINT, NO_STOP_LOSS, NO_TAKE_PROFIT, OPEN_LENDING_POSITION_DISCRIMINATOR, OPEN_POSITION_FUSION_DISCRIMINATOR, OPEN_POSITION_ORCA_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_FUSION_DISCRIMINATOR, OPEN_POSITION_WITH_LIQUIDITY_ORCA_DISCRIMINATOR, type OpenLendingPositionInput, type OpenLendingPositionInstruction, type OpenLendingPositionInstructionData, type OpenLendingPositionInstructionDataArgs, type OpenPositionFusionInput, type OpenPositionFusionInstruction, type OpenPositionFusionInstructionData, type OpenPositionFusionInstructionDataArgs, type OpenPositionOrcaInput, type OpenPositionOrcaInstruction, type OpenPositionOrcaInstructionData, type OpenPositionOrcaInstructionDataArgs, type OpenPositionWithLiquidityFusion, type OpenPositionWithLiquidityFusionInput, type OpenPositionWithLiquidityFusionInstruction, type OpenPositionWithLiquidityFusionInstructionData, type OpenPositionWithLiquidityFusionInstructionDataArgs, type OpenPositionWithLiquidityFusionInstructionsArgs, type OpenPositionWithLiquidityOrca, type OpenPositionWithLiquidityOrcaInput, type OpenPositionWithLiquidityOrcaInstruction, type OpenPositionWithLiquidityOrcaInstructionData, type OpenPositionWithLiquidityOrcaInstructionDataArgs, type OpenPositionWithLiquidityOrcaInstructionsArgs, OrcaUtils, type ParsedAddLiquidityFusionInstruction, type ParsedAddLiquidityOrcaInstruction, type ParsedClosePositionFusionInstruction, type ParsedClosePositionOrcaInstruction, type ParsedCollectAndCompoundFeesFusionInstruction, type ParsedCollectAndCompoundFeesOrcaInstruction, type ParsedCollectFeesFusionInstruction, type ParsedCollectFeesOrcaInstruction, type ParsedCollectRewardOrcaInstruction, type ParsedCreateMarketInstruction, type ParsedCreateTunaConfigInstruction, type ParsedCreateVaultInstruction, type ParsedDepositInstruction, type ParsedLiquidatePositionFusionInstruction, type ParsedLiquidatePositionOrcaInstruction, type ParsedOpenLendingPositionInstruction, type ParsedOpenPositionFusionInstruction, type ParsedOpenPositionOrcaInstruction, type ParsedOpenPositionWithLiquidityFusionInstruction, type ParsedOpenPositionWithLiquidityOrcaInstruction, type ParsedRebalancePositionFusionInstruction, type ParsedRebalancePositionOrcaInstruction, type ParsedRemoveLiquidityFusionInstruction, type ParsedRemoveLiquidityOrcaInstruction, type ParsedRepayBadDebtInstruction, type ParsedRepayDebtInstruction, type ParsedSetAdminAuthorityInstruction, type ParsedSetDefaultMaxPercentageOfLeftoversInstruction, type ParsedSetDefaultMaxSwapSlippageInstruction, type ParsedSetDefaultOraclePriceDeviationThresholdInstruction, type ParsedSetFeeRecipientInstruction, type ParsedSetLimitOrdersInstruction, type ParsedSetLiquidatorAuthorityInstruction, type ParsedSetOwnerAuthorityInstruction, type ParsedSetSuspendedStateInstruction, type ParsedSetTunaPositionFlagsInstruction, type ParsedSetTunaPositionRebalanceThresholdInstruction, type ParsedTunaInstruction, type ParsedUpdateMarketInstruction, type ParsedUpdateVaultInstruction, type ParsedWithdrawInstruction, REBALANCE_POSITION_FUSION_DISCRIMINATOR, REBALANCE_POSITION_ORCA_DISCRIMINATOR, REMOVE_LIQUIDITY_FUSION_DISCRIMINATOR, REMOVE_LIQUIDITY_ORCA_DISCRIMINATOR, REPAY_BAD_DEBT_DISCRIMINATOR, REPAY_DEBT_DISCRIMINATOR, type RebalancePositionFusion, type RebalancePositionFusionInput, type RebalancePositionFusionInstruction, type RebalancePositionFusionInstructionData, type RebalancePositionFusionInstructionDataArgs, type RebalancePositionOrca, type RebalancePositionOrcaInput, type RebalancePositionOrcaInstruction, type RebalancePositionOrcaInstructionData, type RebalancePositionOrcaInstructionDataArgs, type RemainingAccountsInfo, type RemainingAccountsInfoArgs, type RemainingAccountsSlice, type RemainingAccountsSliceArgs, type RemoveLiquidityFusionInput, type RemoveLiquidityFusionInstruction, type RemoveLiquidityFusionInstructionData, type RemoveLiquidityFusionInstructionDataArgs, type RemoveLiquidityFusionInstructionsArgs, type RemoveLiquidityOrcaInput, type RemoveLiquidityOrcaInstruction, type RemoveLiquidityOrcaInstructionData, type RemoveLiquidityOrcaInstructionDataArgs, type RemoveLiquidityOrcaInstructionsArgs, type RepayBadDebtInput, type RepayBadDebtInstruction, type RepayBadDebtInstructionData, type RepayBadDebtInstructionDataArgs, type RepayDebtInput, type RepayDebtInstruction, type RepayDebtInstructionData, type RepayDebtInstructionDataArgs, SET_ADMIN_AUTHORITY_DISCRIMINATOR, SET_DEFAULT_MAX_PERCENTAGE_OF_LEFTOVERS_DISCRIMINATOR, SET_DEFAULT_MAX_SWAP_SLIPPAGE_DISCRIMINATOR, SET_DEFAULT_ORACLE_PRICE_DEVIATION_THRESHOLD_DISCRIMINATOR, SET_FEE_RECIPIENT_DISCRIMINATOR, SET_LIMIT_ORDERS_DISCRIMINATOR, SET_LIQUIDATOR_AUTHORITY_DISCRIMINATOR, SET_OWNER_AUTHORITY_DISCRIMINATOR, SET_SUSPENDED_STATE_DISCRIMINATOR, SET_TUNA_POSITION_FLAGS_DISCRIMINATOR, SET_TUNA_POSITION_REBALANCE_THRESHOLD_DISCRIMINATOR, type SetAdminAuthorityInput, type SetAdminAuthorityInstruction, type SetAdminAuthorityInstructionData, type SetAdminAuthorityInstructionDataArgs, type SetDefaultMaxPercentageOfLeftoversInput, type SetDefaultMaxPercentageOfLeftoversInstruction, type SetDefaultMaxPercentageOfLeftoversInstructionData, type SetDefaultMaxPercentageOfLeftoversInstructionDataArgs, type SetDefaultMaxSwapSlippageInput, type SetDefaultMaxSwapSlippageInstruction, type SetDefaultMaxSwapSlippageInstructionData, type SetDefaultMaxSwapSlippageInstructionDataArgs, type SetDefaultOraclePriceDeviationThresholdInput, type SetDefaultOraclePriceDeviationThresholdInstruction, type SetDefaultOraclePriceDeviationThresholdInstructionData, type SetDefaultOraclePriceDeviationThresholdInstructionDataArgs, type SetFeeRecipientInput, type SetFeeRecipientInstruction, type SetFeeRecipientInstructionData, type SetFeeRecipientInstructionDataArgs, type SetLimitOrdersInput, type SetLimitOrdersInstruction, type SetLimitOrdersInstructionData, type SetLimitOrdersInstructionDataArgs, type SetLiquidatorAuthorityInput, type SetLiquidatorAuthorityInstruction, type SetLiquidatorAuthorityInstructionData, type SetLiquidatorAuthorityInstructionDataArgs, type SetOwnerAuthorityInput, type SetOwnerAuthorityInstruction, type SetOwnerAuthorityInstructionData, type SetOwnerAuthorityInstructionDataArgs, type SetSuspendedStateInput, type SetSuspendedStateInstruction, type SetSuspendedStateInstructionData, type SetSuspendedStateInstructionDataArgs, type SetTunaPositionFlagsInput, type SetTunaPositionFlagsInstruction, type SetTunaPositionFlagsInstructionData, type SetTunaPositionFlagsInstructionDataArgs, type SetTunaPositionRebalanceThresholdInput, type SetTunaPositionRebalanceThresholdInstruction, type SetTunaPositionRebalanceThresholdInstructionData, type SetTunaPositionRebalanceThresholdInstructionDataArgs, TUNA_CONFIG_DISCRIMINATOR, TUNA_ERROR__AMOUNT_SLIPPAGE_EXCEEDED, TUNA_ERROR__BAD_DEBT, TUNA_ERROR__INSUFFICIENT_LIQUIDITY, TUNA_ERROR__INTEREST_RATE_IS_OUT_OF_RANGE, TUNA_ERROR__INVALID_ACCOUNT_OWNER, TUNA_ERROR__INVALID_INSTRUCTION_ARGUMENTS, TUNA_ERROR__INVALID_MARKET_MAKER, TUNA_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH, TUNA_ERROR__INVALID_SQRT_PRICE_LIMIT_DIRECTION, TUNA_ERROR__INVALID_TICK_ARRAY_SEQUENCE, TUNA_ERROR__LEFTOVERS_EXCEEDED, TUNA_ERROR__LEVERAGE_IS_OUT_OF_RANGE, TUNA_ERROR__LIMIT_ORDER_EXECUTION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDATION_THRESHOLD_IS_OUT_OF_RANGE, TUNA_ERROR__LIQUIDITY_ZERO, TUNA_ERROR__MARKET_DEBT_LIMIT_EXCEEDED, TUNA_ERROR__MARKET_DISABLED, TUNA_ERROR__MATH_OVERFLOW, TUNA_ERROR__MATH_UNDERFLOW, TUNA_ERROR__NO_EXTRA_ACCOUNTS_FOR_TRANSFER_HOOK, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_EXCEEDED, TUNA_ERROR__ORACLE_PRICE_DEVIATION_THRESHOLD_OUT_OF_RANGE, TUNA_ERROR__ORACLE_STALE_PRICE, TUNA_ERROR__PARTIAL_FILL_ERROR, TUNA_ERROR__POSITION_IS_AUTO_REBALANCEABLE, TUNA_ERROR__POSITION_IS_HEALTHY, TUNA_ERROR__POSITION_IS_LIQUIDATED, TUNA_ERROR__POSITION_IS_UNHEALTHY, TUNA_ERROR__POSITION_NOT_EMPTY, TUNA_ERROR__PROTOCOL_FEE_IS_OUT_OF_RANGE, TUNA_ERROR__REBALANCE_CONDITIONS_NOT_MET, TUNA_ERROR__REMAINING_ACCOUNTS_DUPLICATED_ACCOUNTS_TYPE, TUNA_ERROR__REMAINING_ACCOUNTS_INSUFFICIENT, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE, TUNA_ERROR__REMAINING_ACCOUNTS_INVALID_SLICE_LENGTH, TUNA_ERROR__REQUIRED_REMAINING_ACCOUNT_NOT_PROVIDED, TUNA_ERROR__SOLVER_FAILED_TO_FIND_ROOT, TUNA_ERROR__SQRT_PRICE_OUT_OF_BOUNDS, TUNA_ERROR__SUPPLY_LIMIT_EXCEEDED, TUNA_ERROR__SUSPENDED, TUNA_ERROR__SWAP_QUOTE_NOT_EQUAL_TO_ACTUAL_SWAP_AMOUNT, TUNA_ERROR__SWAP_SLIPPAGE_EXCEEDED, TUNA_ERROR__SWAP_SLIPPAGE_IS_OUT_OF_RANGE, TUNA_ERROR__SWAP_TO_POSITION_RATIO_ESTIMATION_FAILED, TUNA_ERROR__TICK_INDEX_OF_BOUNDS, TUNA_ERROR__TRANSFER_FEE_CALCULATION_ERROR, TUNA_ERROR__TYPE_CAST_OVERFLOW, TUNA_ERROR__UNABLE_TO_DESERIALIZE_ACCOUNT_DATA, TUNA_ERROR__UNABLE_TO_LOAD_ACCOUNT_DATA, TUNA_ERROR__UNEXPECTED_VALUE, TUNA_ERROR__UNSUPPORTED_TOKEN_MINT, TUNA_ERROR__VAULT_NOT_INITIALIZED, TUNA_ERROR__WITHDRAW_REQUEST_EXCEEDS_USER_BALANCE, TUNA_ERROR__ZERO_PRICE_RANGE, TUNA_ERROR__ZERO_TRADABLE_AMOUNT, TUNA_ERROR__ZERO_YIELD, TUNA_POSITION_DISCRIMINATOR, TUNA_POSITION_FLAGS_ALLOW_REBALANCING, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD, TUNA_POSITION_FLAGS_AUTO_COMPOUND_YIELD_WITH_LEVERAGE, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_STOP_LOSS_SWAP_TO_TOKEN_B, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_A, TUNA_POSITION_FLAGS_TAKE_PROFIT_SWAP_TO_TOKEN_B, TUNA_PROGRAM_ADDRESS, TunaAccount, type TunaConfig, type TunaConfigArgs, type TunaError, TunaInstruction, type TunaPosition, type TunaPositionArgs, TunaPositionState, type TunaPositionStateArgs, UPDATE_MARKET_DISCRIMINATOR, UPDATE_VAULT_DISCRIMINATOR, type UpdateMarketInput, type UpdateMarketInstruction, type UpdateMarketInstructionData, type UpdateMarketInstructionDataArgs, type UpdateVaultInput, type UpdateVaultInstruction, type UpdateVaultInstructionData, type UpdateVaultInstructionDataArgs, VAULT_DISCRIMINATOR, type Vault, type VaultArgs, WITHDRAW_DISCRIMINATOR, WP_NFT_UPDATE_AUTH, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, addLiquidityFusionInstruction, addLiquidityFusionInstructions, addLiquidityOrcaInstruction, addLiquidityOrcaInstructions, calculateProtocolFee, closePositionFusionInstruction, closePositionOrcaInstruction, closePositionWithLiquidityFusionInstructions, closePositionWithLiquidityOrcaInstructions, collectAndCompoundFeesFusionInstruction, collectAndCompoundFeesFusionInstructions, collectAndCompoundFeesOrcaInstruction, collectAndCompoundFeesOrcaInstructions, collectFeesFusionInstruction, collectFeesFusionInstructions, collectFeesOrcaInstruction, collectFeesOrcaInstructions, createAddressLookupTableForMarketInstructions, createAddressLookupTableInstructions, createMarketInstruction, createTunaConfigInstruction, createVaultInstructions, decodeLendingPosition, decodeMarket, decodeTunaConfig, decodeTunaPosition, decodeVault, depositInstruction, depositInstructions, fetchAllLendingPosition, fetchAllLendingPositionWithFilter, fetchAllMarket, fetchAllMaybeLendingPosition, fetchAllMaybeMarket, fetchAllMaybeTunaConfig, fetchAllMaybeTunaPosition, fetchAllMaybeVault, fetchAllTunaConfig, fetchAllTunaPosition, fetchAllTunaPositionWithFilter, fetchAllVault, fetchLendingPosition, fetchMarket, fetchMaybeLendingPosition, fetchMaybeMarket, fetchMaybeTunaConfig, fetchMaybeTunaPosition, fetchMaybeVault, fetchTunaConfig, fetchTunaPosition, fetchVault, getAccountsTypeCodec, getAccountsTypeDecoder, getAccountsTypeEncoder, getAddLiquidityFusionDiscriminatorBytes, getAddLiquidityFusionInstruction, getAddLiquidityFusionInstructionDataCodec, getAddLiquidityFusionInstructionDataDecoder, getAddLiquidityFusionInstructionDataEncoder, getAddLiquidityOrcaDiscriminatorBytes, getAddLiquidityOrcaInstruction, getAddLiquidityOrcaInstructionDataCodec, getAddLiquidityOrcaInstructionDataDecoder, getAddLiquidityOrcaInstructionDataEncoder, getClosePositionFusionDiscriminatorBytes, getClosePositionFusionInstruction, getClosePositionFusionInstructionDataCodec, getClosePositionFusionInstructionDataDecoder, getClosePositionFusionInstructionDataEncoder, getClosePositionOrcaDiscriminatorBytes, getClosePositionOrcaInstruction, getClosePositionOrcaInstructionDataCodec, getClosePositionOrcaInstructionDataDecoder, getClosePositionOrcaInstructionDataEncoder, getCollectAndCompoundFeesFusionDiscriminatorBytes, getCollectAndCompoundFeesFusionInstruction, getCollectAndCompoundFeesFusionInstructionDataCodec, getCollectAndCompoundFeesFusionInstructionDataDecoder, getCollectAndCompoundFeesFusionInstructionDataEncoder, getCollectAndCompoundFeesOrcaDiscriminatorBytes, getCollectAndCompoundFeesOrcaInstruction, getCollectAndCompoundFeesOrcaInstructionDataCodec, getCollectAndCompoundFeesOrcaInstructionDataDecoder, getCollectAndCompoundFeesOrcaInstructionDataEncoder, getCollectFeesFusionDiscriminatorBytes, getCollectFeesFusionInstruction, getCollectFeesFusionInstructionDataCodec, getCollectFeesFusionInstructionDataDecoder, getCollectFeesFusionInstructionDataEncoder, getCollectFeesOrcaDiscriminatorBytes, getCollectFeesOrcaInstruction, getCollectFeesOrcaInstructionDataCodec, getCollectFeesOrcaInstructionDataDecoder, getCollectFeesOrcaInstructionDataEncoder, getCollectRewardOrcaDiscriminatorBytes, getCollectRewardOrcaInstruction, getCollectRewardOrcaInstructionDataCodec, getCollectRewardOrcaInstructionDataDecoder, getCollectRewardOrcaInstructionDataEncoder, getCreateAtaInstruction, getCreateAtaInstructions, getCreateMarketDiscriminatorBytes, getCreateMarketInstruction, getCreateMarketInstructionDataCodec, getCreateMarketInstructionDataDecoder, getCreateMarketInstructionDataEncoder, getCreateTunaConfigDiscriminatorBytes, getCreateTunaConfigInstruction, getCreateTunaConfigInstructionDataCodec, getCreateTunaConfigInstructionDataDecoder, getCreateTunaConfigInstructionDataEncoder, getCreateVaultDiscriminatorBytes, getCreateVaultInstruction, getCreateVaultInstructionDataCodec, getCreateVaultInstructionDataDecoder, getCreateVaultInstructionDataEncoder, getDepositDiscriminatorBytes, getDepositInstruction, getDepositInstructionDataCodec, getDepositInstructionDataDecoder, getDepositInstructionDataEncoder, getLendingPositionAddress, getLendingPositionCodec, getLendingPositionDecoder, getLendingPositionDiscriminatorBytes, getLendingPositionEncoder, getLendingPositionSize, getLendingVaultAddress, getLiquidatePositionFusionDiscriminatorBytes, getLiquidatePositionFusionInstruction, getLiquidatePositionFusionInstructionDataCodec, getLiquidatePositionFusionInstructionDataDecoder, getLiquidatePositionFusionInstructionDataEncoder, getLiquidatePositionOrcaDiscriminatorBytes, getLiquidatePositionOrcaInstruction, getLiquidatePositionOrcaInstructionDataCodec, getLiquidatePositionOrcaInstructionDataDecoder, getLiquidatePositionOrcaInstructionDataEncoder, getLiquidityIncreaseQuote, getMarketAddress, getMarketCodec, getMarketDecoder, getMarketDiscriminatorBytes, getMarketEncoder, getMarketMakerCodec, getMarketMakerDecoder, getMarketMakerEncoder, getMarketSize, getOpenLendingPositionDiscriminatorBytes, getOpenLendingPositionInstruction, getOpenLendingPositionInstructionDataCodec, getOpenLendingPositionInstructionDataDecoder, getOpenLendingPositionInstructionDataEncoder, getOpenPositionFusionDiscriminatorBytes, getOpenPositionFusionInstruction, getOpenPositionFusionInstructionDataCodec, getOpenPositionFusionInstructionDataDecoder, getOpenPositionFusionInstructionDataEncoder, getOpenPositionOrcaDiscriminatorBytes, getOpenPositionOrcaInstruction, getOpenPositionOrcaInstructionDataCodec, getOpenPositionOrcaInstructionDataDecoder, getOpenPositionOrcaInstructionDataEncoder, getOpenPositionWithLiquidityFusionDiscriminatorBytes, getOpenPositionWithLiquidityFusionInstruction, getOpenPositionWithLiquidityFusionInstructionDataCodec, getOpenPositionWithLiquidityFusionInstructionDataDecoder, getOpenPositionWithLiquidityFusionInstructionDataEncoder, getOpenPositionWithLiquidityOrcaDiscriminatorBytes, getOpenPositionWithLiquidityOrcaInstruction, getOpenPositionWithLiquidityOrcaInstructionDataCodec, getOpenPositionWithLiquidityOrcaInstructionDataDecoder, getOpenPositionWithLiquidityOrcaInstructionDataEncoder, getRebalancePositionFusionDiscriminatorBytes, getRebalancePositionFusionInstruction, getRebalancePositionFusionInstructionDataCodec, getRebalancePositionFusionInstructionDataDecoder, getRebalancePositionFusionInstructionDataEncoder, getRebalancePositionOrcaDiscriminatorBytes, getRebalancePositionOrcaInstruction, getRebalancePositionOrcaInstructionDataCodec, getRebalancePositionOrcaInstructionDataDecoder, getRebalancePositionOrcaInstructionDataEncoder, getRemainingAccountsInfoCodec, getRemainingAccountsInfoDecoder, getRemainingAccountsInfoEncoder, getRemainingAccountsSliceCodec, getRemainingAccountsSliceDecoder, getRemainingAccountsSliceEncoder, getRemoveLiquidityFusionDiscriminatorBytes, getRemoveLiquidityFusionInstruction, getRemoveLiquidityFusionInstructionDataCodec, getRemoveLiquidityFusionInstructionDataDecoder, getRemoveLiquidityFusionInstructionDataEncoder, getRemoveLiquidityOrcaDiscriminatorBytes, getRemoveLiquidityOrcaInstruction, getRemoveLiquidityOrcaInstructionDataCodec, getRemoveLiquidityOrcaInstructionDataDecoder, getRemoveLiquidityOrcaInstructionDataEncoder, getRepayBadDebtDiscriminatorBytes, getRepayBadDebtInstruction, getRepayBadDebtInstructionDataCodec, getRepayBadDebtInstructionDataDecoder, getRepayBadDebtInstructionDataEncoder, getRepayDebtDiscriminatorBytes, getRepayDebtInstruction, getRepayDebtInstructionDataCodec, getRepayDebtInstructionDataDecoder, getRepayDebtInstructionDataEncoder, getSetAdminAuthorityDiscriminatorBytes, getSetAdminAuthorityInstruction, getSetAdminAuthorityInstructionDataCodec, getSetAdminAuthorityInstructionDataDecoder, getSetAdminAuthorityInstructionDataEncoder, getSetDefaultMaxPercentageOfLeftoversDiscriminatorBytes, getSetDefaultMaxPercentageOfLeftoversInstruction, getSetDefaultMaxPercentageOfLeftoversInstructionDataCodec, getSetDefaultMaxPercentageOfLeftoversInstructionDataDecoder, getSetDefaultMaxPercentageOfLeftoversInstructionDataEncoder, getSetDefaultMaxSwapSlippageDiscriminatorBytes, getSetDefaultMaxSwapSlippageInstruction, getSetDefaultMaxSwapSlippageInstructionDataCodec, getSetDefaultMaxSwapSlippageInstructionDataDecoder, getSetDefaultMaxSwapSlippageInstructionDataEncoder, getSetDefaultOraclePriceDeviationThresholdDiscriminatorBytes, getSetDefaultOraclePriceDeviationThresholdInstruction, getSetDefaultOraclePriceDeviationThresholdInstructionDataCodec, getSetDefaultOraclePriceDeviationThresholdInstructionDataDecoder, getSetDefaultOraclePriceDeviationThresholdInstructionDataEncoder, getSetFeeRecipientDiscriminatorBytes, getSetFeeRecipientInstruction, getSetFeeRecipientInstructionDataCodec, getSetFeeRecipientInstructionDataDecoder, getSetFeeRecipientInstructionDataEncoder, getSetLimitOrdersDiscriminatorBytes, getSetLimitOrdersInstruction, getSetLimitOrdersInstructionDataCodec, getSetLimitOrdersInstructionDataDecoder, getSetLimitOrdersInstructionDataEncoder, getSetLiquidatorAuthorityDiscriminatorBytes, getSetLiquidatorAuthorityInstruction, getSetLiquidatorAuthorityInstructionDataCodec, getSetLiquidatorAuthorityInstructionDataDecoder, getSetLiquidatorAuthorityInstructionDataEncoder, getSetOwnerAuthorityDiscriminatorBytes, getSetOwnerAuthorityInstruction, getSetOwnerAuthorityInstructionDataCodec, getSetOwnerAuthorityInstructionDataDecoder, getSetOwnerAuthorityInstructionDataEncoder, getSetSuspendedStateDiscriminatorBytes, getSetSuspendedStateInstruction, getSetSuspendedStateInstructionDataCodec, getSetSuspendedStateInstructionDataDecoder, getSetSuspendedStateInstructionDataEncoder, getSetTunaPositionFlagsDiscriminatorBytes, getSetTunaPositionFlagsInstruction, getSetTunaPositionFlagsInstructionDataCodec, getSetTunaPositionFlagsInstructionDataDecoder, getSetTunaPositionFlagsInstructionDataEncoder, getSetTunaPositionRebalanceThresholdDiscriminatorBytes, getSetTunaPositionRebalanceThresholdInstruction, getSetTunaPositionRebalanceThresholdInstructionDataCodec, getSetTunaPositionRebalanceThresholdInstructionDataDecoder, getSetTunaPositionRebalanceThresholdInstructionDataEncoder, getTunaConfigAddress, getTunaConfigCodec, getTunaConfigDecoder, getTunaConfigDiscriminatorBytes, getTunaConfigEncoder, getTunaConfigSize, getTunaErrorMessage, getTunaPositionAddress, getTunaPositionCodec, getTunaPositionDecoder, getTunaPositionDiscriminatorBytes, getTunaPositionEncoder, getTunaPositionSize, getTunaPositionStateCodec, getTunaPositionStateDecoder, getTunaPositionStateEncoder, getUpdateMarketDiscriminatorBytes, getUpdateMarketInstruction, getUpdateMarketInstructionDataCodec, getUpdateMarketInstructionDataDecoder, getUpdateMarketInstructionDataEncoder, getUpdateVaultDiscriminatorBytes, getUpdateVaultInstruction, getUpdateVaultInstructionDataCodec, getUpdateVaultInstructionDataDecoder, getUpdateVaultInstructionDataEncoder, getVaultCodec, getVaultDecoder, getVaultDiscriminatorBytes, getVaultEncoder, getVaultSize, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyTunaAccount, identifyTunaInstruction, isTunaError, lendingPositionAuthorityFilter, lendingPositionMintFilter, liquidatePositionFusionInstruction, liquidatePositionFusionInstructions, liquidatePositionOrcaInstruction, liquidatePositionOrcaInstructions, openLendingPositionAndDepositInstructions, openLendingPositionInstruction, openPositionFusionInstruction, openPositionOrcaInstruction, openPositionWithLiquidityFusionInstruction, openPositionWithLiquidityFusionInstructions, openPositionWithLiquidityOrcaInstruction, openPositionWithLiquidityOrcaInstructions, parseAddLiquidityFusionInstruction, parseAddLiquidityOrcaInstruction, parseClosePositionFusionInstruction, parseClosePositionOrcaInstruction, parseCollectAndCompoundFeesFusionInstruction, parseCollectAndCompoundFeesOrcaInstruction, parseCollectFeesFusionInstruction, parseCollectFeesOrcaInstruction, parseCollectRewardOrcaInstruction, parseCreateMarketInstruction, parseCreateTunaConfigInstruction, parseCreateVaultInstruction, parseDepositInstruction, parseLiquidatePositionFusionInstruction, parseLiquidatePositionOrcaInstruction, parseOpenLendingPositionInstruction, parseOpenPositionFusionInstruction, parseOpenPositionOrcaInstruction, parseOpenPositionWithLiquidityFusionInstruction, parseOpenPositionWithLiquidityOrcaInstruction, parseRebalancePositionFusionInstruction, parseRebalancePositionOrcaInstruction, parseRemoveLiquidityFusionInstruction, parseRemoveLiquidityOrcaInstruction, parseRepayBadDebtInstruction, parseRepayDebtInstruction, parseSetAdminAuthorityInstruction, parseSetDefaultMaxPercentageOfLeftoversInstruction, parseSetDefaultMaxSwapSlippageInstruction, parseSetDefaultOraclePriceDeviationThresholdInstruction, parseSetFeeRecipientInstruction, parseSetLimitOrdersInstruction, parseSetLiquidatorAuthorityInstruction, parseSetOwnerAuthorityInstruction, parseSetSuspendedStateInstruction, parseSetTunaPositionFlagsInstruction, parseSetTunaPositionRebalanceThresholdInstruction, parseUpdateMarketInstruction, parseUpdateVaultInstruction, parseWithdrawInstruction, rebalancePositionFusionInstruction, rebalancePositionFusionInstructions, rebalancePositionOrcaInstruction, rebalancePositionOrcaInstructions, removeLiquidityFusionInstruction, removeLiquidityFusionInstructions, removeLiquidityOrcaInstruction, removeLiquidityOrcaInstructions, repayBadDebtInstruction, repayDebtInstruction, repayDebtInstructions, setLimitOrdersInstruction, tunaPositionAuthorityFilter, tunaPositionMarketMakerFilter, tunaPositionMintAFilter, tunaPositionMintBFilter, tunaPositionMintFilter, tunaPositionPoolFilter, updateMarketInstruction, updateVaultInstruction, withdrawInstruction, withdrawInstructions };
package/dist/index.js CHANGED
@@ -9114,13 +9114,28 @@ async function openPositionFusionInstruction(rpc, authority, positionMint, fusio
9114
9114
  var import_whirlpools_client9 = require("@orca-so/whirlpools-client");
9115
9115
  var import_whirlpools_core4 = require("@orca-so/whirlpools-core");
9116
9116
  var import_kit69 = require("@solana/kit");
9117
+ var import_sysvars = require("@solana/sysvars");
9117
9118
  var import_memo10 = require("@solana-program/memo");
9118
9119
  var import_token_202218 = require("@solana-program/token-2022");
9119
9120
  var import_assert13 = __toESM(require("assert"));
9120
- async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positionMint, whirlpoolAddress, args, createInstructions, cleanupInstructions) {
9121
+
9122
+ // src/utils/sysvar.ts
9123
+ var ACCOUNT_STORAGE_OVERHEAD = 128;
9124
+ function calculateMinimumBalanceForRentExemption(rent, dataSize) {
9125
+ const dataSizeForRent = BigInt(dataSize + ACCOUNT_STORAGE_OVERHEAD);
9126
+ const rentLamportsPerYear = rent.lamportsPerByteYear * dataSizeForRent;
9127
+ const minimumBalance = rentLamportsPerYear * BigInt(rent.exemptionThreshold);
9128
+ return minimumBalance;
9129
+ }
9130
+
9131
+ // src/txbuilder/openPositionWithLiquidityOrca.ts
9132
+ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, whirlpoolAddress, args, createInstructions, cleanupInstructions) {
9121
9133
  const instructions = [];
9122
9134
  if (!createInstructions) createInstructions = instructions;
9123
9135
  if (!cleanupInstructions) cleanupInstructions = instructions;
9136
+ const rent = await (0, import_sysvars.fetchSysvarRent)(rpc);
9137
+ let nonRefundableRent = 0n;
9138
+ const positionMint = await (0, import_kit69.generateKeyPairSigner)();
9124
9139
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
9125
9140
  const whirlpool = await (0, import_whirlpools_client9.fetchMaybeWhirlpool)(rpc, whirlpoolAddress);
9126
9141
  if (!whirlpool.exists) throw new Error("Whirlpool account not found");
@@ -9184,24 +9199,34 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
9184
9199
  const [lowerTickArrayAddress] = await (0, import_whirlpools_client9.getTickArrayAddress)(whirlpool.address, lowerTickArrayIndex);
9185
9200
  const upperTickArrayIndex = (0, import_whirlpools_core4.getTickArrayStartTickIndex)(args.tickUpperIndex, whirlpool.data.tickSpacing);
9186
9201
  const [upperTickArrayAddress] = await (0, import_whirlpools_client9.getTickArrayAddress)(whirlpool.address, upperTickArrayIndex);
9187
- instructions.push(
9188
- (0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
9189
- whirlpool: whirlpool.address,
9190
- funder: authority,
9191
- tickArray: lowerTickArrayAddress,
9192
- startTickIndex: lowerTickArrayIndex,
9193
- idempotent: true
9194
- })
9195
- );
9196
- instructions.push(
9197
- (0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
9198
- whirlpool: whirlpool.address,
9199
- funder: authority,
9200
- tickArray: upperTickArrayAddress,
9201
- startTickIndex: upperTickArrayIndex,
9202
- idempotent: true
9203
- })
9204
- );
9202
+ const [lowerTickArray, upperTickArray] = await (0, import_whirlpools_client9.fetchAllMaybeTickArray)(rpc, [
9203
+ lowerTickArrayAddress,
9204
+ upperTickArrayAddress
9205
+ ]);
9206
+ if (!lowerTickArray.exists) {
9207
+ instructions.push(
9208
+ (0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
9209
+ whirlpool: whirlpool.address,
9210
+ funder: authority,
9211
+ tickArray: lowerTickArrayAddress,
9212
+ startTickIndex: lowerTickArrayIndex,
9213
+ idempotent: false
9214
+ })
9215
+ );
9216
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_whirlpools_client9.getDynamicTickArrayMinSize)());
9217
+ }
9218
+ if (!upperTickArray.exists && lowerTickArrayIndex !== upperTickArrayIndex) {
9219
+ instructions.push(
9220
+ (0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
9221
+ whirlpool: whirlpool.address,
9222
+ funder: authority,
9223
+ tickArray: upperTickArrayAddress,
9224
+ startTickIndex: upperTickArrayIndex,
9225
+ idempotent: false
9226
+ })
9227
+ );
9228
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_whirlpools_client9.getDynamicTickArrayMinSize)());
9229
+ }
9205
9230
  const ix = await openPositionWithLiquidityOrcaInstruction(
9206
9231
  authority,
9207
9232
  positionMint,
@@ -9218,7 +9243,11 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
9218
9243
  cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
9219
9244
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
9220
9245
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
9221
- return instructions;
9246
+ return {
9247
+ instructions,
9248
+ positionMint: positionMint.address,
9249
+ initializationCost: (0, import_kit69.lamports)(nonRefundableRent)
9250
+ };
9222
9251
  }
9223
9252
  async function openPositionWithLiquidityOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
9224
9253
  const tunaPositionAddress = (await getTunaPositionAddress(positionMint.address))[0];
@@ -9336,13 +9365,17 @@ async function openPositionWithLiquidityOrcaInstruction(authority, positionMint,
9336
9365
  var import_fusionamm_client10 = require("@crypticdot/fusionamm-client");
9337
9366
  var import_fusionamm_core5 = require("@crypticdot/fusionamm-core");
9338
9367
  var import_kit70 = require("@solana/kit");
9368
+ var import_sysvars2 = require("@solana/sysvars");
9339
9369
  var import_memo11 = require("@solana-program/memo");
9340
9370
  var import_token_202219 = require("@solana-program/token-2022");
9341
9371
  var import_assert14 = __toESM(require("assert"));
9342
- async function openPositionWithLiquidityFusionInstructions(rpc, authority, positionMint, fusionPoolAddress, args, createInstructions, cleanupInstructions) {
9372
+ async function openPositionWithLiquidityFusionInstructions(rpc, authority, fusionPoolAddress, args, createInstructions, cleanupInstructions) {
9343
9373
  const instructions = [];
9344
9374
  if (!createInstructions) createInstructions = instructions;
9345
9375
  if (!cleanupInstructions) cleanupInstructions = instructions;
9376
+ const rent = await (0, import_sysvars2.fetchSysvarRent)(rpc);
9377
+ let nonRefundableRent = 0n;
9378
+ const positionMint = await (0, import_kit70.generateKeyPairSigner)();
9346
9379
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
9347
9380
  const fusionPool = await (0, import_fusionamm_client10.fetchMaybeFusionPool)(rpc, fusionPoolAddress);
9348
9381
  if (!fusionPool.exists) throw new Error("FusionPool account not found");
@@ -9419,6 +9452,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9419
9452
  startTickIndex: lowerTickArrayIndex
9420
9453
  })
9421
9454
  );
9455
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_fusionamm_client10.getTickArraySize)());
9422
9456
  }
9423
9457
  if (!upperTickArray.exists && lowerTickArrayIndex !== upperTickArrayIndex) {
9424
9458
  instructions.push(
@@ -9429,6 +9463,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9429
9463
  startTickIndex: upperTickArrayIndex
9430
9464
  })
9431
9465
  );
9466
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_fusionamm_client10.getTickArraySize)());
9432
9467
  }
9433
9468
  const ix = await openPositionWithLiquidityFusionInstruction(
9434
9469
  authority,
@@ -9446,7 +9481,11 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9446
9481
  cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
9447
9482
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
9448
9483
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
9449
- return instructions;
9484
+ return {
9485
+ instructions,
9486
+ positionMint: positionMint.address,
9487
+ initializationCost: (0, import_kit70.lamports)(nonRefundableRent)
9488
+ };
9450
9489
  }
9451
9490
  async function openPositionWithLiquidityFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
9452
9491
  const tunaPositionAddress = (await getTunaPositionAddress(positionMint.address))[0];
@@ -10221,10 +10260,13 @@ async function repayDebtInstruction(authority, positionMint, mintA, mintB, marke
10221
10260
  // src/txbuilder/rebalancePositionOrca.ts
10222
10261
  var import_whirlpools_client12 = require("@orca-so/whirlpools-client");
10223
10262
  var import_kit74 = require("@solana/kit");
10263
+ var import_sysvars3 = require("@solana/sysvars");
10224
10264
  var import_memo18 = require("@solana-program/memo");
10225
10265
  var import_token_202226 = require("@solana-program/token-2022");
10226
10266
  var import_assert18 = __toESM(require("assert"));
10227
10267
  async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
10268
+ const rent = await (0, import_sysvars3.fetchSysvarRent)(rpc);
10269
+ let nonRefundableRent = 0n;
10228
10270
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
10229
10271
  const tunaPosition = await fetchMaybeTunaPosition(rpc, (await getTunaPositionAddress(positionMint))[0]);
10230
10272
  if (!tunaPosition.exists) throw new Error("Tuna position account not found");
@@ -10242,24 +10284,34 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
10242
10284
  if (!cleanupInstructions) cleanupInstructions = instructions;
10243
10285
  const internalCleanupInstructions = [];
10244
10286
  const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
10245
- instructions.push(
10246
- (0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
10247
- whirlpool: whirlpool.address,
10248
- funder: authority,
10249
- tickArray: secondaryTickArrays.lowerTickArrayAddress,
10250
- startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
10251
- idempotent: true
10252
- })
10253
- );
10254
- instructions.push(
10255
- (0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
10256
- whirlpool: whirlpool.address,
10257
- funder: authority,
10258
- tickArray: secondaryTickArrays.upperTickArrayAddress,
10259
- startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
10260
- idempotent: true
10261
- })
10262
- );
10287
+ const [lowerTickArray, upperTickArray] = await (0, import_whirlpools_client12.fetchAllMaybeTickArray)(rpc, [
10288
+ secondaryTickArrays.lowerTickArrayAddress,
10289
+ secondaryTickArrays.upperTickArrayAddress
10290
+ ]);
10291
+ if (!lowerTickArray.exists) {
10292
+ instructions.push(
10293
+ (0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
10294
+ whirlpool: whirlpool.address,
10295
+ funder: authority,
10296
+ tickArray: secondaryTickArrays.lowerTickArrayAddress,
10297
+ startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
10298
+ idempotent: false
10299
+ })
10300
+ );
10301
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_whirlpools_client12.getDynamicTickArrayMinSize)());
10302
+ }
10303
+ if (!upperTickArray.exists && secondaryTickArrays.lowerTickArrayStartIndex !== secondaryTickArrays.upperTickArrayStartIndex) {
10304
+ instructions.push(
10305
+ (0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
10306
+ whirlpool: whirlpool.address,
10307
+ funder: authority,
10308
+ tickArray: secondaryTickArrays.upperTickArrayAddress,
10309
+ startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
10310
+ idempotent: false
10311
+ })
10312
+ );
10313
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_whirlpools_client12.getDynamicTickArrayMinSize)());
10314
+ }
10263
10315
  const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
10264
10316
  rpc,
10265
10317
  authority,
@@ -10290,7 +10342,10 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
10290
10342
  cleanupInstructions.push(...internalCleanupInstructions);
10291
10343
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
10292
10344
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
10293
- return instructions;
10345
+ return {
10346
+ instructions,
10347
+ initializationCost: (0, import_kit74.lamports)(nonRefundableRent)
10348
+ };
10294
10349
  }
10295
10350
  async function rebalancePositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool) {
10296
10351
  const positionMint = tunaPosition.data.positionMint;
@@ -10389,10 +10444,13 @@ async function rebalancePositionOrcaInstruction(authority, tunaPosition, tunaCon
10389
10444
  // src/txbuilder/rebalancePositionFusion.ts
10390
10445
  var import_fusionamm_client13 = require("@crypticdot/fusionamm-client");
10391
10446
  var import_kit75 = require("@solana/kit");
10447
+ var import_sysvars4 = require("@solana/sysvars");
10392
10448
  var import_memo19 = require("@solana-program/memo");
10393
10449
  var import_token_202227 = require("@solana-program/token-2022");
10394
10450
  var import_assert19 = __toESM(require("assert"));
10395
10451
  async function rebalancePositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
10452
+ const rent = await (0, import_sysvars4.fetchSysvarRent)(rpc);
10453
+ let nonRefundableRent = 0n;
10396
10454
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
10397
10455
  const tunaPosition = await fetchMaybeTunaPosition(rpc, (await getTunaPositionAddress(positionMint))[0]);
10398
10456
  if (!tunaPosition.exists) throw new Error("Tuna position account not found");
@@ -10422,6 +10480,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10422
10480
  startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex
10423
10481
  })
10424
10482
  );
10483
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_fusionamm_client13.getTickArraySize)());
10425
10484
  }
10426
10485
  if (!upperTickArray.exists && secondaryTickArrays.lowerTickArrayStartIndex !== secondaryTickArrays.upperTickArrayStartIndex) {
10427
10486
  instructions.push(
@@ -10432,6 +10491,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10432
10491
  startTickIndex: secondaryTickArrays.upperTickArrayStartIndex
10433
10492
  })
10434
10493
  );
10494
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, (0, import_fusionamm_client13.getTickArraySize)());
10435
10495
  }
10436
10496
  const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
10437
10497
  rpc,
@@ -10462,7 +10522,10 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10462
10522
  instructions.push(ix);
10463
10523
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
10464
10524
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
10465
- return instructions;
10525
+ return {
10526
+ instructions,
10527
+ initializationCost: (0, import_kit75.lamports)(nonRefundableRent)
10528
+ };
10466
10529
  }
10467
10530
  async function rebalancePositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool) {
10468
10531
  const positionMint = tunaPosition.data.positionMint;
package/dist/index.mjs CHANGED
@@ -9305,7 +9305,9 @@ async function openPositionFusionInstruction(rpc, authority, positionMint, fusio
9305
9305
 
9306
9306
  // src/txbuilder/openPositionWithLiquidityOrca.ts
9307
9307
  import {
9308
+ fetchAllMaybeTickArray as fetchAllMaybeTickArray2,
9308
9309
  fetchMaybeWhirlpool as fetchMaybeWhirlpool7,
9310
+ getDynamicTickArrayMinSize,
9309
9311
  getInitializeDynamicTickArrayInstruction as getInitializeDynamicTickArrayInstruction2,
9310
9312
  getOracleAddress as getOracleAddress4,
9311
9313
  getPositionAddress as getPositionAddress15,
@@ -9314,8 +9316,11 @@ import {
9314
9316
  } from "@orca-so/whirlpools-client";
9315
9317
  import { getTickArrayStartTickIndex as getTickArrayStartTickIndex6 } from "@orca-so/whirlpools-core";
9316
9318
  import {
9317
- AccountRole as AccountRole10
9319
+ AccountRole as AccountRole10,
9320
+ generateKeyPairSigner,
9321
+ lamports
9318
9322
  } from "@solana/kit";
9323
+ import { fetchSysvarRent } from "@solana/sysvars";
9319
9324
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS10 } from "@solana-program/memo";
9320
9325
  import {
9321
9326
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS3,
@@ -9324,10 +9329,24 @@ import {
9324
9329
  TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS15
9325
9330
  } from "@solana-program/token-2022";
9326
9331
  import assert13 from "assert";
9327
- async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positionMint, whirlpoolAddress, args, createInstructions, cleanupInstructions) {
9332
+
9333
+ // src/utils/sysvar.ts
9334
+ var ACCOUNT_STORAGE_OVERHEAD = 128;
9335
+ function calculateMinimumBalanceForRentExemption(rent, dataSize) {
9336
+ const dataSizeForRent = BigInt(dataSize + ACCOUNT_STORAGE_OVERHEAD);
9337
+ const rentLamportsPerYear = rent.lamportsPerByteYear * dataSizeForRent;
9338
+ const minimumBalance = rentLamportsPerYear * BigInt(rent.exemptionThreshold);
9339
+ return minimumBalance;
9340
+ }
9341
+
9342
+ // src/txbuilder/openPositionWithLiquidityOrca.ts
9343
+ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, whirlpoolAddress, args, createInstructions, cleanupInstructions) {
9328
9344
  const instructions = [];
9329
9345
  if (!createInstructions) createInstructions = instructions;
9330
9346
  if (!cleanupInstructions) cleanupInstructions = instructions;
9347
+ const rent = await fetchSysvarRent(rpc);
9348
+ let nonRefundableRent = 0n;
9349
+ const positionMint = await generateKeyPairSigner();
9331
9350
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
9332
9351
  const whirlpool = await fetchMaybeWhirlpool7(rpc, whirlpoolAddress);
9333
9352
  if (!whirlpool.exists) throw new Error("Whirlpool account not found");
@@ -9391,24 +9410,34 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
9391
9410
  const [lowerTickArrayAddress] = await getTickArrayAddress6(whirlpool.address, lowerTickArrayIndex);
9392
9411
  const upperTickArrayIndex = getTickArrayStartTickIndex6(args.tickUpperIndex, whirlpool.data.tickSpacing);
9393
9412
  const [upperTickArrayAddress] = await getTickArrayAddress6(whirlpool.address, upperTickArrayIndex);
9394
- instructions.push(
9395
- getInitializeDynamicTickArrayInstruction2({
9396
- whirlpool: whirlpool.address,
9397
- funder: authority,
9398
- tickArray: lowerTickArrayAddress,
9399
- startTickIndex: lowerTickArrayIndex,
9400
- idempotent: true
9401
- })
9402
- );
9403
- instructions.push(
9404
- getInitializeDynamicTickArrayInstruction2({
9405
- whirlpool: whirlpool.address,
9406
- funder: authority,
9407
- tickArray: upperTickArrayAddress,
9408
- startTickIndex: upperTickArrayIndex,
9409
- idempotent: true
9410
- })
9411
- );
9413
+ const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray2(rpc, [
9414
+ lowerTickArrayAddress,
9415
+ upperTickArrayAddress
9416
+ ]);
9417
+ if (!lowerTickArray.exists) {
9418
+ instructions.push(
9419
+ getInitializeDynamicTickArrayInstruction2({
9420
+ whirlpool: whirlpool.address,
9421
+ funder: authority,
9422
+ tickArray: lowerTickArrayAddress,
9423
+ startTickIndex: lowerTickArrayIndex,
9424
+ idempotent: false
9425
+ })
9426
+ );
9427
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getDynamicTickArrayMinSize());
9428
+ }
9429
+ if (!upperTickArray.exists && lowerTickArrayIndex !== upperTickArrayIndex) {
9430
+ instructions.push(
9431
+ getInitializeDynamicTickArrayInstruction2({
9432
+ whirlpool: whirlpool.address,
9433
+ funder: authority,
9434
+ tickArray: upperTickArrayAddress,
9435
+ startTickIndex: upperTickArrayIndex,
9436
+ idempotent: false
9437
+ })
9438
+ );
9439
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getDynamicTickArrayMinSize());
9440
+ }
9412
9441
  const ix = await openPositionWithLiquidityOrcaInstruction(
9413
9442
  authority,
9414
9443
  positionMint,
@@ -9425,7 +9454,11 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
9425
9454
  cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
9426
9455
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
9427
9456
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
9428
- return instructions;
9457
+ return {
9458
+ instructions,
9459
+ positionMint: positionMint.address,
9460
+ initializationCost: lamports(nonRefundableRent)
9461
+ };
9429
9462
  }
9430
9463
  async function openPositionWithLiquidityOrcaInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool, args) {
9431
9464
  const tunaPositionAddress = (await getTunaPositionAddress(positionMint.address))[0];
@@ -9541,18 +9574,22 @@ async function openPositionWithLiquidityOrcaInstruction(authority, positionMint,
9541
9574
 
9542
9575
  // src/txbuilder/openPositionWithLiquidityFusion.ts
9543
9576
  import {
9544
- fetchAllMaybeTickArray as fetchAllMaybeTickArray2,
9577
+ fetchAllMaybeTickArray as fetchAllMaybeTickArray3,
9545
9578
  fetchMaybeFusionPool as fetchMaybeFusionPool7,
9546
9579
  FP_NFT_UPDATE_AUTH as FP_NFT_UPDATE_AUTH2,
9547
9580
  FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS8,
9548
9581
  getInitializeTickArrayInstruction as getInitializeTickArrayInstruction2,
9549
9582
  getPositionAddress as getPositionAddress16,
9550
- getTickArrayAddress as getTickArrayAddress7
9583
+ getTickArrayAddress as getTickArrayAddress7,
9584
+ getTickArraySize
9551
9585
  } from "@crypticdot/fusionamm-client";
9552
9586
  import { getTickArrayStartTickIndex as getTickArrayStartTickIndex7 } from "@crypticdot/fusionamm-core";
9553
9587
  import {
9554
- AccountRole as AccountRole11
9588
+ AccountRole as AccountRole11,
9589
+ generateKeyPairSigner as generateKeyPairSigner2,
9590
+ lamports as lamports2
9555
9591
  } from "@solana/kit";
9592
+ import { fetchSysvarRent as fetchSysvarRent2 } from "@solana/sysvars";
9556
9593
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS11 } from "@solana-program/memo";
9557
9594
  import {
9558
9595
  ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDRESS4,
@@ -9561,10 +9598,13 @@ import {
9561
9598
  TOKEN_2022_PROGRAM_ADDRESS as TOKEN_2022_PROGRAM_ADDRESS16
9562
9599
  } from "@solana-program/token-2022";
9563
9600
  import assert14 from "assert";
9564
- async function openPositionWithLiquidityFusionInstructions(rpc, authority, positionMint, fusionPoolAddress, args, createInstructions, cleanupInstructions) {
9601
+ async function openPositionWithLiquidityFusionInstructions(rpc, authority, fusionPoolAddress, args, createInstructions, cleanupInstructions) {
9565
9602
  const instructions = [];
9566
9603
  if (!createInstructions) createInstructions = instructions;
9567
9604
  if (!cleanupInstructions) cleanupInstructions = instructions;
9605
+ const rent = await fetchSysvarRent2(rpc);
9606
+ let nonRefundableRent = 0n;
9607
+ const positionMint = await generateKeyPairSigner2();
9568
9608
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
9569
9609
  const fusionPool = await fetchMaybeFusionPool7(rpc, fusionPoolAddress);
9570
9610
  if (!fusionPool.exists) throw new Error("FusionPool account not found");
@@ -9628,7 +9668,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9628
9668
  const [lowerTickArrayAddress] = await getTickArrayAddress7(fusionPool.address, lowerTickArrayIndex);
9629
9669
  const upperTickArrayIndex = getTickArrayStartTickIndex7(args.tickUpperIndex, fusionPool.data.tickSpacing);
9630
9670
  const [upperTickArrayAddress] = await getTickArrayAddress7(fusionPool.address, upperTickArrayIndex);
9631
- const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray2(rpc, [
9671
+ const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray3(rpc, [
9632
9672
  lowerTickArrayAddress,
9633
9673
  upperTickArrayAddress
9634
9674
  ]);
@@ -9641,6 +9681,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9641
9681
  startTickIndex: lowerTickArrayIndex
9642
9682
  })
9643
9683
  );
9684
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getTickArraySize());
9644
9685
  }
9645
9686
  if (!upperTickArray.exists && lowerTickArrayIndex !== upperTickArrayIndex) {
9646
9687
  instructions.push(
@@ -9651,6 +9692,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9651
9692
  startTickIndex: upperTickArrayIndex
9652
9693
  })
9653
9694
  );
9695
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getTickArraySize());
9654
9696
  }
9655
9697
  const ix = await openPositionWithLiquidityFusionInstruction(
9656
9698
  authority,
@@ -9668,7 +9710,11 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
9668
9710
  cleanupInstructions.push(...createUserAtaBInstructions.cleanup);
9669
9711
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
9670
9712
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
9671
- return instructions;
9713
+ return {
9714
+ instructions,
9715
+ positionMint: positionMint.address,
9716
+ initializationCost: lamports2(nonRefundableRent)
9717
+ };
9672
9718
  }
9673
9719
  async function openPositionWithLiquidityFusionInstruction(authority, positionMint, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool, args) {
9674
9720
  const tunaPositionAddress = (await getTunaPositionAddress(positionMint.address))[0];
@@ -10474,15 +10520,19 @@ async function repayDebtInstruction(authority, positionMint, mintA, mintB, marke
10474
10520
 
10475
10521
  // src/txbuilder/rebalancePositionOrca.ts
10476
10522
  import {
10523
+ fetchAllMaybeTickArray as fetchAllMaybeTickArray4,
10477
10524
  fetchMaybeWhirlpool as fetchMaybeWhirlpool9,
10525
+ getDynamicTickArrayMinSize as getDynamicTickArrayMinSize2,
10478
10526
  getInitializeDynamicTickArrayInstruction as getInitializeDynamicTickArrayInstruction3,
10479
10527
  getOracleAddress as getOracleAddress7,
10480
10528
  getPositionAddress as getPositionAddress19,
10481
10529
  WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS11
10482
10530
  } from "@orca-so/whirlpools-client";
10483
10531
  import {
10484
- AccountRole as AccountRole14
10532
+ AccountRole as AccountRole14,
10533
+ lamports as lamports3
10485
10534
  } from "@solana/kit";
10535
+ import { fetchSysvarRent as fetchSysvarRent3 } from "@solana/sysvars";
10486
10536
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS18 } from "@solana-program/memo";
10487
10537
  import {
10488
10538
  fetchAllMaybeMint as fetchAllMaybeMint18,
@@ -10491,6 +10541,8 @@ import {
10491
10541
  } from "@solana-program/token-2022";
10492
10542
  import assert18 from "assert";
10493
10543
  async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
10544
+ const rent = await fetchSysvarRent3(rpc);
10545
+ let nonRefundableRent = 0n;
10494
10546
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
10495
10547
  const tunaPosition = await fetchMaybeTunaPosition(rpc, (await getTunaPositionAddress(positionMint))[0]);
10496
10548
  if (!tunaPosition.exists) throw new Error("Tuna position account not found");
@@ -10508,24 +10560,34 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
10508
10560
  if (!cleanupInstructions) cleanupInstructions = instructions;
10509
10561
  const internalCleanupInstructions = [];
10510
10562
  const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
10511
- instructions.push(
10512
- getInitializeDynamicTickArrayInstruction3({
10513
- whirlpool: whirlpool.address,
10514
- funder: authority,
10515
- tickArray: secondaryTickArrays.lowerTickArrayAddress,
10516
- startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
10517
- idempotent: true
10518
- })
10519
- );
10520
- instructions.push(
10521
- getInitializeDynamicTickArrayInstruction3({
10522
- whirlpool: whirlpool.address,
10523
- funder: authority,
10524
- tickArray: secondaryTickArrays.upperTickArrayAddress,
10525
- startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
10526
- idempotent: true
10527
- })
10528
- );
10563
+ const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray4(rpc, [
10564
+ secondaryTickArrays.lowerTickArrayAddress,
10565
+ secondaryTickArrays.upperTickArrayAddress
10566
+ ]);
10567
+ if (!lowerTickArray.exists) {
10568
+ instructions.push(
10569
+ getInitializeDynamicTickArrayInstruction3({
10570
+ whirlpool: whirlpool.address,
10571
+ funder: authority,
10572
+ tickArray: secondaryTickArrays.lowerTickArrayAddress,
10573
+ startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
10574
+ idempotent: false
10575
+ })
10576
+ );
10577
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getDynamicTickArrayMinSize2());
10578
+ }
10579
+ if (!upperTickArray.exists && secondaryTickArrays.lowerTickArrayStartIndex !== secondaryTickArrays.upperTickArrayStartIndex) {
10580
+ instructions.push(
10581
+ getInitializeDynamicTickArrayInstruction3({
10582
+ whirlpool: whirlpool.address,
10583
+ funder: authority,
10584
+ tickArray: secondaryTickArrays.upperTickArrayAddress,
10585
+ startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
10586
+ idempotent: false
10587
+ })
10588
+ );
10589
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getDynamicTickArrayMinSize2());
10590
+ }
10529
10591
  const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
10530
10592
  rpc,
10531
10593
  authority,
@@ -10556,7 +10618,10 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
10556
10618
  cleanupInstructions.push(...internalCleanupInstructions);
10557
10619
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
10558
10620
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
10559
- return instructions;
10621
+ return {
10622
+ instructions,
10623
+ initializationCost: lamports3(nonRefundableRent)
10624
+ };
10560
10625
  }
10561
10626
  async function rebalancePositionOrcaInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, whirlpool) {
10562
10627
  const positionMint = tunaPosition.data.positionMint;
@@ -10654,15 +10719,18 @@ async function rebalancePositionOrcaInstruction(authority, tunaPosition, tunaCon
10654
10719
 
10655
10720
  // src/txbuilder/rebalancePositionFusion.ts
10656
10721
  import {
10657
- fetchAllMaybeTickArray as fetchAllMaybeTickArray3,
10722
+ fetchAllMaybeTickArray as fetchAllMaybeTickArray5,
10658
10723
  fetchMaybeFusionPool as fetchMaybeFusionPool9,
10659
10724
  FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS11,
10660
10725
  getInitializeTickArrayInstruction as getInitializeTickArrayInstruction3,
10661
- getPositionAddress as getPositionAddress20
10726
+ getPositionAddress as getPositionAddress20,
10727
+ getTickArraySize as getTickArraySize2
10662
10728
  } from "@crypticdot/fusionamm-client";
10663
10729
  import {
10664
- AccountRole as AccountRole15
10730
+ AccountRole as AccountRole15,
10731
+ lamports as lamports4
10665
10732
  } from "@solana/kit";
10733
+ import { fetchSysvarRent as fetchSysvarRent4 } from "@solana/sysvars";
10666
10734
  import { MEMO_PROGRAM_ADDRESS as MEMO_PROGRAM_ADDRESS19 } from "@solana-program/memo";
10667
10735
  import {
10668
10736
  fetchAllMaybeMint as fetchAllMaybeMint19,
@@ -10671,6 +10739,8 @@ import {
10671
10739
  } from "@solana-program/token-2022";
10672
10740
  import assert19 from "assert";
10673
10741
  async function rebalancePositionFusionInstructions(rpc, authority, positionMint, createInstructions, cleanupInstructions) {
10742
+ const rent = await fetchSysvarRent4(rpc);
10743
+ let nonRefundableRent = 0n;
10674
10744
  const tunaConfig = await fetchTunaConfig(rpc, (await getTunaConfigAddress())[0]);
10675
10745
  const tunaPosition = await fetchMaybeTunaPosition(rpc, (await getTunaPositionAddress(positionMint))[0]);
10676
10746
  if (!tunaPosition.exists) throw new Error("Tuna position account not found");
@@ -10687,7 +10757,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10687
10757
  if (!createInstructions) createInstructions = instructions;
10688
10758
  if (!cleanupInstructions) cleanupInstructions = instructions;
10689
10759
  const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
10690
- const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray3(rpc, [
10760
+ const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray5(rpc, [
10691
10761
  secondaryTickArrays.lowerTickArrayAddress,
10692
10762
  secondaryTickArrays.upperTickArrayAddress
10693
10763
  ]);
@@ -10700,6 +10770,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10700
10770
  startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex
10701
10771
  })
10702
10772
  );
10773
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getTickArraySize2());
10703
10774
  }
10704
10775
  if (!upperTickArray.exists && secondaryTickArrays.lowerTickArrayStartIndex !== secondaryTickArrays.upperTickArrayStartIndex) {
10705
10776
  instructions.push(
@@ -10710,6 +10781,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10710
10781
  startTickIndex: secondaryTickArrays.upperTickArrayStartIndex
10711
10782
  })
10712
10783
  );
10784
+ nonRefundableRent += calculateMinimumBalanceForRentExemption(rent, getTickArraySize2());
10713
10785
  }
10714
10786
  const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
10715
10787
  rpc,
@@ -10740,7 +10812,10 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
10740
10812
  instructions.push(ix);
10741
10813
  cleanupInstructions.push(...createFeeRecipientAtaAInstructions.cleanup);
10742
10814
  cleanupInstructions.push(...createFeeRecipientAtaBInstructions.cleanup);
10743
- return instructions;
10815
+ return {
10816
+ instructions,
10817
+ initializationCost: lamports4(nonRefundableRent)
10818
+ };
10744
10819
  }
10745
10820
  async function rebalancePositionFusionInstruction(authority, tunaPosition, tunaConfig, mintA, mintB, vaultA, vaultB, fusionPool) {
10746
10821
  const positionMint = tunaPosition.data.positionMint;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crypticdot/defituna-client",
3
3
  "description": "Typescript client to interact with DefiTuna's on-chain program.",
4
- "version": "2.0.13",
4
+ "version": "2.0.14",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "main": "./dist/index.js",
@@ -23,6 +23,7 @@
23
23
  "@crypticdot/fusionamm-client": "^1.0.54",
24
24
  "@crypticdot/fusionamm-sdk": "^1.0.54",
25
25
  "@solana/kit": "^2.1.0",
26
+ "@solana/sysvars": "^2.1.0",
26
27
  "@solana-program/compute-budget": "^0.7.0",
27
28
  "@solana-program/system": "^0.7.0",
28
29
  "@solana-program/token": "^0.5.1",