@raydium-io/raydium-sdk-v2 0.0.38-alpha → 0.0.39-alpha
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/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/raydium/account/account.d.ts +2 -2
- package/lib/raydium/clmm/clmm.d.ts +2 -2
- package/lib/raydium/clmm/index.d.ts +2 -2
- package/lib/raydium/clmm/instrument.d.ts +1 -1
- package/lib/raydium/clmm/layout.d.ts +1 -1
- package/lib/raydium/clmm/type.d.ts +1 -1
- package/lib/raydium/clmm/utils/math.d.ts +1 -1
- package/lib/raydium/clmm/utils/pool.d.ts +1 -1
- package/lib/raydium/clmm/utils/position.d.ts +1 -1
- package/lib/raydium/clmm/utils/tick.d.ts +1 -1
- package/lib/raydium/clmm/utils/tickQuery.d.ts +1 -1
- package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +1 -1
- package/lib/raydium/cpmm/cpmm.d.ts +2 -2
- package/lib/raydium/cpmm/layout.d.ts +1 -1
- package/lib/raydium/farm/farm.d.ts +2 -2
- package/lib/raydium/ido/ido.d.ts +2 -2
- package/lib/raydium/ido/index.d.ts +2 -2
- package/lib/raydium/index.d.ts +2 -2
- package/lib/raydium/index.js +1 -1
- package/lib/raydium/index.js.map +1 -1
- package/lib/raydium/index.mjs +1 -1
- package/lib/raydium/index.mjs.map +1 -1
- package/lib/raydium/liquidity/layout.d.ts +2 -2
- package/lib/raydium/liquidity/liquidity.d.ts +2 -2
- package/lib/raydium/liquidity/liquidity.js +1 -1
- package/lib/raydium/liquidity/liquidity.js.map +1 -1
- package/lib/raydium/liquidity/liquidity.mjs +1 -1
- package/lib/raydium/liquidity/liquidity.mjs.map +1 -1
- package/lib/raydium/marketV2/createMarket.d.ts +2 -2
- package/lib/raydium/marketV2/index.d.ts +2 -2
- package/lib/raydium/moduleBase.d.ts +2 -2
- package/lib/raydium/raydium.d.ts +2 -2
- package/lib/raydium/raydium.js +1 -1
- package/lib/raydium/raydium.js.map +1 -1
- package/lib/raydium/raydium.mjs +1 -1
- package/lib/raydium/raydium.mjs.map +1 -1
- package/lib/raydium/token/token.d.ts +2 -2
- package/lib/raydium/tradeV2/index.d.ts +1 -1
- package/lib/raydium/tradeV2/instrument.d.ts +1 -1
- package/lib/raydium/tradeV2/trade.d.ts +2 -2
- package/lib/raydium/tradeV2/type.d.ts +1 -1
- package/lib/raydium/utils1216/index.d.ts +2 -2
- package/lib/raydium/utils1216/utils1216.d.ts +2 -2
- package/lib/{raydium-34e76972.d.ts → raydium-2631faa2.d.ts} +2 -2
- package/package.json +1 -1
- package/src/raydium/liquidity/liquidity.ts +9 -6
- /package/lib/{type-6d046773.d.ts → type-08d7cf11.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import '../../type-15746482.js';
|
|
3
|
-
export { j as default } from '../../raydium-
|
|
3
|
+
export { j as default } from '../../raydium-2631faa2.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '@solana/spl-token';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-08d7cf11.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -14,7 +14,7 @@ import '../../marshmallow/index.js';
|
|
|
14
14
|
import '../../marshmallow/buffer-layout.js';
|
|
15
15
|
import '../../common/logger.js';
|
|
16
16
|
import '../../module/currency.js';
|
|
17
|
-
import '../../type-
|
|
17
|
+
import '../../type-08d7cf11.js';
|
|
18
18
|
import '../clmm/layout.js';
|
|
19
19
|
|
|
20
20
|
declare function route1Instruction(programId: PublicKey, poolInfoA: ApiV3PoolInfoItem, poolKeyA: PoolKeys, poolKeyB: PoolKeys, userSourceToken: PublicKey, userRouteToken: PublicKey, userPdaAccount: PublicKey, ownerWallet: PublicKey, inputMint: PublicKey, amountIn: BN__default, amountOut: BN__default, tickArrayA?: PublicKey[]): TransactionInstruction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
export { i as default } from '../../raydium-
|
|
2
|
+
export { i as default } from '../../raydium-2631faa2.js';
|
|
3
3
|
import './type.js';
|
|
4
4
|
import '../../type-15746482.js';
|
|
5
5
|
import '../../api/api.js';
|
|
@@ -21,7 +21,7 @@ import '../../module/currency.js';
|
|
|
21
21
|
import '../account/types.js';
|
|
22
22
|
import '../account/layout.js';
|
|
23
23
|
import '../liquidity/type.js';
|
|
24
|
-
import '../../type-
|
|
24
|
+
import '../../type-08d7cf11.js';
|
|
25
25
|
import '../clmm/layout.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
@@ -2,7 +2,7 @@ import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from
|
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-15746482.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
|
-
import { c as ClmmPoolInfo } from '../../type-
|
|
5
|
+
import { c as ClmmPoolInfo } from '../../type-08d7cf11.js';
|
|
6
6
|
import '@solana/spl-token';
|
|
7
7
|
import '../../solana/type.js';
|
|
8
8
|
import '../../common/txTool/txType.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
1
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-2631faa2.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import '../../api/api.js';
|
|
4
4
|
import 'axios';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-08d7cf11.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../marshmallow/index.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import 'bn.js';
|
|
4
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
4
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-2631faa2.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
6
|
import '../../api/api.js';
|
|
7
7
|
import 'axios';
|
|
@@ -20,7 +20,7 @@ import '../../api/url.js';
|
|
|
20
20
|
import '../account/types.js';
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
|
-
import '../../type-
|
|
23
|
+
import '../../type-08d7cf11.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
25
|
import '../cpmm/type.js';
|
|
26
26
|
import '../cpmm/curve/calculator.js';
|
|
@@ -10,7 +10,7 @@ import { TxVersion } from './common/txTool/txType.js';
|
|
|
10
10
|
import BN__default from 'bn.js';
|
|
11
11
|
import Decimal from 'decimal.js';
|
|
12
12
|
import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, ComputeAmountOutParam, SwapParam } from './raydium/liquidity/type.js';
|
|
13
|
-
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-
|
|
13
|
+
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-08d7cf11.js';
|
|
14
14
|
import { ClmmPositionLayout, PositionInfoLayout, PoolInfoLayout } from './raydium/clmm/layout.js';
|
|
15
15
|
import { CpmmConfigInfoInterface, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
|
|
16
16
|
import { CpmmPoolInfoLayout } from './raydium/cpmm/layout.js';
|
|
@@ -299,11 +299,11 @@ declare class Utils1216 extends ModuleBase {
|
|
|
299
299
|
perLpLoss: BN__default;
|
|
300
300
|
totalClaimedAmount: BN__default;
|
|
301
301
|
}[], "", {
|
|
302
|
+
status: number;
|
|
302
303
|
padding: BN__default[];
|
|
303
304
|
bump: number;
|
|
304
305
|
endTime: BN__default;
|
|
305
306
|
openTime: BN__default;
|
|
306
|
-
status: number;
|
|
307
307
|
ammId: PublicKey;
|
|
308
308
|
tokenInfo: {
|
|
309
309
|
mintDecimals: number;
|
package/package.json
CHANGED
|
@@ -97,6 +97,10 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
97
97
|
baseIn ? poolInfo.mintB.symbol : poolInfo.mintA.symbol,
|
|
98
98
|
"slippage:",
|
|
99
99
|
`${slippage.toSignificant()}%`,
|
|
100
|
+
"baseReserve",
|
|
101
|
+
baseReserve.toString(),
|
|
102
|
+
"quoteReserve",
|
|
103
|
+
quoteReserve.toString(),
|
|
100
104
|
);
|
|
101
105
|
|
|
102
106
|
// input is fixed
|
|
@@ -112,12 +116,11 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
112
116
|
: divCeil(inputAmount.mul(baseReserve), quoteReserve);
|
|
113
117
|
}
|
|
114
118
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
);
|
|
119
|
+
this.logDebug("amountRaw:", amountRaw.toString(), "lpAmount:", lpAmount.toString());
|
|
120
|
+
|
|
121
|
+
const liquidity = divCeil(inputAmount.mul(lpAmount), input === "base" ? baseReserve : quoteReserve);
|
|
122
|
+
|
|
123
|
+
this.logDebug("liquidity:", liquidity.toString());
|
|
121
124
|
|
|
122
125
|
const _slippage = new Percent(new BN(1)).add(slippage);
|
|
123
126
|
const slippageAdjustedAmount = _slippage.mul(amountRaw).quotient;
|
|
File without changes
|