diff --git a/artifacts/dynamic_position_migration_test/lb_clmm.so b/artifacts/dynamic_position_migration_test/lb_clmm.so index c39efa8..3e82799 100755 Binary files a/artifacts/dynamic_position_migration_test/lb_clmm.so and b/artifacts/dynamic_position_migration_test/lb_clmm.so differ diff --git a/ts-client/package.json b/ts-client/package.json index 588566c..948390a 100644 --- a/ts-client/package.json +++ b/ts-client/package.json @@ -15,6 +15,7 @@ "test": "jest 'src/test/(sdk|token_2022).test.ts'", "debug": "jest src/test/sdk_token2022.test.ts", "unit-test": "jest src/test/calculate_distribution.test.ts", + "dynamic-position-migration-test": "jest src/test/migrate_to_dynamic_position.test.ts", "example": "dotenv -e .env npx ts-node src/example.ts", "start-server": "npx tsc && node dist/src/server/index.js" }, diff --git a/ts-client/src/dlmm/idl.ts b/ts-client/src/dlmm/idl.ts index a9a8257..fdd8d42 100644 --- a/ts-client/src/dlmm/idl.ts +++ b/ts-client/src/dlmm/idl.ts @@ -2413,17 +2413,7 @@ export type LbClmm = { "isSigner": false }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false - }, - { - "name": "owner", + "name": "sender", "isMut": true, "isSigner": true }, @@ -5008,20 +4998,6 @@ export type LbClmm = { ], "type": "u32" }, - { - "name": "minBinId", - "docs": [ - "Min bin id supported by the pool based on the configured bin step." - ], - "type": "i32" - }, - { - "name": "maxBinId", - "docs": [ - "Max bin id supported by the pool based on the configured bin step." - ], - "type": "i32" - }, { "name": "protocolShare", "docs": [ @@ -9561,17 +9537,7 @@ export const IDL: LbClmm = { "isSigner": false }, { - "name": "binArrayLower", - "isMut": true, - "isSigner": false - }, - { - "name": "binArrayUpper", - "isMut": true, - "isSigner": false - }, - { - "name": "owner", + "name": "sender", "isMut": true, "isSigner": true }, @@ -12156,20 +12122,6 @@ export const IDL: LbClmm = { ], "type": "u32" }, - { - "name": "minBinId", - "docs": [ - "Min bin id supported by the pool based on the configured bin step." - ], - "type": "i32" - }, - { - "name": "maxBinId", - "docs": [ - "Max bin id supported by the pool based on the configured bin step." - ], - "type": "i32" - }, { "name": "protocolShare", "docs": [ diff --git a/ts-client/src/dlmm/index.ts b/ts-client/src/dlmm/index.ts index 01af9d7..99262bc 100644 --- a/ts-client/src/dlmm/index.ts +++ b/ts-client/src/dlmm/index.ts @@ -3582,10 +3582,8 @@ export class DLMM { .accounts({ positionV2, positionV3, - binArrayLower: lowerBinArray, - binArrayUpper: upperBinArray, + sender: feePayer, lbPair: this.pubkey, - owner: positionState.owner, systemProgram: SystemProgram.programId, rentReceiver: positionState.owner, }) diff --git a/ts-client/src/test/migrate_to_dynamic_position.test.ts b/ts-client/src/test/migrate_to_dynamic_position.test.ts index 8f3d135..586f67d 100644 --- a/ts-client/src/test/migrate_to_dynamic_position.test.ts +++ b/ts-client/src/test/migrate_to_dynamic_position.test.ts @@ -13,7 +13,8 @@ import { IPosition, wrapPosition } from "../dlmm/helpers/positions"; import { PositionInfo, PositionVersion } from "../dlmm/types"; // 1. Dump the account: target/debug/cli download-user-pool-files --wallet-key --override-wallet-key bossj3JvwiNK7pvjr149DqdtJxf2gdygbcmEPTkb2F1 --pool-key 6StaAqeVjKUPTgMLmcLmdpmUjoYHRcZ6uViLdWNdUghM --output-path $(readlink -f ./artifacts/jlp-hubsol-6StaAqeVjKUPTgMLmcLmdpmUjoYHRcZ6uViLdWNdUghM) -// 2. Run local validator: solana-test-validator --bpf-program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo ./artifacts/lb_clmm.so --account-dir ./artifacts/jlp-hubsol-6StaAqeVjKUPTgMLmcLmdpmUjoYHRcZ6uViLdWNdUghM --reset +// 2. Run local validator: solana-test-validator --bpf-program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo ./artifacts/dynamic_position_migration_test/lb_clmm.so --account-dir ./artifacts/jlp-hubsol-6StaAqeVjKUPTgMLmcLmdpmUjoYHRcZ6uViLdWNdUghM --reset +// 3. pnpm dynamic-position-migration-test const poolKey = new PublicKey("6StaAqeVjKUPTgMLmcLmdpmUjoYHRcZ6uViLdWNdUghM"); const keypairBuffer = fs.readFileSync( diff --git a/ts-client/src/test/sdk.test.ts b/ts-client/src/test/sdk.test.ts index e61f598..feebab8 100644 --- a/ts-client/src/test/sdk.test.ts +++ b/ts-client/src/test/sdk.test.ts @@ -231,8 +231,6 @@ describe("SDK test", () => { reductionFactor: 5000, variableFeeControl: 40000, protocolShare: 0, - maxBinId: 43690, - minBinId: -43690, maxVolatilityAccumulator: 350000, }) .accounts({ @@ -260,8 +258,6 @@ describe("SDK test", () => { reductionFactor: 5000, variableFeeControl: 40000, protocolShare: 0, - maxBinId: 43690, - minBinId: -43690, maxVolatilityAccumulator: 350000, }) .accounts({ @@ -890,13 +886,11 @@ describe("SDK test", () => { }); it("fetch all preset parameter", async () => { - const { presetParameter, presetParameter2 } = - await DLMM.getAllPresetParameters(connection, { - cluster: "localhost", - }); + const { presetParameter } = await DLMM.getAllPresetParameters(connection, { + cluster: "localhost", + }); - const length = presetParameter.length + presetParameter2.length; - expect(length).toBeGreaterThan(0); + expect(presetParameter.length).toBeGreaterThan(0); }); it("create LB pair with bitmap extension", async () => {