Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add function to seedLiquiditySingleBin #131

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions ts-client/src/dlmm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4291,8 +4291,7 @@ export class DLMM {
* @param
* - `owner`: The public key of the positions owner.
* - `base`: Base key
* - `seedAmount`: Lamport amount to be seeded to the pool.
* - `isTokenX`: Indicate that the seed amount will be 100 percent token X or token Y.
* - `seedAmount`: Token X lamport amount to be seeded to the pool.
* - `price`: TokenX/TokenY Price in UI format
* - `roundingUp`: Whether to round up the price
* - `feeOwner`: Position fee owner
Expand All @@ -4306,7 +4305,6 @@ export class DLMM {
owner: PublicKey,
base: PublicKey,
seedAmount: BN,
isTokenX: boolean,
price: number,
roundingUp: boolean,
feeOwner: PublicKey,
Expand Down Expand Up @@ -4427,13 +4425,13 @@ export class DLMM {

const binLiquidityDist: BinLiquidityDistribution = {
binId: binIdNumber,
distributionX: isTokenX ? 10000 : 0,
distributionY: isTokenX ? 0 : 10000,
distributionX: BASIS_POINT_MAX,
distributionY: 0,
};

const addLiquidityParams: LiquidityParameter = {
amountX: isTokenX ? seedAmount : new BN(0),
amountY: isTokenX ? new BN(0) : seedAmount,
amountX: seedAmount,
amountY: new BN(0),
binLiquidityDist: [binLiquidityDist]
};

Expand Down
3 changes: 1 addition & 2 deletions ts-client/src/test/single_bin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ describe("Single Bin Seed Liquidity Test", () => {
owner.publicKey,
baseKeypair.publicKey,
wenSeedAmount,
true,
initialPrice,
true,
owner.publicKey,
Expand Down Expand Up @@ -214,4 +213,4 @@ describe("Single Bin Seed Liquidity Test", () => {

})

});
});
Loading