@meteora-ag/cp-amm-sdk 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +110 -5
- package/dist/index.d.ts +110 -5
- package/dist/index.js +252 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +254 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7952,7 +7952,7 @@ var getSqrtPriceFromPrice = (price, tokenADecimal, tokenBDecimal) => {
|
|
|
7952
7952
|
const sqrtValueQ64 = sqrtValue.mul(_decimaljs2.default.pow(2, 64));
|
|
7953
7953
|
return new (0, _anchor.BN)(sqrtValueQ64.floor().toFixed());
|
|
7954
7954
|
};
|
|
7955
|
-
var
|
|
7955
|
+
var getUnClaimLpFee = (poolState, positionState) => {
|
|
7956
7956
|
const totalPositionLiquidity = positionState.unlockedLiquidity.add(positionState.vestedLiquidity).add(positionState.permanentLockedLiquidity);
|
|
7957
7957
|
const feeAPerTokenStored = new (0, _anchor.BN)(
|
|
7958
7958
|
Buffer.from(poolState.feeAPerLiquidity).reverse()
|
|
@@ -7968,8 +7968,103 @@ var getUnClaimReward = (poolState, positionState) => {
|
|
|
7968
7968
|
rewards: positionState.rewardInfos.length > 0 ? positionState.rewardInfos.map((item) => item.rewardPendings) : []
|
|
7969
7969
|
};
|
|
7970
7970
|
};
|
|
7971
|
+
function getRewardPerTokenStore(poolReward, poolLiquidity, currentTime) {
|
|
7972
|
+
if (poolLiquidity.eq(new (0, _anchor.BN)(0))) {
|
|
7973
|
+
return new (0, _anchor.BN)(0);
|
|
7974
|
+
}
|
|
7975
|
+
const lastTimeRewardApplicable = _anchor.BN.min(
|
|
7976
|
+
currentTime,
|
|
7977
|
+
poolReward.rewardDurationEnd
|
|
7978
|
+
);
|
|
7979
|
+
const timePeriod = lastTimeRewardApplicable.sub(poolReward.lastUpdateTime);
|
|
7980
|
+
const currentTotalReward = timePeriod.mul(poolReward.rewardRate);
|
|
7981
|
+
const rewardPerTokenStore = currentTotalReward.shln(128).div(poolLiquidity);
|
|
7982
|
+
const totalRewardPerTokenStore = new (0, _anchor.BN)(
|
|
7983
|
+
Buffer.from(poolReward.rewardPerTokenStored).reverse()
|
|
7984
|
+
).add(rewardPerTokenStore);
|
|
7985
|
+
return totalRewardPerTokenStore;
|
|
7986
|
+
}
|
|
7987
|
+
function getRewardPerPeriod(poolReward, currentTime, periodTime) {
|
|
7988
|
+
const timeRewardAppicable = currentTime.add(periodTime);
|
|
7989
|
+
const period = timeRewardAppicable <= poolReward.rewardDurationEnd ? periodTime : poolReward.rewardDurationEnd.sub(currentTime);
|
|
7990
|
+
const rewardPerPeriod = poolReward.rewardRate.mul(period);
|
|
7991
|
+
return rewardPerPeriod;
|
|
7992
|
+
}
|
|
7993
|
+
function getRewardInfo(poolState, rewardIndex, periodTime, currentTime) {
|
|
7994
|
+
const poolReward = poolState.rewardInfos[rewardIndex];
|
|
7995
|
+
const rewardPerTokenStore = getRewardPerTokenStore(
|
|
7996
|
+
poolReward,
|
|
7997
|
+
poolState.liquidity,
|
|
7998
|
+
currentTime
|
|
7999
|
+
);
|
|
8000
|
+
const totalRewardDistributed = rewardPerTokenStore.mul(poolState.liquidity).shrn(192);
|
|
8001
|
+
if (poolReward.rewardDurationEnd <= currentTime) {
|
|
8002
|
+
return {
|
|
8003
|
+
rewardPerPeriod: new (0, _anchor.BN)(0),
|
|
8004
|
+
rewardBalance: new (0, _anchor.BN)(0),
|
|
8005
|
+
totalRewardDistributed
|
|
8006
|
+
};
|
|
8007
|
+
}
|
|
8008
|
+
const rewardPerPeriod = getRewardPerPeriod(
|
|
8009
|
+
poolReward,
|
|
8010
|
+
currentTime,
|
|
8011
|
+
periodTime
|
|
8012
|
+
);
|
|
8013
|
+
const remainTime = poolReward.rewardDurationEnd.sub(currentTime);
|
|
8014
|
+
const rewardBalance = poolReward.rewardRate.mul(remainTime).shrn(64);
|
|
8015
|
+
if (poolState.liquidity.eq(new (0, _anchor.BN)(0))) {
|
|
8016
|
+
return {
|
|
8017
|
+
rewardPerPeriod,
|
|
8018
|
+
rewardBalance,
|
|
8019
|
+
totalRewardDistributed: new (0, _anchor.BN)(0)
|
|
8020
|
+
};
|
|
8021
|
+
}
|
|
8022
|
+
return {
|
|
8023
|
+
rewardPerPeriod: rewardPerPeriod.shrn(64),
|
|
8024
|
+
rewardBalance,
|
|
8025
|
+
totalRewardDistributed
|
|
8026
|
+
};
|
|
8027
|
+
}
|
|
8028
|
+
function getUserRewardPending(poolState, positionState, rewardIndex, currentTime, periodTime) {
|
|
8029
|
+
if (poolState.liquidity.eq(new (0, _anchor.BN)(0))) {
|
|
8030
|
+
return {
|
|
8031
|
+
userRewardPerPeriod: new (0, _anchor.BN)(0),
|
|
8032
|
+
userPendingReward: new (0, _anchor.BN)(0)
|
|
8033
|
+
};
|
|
8034
|
+
}
|
|
8035
|
+
const poolReward = poolState.rewardInfos[rewardIndex];
|
|
8036
|
+
const userRewardInfo = positionState.rewardInfos[rewardIndex];
|
|
8037
|
+
const rewardPerTokenStore = getRewardPerTokenStore(
|
|
8038
|
+
poolReward,
|
|
8039
|
+
poolState.liquidity,
|
|
8040
|
+
currentTime
|
|
8041
|
+
);
|
|
8042
|
+
const totalPositionLiquidity = positionState.unlockedLiquidity.add(positionState.vestedLiquidity).add(positionState.permanentLockedLiquidity);
|
|
8043
|
+
const userRewardPerTokenCheckPoint = new (0, _anchor.BN)(
|
|
8044
|
+
Buffer.from(userRewardInfo.rewardPerTokenCheckpoint).reverse()
|
|
8045
|
+
);
|
|
8046
|
+
const newReward = totalPositionLiquidity.mul(rewardPerTokenStore.sub(userRewardPerTokenCheckPoint)).shrn(192);
|
|
8047
|
+
if (poolReward.rewardDurationEnd <= currentTime) {
|
|
8048
|
+
return {
|
|
8049
|
+
userPendingReward: userRewardInfo.rewardPendings.add(newReward),
|
|
8050
|
+
userRewardPerPeriod: new (0, _anchor.BN)(0)
|
|
8051
|
+
};
|
|
8052
|
+
}
|
|
8053
|
+
const rewardPerPeriod = getRewardPerPeriod(
|
|
8054
|
+
poolReward,
|
|
8055
|
+
currentTime,
|
|
8056
|
+
periodTime
|
|
8057
|
+
);
|
|
8058
|
+
const rewardPerTokenStorePerPeriod = rewardPerPeriod.shln(128).div(poolState.liquidity);
|
|
8059
|
+
const userRewardPerPeriod = totalPositionLiquidity.mul(rewardPerTokenStorePerPeriod).shrn(192);
|
|
8060
|
+
return {
|
|
8061
|
+
userPendingReward: userRewardInfo.rewardPendings.add(newReward),
|
|
8062
|
+
userRewardPerPeriod
|
|
8063
|
+
};
|
|
8064
|
+
}
|
|
7971
8065
|
|
|
7972
8066
|
// src/helpers/accountFilters.ts
|
|
8067
|
+
|
|
7973
8068
|
var positionByPoolFilter = (pool) => {
|
|
7974
8069
|
return {
|
|
7975
8070
|
memcmp: {
|
|
@@ -7986,6 +8081,18 @@ var vestingByPositionFilter = (position) => {
|
|
|
7986
8081
|
}
|
|
7987
8082
|
};
|
|
7988
8083
|
};
|
|
8084
|
+
function offsetBasedFilter(value, offset) {
|
|
8085
|
+
const valueKey = typeof value === "string" ? new (0, _web3js.PublicKey)(value) : value;
|
|
8086
|
+
return [
|
|
8087
|
+
{
|
|
8088
|
+
memcmp: {
|
|
8089
|
+
offset,
|
|
8090
|
+
bytes: valueKey.toBase58(),
|
|
8091
|
+
encoding: "base58"
|
|
8092
|
+
}
|
|
8093
|
+
}
|
|
8094
|
+
];
|
|
8095
|
+
}
|
|
7989
8096
|
|
|
7990
8097
|
// src/helpers/token2022.ts
|
|
7991
8098
|
|
|
@@ -10457,6 +10564,18 @@ var CpAmm = class {
|
|
|
10457
10564
|
return poolState;
|
|
10458
10565
|
});
|
|
10459
10566
|
}
|
|
10567
|
+
/**
|
|
10568
|
+
* Fetches all Pool states by tokenAMint.
|
|
10569
|
+
* @param tokenAMint - Public key of the tokenA mint.
|
|
10570
|
+
* @returns Array of matched pool accounts and their state.
|
|
10571
|
+
*/
|
|
10572
|
+
fetchPoolStatesByTokenAMint(tokenAMint) {
|
|
10573
|
+
return __async(this, null, function* () {
|
|
10574
|
+
const filters = offsetBasedFilter(tokenAMint, 168);
|
|
10575
|
+
const pools = yield this._program.account.pool.all(filters);
|
|
10576
|
+
return pools;
|
|
10577
|
+
});
|
|
10578
|
+
}
|
|
10460
10579
|
/**
|
|
10461
10580
|
* Fetches the Position state.
|
|
10462
10581
|
* @param position - Public key of the position.
|
|
@@ -10564,6 +10683,11 @@ var CpAmm = class {
|
|
|
10564
10683
|
return positionResult;
|
|
10565
10684
|
});
|
|
10566
10685
|
}
|
|
10686
|
+
/**
|
|
10687
|
+
* Retrieves all vesting accounts associated with a position.
|
|
10688
|
+
* @param position - Public key of the position.
|
|
10689
|
+
* @returns Array of vesting account public keys and their states.
|
|
10690
|
+
*/
|
|
10567
10691
|
getAllVestingsByPosition(position) {
|
|
10568
10692
|
return __async(this, null, function* () {
|
|
10569
10693
|
const vestings = yield this._program.account.vesting.all([
|
|
@@ -10572,12 +10696,22 @@ var CpAmm = class {
|
|
|
10572
10696
|
return vestings;
|
|
10573
10697
|
});
|
|
10574
10698
|
}
|
|
10699
|
+
/**
|
|
10700
|
+
* Checks if a position has any locked liquidity.
|
|
10701
|
+
* @param position - Position state.
|
|
10702
|
+
* @returns True if the position has locked liquidity, false otherwise.
|
|
10703
|
+
*/
|
|
10575
10704
|
isLockedPosition(position) {
|
|
10576
10705
|
const totalLockedLiquidity = position.vestedLiquidity.add(
|
|
10577
10706
|
position.permanentLockedLiquidity
|
|
10578
10707
|
);
|
|
10579
10708
|
return totalLockedLiquidity.gtn(0);
|
|
10580
10709
|
}
|
|
10710
|
+
/**
|
|
10711
|
+
* Checks if a position is permanently locked.
|
|
10712
|
+
* @param positionState - Position state.
|
|
10713
|
+
* @returns True if the position is permanently locked, false otherwise.
|
|
10714
|
+
*/
|
|
10581
10715
|
isPermanentLockedPosition(positionState) {
|
|
10582
10716
|
return positionState.permanentLockedLiquidity.gtn(0);
|
|
10583
10717
|
}
|
|
@@ -10616,6 +10750,11 @@ var CpAmm = class {
|
|
|
10616
10750
|
}
|
|
10617
10751
|
return { canUnlock: true };
|
|
10618
10752
|
}
|
|
10753
|
+
/**
|
|
10754
|
+
* Checks if a pool exists.
|
|
10755
|
+
* @param pool - Public key of the pool.
|
|
10756
|
+
* @returns True if the pool exists, false otherwise.
|
|
10757
|
+
*/
|
|
10619
10758
|
isPoolExist(pool) {
|
|
10620
10759
|
return __async(this, null, function* () {
|
|
10621
10760
|
const poolState = yield this._program.account.pool.fetchNullable(pool);
|
|
@@ -10691,6 +10830,11 @@ var CpAmm = class {
|
|
|
10691
10830
|
priceImpact: swapResult.priceImpact
|
|
10692
10831
|
};
|
|
10693
10832
|
}
|
|
10833
|
+
/**
|
|
10834
|
+
* Calculates the expected output amount or input amount for a swap depending on the swap mode.
|
|
10835
|
+
* @param params GetQuote2Params
|
|
10836
|
+
* @returns Quote2Result
|
|
10837
|
+
*/
|
|
10694
10838
|
getQuote2(params) {
|
|
10695
10839
|
const {
|
|
10696
10840
|
inputTokenMint,
|
|
@@ -11130,6 +11274,11 @@ var CpAmm = class {
|
|
|
11130
11274
|
return { tx: transaction, pool, position };
|
|
11131
11275
|
});
|
|
11132
11276
|
}
|
|
11277
|
+
/**
|
|
11278
|
+
* Builds a transaction to create a customizable pool with dynamic config.
|
|
11279
|
+
* @param params InitializeCustomizeablePoolWithDynamicConfigParams
|
|
11280
|
+
* @returns Transaction and related addresses.
|
|
11281
|
+
*/
|
|
11133
11282
|
createCustomPoolWithDynamicConfig(params) {
|
|
11134
11283
|
return __async(this, null, function* () {
|
|
11135
11284
|
const {
|
|
@@ -11667,6 +11816,11 @@ var CpAmm = class {
|
|
|
11667
11816
|
}).remainingAccounts(remainingAccounts).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
11668
11817
|
});
|
|
11669
11818
|
}
|
|
11819
|
+
/**
|
|
11820
|
+
* Builds a transaction to perform a swap in the pool.
|
|
11821
|
+
* @param params Swap2Params
|
|
11822
|
+
* @returns Transaction builder.
|
|
11823
|
+
*/
|
|
11670
11824
|
swap2(params) {
|
|
11671
11825
|
return __async(this, null, function* () {
|
|
11672
11826
|
const {
|
|
@@ -11835,6 +11989,11 @@ var CpAmm = class {
|
|
|
11835
11989
|
return new (0, _web3js.Transaction)().add(instruction);
|
|
11836
11990
|
});
|
|
11837
11991
|
}
|
|
11992
|
+
/**
|
|
11993
|
+
* Builds a transaction to close a position.
|
|
11994
|
+
* @param params ClosePositionParams
|
|
11995
|
+
* @returns Transaction builder.
|
|
11996
|
+
*/
|
|
11838
11997
|
closePosition(params) {
|
|
11839
11998
|
return __async(this, null, function* () {
|
|
11840
11999
|
const { owner, pool, position, positionNftMint, positionNftAccount } = params;
|
|
@@ -12077,6 +12236,77 @@ var CpAmm = class {
|
|
|
12077
12236
|
return transaction;
|
|
12078
12237
|
});
|
|
12079
12238
|
}
|
|
12239
|
+
/**
|
|
12240
|
+
* Builds a transaction to initialize a reward for a pool.
|
|
12241
|
+
* @param params InitializeRewardParams
|
|
12242
|
+
* @returns Transaction builder.
|
|
12243
|
+
*/
|
|
12244
|
+
initializeReward(params) {
|
|
12245
|
+
return __async(this, null, function* () {
|
|
12246
|
+
const {
|
|
12247
|
+
rewardIndex,
|
|
12248
|
+
rewardDuration,
|
|
12249
|
+
funder,
|
|
12250
|
+
pool,
|
|
12251
|
+
creator,
|
|
12252
|
+
payer,
|
|
12253
|
+
rewardMint,
|
|
12254
|
+
rewardMintProgram
|
|
12255
|
+
} = params;
|
|
12256
|
+
const rewardVault = deriveRewardVaultAddress(pool, rewardIndex);
|
|
12257
|
+
return yield this._program.methods.initializeReward(rewardIndex, rewardDuration, funder).accountsPartial({
|
|
12258
|
+
poolAuthority: this.poolAuthority,
|
|
12259
|
+
pool,
|
|
12260
|
+
rewardVault,
|
|
12261
|
+
rewardMint,
|
|
12262
|
+
signer: creator,
|
|
12263
|
+
payer,
|
|
12264
|
+
tokenProgram: rewardMintProgram
|
|
12265
|
+
}).transaction();
|
|
12266
|
+
});
|
|
12267
|
+
}
|
|
12268
|
+
/**
|
|
12269
|
+
* Builds a transaction to initialize and fund a reward for a pool.
|
|
12270
|
+
* @param params InitializeAndFundReward
|
|
12271
|
+
* @returns Transaction builder.
|
|
12272
|
+
*/
|
|
12273
|
+
initializeAndFundReward(params) {
|
|
12274
|
+
return __async(this, null, function* () {
|
|
12275
|
+
const {
|
|
12276
|
+
rewardIndex,
|
|
12277
|
+
rewardDuration,
|
|
12278
|
+
pool,
|
|
12279
|
+
creator,
|
|
12280
|
+
payer,
|
|
12281
|
+
rewardMint,
|
|
12282
|
+
carryForward,
|
|
12283
|
+
amount,
|
|
12284
|
+
rewardMintProgram
|
|
12285
|
+
} = params;
|
|
12286
|
+
const rewardVault = deriveRewardVaultAddress(pool, rewardIndex);
|
|
12287
|
+
const initializeRewardTx = yield this.initializeReward({
|
|
12288
|
+
rewardIndex,
|
|
12289
|
+
rewardDuration,
|
|
12290
|
+
funder: payer,
|
|
12291
|
+
pool,
|
|
12292
|
+
creator,
|
|
12293
|
+
payer,
|
|
12294
|
+
rewardMint,
|
|
12295
|
+
rewardMintProgram
|
|
12296
|
+
});
|
|
12297
|
+
const fundRewardTx = yield this.fundReward({
|
|
12298
|
+
rewardIndex,
|
|
12299
|
+
carryForward,
|
|
12300
|
+
pool,
|
|
12301
|
+
funder: payer,
|
|
12302
|
+
amount,
|
|
12303
|
+
rewardMint,
|
|
12304
|
+
rewardVault,
|
|
12305
|
+
rewardMintProgram
|
|
12306
|
+
});
|
|
12307
|
+
return new (0, _web3js.Transaction)().add(initializeRewardTx).add(fundRewardTx);
|
|
12308
|
+
});
|
|
12309
|
+
}
|
|
12080
12310
|
/**
|
|
12081
12311
|
* Builds a transaction to update reward duration.
|
|
12082
12312
|
* @param {UpdateRewardDurationParams} params - Parameters including pool and new duration.
|
|
@@ -12084,10 +12314,10 @@ var CpAmm = class {
|
|
|
12084
12314
|
*/
|
|
12085
12315
|
updateRewardDuration(params) {
|
|
12086
12316
|
return __async(this, null, function* () {
|
|
12087
|
-
const { pool,
|
|
12317
|
+
const { pool, signer, rewardIndex, newDuration } = params;
|
|
12088
12318
|
return yield this._program.methods.updateRewardDuration(rewardIndex, newDuration).accountsPartial({
|
|
12089
12319
|
pool,
|
|
12090
|
-
signer
|
|
12320
|
+
signer
|
|
12091
12321
|
}).transaction();
|
|
12092
12322
|
});
|
|
12093
12323
|
}
|
|
@@ -12098,10 +12328,10 @@ var CpAmm = class {
|
|
|
12098
12328
|
*/
|
|
12099
12329
|
updateRewardFunder(params) {
|
|
12100
12330
|
return __async(this, null, function* () {
|
|
12101
|
-
const { pool,
|
|
12331
|
+
const { pool, signer, rewardIndex, newFunder } = params;
|
|
12102
12332
|
return yield this._program.methods.updateRewardFunder(rewardIndex, newFunder).accountsPartial({
|
|
12103
12333
|
pool,
|
|
12104
|
-
signer
|
|
12334
|
+
signer
|
|
12105
12335
|
}).transaction();
|
|
12106
12336
|
});
|
|
12107
12337
|
}
|
|
@@ -12378,9 +12608,9 @@ var CpAmm = class {
|
|
|
12378
12608
|
position,
|
|
12379
12609
|
positionNftAccount,
|
|
12380
12610
|
rewardIndex,
|
|
12381
|
-
skipReward,
|
|
12382
12611
|
poolState,
|
|
12383
|
-
positionState
|
|
12612
|
+
positionState,
|
|
12613
|
+
isSkipReward
|
|
12384
12614
|
} = params;
|
|
12385
12615
|
const rewardInfo = poolState.rewardInfos[rewardIndex];
|
|
12386
12616
|
const tokenProgram = getTokenProgram(rewardInfo.rewardTokenFlag);
|
|
@@ -12399,6 +12629,7 @@ var CpAmm = class {
|
|
|
12399
12629
|
const closeWrappedSOLIx = yield unwrapSOLInstruction(user);
|
|
12400
12630
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
12401
12631
|
}
|
|
12632
|
+
const skipReward = isSkipReward ? 1 : 0;
|
|
12402
12633
|
return yield this._program.methods.claimReward(rewardIndex, skipReward).accountsPartial({
|
|
12403
12634
|
pool: positionState.pool,
|
|
12404
12635
|
positionNftAccount,
|
|
@@ -12412,6 +12643,11 @@ var CpAmm = class {
|
|
|
12412
12643
|
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
12413
12644
|
});
|
|
12414
12645
|
}
|
|
12646
|
+
/**
|
|
12647
|
+
* Builds a transaction to split a position into two positions.
|
|
12648
|
+
* @param params SplitPositionParams
|
|
12649
|
+
* @returns Transaction builder.
|
|
12650
|
+
*/
|
|
12415
12651
|
splitPosition(params) {
|
|
12416
12652
|
return __async(this, null, function* () {
|
|
12417
12653
|
const {
|
|
@@ -12448,6 +12684,11 @@ var CpAmm = class {
|
|
|
12448
12684
|
}).transaction();
|
|
12449
12685
|
});
|
|
12450
12686
|
}
|
|
12687
|
+
/**
|
|
12688
|
+
* Builds a transaction to split a position into two positions.
|
|
12689
|
+
* @param params SplitPosition2Params
|
|
12690
|
+
* @returns Transaction builder.
|
|
12691
|
+
*/
|
|
12451
12692
|
splitPosition2(params) {
|
|
12452
12693
|
return __async(this, null, function* () {
|
|
12453
12694
|
const {
|
|
@@ -12630,5 +12871,8 @@ var CpAmm = class {
|
|
|
12630
12871
|
|
|
12631
12872
|
|
|
12632
12873
|
|
|
12633
|
-
|
|
12874
|
+
|
|
12875
|
+
|
|
12876
|
+
|
|
12877
|
+
exports.ActivationPoint = ActivationPoint; exports.ActivationType = ActivationType; exports.BASIS_POINT_MAX = BASIS_POINT_MAX; exports.BIN_STEP_BPS_DEFAULT = BIN_STEP_BPS_DEFAULT; exports.BIN_STEP_BPS_U128_DEFAULT = BIN_STEP_BPS_U128_DEFAULT; exports.BaseFeeMode = BaseFeeMode; exports.CP_AMM_PROGRAM_ID = CP_AMM_PROGRAM_ID; exports.CURRENT_POOL_VERSION = CURRENT_POOL_VERSION; exports.CollectFeeMode = CollectFeeMode; exports.CpAmm = CpAmm; exports.CpAmmIdl = cp_amm_default; exports.DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = DYNAMIC_FEE_DECAY_PERIOD_DEFAULT; exports.DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = DYNAMIC_FEE_FILTER_PERIOD_DEFAULT; exports.DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT; exports.DYNAMIC_FEE_ROUNDING_OFFSET = DYNAMIC_FEE_ROUNDING_OFFSET; exports.DYNAMIC_FEE_SCALING_FACTOR = DYNAMIC_FEE_SCALING_FACTOR; exports.FEE_DENOMINATOR = FEE_DENOMINATOR; exports.FeeRateLimiter = FeeRateLimiter; exports.FeeScheduler = FeeScheduler; exports.LIQUIDITY_SCALE = LIQUIDITY_SCALE; exports.MAX = MAX; exports.MAX_CU_BUFFER = MAX_CU_BUFFER; exports.MAX_EXPONENTIAL = MAX_EXPONENTIAL; exports.MAX_FEE_BPS_V0 = MAX_FEE_BPS_V0; exports.MAX_FEE_BPS_V1 = MAX_FEE_BPS_V1; exports.MAX_FEE_NUMERATOR_V0 = MAX_FEE_NUMERATOR_V0; exports.MAX_FEE_NUMERATOR_V1 = MAX_FEE_NUMERATOR_V1; exports.MAX_PRICE_CHANGE_BPS_DEFAULT = MAX_PRICE_CHANGE_BPS_DEFAULT; exports.MAX_RATE_LIMITER_DURATION_IN_SECONDS = MAX_RATE_LIMITER_DURATION_IN_SECONDS; exports.MAX_RATE_LIMITER_DURATION_IN_SLOTS = MAX_RATE_LIMITER_DURATION_IN_SLOTS; exports.MAX_SQRT_PRICE = MAX_SQRT_PRICE; exports.MIN_CU_BUFFER = MIN_CU_BUFFER; exports.MIN_FEE_BPS = MIN_FEE_BPS; exports.MIN_FEE_NUMERATOR = MIN_FEE_NUMERATOR; exports.MIN_SQRT_PRICE = MIN_SQRT_PRICE; exports.ONE_Q64 = ONE_Q64; exports.PoolStatus = PoolStatus; exports.PoolVersion = PoolVersion; exports.Rounding = Rounding; exports.SCALE_OFFSET = SCALE_OFFSET; exports.SPLIT_POSITION_DENOMINATOR = SPLIT_POSITION_DENOMINATOR; exports.SwapMode = SwapMode; exports.TradeDirection = TradeDirection; exports.U128_MAX = U128_MAX; exports.U16_MAX = U16_MAX; exports.U64_MAX = U64_MAX; exports.bpsToFeeNumerator = bpsToFeeNumerator; exports.calculateAtoBFromAmountIn = calculateAtoBFromAmountIn; exports.calculateAtoBFromAmountOut = calculateAtoBFromAmountOut; exports.calculateAtoBFromPartialAmountIn = calculateAtoBFromPartialAmountIn; exports.calculateBtoAFromAmountIn = calculateBtoAFromAmountIn; exports.calculateBtoAFromAmountOut = calculateBtoAFromAmountOut; exports.calculateBtoAFromPartialAmountIn = calculateBtoAFromPartialAmountIn; exports.calculateInitSqrtPrice = calculateInitSqrtPrice; exports.calculateTransferFeeExcludedAmount = calculateTransferFeeExcludedAmount; exports.calculateTransferFeeIncludedAmount = calculateTransferFeeIncludedAmount; exports.convertToFeeSchedulerSecondFactor = convertToFeeSchedulerSecondFactor; exports.convertToLamports = convertToLamports; exports.convertToRateLimiterSecondFactor = convertToRateLimiterSecondFactor; exports.decimalToQ64 = decimalToQ64; exports.deriveClaimFeeOperatorAddress = deriveClaimFeeOperatorAddress; exports.deriveConfigAddress = deriveConfigAddress; exports.deriveCustomizablePoolAddress = deriveCustomizablePoolAddress; exports.derivePoolAddress = derivePoolAddress; exports.derivePoolAuthority = derivePoolAuthority; exports.derivePositionAddress = derivePositionAddress; exports.derivePositionNftAccount = derivePositionNftAccount; exports.deriveRewardVaultAddress = deriveRewardVaultAddress; exports.deriveTokenBadgeAddress = deriveTokenBadgeAddress; exports.deriveTokenVaultAddress = deriveTokenVaultAddress; exports.feeNumeratorToBps = feeNumeratorToBps; exports.fromDecimalToBN = fromDecimalToBN; exports.getAllPositionNftAccountByOwner = getAllPositionNftAccountByOwner; exports.getAllUserPositionNftAccount = getAllUserPositionNftAccount; exports.getAmountAFromLiquidityDelta = getAmountAFromLiquidityDelta; exports.getAmountBFromLiquidityDelta = getAmountBFromLiquidityDelta; exports.getAmountWithSlippage = getAmountWithSlippage; exports.getAvailableVestingLiquidity = getAvailableVestingLiquidity; exports.getBaseFeeHandler = getBaseFeeHandler; exports.getBaseFeeNumerator = getBaseFeeNumerator; exports.getBaseFeeNumeratorByPeriod = getBaseFeeNumeratorByPeriod; exports.getBaseFeeParams = getBaseFeeParams; exports.getCheckedAmounts = getCheckedAmounts; exports.getCurrentPoint = getCurrentPoint; exports.getDynamicFeeNumerator = getDynamicFeeNumerator; exports.getDynamicFeeParams = getDynamicFeeParams; exports.getEstimatedComputeUnitIxWithBuffer = getEstimatedComputeUnitIxWithBuffer; exports.getEstimatedComputeUnitUsageWithBuffer = getEstimatedComputeUnitUsageWithBuffer; exports.getExcludedFeeAmount = getExcludedFeeAmount; exports.getExcludedFeeAmountFromIncludedFeeAmount = getExcludedFeeAmountFromIncludedFeeAmount; exports.getFeeInPeriod = getFeeInPeriod; exports.getFeeMode = getFeeMode; exports.getFeeNumeratorFromExcludedFeeAmount = getFeeNumeratorFromExcludedFeeAmount; exports.getFeeNumeratorFromIncludedFeeAmount = getFeeNumeratorFromIncludedFeeAmount; exports.getFeeNumeratorOnExponentialFeeScheduler = getFeeNumeratorOnExponentialFeeScheduler; exports.getFeeNumeratorOnLinearFeeScheduler = getFeeNumeratorOnLinearFeeScheduler; exports.getFeeOnAmount = getFeeOnAmount; exports.getFeeSchedulerParams = getFeeSchedulerParams; exports.getFirstKey = getFirstKey; exports.getIncludedFeeAmount = getIncludedFeeAmount; exports.getLiquidityDeltaFromAmountA = getLiquidityDeltaFromAmountA; exports.getLiquidityDeltaFromAmountB = getLiquidityDeltaFromAmountB; exports.getMaxAmountWithSlippage = getMaxAmountWithSlippage; exports.getMaxBaseFeeNumerator = getMaxBaseFeeNumerator; exports.getMaxFeeBps = getMaxFeeBps; exports.getMaxFeeNumerator = getMaxFeeNumerator; exports.getMaxIndex = getMaxIndex; exports.getMinBaseFeeNumerator = getMinBaseFeeNumerator; exports.getNextSqrtPriceFromAmountInARoundingUp = getNextSqrtPriceFromAmountInARoundingUp; exports.getNextSqrtPriceFromAmountInBRoundingDown = getNextSqrtPriceFromAmountInBRoundingDown; exports.getNextSqrtPriceFromAmountOutARoundingUp = getNextSqrtPriceFromAmountOutARoundingUp; exports.getNextSqrtPriceFromAmountOutBRoundingDown = getNextSqrtPriceFromAmountOutBRoundingDown; exports.getNextSqrtPriceFromInput = getNextSqrtPriceFromInput; exports.getNextSqrtPriceFromOutput = getNextSqrtPriceFromOutput; exports.getOrCreateATAInstruction = getOrCreateATAInstruction; exports.getPriceChange = getPriceChange; exports.getPriceFromSqrtPrice = getPriceFromSqrtPrice; exports.getPriceImpact = getPriceImpact; exports.getRateLimiterParams = getRateLimiterParams; exports.getRewardInfo = getRewardInfo; exports.getSecondKey = getSecondKey; exports.getSimulationComputeUnits = getSimulationComputeUnits; exports.getSqrtPriceFromPrice = getSqrtPriceFromPrice; exports.getSwapResultFromExactInput = getSwapResultFromExactInput; exports.getSwapResultFromExactOutput = getSwapResultFromExactOutput; exports.getSwapResultFromPartialInput = getSwapResultFromPartialInput; exports.getTokenDecimals = getTokenDecimals; exports.getTokenProgram = getTokenProgram; exports.getTotalFeeNumerator = getTotalFeeNumerator; exports.getTotalLockedLiquidity = getTotalLockedLiquidity; exports.getTotalTradingFeeFromExcludedFeeAmount = getTotalTradingFeeFromExcludedFeeAmount; exports.getTotalTradingFeeFromIncludedFeeAmount = getTotalTradingFeeFromIncludedFeeAmount; exports.getUnClaimLpFee = getUnClaimLpFee; exports.getUserRewardPending = getUserRewardPending; exports.hasPartner = hasPartner; exports.isDynamicFeeEnabled = isDynamicFeeEnabled; exports.isNonZeroRateLimiter = isNonZeroRateLimiter; exports.isRateLimiterApplied = isRateLimiterApplied; exports.isSwapEnabled = isSwapEnabled; exports.isVestingComplete = isVestingComplete; exports.isZeroRateLimiter = isZeroRateLimiter; exports.mulDiv = mulDiv; exports.offsetBasedFilter = offsetBasedFilter; exports.parseFeeSchedulerSecondFactor = parseFeeSchedulerSecondFactor; exports.parseRateLimiterSecondFactor = parseRateLimiterSecondFactor; exports.positionByPoolFilter = positionByPoolFilter; exports.pow = pow; exports.q64ToDecimal = q64ToDecimal; exports.splitFees = splitFees; exports.sqrt = sqrt; exports.swapQuoteExactInput = swapQuoteExactInput; exports.swapQuoteExactOutput = swapQuoteExactOutput; exports.swapQuotePartialInput = swapQuotePartialInput; exports.toNumerator = toNumerator; exports.unwrapSOLInstruction = unwrapSOLInstruction; exports.validateFeeFraction = validateFeeFraction; exports.validateFeeRateLimiter = validateFeeRateLimiter; exports.validateFeeScheduler = validateFeeScheduler; exports.vestingByPositionFilter = vestingByPositionFilter; exports.wrapSOLInstruction = wrapSOLInstruction;
|
|
12634
12878
|
//# sourceMappingURL=index.js.map
|