@meteora-ag/cp-amm-sdk 1.2.7 → 1.2.8
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 +7 -29
- package/dist/index.d.ts +7 -29
- package/dist/index.js +5 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Connection, TransactionInstruction, AddressLookupTableAccount, Commitment, GetProgramAccountsFilter } from '@solana/web3.js';
|
|
2
|
-
import { Program, IdlAccounts,
|
|
2
|
+
import { Program, IdlAccounts, IdlTypes, BN, BorshCoder } from '@coral-xyz/anchor';
|
|
3
3
|
import { Mint } from '@solana/spl-token';
|
|
4
4
|
import Decimal from 'decimal.js';
|
|
5
5
|
import BN$1 from 'bn.js';
|
|
@@ -6448,6 +6448,7 @@ type DynamicFeeStruct = IdlTypes<CpAmm$1>["dynamicFeeStruct"];
|
|
|
6448
6448
|
*/
|
|
6449
6449
|
type BaseFee = IdlTypes<CpAmm$1>["baseFeeParameters"];
|
|
6450
6450
|
type PoolFeesStruct = IdlTypes<CpAmm$1>["poolFeesStruct"];
|
|
6451
|
+
type DecodedPoolFees = PodAlignedFeeTimeScheduler | PodAlignedFeeRateLimiter | PodAlignedFeeMarketCapScheduler;
|
|
6451
6452
|
type PoolFeesParams = {
|
|
6452
6453
|
baseFee: BaseFee;
|
|
6453
6454
|
padding: number[];
|
|
@@ -7150,30 +7151,7 @@ declare class CpAmm {
|
|
|
7150
7151
|
publicKey: PublicKey;
|
|
7151
7152
|
account: PoolState;
|
|
7152
7153
|
}>>;
|
|
7153
|
-
fetchPoolFees(pool: PublicKey): Promise<
|
|
7154
|
-
cliffFeeNumerator: BN$1;
|
|
7155
|
-
baseFeeMode: number;
|
|
7156
|
-
padding: number[];
|
|
7157
|
-
numberOfPeriod: number;
|
|
7158
|
-
periodFrequency: BN$1;
|
|
7159
|
-
reductionFactor: BN$1;
|
|
7160
|
-
} | {
|
|
7161
|
-
cliffFeeNumerator: BN$1;
|
|
7162
|
-
baseFeeMode: number;
|
|
7163
|
-
padding: number[];
|
|
7164
|
-
numberOfPeriod: number;
|
|
7165
|
-
sqrtPriceStepBps: number;
|
|
7166
|
-
schedulerExpirationDuration: number;
|
|
7167
|
-
reductionFactor: BN$1;
|
|
7168
|
-
} | {
|
|
7169
|
-
cliffFeeNumerator: BN$1;
|
|
7170
|
-
baseFeeMode: number;
|
|
7171
|
-
padding: number[];
|
|
7172
|
-
feeIncrementBps: number;
|
|
7173
|
-
maxLimiterDuration: number;
|
|
7174
|
-
maxFeeBps: number;
|
|
7175
|
-
referenceAmount: BN$1;
|
|
7176
|
-
}>;
|
|
7154
|
+
fetchPoolFees(pool: PublicKey): Promise<DecodedPoolFees | null>;
|
|
7177
7155
|
/**
|
|
7178
7156
|
* Fetches the Position state.
|
|
7179
7157
|
* @param position - Public key of the position.
|
|
@@ -8133,7 +8111,7 @@ declare function getTotalFeeNumerator(poolFees: PoolFeesStruct, baseFeeNumerator
|
|
|
8133
8111
|
* @param maxFeeNumerator - The max fee numerator
|
|
8134
8112
|
* @returns The total trading fee from included fee amount
|
|
8135
8113
|
*/
|
|
8136
|
-
declare function getTotalTradingFeeFromIncludedFeeAmount(
|
|
8114
|
+
declare function getTotalTradingFeeFromIncludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, includedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
|
|
8137
8115
|
/**
|
|
8138
8116
|
* Gets the total trading fee from excluded fee amount
|
|
8139
8117
|
* @param poolFees - The pool fees
|
|
@@ -8144,7 +8122,7 @@ declare function getTotalTradingFeeFromIncludedFeeAmount(program: Program<CpAmm$
|
|
|
8144
8122
|
* @param maxFeeNumerator - The max fee numerator
|
|
8145
8123
|
* @returns The total trading fee from excluded fee amount
|
|
8146
8124
|
*/
|
|
8147
|
-
declare function getTotalTradingFeeFromExcludedFeeAmount(
|
|
8125
|
+
declare function getTotalTradingFeeFromExcludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, excludedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
|
|
8148
8126
|
/**
|
|
8149
8127
|
* Splits the fees
|
|
8150
8128
|
* @param poolFees - The pool fees
|
|
@@ -8288,7 +8266,7 @@ declare class FeeMarketCapScheduler implements BaseFeeHandler {
|
|
|
8288
8266
|
* @param rawData Raw data
|
|
8289
8267
|
* @returns Base fee handler instance
|
|
8290
8268
|
*/
|
|
8291
|
-
declare function getBaseFeeHandler(
|
|
8269
|
+
declare function getBaseFeeHandler(rawData: number[]): BaseFeeHandler;
|
|
8292
8270
|
|
|
8293
8271
|
/**
|
|
8294
8272
|
* Check if dynamic fee is enabled
|
|
@@ -16555,4 +16533,4 @@ var cp_amm = {
|
|
|
16555
16533
|
constants: constants
|
|
16556
16534
|
};
|
|
16557
16535
|
|
|
16558
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BorshFeeMarketCapScheduler, type BorshFeeRateLimiter, type BorshFeeTimeScheduler, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, FEE_PADDING, FeeMarketCapScheduler, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeTimeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PodAlignedFeeMarketCapScheduler, type PodAlignedFeeRateLimiter, type PodAlignedFeeTimeScheduler, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult2, type TokenBadgeState, TradeDirection, type TransferHookState, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, cpAmmCoder, decimalToQ64, decodeFeeMarketCapSchedulerParams, decodeFeeRateLimiterParams, decodeFeeTimeSchedulerParams, decodePodAlignedFeeMarketCapScheduler, decodePodAlignedFeeRateLimiter, decodePodAlignedFeeTimeScheduler, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, deriveOperatorAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams, encodeFeeTimeSchedulerParams, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMarketCapBaseFeeNumerator, getFeeMarketCapBaseFeeNumeratorByPeriod, getFeeMarketCapMinBaseFeeNumerator, getFeeMarketCapSchedulerParams, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeTimeBaseFeeNumerator, getFeeTimeBaseFeeNumeratorByPeriod, getFeeTimeMinBaseFeeNumerator, getFeeTimeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, hasTransferHookExtension, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toBorshFeeTimeScheduler, toNumerator, toPodAlignedFeeTimeScheduler, unwrapSOLInstruction, validateFeeFraction, validateFeeMarketCapBaseFeeIsStatic, validateFeeMarketCapScheduler, validateFeeRateLimiter, validateFeeRateLimiterBaseFeeIsStatic, validateFeeTimeScheduler, validateFeeTimeSchedulerBaseFeeIsStatic, validateNoTransferHook, vestingByPositionFilter, wrapSOLInstruction };
|
|
16536
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BorshFeeMarketCapScheduler, type BorshFeeRateLimiter, type BorshFeeTimeScheduler, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DecodedPoolFees, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, FEE_PADDING, FeeMarketCapScheduler, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeTimeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PodAlignedFeeMarketCapScheduler, type PodAlignedFeeRateLimiter, type PodAlignedFeeTimeScheduler, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult2, type TokenBadgeState, TradeDirection, type TransferHookState, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, cpAmmCoder, decimalToQ64, decodeFeeMarketCapSchedulerParams, decodeFeeRateLimiterParams, decodeFeeTimeSchedulerParams, decodePodAlignedFeeMarketCapScheduler, decodePodAlignedFeeRateLimiter, decodePodAlignedFeeTimeScheduler, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, deriveOperatorAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams, encodeFeeTimeSchedulerParams, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMarketCapBaseFeeNumerator, getFeeMarketCapBaseFeeNumeratorByPeriod, getFeeMarketCapMinBaseFeeNumerator, getFeeMarketCapSchedulerParams, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeTimeBaseFeeNumerator, getFeeTimeBaseFeeNumeratorByPeriod, getFeeTimeMinBaseFeeNumerator, getFeeTimeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, hasTransferHookExtension, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toBorshFeeTimeScheduler, toNumerator, toPodAlignedFeeTimeScheduler, unwrapSOLInstruction, validateFeeFraction, validateFeeMarketCapBaseFeeIsStatic, validateFeeMarketCapScheduler, validateFeeRateLimiter, validateFeeRateLimiterBaseFeeIsStatic, validateFeeTimeScheduler, validateFeeTimeSchedulerBaseFeeIsStatic, validateNoTransferHook, vestingByPositionFilter, wrapSOLInstruction };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Connection, TransactionInstruction, AddressLookupTableAccount, Commitment, GetProgramAccountsFilter } from '@solana/web3.js';
|
|
2
|
-
import { Program, IdlAccounts,
|
|
2
|
+
import { Program, IdlAccounts, IdlTypes, BN, BorshCoder } from '@coral-xyz/anchor';
|
|
3
3
|
import { Mint } from '@solana/spl-token';
|
|
4
4
|
import Decimal from 'decimal.js';
|
|
5
5
|
import BN$1 from 'bn.js';
|
|
@@ -6448,6 +6448,7 @@ type DynamicFeeStruct = IdlTypes<CpAmm$1>["dynamicFeeStruct"];
|
|
|
6448
6448
|
*/
|
|
6449
6449
|
type BaseFee = IdlTypes<CpAmm$1>["baseFeeParameters"];
|
|
6450
6450
|
type PoolFeesStruct = IdlTypes<CpAmm$1>["poolFeesStruct"];
|
|
6451
|
+
type DecodedPoolFees = PodAlignedFeeTimeScheduler | PodAlignedFeeRateLimiter | PodAlignedFeeMarketCapScheduler;
|
|
6451
6452
|
type PoolFeesParams = {
|
|
6452
6453
|
baseFee: BaseFee;
|
|
6453
6454
|
padding: number[];
|
|
@@ -7150,30 +7151,7 @@ declare class CpAmm {
|
|
|
7150
7151
|
publicKey: PublicKey;
|
|
7151
7152
|
account: PoolState;
|
|
7152
7153
|
}>>;
|
|
7153
|
-
fetchPoolFees(pool: PublicKey): Promise<
|
|
7154
|
-
cliffFeeNumerator: BN$1;
|
|
7155
|
-
baseFeeMode: number;
|
|
7156
|
-
padding: number[];
|
|
7157
|
-
numberOfPeriod: number;
|
|
7158
|
-
periodFrequency: BN$1;
|
|
7159
|
-
reductionFactor: BN$1;
|
|
7160
|
-
} | {
|
|
7161
|
-
cliffFeeNumerator: BN$1;
|
|
7162
|
-
baseFeeMode: number;
|
|
7163
|
-
padding: number[];
|
|
7164
|
-
numberOfPeriod: number;
|
|
7165
|
-
sqrtPriceStepBps: number;
|
|
7166
|
-
schedulerExpirationDuration: number;
|
|
7167
|
-
reductionFactor: BN$1;
|
|
7168
|
-
} | {
|
|
7169
|
-
cliffFeeNumerator: BN$1;
|
|
7170
|
-
baseFeeMode: number;
|
|
7171
|
-
padding: number[];
|
|
7172
|
-
feeIncrementBps: number;
|
|
7173
|
-
maxLimiterDuration: number;
|
|
7174
|
-
maxFeeBps: number;
|
|
7175
|
-
referenceAmount: BN$1;
|
|
7176
|
-
}>;
|
|
7154
|
+
fetchPoolFees(pool: PublicKey): Promise<DecodedPoolFees | null>;
|
|
7177
7155
|
/**
|
|
7178
7156
|
* Fetches the Position state.
|
|
7179
7157
|
* @param position - Public key of the position.
|
|
@@ -8133,7 +8111,7 @@ declare function getTotalFeeNumerator(poolFees: PoolFeesStruct, baseFeeNumerator
|
|
|
8133
8111
|
* @param maxFeeNumerator - The max fee numerator
|
|
8134
8112
|
* @returns The total trading fee from included fee amount
|
|
8135
8113
|
*/
|
|
8136
|
-
declare function getTotalTradingFeeFromIncludedFeeAmount(
|
|
8114
|
+
declare function getTotalTradingFeeFromIncludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, includedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
|
|
8137
8115
|
/**
|
|
8138
8116
|
* Gets the total trading fee from excluded fee amount
|
|
8139
8117
|
* @param poolFees - The pool fees
|
|
@@ -8144,7 +8122,7 @@ declare function getTotalTradingFeeFromIncludedFeeAmount(program: Program<CpAmm$
|
|
|
8144
8122
|
* @param maxFeeNumerator - The max fee numerator
|
|
8145
8123
|
* @returns The total trading fee from excluded fee amount
|
|
8146
8124
|
*/
|
|
8147
|
-
declare function getTotalTradingFeeFromExcludedFeeAmount(
|
|
8125
|
+
declare function getTotalTradingFeeFromExcludedFeeAmount(poolFees: PoolFeesStruct, currentPoint: BN, activationPoint: BN, excludedFeeAmount: BN, tradeDirection: TradeDirection, maxFeeNumerator: BN, initSqrtPrice: BN, currentSqrtPrice: BN): BN;
|
|
8148
8126
|
/**
|
|
8149
8127
|
* Splits the fees
|
|
8150
8128
|
* @param poolFees - The pool fees
|
|
@@ -8288,7 +8266,7 @@ declare class FeeMarketCapScheduler implements BaseFeeHandler {
|
|
|
8288
8266
|
* @param rawData Raw data
|
|
8289
8267
|
* @returns Base fee handler instance
|
|
8290
8268
|
*/
|
|
8291
|
-
declare function getBaseFeeHandler(
|
|
8269
|
+
declare function getBaseFeeHandler(rawData: number[]): BaseFeeHandler;
|
|
8292
8270
|
|
|
8293
8271
|
/**
|
|
8294
8272
|
* Check if dynamic fee is enabled
|
|
@@ -16555,4 +16533,4 @@ var cp_amm = {
|
|
|
16555
16533
|
constants: constants
|
|
16556
16534
|
};
|
|
16557
16535
|
|
|
16558
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BorshFeeMarketCapScheduler, type BorshFeeRateLimiter, type BorshFeeTimeScheduler, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, FEE_PADDING, FeeMarketCapScheduler, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeTimeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PodAlignedFeeMarketCapScheduler, type PodAlignedFeeRateLimiter, type PodAlignedFeeTimeScheduler, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult2, type TokenBadgeState, TradeDirection, type TransferHookState, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, cpAmmCoder, decimalToQ64, decodeFeeMarketCapSchedulerParams, decodeFeeRateLimiterParams, decodeFeeTimeSchedulerParams, decodePodAlignedFeeMarketCapScheduler, decodePodAlignedFeeRateLimiter, decodePodAlignedFeeTimeScheduler, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, deriveOperatorAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams, encodeFeeTimeSchedulerParams, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMarketCapBaseFeeNumerator, getFeeMarketCapBaseFeeNumeratorByPeriod, getFeeMarketCapMinBaseFeeNumerator, getFeeMarketCapSchedulerParams, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeTimeBaseFeeNumerator, getFeeTimeBaseFeeNumeratorByPeriod, getFeeTimeMinBaseFeeNumerator, getFeeTimeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, hasTransferHookExtension, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toBorshFeeTimeScheduler, toNumerator, toPodAlignedFeeTimeScheduler, unwrapSOLInstruction, validateFeeFraction, validateFeeMarketCapBaseFeeIsStatic, validateFeeMarketCapScheduler, validateFeeRateLimiter, validateFeeRateLimiterBaseFeeIsStatic, validateFeeTimeScheduler, validateFeeTimeSchedulerBaseFeeIsStatic, validateNoTransferHook, vestingByPositionFilter, wrapSOLInstruction };
|
|
16536
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BorshFeeMarketCapScheduler, type BorshFeeRateLimiter, type BorshFeeTimeScheduler, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DecodedPoolFees, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, FEE_PADDING, FeeMarketCapScheduler, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeTimeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PodAlignedFeeMarketCapScheduler, type PodAlignedFeeRateLimiter, type PodAlignedFeeTimeScheduler, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult2, type TokenBadgeState, TradeDirection, type TransferHookState, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, cpAmmCoder, decimalToQ64, decodeFeeMarketCapSchedulerParams, decodeFeeRateLimiterParams, decodeFeeTimeSchedulerParams, decodePodAlignedFeeMarketCapScheduler, decodePodAlignedFeeRateLimiter, decodePodAlignedFeeTimeScheduler, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, deriveOperatorAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, encodeFeeMarketCapSchedulerParams, encodeFeeRateLimiterParams, encodeFeeTimeSchedulerParams, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMarketCapBaseFeeNumerator, getFeeMarketCapBaseFeeNumeratorByPeriod, getFeeMarketCapMinBaseFeeNumerator, getFeeMarketCapSchedulerParams, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeTimeBaseFeeNumerator, getFeeTimeBaseFeeNumeratorByPeriod, getFeeTimeMinBaseFeeNumerator, getFeeTimeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, hasTransferHookExtension, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toBorshFeeTimeScheduler, toNumerator, toPodAlignedFeeTimeScheduler, unwrapSOLInstruction, validateFeeFraction, validateFeeMarketCapBaseFeeIsStatic, validateFeeMarketCapScheduler, validateFeeRateLimiter, validateFeeRateLimiterBaseFeeIsStatic, validateFeeTimeScheduler, validateFeeTimeSchedulerBaseFeeIsStatic, validateNoTransferHook, vestingByPositionFilter, wrapSOLInstruction };
|
package/dist/index.js
CHANGED
|
@@ -8824,11 +8824,8 @@ function getTotalFeeNumerator(poolFees, baseFeeNumerator, maxFeeNumerator) {
|
|
|
8824
8824
|
const totalFeeNumerator = dynamicFeeNumerator.add(baseFeeNumerator);
|
|
8825
8825
|
return _anchor.BN.min(totalFeeNumerator, maxFeeNumerator);
|
|
8826
8826
|
}
|
|
8827
|
-
function getTotalTradingFeeFromIncludedFeeAmount(
|
|
8828
|
-
const baseFeeHandler = getBaseFeeHandler(
|
|
8829
|
-
program,
|
|
8830
|
-
poolFees.baseFee.baseFeeInfo.data
|
|
8831
|
-
);
|
|
8827
|
+
function getTotalTradingFeeFromIncludedFeeAmount(poolFees, currentPoint, activationPoint, includedFeeAmount, tradeDirection, maxFeeNumerator, initSqrtPrice, currentSqrtPrice) {
|
|
8828
|
+
const baseFeeHandler = getBaseFeeHandler(poolFees.baseFee.baseFeeInfo.data);
|
|
8832
8829
|
const baseFeeNumerator = baseFeeHandler.getBaseFeeNumeratorFromIncludedFeeAmount(
|
|
8833
8830
|
currentPoint,
|
|
8834
8831
|
activationPoint,
|
|
@@ -8839,11 +8836,8 @@ function getTotalTradingFeeFromIncludedFeeAmount(program, poolFees, currentPoint
|
|
|
8839
8836
|
);
|
|
8840
8837
|
return getTotalFeeNumerator(poolFees, baseFeeNumerator, maxFeeNumerator);
|
|
8841
8838
|
}
|
|
8842
|
-
function getTotalTradingFeeFromExcludedFeeAmount(
|
|
8843
|
-
const baseFeeHandler = getBaseFeeHandler(
|
|
8844
|
-
program,
|
|
8845
|
-
poolFees.baseFee.baseFeeInfo.data
|
|
8846
|
-
);
|
|
8839
|
+
function getTotalTradingFeeFromExcludedFeeAmount(poolFees, currentPoint, activationPoint, excludedFeeAmount, tradeDirection, maxFeeNumerator, initSqrtPrice, currentSqrtPrice) {
|
|
8840
|
+
const baseFeeHandler = getBaseFeeHandler(poolFees.baseFee.baseFeeInfo.data);
|
|
8847
8841
|
const baseFeeNumerator = baseFeeHandler.getBaseFeeNumeratorFromExcludedFeeAmount(
|
|
8848
8842
|
currentPoint,
|
|
8849
8843
|
activationPoint,
|
|
@@ -9536,7 +9530,7 @@ var FeeMarketCapScheduler = class {
|
|
|
9536
9530
|
);
|
|
9537
9531
|
}
|
|
9538
9532
|
};
|
|
9539
|
-
function getBaseFeeHandler(
|
|
9533
|
+
function getBaseFeeHandler(rawData) {
|
|
9540
9534
|
const data = Buffer.from(rawData);
|
|
9541
9535
|
const modeIndex = data.readUInt8(8);
|
|
9542
9536
|
const baseFeeMode = modeIndex;
|
|
@@ -9731,7 +9725,6 @@ function getSwapResultFromExactInput(program, poolState, amountIn, feeMode, trad
|
|
|
9731
9725
|
let actualPartnerFee = new (0, _bnjs2.default)(0);
|
|
9732
9726
|
const maxFeeNumerator = getMaxFeeNumerator(poolState.version);
|
|
9733
9727
|
const tradeFeeNumerator = getTotalTradingFeeFromIncludedFeeAmount(
|
|
9734
|
-
program,
|
|
9735
9728
|
poolState.poolFees,
|
|
9736
9729
|
currentPoint,
|
|
9737
9730
|
poolState.activationPoint,
|
|
@@ -9845,7 +9838,6 @@ function getSwapResultFromPartialInput(program, poolState, amountIn, feeMode, tr
|
|
|
9845
9838
|
let actualPartnerFee = new (0, _bnjs2.default)(0);
|
|
9846
9839
|
const maxFeeNumerator = getMaxFeeNumerator(poolState.version);
|
|
9847
9840
|
const tradeFeeNumerator = getTotalTradingFeeFromIncludedFeeAmount(
|
|
9848
|
-
program,
|
|
9849
9841
|
poolState.poolFees,
|
|
9850
9842
|
currentPoint,
|
|
9851
9843
|
poolState.activationPoint,
|
|
@@ -9890,7 +9882,6 @@ function getSwapResultFromPartialInput(program, poolState, amountIn, feeMode, tr
|
|
|
9890
9882
|
actualAmountIn = actualAmountIn.sub(amountLeft);
|
|
9891
9883
|
if (feeMode.feesOnInput) {
|
|
9892
9884
|
const tradeFeeNumerator2 = getTotalTradingFeeFromExcludedFeeAmount(
|
|
9893
|
-
program,
|
|
9894
9885
|
poolState.poolFees,
|
|
9895
9886
|
currentPoint,
|
|
9896
9887
|
poolState.activationPoint,
|
|
@@ -10029,7 +10020,6 @@ function getSwapResultFromExactOutput(program, poolState, amountOut, feeMode, tr
|
|
|
10029
10020
|
includedFeeAmountOut = amountOut;
|
|
10030
10021
|
} else {
|
|
10031
10022
|
const tradeFeeNumerator = getTotalTradingFeeFromExcludedFeeAmount(
|
|
10032
|
-
program,
|
|
10033
10023
|
poolState.poolFees,
|
|
10034
10024
|
currentPoint,
|
|
10035
10025
|
poolState.activationPoint,
|
|
@@ -10071,7 +10061,6 @@ function getSwapResultFromExactOutput(program, poolState, amountOut, feeMode, tr
|
|
|
10071
10061
|
let includedFeeInputAmount;
|
|
10072
10062
|
if (feeMode.feesOnInput) {
|
|
10073
10063
|
const tradeFeeNumerator = getTotalTradingFeeFromExcludedFeeAmount(
|
|
10074
|
-
program,
|
|
10075
10064
|
poolState.poolFees,
|
|
10076
10065
|
currentPoint,
|
|
10077
10066
|
poolState.activationPoint,
|